-
Notifications
You must be signed in to change notification settings - Fork 8
feat: dexop - operator to manage Oauth2 clients in Dex #876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
b042e70
dexop: initialize
skrobul 171b1fd
dexop: fix broken go.mod and upgrade tools
skrobul 3f1b141
dexop: generate Client resource
skrobul b2f57e0
dexop: example manifest
skrobul 9e84ef6
dexop: install dex client APIs
skrobul d5138e7
dexop: add Dex client
skrobul 2b6391c
dexop: handle create and delete correctly
skrobul f166fe2
dexop: UpdateOauth2Client can set logo and trusted peers
skrobul b26af26
dexop: add support for reading Secrets
skrobul 92252d1
dexop: add support for generating secrets
skrobul 7cf5805
dexop: generate secure secret values
skrobul 4f16a05
dexop: refactor Reconcile part 1
skrobul 2a2062b
dexop: improve tests
skrobul 5270e93
dexop: add more comprehensive tests
skrobul b40e40f
dexop: implement update by recreate
skrobul 060c53f
dexop: update rbac
skrobul 39a04fa
dexop: ability to configure certs
skrobul bbe9171
dexop: use dedicated instance of Dex for testing
skrobul b8f7509
dexop: fix most linting issues
skrobul 8317aa2
dexop: migrate from deprecated grpc.Dial
skrobul eff30b6
dexop: build container with go 1.23
skrobul 1983fc0
dexop: add github container builds workflow
skrobul a85c764
dexop: update the README
skrobul 18e9cd3
dexop: add autogenerated install
skrobul 6fe521f
dexop: add Helm chart
skrobul 1a45cc6
dexop: refactor deletion
skrobul a312acf
dexop: refactor adding finalizer
skrobul 6429441
dexop: refactor secret handling
skrobul e245b5b
dexop: refactor adding/updating client
skrobul 95b9ed8
dexop: refactor secret handling further
skrobul ddf8f53
dexop: don't build images on PR
skrobul 9b699c2
dexop: migrate to new golangci
skrobul fd741d7
dexop: make Secrets compatible with Understack
skrobul 2ea0d15
dexop: remove unnecessary TypeMeta
skrobul 44f966f
dexop: better error handling for certs
skrobul 1357548
dexop: style
skrobul d237a17
dexop: add missing nil checks
skrobul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| --- | ||
| name: build-dexop-images | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - dexop-v* | ||
| paths: | ||
| - "go/dexop/**" | ||
|
|
||
| jobs: | ||
| build-ghcr-registry: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| packages: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 | ||
|
|
||
| - name: Login to ghcr.io | ||
| uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3 | ||
| with: | ||
| registry: "ghcr.io" | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract tag name | ||
| id: extract_tag | ||
| run: echo "tag=${GITHUB_REF#refs/tags/dexop-v}" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Build and deploy Dexop image | ||
| uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6 | ||
| with: | ||
| context: go/dexop/ | ||
| file: go/dexop/Dockerfile | ||
| # push for all main branch commits | ||
| push: ${{ github.event_name != 'pull_request' }} | ||
| tags: ghcr.io/${{ github.repository }}/dexop:latest,ghcr.io/${{ github.repository }}/dexop:${{ steps.extract_tag.outputs.tag }} | ||
| labels: | | ||
| org.opencontainers.image.version=${{ steps.extract_tag.outputs.tag }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
| # Ignore build and test binaries. | ||
| bin/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # Binaries for programs and plugins | ||
| *.exe | ||
| *.exe~ | ||
| *.dll | ||
| *.so | ||
| *.dylib | ||
| bin/* | ||
| Dockerfile.cross | ||
|
|
||
| # Test binary, built with `go test -c` | ||
| *.test | ||
|
|
||
| # Output of the go coverage tool, specifically when used with LiteIDE | ||
| *.out | ||
|
|
||
| # Go workspace file | ||
| go.work | ||
|
|
||
| # Kubernetes Generated files - skip generated files, except for vendored files | ||
| !vendor/**/zz_generated.* | ||
|
|
||
| # editor and IDE paraphernalia | ||
| .idea | ||
| .vscode | ||
| *.swp | ||
| *.swo | ||
| *~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| version: "2" | ||
| run: | ||
| allow-parallel-runners: true | ||
| linters: | ||
| default: none | ||
| enable: | ||
| - dupl | ||
| - errcheck | ||
| - goconst | ||
| - gocyclo | ||
| - govet | ||
| - ineffassign | ||
| - lll | ||
| - misspell | ||
| - nakedret | ||
| - prealloc | ||
| - staticcheck | ||
| - unconvert | ||
| - unparam | ||
| - unused | ||
| exclusions: | ||
| generated: lax | ||
| rules: | ||
| - linters: | ||
| - lll | ||
| path: api/* | ||
| - linters: | ||
| - dupl | ||
| - lll | ||
| path: internal/* | ||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| settings: | ||
| staticcheck: | ||
| dot-import-whitelist: | ||
| - fmt | ||
| - github.com/onsi/ginkgo/v2 | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
| exclusions: | ||
| generated: lax | ||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| golang 1.23.6 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Build the manager binary | ||
| FROM golang:1.23 AS builder | ||
| ARG TARGETOS | ||
| ARG TARGETARCH | ||
|
|
||
| WORKDIR /workspace | ||
| # Copy the Go Modules manifests | ||
| COPY go.mod go.mod | ||
| COPY go.sum go.sum | ||
| # cache deps before building and copying source so that we don't need to re-download as much | ||
| # and so that source changes don't invalidate our downloaded layer | ||
| RUN go mod download | ||
|
|
||
| # Copy the go source | ||
| COPY cmd/main.go cmd/main.go | ||
| COPY api/ api/ | ||
| COPY internal/controller/ internal/controller/ | ||
| COPY dex/ dex/ | ||
|
|
||
| # Build | ||
| # the GOARCH has not a default value to allow the binary be built according to the host where the command | ||
| # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO | ||
| # the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, | ||
| # by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. | ||
| RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o manager cmd/main.go | ||
|
|
||
| # Use distroless as minimal base image to package the manager binary | ||
| # Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
| FROM gcr.io/distroless/static:nonroot | ||
| WORKDIR / | ||
| COPY --from=builder /workspace/manager . | ||
| USER 65532:65532 | ||
|
|
||
| ENTRYPOINT ["/manager"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.