Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added support for annotations on the PgSTAC bootstrap job via `pgstacBootstrap.jobAnnotations` in values.yaml [#381](https://github.com/developmentseed/eoapi-k8s/pull/381)
- Added auth support to STAC Browser [#376](https://github.com/developmentseed/eoapi-k8s/pull/376)

### Fixed

Expand Down
9 changes: 6 additions & 3 deletions charts/eoapi/profiles/experimental.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,12 @@ ingress:

stac-auth-proxy:
enabled: true
# For testing this will be set dynamically; for production, point to your OIDC server
# env:
# OIDC_DISCOVERY_URL: "http://eoapi-mock-oidc-server.eoapi.svc.cluster.local:8080/.well-known/openid-configuration"
image:
tag: "v0.10.2-rc1"
env:
ROOT_PATH: "/stac"
# For testing this will be set dynamically; for production, point to your OIDC server
# OIDC_DISCOVERY_URL: "http://eoapi-mock-oidc-server.eoapi.svc.cluster.local:8080/.well-known/openid-configuration"

######################
# MOCK OIDC SERVER
Expand Down
15 changes: 13 additions & 2 deletions charts/eoapi/templates/services/browser/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
app: {{ .Release.Name }}-browser
gitsha: {{ .Values.gitSha }}
spec:
replicas: {{.Values.browser.replicaCount}}
replicas: {{ .Values.browser.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}-browser
Expand All @@ -23,5 +23,16 @@ spec:
- containerPort: 8080
env:
- name: SB_catalogUrl
value: "{{ .Values.stac.ingress.path }}"
value: "http://{{ .Values.ingress.host }}{{ .Values.stac.ingress.path }}"
{{- if index .Values "stac-auth-proxy" "enabled" }}
- name: SB_authConfig
value: |
{
"type": "openIdConnect",
"openIdConnectUrl": "http://{{ .Values.ingress.host }}{{ .Values.mockOidcServer.ingress.path }}/.well-known/openid-configuration",
"oidcOptions": {
"client_id": "{{ .Values.browser.oidcClientId | default "test-client" }}"
}
}
{{- end }}
{{- end }}
58 changes: 58 additions & 0 deletions charts/eoapi/tests/stac_browser_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,61 @@ tests:
- equal:
path: metadata.annotations.annotation2
value: world
- it: "stac browser deployment with auth enabled"
set:
raster.enabled: false
stac.enabled: true
vector.enabled: false
multidim.enabled: false
browser.enabled: true
stac-auth-proxy.enabled: true
ingress.host: "localhost"
stac.ingress.path: "/stac"
mockOidcServer.ingress.path: "/mock-oidc"
browser.oidcClientId: "test-client"
gitSha: "ABC123"
template: templates/services/browser/deployment.yaml
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].env
content:
name: SB_catalogUrl
value: "http://localhost/stac"
- contains:
path: spec.template.spec.containers[0].env
content:
name: SB_authConfig
value: |
{
"type": "openIdConnect",
"openIdConnectUrl": "http://localhost/mock-oidc/.well-known/openid-configuration",
"oidcOptions": {
"client_id": "test-client"
}
}
- it: "stac browser deployment without auth"
set:
raster.enabled: false
stac.enabled: true
vector.enabled: false
multidim.enabled: false
browser.enabled: true
stac-auth-proxy.enabled: false
ingress.host: "localhost"
stac.ingress.path: "/stac"
gitSha: "ABC123"
template: templates/services/browser/deployment.yaml
asserts:
- isKind:
of: Deployment
- contains:
path: spec.template.spec.containers[0].env
content:
name: SB_catalogUrl
value: "http://localhost/stac"
- notContains:
path: spec.template.spec.containers[0].env
content:
name: SB_authConfig
1 change: 1 addition & 0 deletions charts/eoapi/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ browser:
tag: 3.3.4
ingress:
enabled: true # Control ingress specifically for browser service
oidcClientId: "some-client-id"

docServer:
enabled: true
Expand Down
Loading