mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-29 02:16:28 +02:00
* databroker: add databroker, identity manager, update cache (#864) * databroker: add databroker, identity manager, update cache * fix cache tests * directory service (#885) * directory: add google and okta * add onelogin * add directory provider * initialize before sync, upate google provider, remove dead code * add azure provider * fix azure provider * fix gitlab * add gitlab test, fix azure test * hook up okta * remove dead code * fix tests * fix flaky test * authorize: use databroker data for rego policy (#904) * wip * add directory provider * initialize before sync, upate google provider, remove dead code * fix flaky test * update authorize to use databroker data * implement signed jwt * wait for session and user to appear * fix test * directory service (#885) * directory: add google and okta * add onelogin * add directory provider * initialize before sync, upate google provider, remove dead code * add azure provider * fix azure provider * fix gitlab * add gitlab test, fix azure test * hook up okta * remove dead code * fix tests * fix flaky test * remove log line * only redirect when no session id exists * prepare rego query as part of create * return on ctx done * retry on disconnect for sync * move jwt signing * use != * use parent ctx for wait * remove session state, remove logs * rename function * add log message * pre-allocate slice * use errgroup * return nil on eof for sync * move check * disable timeout on gRPC requests in envoy * fix gitlab test * use v4 backoff * authenticate: databroker changes (#914) * wip * add directory provider * initialize before sync, upate google provider, remove dead code * fix flaky test * update authorize to use databroker data * implement signed jwt * wait for session and user to appear * fix test * directory service (#885) * directory: add google and okta * add onelogin * add directory provider * initialize before sync, upate google provider, remove dead code * add azure provider * fix azure provider * fix gitlab * add gitlab test, fix azure test * hook up okta * remove dead code * fix tests * fix flaky test * remove log line * only redirect when no session id exists * prepare rego query as part of create * return on ctx done * retry on disconnect for sync * move jwt signing * use != * use parent ctx for wait * remove session state, remove logs * rename function * add log message * pre-allocate slice * use errgroup * return nil on eof for sync * move check * disable timeout on gRPC requests in envoy * fix dashboard * delete session on logout * permanently delete sessions once they are marked as deleted * remove permanent delete * fix tests * remove groups and refresh test * databroker: remove dead code, rename cache url, move dashboard (#925) * wip * add directory provider * initialize before sync, upate google provider, remove dead code * fix flaky test * update authorize to use databroker data * implement signed jwt * wait for session and user to appear * fix test * directory service (#885) * directory: add google and okta * add onelogin * add directory provider * initialize before sync, upate google provider, remove dead code * add azure provider * fix azure provider * fix gitlab * add gitlab test, fix azure test * hook up okta * remove dead code * fix tests * fix flaky test * remove log line * only redirect when no session id exists * prepare rego query as part of create * return on ctx done * retry on disconnect for sync * move jwt signing * use != * use parent ctx for wait * remove session state, remove logs * rename function * add log message * pre-allocate slice * use errgroup * return nil on eof for sync * move check * disable timeout on gRPC requests in envoy * fix dashboard * delete session on logout * permanently delete sessions once they are marked as deleted * remove permanent delete * fix tests * remove cache service * remove kv * remove refresh docs * remove obsolete cache docs * add databroker url option * cache: use memberlist to detect multiple instances * add databroker service url * remove cache service * remove kv * remove refresh docs * remove obsolete cache docs * add databroker url option * cache: use memberlist to detect multiple instances * add databroker service url * wip * remove groups and refresh test * fix redirect, signout * remove databroker client from proxy * remove unused method * remove user dashboard test * handle missing session ids * session: reject sessions with no id * sessions: invalidate old sessions via databroker server version (#930) * session: add a version field tied to the databroker server version that can be used to invalidate sessions * fix tests * add log * authenticate: create user record immediately, call "get" directly in authorize (#931)
117 lines
3.8 KiB
Makefile
117 lines
3.8 KiB
Makefile
# Setup name variables for the package/tool
|
|
PREFIX?=$(shell pwd)
|
|
|
|
NAME := pomerium
|
|
PKG := github.com/pomerium/$(NAME)
|
|
|
|
BUILDDIR := ${PREFIX}/dist
|
|
BINDIR := ${PREFIX}/bin
|
|
GO111MODULE=on
|
|
CGO_ENABLED := 0
|
|
# Set any default go build tags
|
|
BUILDTAGS :=
|
|
|
|
# Populate version variables
|
|
# Add to compile time flags
|
|
VERSION := $(shell cat VERSION)
|
|
GITCOMMIT := $(shell git rev-parse --short HEAD)
|
|
BUILDMETA:=
|
|
GITUNTRACKEDCHANGES := $(shell git status --porcelain --untracked-files=no)
|
|
ifneq ($(GITUNTRACKEDCHANGES),)
|
|
BUILDMETA := dirty
|
|
endif
|
|
CTIMEVAR=-X $(PKG)/internal/version.GitCommit=$(GITCOMMIT) \
|
|
-X $(PKG)/internal/version.Version=$(VERSION) \
|
|
-X $(PKG)/internal/version.BuildMeta=$(BUILDMETA) \
|
|
-X $(PKG)/internal/version.ProjectName=$(NAME) \
|
|
-X $(PKG)/internal/version.ProjectURL=$(PKG)
|
|
GO_LDFLAGS=-ldflags "-s -w $(CTIMEVAR)"
|
|
GOOSARCHES = linux/amd64 darwin/amd64 windows/amd64
|
|
GOOS = $(shell go env GOOS)
|
|
GOARCH= $(shell go env GOARCH)
|
|
MISSPELL_VERSION = v0.3.4
|
|
GOLANGCI_VERSION = v1.21.0
|
|
OPA_VERSION = v0.19.1
|
|
GETENVOY_VERSION = v0.1.8
|
|
|
|
.PHONY: all
|
|
all: clean build-deps test lint spellcheck build ## Runs a clean, build, fmt, lint, test, and vet.
|
|
|
|
|
|
.PHONY: generate-mocks
|
|
generate-mocks: ## Generate mocks
|
|
@echo "==> $@"
|
|
@go run github.com/golang/mock/mockgen -destination authorize/evaluator/mock_evaluator/mock.go github.com/pomerium/pomerium/authorize/evaluator Evaluator
|
|
|
|
.PHONY: build-deps
|
|
build-deps: ## Install build dependencies
|
|
@echo "==> $@"
|
|
@cd /tmp; GO111MODULE=on go get github.com/client9/misspell/cmd/misspell@${MISSPELL_VERSION}
|
|
@cd /tmp; GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_VERSION}
|
|
@cd /tmp; GO111MODULE=on go get github.com/open-policy-agent/opa@${OPA_VERSION}
|
|
@cd /tmp; GO111MODULE=on go get github.com/tetratelabs/getenvoy/cmd/getenvoy@${GETENVOY_VERSION}
|
|
|
|
.PHONY: docs
|
|
docs: ## Start the vuepress docs development server
|
|
@echo "==> $@"
|
|
@yarn && yarn docs:dev
|
|
|
|
.PHONY: tag
|
|
tag: ## Create a new git tag to prepare to build a release
|
|
git tag -sa $(VERSION) -m "$(VERSION)"
|
|
@echo "Run git push origin $(VERSION) to push your new tag to GitHub."
|
|
|
|
.PHONY: frontend
|
|
frontend: ## Runs go generate on the static assets package.
|
|
@echo "==> $@"
|
|
@CGO_ENABLED=0 GO111MODULE=on go generate github.com/pomerium/pomerium/internal/frontend
|
|
|
|
.PHONY: build
|
|
build: ## Builds dynamic executables and/or packages.
|
|
@echo "==> $@"
|
|
@CGO_ENABLED=0 GO111MODULE=on go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(BINDIR)/$(NAME) ./cmd/"$(NAME)"
|
|
./scripts/embed-envoy.bash $(BINDIR)/$(NAME)
|
|
|
|
.PHONY: lint
|
|
lint: ## Verifies `golint` passes.
|
|
@echo "==> $@"
|
|
@golangci-lint run ./...
|
|
|
|
.PHONY: test
|
|
test: ## Runs the go tests.
|
|
@echo "==> $@"
|
|
@go test -tags "$(BUILDTAGS)" $(shell go list ./... | grep -v vendor | grep -v github.com/pomerium/pomerium/integration)
|
|
@opa test ./authorize/evaluator/opa/policy
|
|
|
|
.PHONY: spellcheck
|
|
spellcheck: # Spellcheck docs
|
|
@echo "==> Spell checking docs..."
|
|
@misspell -error -source=text docs/
|
|
|
|
|
|
.PHONY: cover
|
|
cover: ## Runs go test with coverage
|
|
@echo "" > coverage.txt
|
|
@for d in $(shell go list ./... | grep -v vendor); do \
|
|
go test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
|
|
if [ -f profile.out ]; then \
|
|
cat profile.out >> coverage.txt; \
|
|
rm profile.out; \
|
|
fi; \
|
|
done;
|
|
|
|
.PHONY: clean
|
|
clean: ## Cleanup any build binaries or packages.
|
|
@echo "==> $@"
|
|
$(RM) -r $(BINDIR)
|
|
$(RM) -r $(BUILDDIR)
|
|
|
|
.PHONY: release
|
|
snapshot: ## Builds the cross-compiled binaries, naming them in such a way for release (eg. binary-GOOS-GOARCH)
|
|
@echo "+ $@"
|
|
@cd /tmp; GO111MODULE=on go get github.com/goreleaser/goreleaser
|
|
goreleaser release --rm-dist -f .github/goreleaser.yaml --snapshot
|
|
|
|
.PHONY: help
|
|
help:
|
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
|