git.iko.soy/typeable/oauth2-proxy
on master help sign in
fix test setup and add local image build make target

Signed-off-by: Jan Larwig <jan@larwig.com>

commit955ab6b41bec78ac384b0b1f7bbbc6f297898734 authorJan Larwig <jan@larwig.com> dateSat 26 Jul 2025, 12:46 (1 year ago) parent48bd2d7
6 files changed+58−15
Makefile+4 contrib/local-environment/docker-compose-alpha-config.yaml+48−1 contrib/local-environment/docker-compose.yaml+1−1 contrib/local-environment/oauth2-proxy-alpha-config.yaml+2−10 docs/docs/configuration/alpha_config.md+2−2 pkg/apis/options/secret_source.go+1−1
Makefile+4
@@ -74,6 +74,10 @@ DOCKER_BUILDX_PUSH_X_PLATFORM_ALPINE := $(DOCKER_BUILDX_X_PLATFORM_ALPINE) --pus
7474.PHONY: build-docker
7575build-docker: build-distroless build-alpine ## Build multi architecture docker images in both flavours (distroless / alpine)
7676
77+.PHONY: build-docker-local
78+build-docker-local: ## Build distroless docker image and locally load into docker images
79+ $(DOCKER_BUILDX) --load -t $(REGISTRY)/$(REPOSITORY):${VERSION}-local .
80+
7781.PHONY: build-distroless
7882build-distroless: ## Build multi architecture distroless based docker image
7983 $(DOCKER_BUILDX_X_PLATFORM) -t $(REGISTRY)/$(REPOSITORY):latest -t $(REGISTRY)/$(REPOSITORY):${VERSION} .
contrib/local-environment/docker-compose-alpha-config.yaml+48−1
@@ -10,11 +10,58 @@
1010# make alpha-config-<command> (eg make nginx-up, make nginx-down)
1111#
1212# Access http://localhost:4180 to initiate a login cycle
13−version: '3.0'
13+version: "3.0"
1414services:
1515 oauth2-proxy:
16+ container_name: oauth2-proxy
1617 image: quay.io/oauth2-proxy/oauth2-proxy:v7.13.0
1718 command: --config /oauth2-proxy.cfg --alpha-config /oauth2-proxy-alpha-config.yaml
19+ hostname: oauth2-proxy
1820 volumes:
1921 - "./oauth2-proxy-alpha-config.cfg:/oauth2-proxy.cfg"
2022 - "./oauth2-proxy-alpha-config.yaml:/oauth2-proxy-alpha-config.yaml"
23+ restart: unless-stopped
24+ ports:
25+ - 4180:4180/tcp
26+ networks:
27+ dex: {}
28+ httpbin: {}
29+ depends_on:
30+ - dex
31+ - httpbin
32+ dex:
33+ container_name: dex
34+ image: ghcr.io/dexidp/dex:v2.43.1
35+ command: dex serve /dex.yaml
36+ hostname: dex
37+ volumes:
38+ - "./dex.yaml:/dex.yaml"
39+ restart: unless-stopped
40+ ports:
41+ - 5556:5556/tcp
42+ networks:
43+ dex:
44+ aliases:
45+ - dex.localtest.me
46+ etcd: {}
47+ depends_on:
48+ - etcd
49+ httpbin:
50+ container_name: httpbin
51+ image: kennethreitz/httpbin
52+ ports: []
53+ networks:
54+ httpbin: {}
55+ etcd:
56+ container_name: etcd
57+ image: gcr.io/etcd-development/etcd:v3.6.2
58+ entrypoint: /usr/local/bin/etcd
59+ command:
60+ - --listen-client-urls=http://0.0.0.0:2379
61+ - --advertise-client-urls=http://etcd:2379
62+ networks:
63+ etcd: {}
64+networks:
65+ dex: {}
66+ etcd: {}
67+ httpbin: {}
contrib/local-environment/docker-compose.yaml+1−1
@@ -9,7 +9,7 @@
99# make <command> (eg. make up, make down)
1010#
1111# Access http://oauth2-proxy.localtest.me:4180 to initiate a login cycle
12−version: '3.0'
12+version: "3.0"
1313services:
1414 oauth2-proxy:
1515 container_name: oauth2-proxy
contrib/local-environment/oauth2-proxy-alpha-config.yaml+2−10
@@ -4,12 +4,8 @@ upstreamConfig:
44 upstreams:
55 - id: httpbin
66 path: /
7− uri: http://httpbin.localtest.me:8080
7+ uri: http://httpbin
88injectRequestHeaders:
9− - name: X-Forwarded-Groups
10− values:
11− - claimSource:
12− claim: groups
139 - name: X-Forwarded-User
1410 values:
1511 - claimSource:
@@ -18,14 +14,10 @@ injectRequestHeaders:
1814 values:
1915 - claimSource:
2016 claim: email
21− - name: X-Forwarded-Preferred-Username
22− values:
23− - claimSource:
24− claim: preferred_username
2517providers:
2618 - id: oidc
2719 provider: oidc
2820 clientSecret: b2F1dGgyLXByb3h5LWNsaWVudC1zZWNyZXQK
2921 clientID: oauth2-proxy
3022 oidcConfig:
31− issuerURL: http://dex.localhost:5556/dex
23+ issuerURL: http://dex.localtest.me:5556/dex
docs/docs/configuration/alpha_config.md+2−2
@@ -268,7 +268,7 @@ make up the header value
268268
269269| Field | Type | Description |
270270| ----- | ---- | ----------- |
271−| `value` | _[]byte_ | Value expects a base64 encoded []byte |
271+| `value` | _[]byte_ | Value expects a base64 encoded string value. |
272272| `fromEnv` | _string_ | FromEnv expects the name of an environment variable. |
273273| `fromFile` | _string_ | FromFile expects a path to a file containing the secret value. |
274274| `claim` | _string_ | Claim is the name of the claim in the session that the value should be<br/>loaded from. Available claims: `access_token` `id_token` `created_at`<br/>`expires_on` `refresh_token` `email` `user` `groups` `preferred_username`. |
@@ -480,7 +480,7 @@ Only one source within the struct should be defined at any time.
480480
481481| Field | Type | Description |
482482| ----- | ---- | ----------- |
483−| `value` | _[]byte_ | Value expects a base64 encoded []byte |
483+| `value` | _[]byte_ | Value expects a base64 encoded string value. |
484484| `fromEnv` | _string_ | FromEnv expects the name of an environment variable. |
485485| `fromFile` | _string_ | FromFile expects a path to a file containing the secret value. |
486486
pkg/apis/options/secret_source.go+1−1
@@ -3,7 +3,7 @@ package options
33// SecretSource references an individual secret value.
44// Only one source within the struct should be defined at any time.
55type SecretSource struct {
6− // Value expects a base64 encoded []byte
6+ // Value expects a base64 encoded string value.
77 Value []byte `yaml:"value,omitempty"`
88
99 // FromEnv expects the name of an environment variable.