diff --git a/.dockerignore b/.dockerignore index 6e7c7ac1..31b16d2a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ .github/ +.gitpod.yml bin/ tmp/ -.gitpod.yml diff --git a/.editorconfig b/.editorconfig index 6ccdbfc9..5cac4723 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,3 +13,6 @@ indent_style = tab [*.proto] indent_size = 2 + +[{Makefile,*.mk}] +indent_style = tab diff --git a/DCO b/.github/DCO similarity index 100% rename from DCO rename to .github/DCO diff --git a/.gitignore b/.gitignore index ca5321ff..f6cd2e19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ -bin -dist -_output -.idea +/.idea/ +/bin/ +/docker-compose.override.yaml /vendor/ diff --git a/Dockerfile b/Dockerfile index f2a7043a..30b862ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ARG TARGETOS ARG TARGETARCH ARG TARGETVARIANT="" -WORKDIR /go/src/github.com/dexidp/dex +WORKDIR /usr/local/src/dex ENV GOOS=${TARGETOS} \ GOARCH=${TARGETARCH} \ diff --git a/MAINTAINERS b/MAINTAINERS index 3e3ae80b..36ece37d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1,5 +1,5 @@ Joel Speed (@JoelSpeed) Mark Sagi-Kazar (@sagikazarmark) -Nandor Kracser (@bonifaido) +Nandor Kracser (@bonifaido) Rithu John (@rithujohn191) Stephen Augustus (@justaugustus) diff --git a/Makefile b/Makefile index 65042522..82b266a6 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,18 @@ bin/example-app: release-binary: @go build -o /go/bin/dex -v -ldflags $(LD_FLAGS) $(REPO_PATH)/cmd/dex +docker-compose.override.yaml: + cp docker-compose.override.yaml.dist docker-compose.override.yaml + +.PHONY: up +up: docker-compose.override.yaml ## Launch the development environment + @ if [ docker-compose.override.yaml -ot docker-compose.override.yaml.dist ]; then diff -u docker-compose.override.yaml docker-compose.override.yaml.dist || (echo "!!! The distributed docker-compose.override.yaml example changed. Please update your file accordingly (or at least touch it). !!!" && false); fi + docker-compose up -d + +.PHONY: down +down: clear ## Destroy the development environment + docker-compose down --volumes --remove-orphans --rmi local + test: bin/test/kube-apiserver bin/test/etcd @go test -v ./... diff --git a/NOTICE b/NOTICE deleted file mode 100644 index 23a0ada2..00000000 --- a/NOTICE +++ /dev/null @@ -1,5 +0,0 @@ -CoreOS Project -Copyright 2018 CoreOS, Inc - -This product includes software developed at CoreOS, Inc. -(http://www.coreos.com/). diff --git a/README.md b/README.md index fe0b09c9..ad7a9605 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/dexidp/dex) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod&style=flat-square)](https://gitpod.io/#https://github.com/dexidp/dex) -![logo](Documentation/logos/dex-horizontal-color.png) +![logo](docs/logos/dex-horizontal-color.png) Dex is an identity service that uses [OpenID Connect][openid-connect] to drive authentication for other apps. @@ -56,7 +56,7 @@ More docs for running dex as a Kubernetes authenticator can be found [here](http When a user logs in through dex, the user's identity is usually stored in another user-management system: a LDAP directory, a GitHub org, etc. Dex acts as a shim between a client app and the upstream identity provider. The client only needs to understand OpenID Connect to query dex, while dex implements an array of protocols for querying other user-management systems. -![](Documentation/img/dex-flow.png) +![](docs/img/dex-flow.png) A "connector" is a strategy used by dex for authenticating a user against another identity provider. Dex implements connectors that target specific platforms such as GitHub, LinkedIn, and Microsoft as well as established protocols like LDAP and SAML. diff --git a/docker-compose.override.yaml.dist b/docker-compose.override.yaml.dist new file mode 100644 index 00000000..8b4276d7 --- /dev/null +++ b/docker-compose.override.yaml.dist @@ -0,0 +1,14 @@ +version: "3.8" + +services: + mysql: + ports: + - "127.0.0.1:3306:3306" + + postgres: + ports: + - "127.0.0.1:5432:5432" + + etcd: + ports: + - "127.0.0.1:2379:2379" diff --git a/docker-compose.yaml b/docker-compose.yaml index 644bddf6..91e58c3f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,39 +1,34 @@ # This docker-compose file provides quick setups for testing different storage backend options. version: "3.8" + services: - mysql: - # For using percona-xtradb you need to make strict mode permissive with: - # docker-compose exec mysql mysql -uroot -proot -e "SET GLOBAL pxc_strict_mode=PERMISSIVE;" - # See: https://www.percona.com/doc/percona-xtradb-cluster/5.7/features/pxc-strict-mode.html - # image: percona/percona-xtradb-cluster:5.7 - # image: mariadb:10.5 - # image: mysql:5.6 - # image: mysql:8.0 - image: mysql:5.7 - environment: - MYSQL_DATABASE: dex - MYSQL_USER: mysql - MYSQL_PASSWORD: mysql - MYSQL_ROOT_PASSWORD: root - ports: - - "127.0.0.1:3306:3306" + mysql: + # For using percona-xtradb you need to make strict mode permissive with: + # docker-compose exec mysql mysql -uroot -proot -e "SET GLOBAL pxc_strict_mode=PERMISSIVE;" + # See: https://www.percona.com/doc/percona-xtradb-cluster/5.7/features/pxc-strict-mode.html + # image: percona/percona-xtradb-cluster:5.7 + # image: mariadb:10.5 + # image: mysql:5.6 + # image: mysql:8.0 + image: mysql:5.7 + environment: + MYSQL_DATABASE: dex + MYSQL_USER: mysql + MYSQL_PASSWORD: mysql + MYSQL_ROOT_PASSWORD: root - postgres: - image: postgres:10.15 - environment: - POSTGRES_DB: dex - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - ports: - - "127.0.0.1:5432:5432" + postgres: + image: postgres:10.15 + environment: + POSTGRES_DB: dex + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres - etcd: - image: gcr.io/etcd-development/etcd:v3.4.9 - environment: - ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379 - ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - ports: - - "127.0.0.1:2379:2379" + etcd: + image: gcr.io/etcd-development/etcd:v3.4.9 + environment: + ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379 + ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379 - # For testing the Kubernetes storage backend we suggest https://kind.sigs.k8s.io/: - # kind create cluster + # For testing the Kubernetes storage backend we suggest https://kind.sigs.k8s.io/: + # kind create cluster diff --git a/Documentation/README.md b/docs/README.md similarity index 100% rename from Documentation/README.md rename to docs/README.md diff --git a/Documentation/img/caution.png b/docs/img/caution.png similarity index 100% rename from Documentation/img/caution.png rename to docs/img/caution.png diff --git a/Documentation/img/dex-backend-flow.png b/docs/img/dex-backend-flow.png similarity index 100% rename from Documentation/img/dex-backend-flow.png rename to docs/img/dex-backend-flow.png diff --git a/Documentation/img/dex-flow.png b/docs/img/dex-flow.png similarity index 100% rename from Documentation/img/dex-flow.png rename to docs/img/dex-flow.png diff --git a/Documentation/logos/dex-glyph-bw.png b/docs/logos/dex-glyph-bw.png similarity index 100% rename from Documentation/logos/dex-glyph-bw.png rename to docs/logos/dex-glyph-bw.png diff --git a/Documentation/logos/dex-glyph-bw.svg b/docs/logos/dex-glyph-bw.svg similarity index 100% rename from Documentation/logos/dex-glyph-bw.svg rename to docs/logos/dex-glyph-bw.svg diff --git a/Documentation/logos/dex-glyph-color.png b/docs/logos/dex-glyph-color.png similarity index 100% rename from Documentation/logos/dex-glyph-color.png rename to docs/logos/dex-glyph-color.png diff --git a/Documentation/logos/dex-glyph-color.svg b/docs/logos/dex-glyph-color.svg similarity index 100% rename from Documentation/logos/dex-glyph-color.svg rename to docs/logos/dex-glyph-color.svg diff --git a/Documentation/logos/dex-glyph-white.png b/docs/logos/dex-glyph-white.png similarity index 100% rename from Documentation/logos/dex-glyph-white.png rename to docs/logos/dex-glyph-white.png diff --git a/Documentation/logos/dex-glyph-white.svg b/docs/logos/dex-glyph-white.svg similarity index 100% rename from Documentation/logos/dex-glyph-white.svg rename to docs/logos/dex-glyph-white.svg diff --git a/Documentation/logos/dex-horizontal-color.png b/docs/logos/dex-horizontal-color.png similarity index 100% rename from Documentation/logos/dex-horizontal-color.png rename to docs/logos/dex-horizontal-color.png diff --git a/Documentation/logos/dex-horizontal-color.svg b/docs/logos/dex-horizontal-color.svg similarity index 100% rename from Documentation/logos/dex-horizontal-color.svg rename to docs/logos/dex-horizontal-color.svg diff --git a/Documentation/logos/dex-horizontal-white.png b/docs/logos/dex-horizontal-white.png similarity index 100% rename from Documentation/logos/dex-horizontal-white.png rename to docs/logos/dex-horizontal-white.png diff --git a/Documentation/logos/dex-horizontal-white.svg b/docs/logos/dex-horizontal-white.svg similarity index 100% rename from Documentation/logos/dex-horizontal-white.svg rename to docs/logos/dex-horizontal-white.svg diff --git a/examples/config-dev.yaml b/examples/config-dev.yaml index 5b054ebd..d894984d 100644 --- a/examples/config-dev.yaml +++ b/examples/config-dev.yaml @@ -6,7 +6,7 @@ issuer: http://127.0.0.1:5556/dex # The storage configuration determines where dex stores its state. Supported # options include SQL flavors and Kubernetes third party resources. # -# See the storage document at Documentation/storage.md for further information. +# See the documentation (https://dexidp.io/docs/storage/) for further information. storage: type: sqlite3 config: diff --git a/examples/grpc-client/README.md b/examples/grpc-client/README.md index 460a5d1c..59629e05 100644 --- a/examples/grpc-client/README.md +++ b/examples/grpc-client/README.md @@ -1,6 +1,6 @@ # Running a Dex gRPC client -Using gRPC, a client application can directly call methods on a server application as if it was a local object. The schema for Dex's gRPC API calls is defined in [`api/api.proto`][api-proto]. [`client.go`][client] is an example client program that makes a bunch of API calls to the dex server. For further details on the Dex API refer [`Documentation/api.md`][api-docs]. +Using gRPC, a client application can directly call methods on a server application as if it was a local object. The schema for Dex's gRPC API calls is defined in [`api/api.proto`][api-proto]. [`client.go`][client] is an example client program that makes a bunch of API calls to the dex server. For further details on the Dex API refer the [documentation][https://dexidp.io/docs/api/]. ## Generating Credentials @@ -60,4 +60,3 @@ Run the following command to destroy all the credentials files that were created ``` [api-proto]: ../../api/api.proto [client]: client.go -[api-docs]: ../../Documentation/api.md