git.iko.soy/typeable/oauth2-proxy
on master help sign in
fix test setup and add local image build make target
955ab6bJan Larwig
@@ -74,6 +74,10 @@ DOCKER_BUILDX_PUSH_X_PLATFORM_ALPINE := $(DOCKER_BUILDX_X_PLATFORM_ALPINE) --pus
74.PHONY: build-docker
74.PHONY: build-docker
75build-docker: build-distroless build-alpine ## Build multi architecture docker images in both flavours (distroless / alpine)
75build-docker: build-distroless build-alpine ## Build multi architecture docker images in both flavours (distroless / alpine)
76
76
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+
77.PHONY: build-distroless
81.PHONY: build-distroless
78build-distroless: ## Build multi architecture distroless based docker image
82build-distroless: ## Build multi architecture distroless based docker image
79 $(DOCKER_BUILDX_X_PLATFORM) -t $(REGISTRY)/$(REPOSITORY):latest -t $(REGISTRY)/$(REPOSITORY):${VERSION} .
83 $(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 @@
10# make alpha-config-<command> (eg make nginx-up, make nginx-down)
10# make alpha-config-<command> (eg make nginx-up, make nginx-down)
11#
11#
12# Access http://localhost:4180 to initiate a login cycle
12# Access http://localhost:4180 to initiate a login cycle
13−version: '3.0'
13+version: "3.0"
14services:
14services:
15 oauth2-proxy:
15 oauth2-proxy:
16+ container_name: oauth2-proxy
16 image: quay.io/oauth2-proxy/oauth2-proxy:v7.13.0
17 image: quay.io/oauth2-proxy/oauth2-proxy:v7.13.0
17 command: --config /oauth2-proxy.cfg --alpha-config /oauth2-proxy-alpha-config.yaml
18 command: --config /oauth2-proxy.cfg --alpha-config /oauth2-proxy-alpha-config.yaml
19+ hostname: oauth2-proxy
18 volumes:
20 volumes:
19 - "./oauth2-proxy-alpha-config.cfg:/oauth2-proxy.cfg"
21 - "./oauth2-proxy-alpha-config.cfg:/oauth2-proxy.cfg"
20 - "./oauth2-proxy-alpha-config.yaml:/oauth2-proxy-alpha-config.yaml"
22 - "./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 @@
9# make <command> (eg. make up, make down)
9# make <command> (eg. make up, make down)
10#
10#
11# Access http://oauth2-proxy.localtest.me:4180 to initiate a login cycle
11# Access http://oauth2-proxy.localtest.me:4180 to initiate a login cycle
12−version: '3.0'
12+version: "3.0"
13services:
13services:
14 oauth2-proxy:
14 oauth2-proxy:
15 container_name: oauth2-proxy
15 container_name: oauth2-proxy
contrib/local-environment/oauth2-proxy-alpha-config.yaml+2−10
@@ -4,12 +4,8 @@ upstreamConfig:
4 upstreams:
4 upstreams:
5 - id: httpbin
5 - id: httpbin
6 path: /
6 path: /
7− uri: http://httpbin.localtest.me:8080
7+ uri: http://httpbin
8injectRequestHeaders:
8injectRequestHeaders:
9− - name: X-Forwarded-Groups
10− values:
11− - claimSource:
12− claim: groups
13 - name: X-Forwarded-User
9 - name: X-Forwarded-User
14 values:
10 values:
15 - claimSource:
11 - claimSource:
@@ -18,14 +14,10 @@ injectRequestHeaders:
18 values:
14 values:
19 - claimSource:
15 - claimSource:
20 claim: email
16 claim: email
21− - name: X-Forwarded-Preferred-Username
22− values:
23− - claimSource:
24− claim: preferred_username
25providers:
17providers:
26 - id: oidc
18 - id: oidc
27 provider: oidc
19 provider: oidc
28 clientSecret: b2F1dGgyLXByb3h5LWNsaWVudC1zZWNyZXQK
20 clientSecret: b2F1dGgyLXByb3h5LWNsaWVudC1zZWNyZXQK
29 clientID: oauth2-proxy
21 clientID: oauth2-proxy
30 oidcConfig:
22 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
268
268
269| Field | Type | Description |
269| Field | Type | Description |
270| ----- | ---- | ----------- |
270| ----- | ---- | ----------- |
271−| `value` | _[]byte_ | Value expects a base64 encoded []byte |
271+| `value` | _[]byte_ | Value expects a base64 encoded string value. |
272| `fromEnv` | _string_ | FromEnv expects the name of an environment variable. |
272| `fromEnv` | _string_ | FromEnv expects the name of an environment variable. |
273| `fromFile` | _string_ | FromFile expects a path to a file containing the secret value. |
273| `fromFile` | _string_ | FromFile expects a path to a file containing the secret value. |
274| `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`. |
274| `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.
480
480
481| Field | Type | Description |
481| Field | Type | Description |
482| ----- | ---- | ----------- |
482| ----- | ---- | ----------- |
483−| `value` | _[]byte_ | Value expects a base64 encoded []byte |
483+| `value` | _[]byte_ | Value expects a base64 encoded string value. |
484| `fromEnv` | _string_ | FromEnv expects the name of an environment variable. |
484| `fromEnv` | _string_ | FromEnv expects the name of an environment variable. |
485| `fromFile` | _string_ | FromFile expects a path to a file containing the secret value. |
485| `fromFile` | _string_ | FromFile expects a path to a file containing the secret value. |
486
486
pkg/apis/options/secret_source.go+1−1
@@ -3,7 +3,7 @@ package options
3// SecretSource references an individual secret value.
3// SecretSource references an individual secret value.
4// Only one source within the struct should be defined at any time.
4// Only one source within the struct should be defined at any time.
5type SecretSource struct {
5type SecretSource struct {
6− // Value expects a base64 encoded []byte
6+ // Value expects a base64 encoded string value.
7 Value []byte `yaml:"value,omitempty"`
7 Value []byte `yaml:"value,omitempty"`
8
8
9 // FromEnv expects the name of an environment variable.
9 // FromEnv expects the name of an environment variable.