Skip to content
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

Changing to json-errors instead of redirects #2

Merged
merged 1 commit into from
Nov 28, 2024
Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# client-registration-api
API for registering application clients for users of OpenEPI

*NB!* This service needs to run in the same cluster as our authentication solution.

## Generating mocks for unit testing
We use the tool mockery for generating mocks for unit testing. To install mockery, see installation instructions:
https://vektra.github.io/mockery/latest/installation/
Expand Down
10 changes: 6 additions & 4 deletions deployment/kubernetes/client-registration-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
name: auth-secrets
key: user_cookie_secret
- name: OAUTH2_PROXY_REDIRECT_URL
value: /oauth2/callback
value: /client-registration/oauth2/callback
- name: OAUTH2_PROXY_OIDC_ISSUER_URL
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -105,9 +105,11 @@ spec:
- name: OAUTH2_PROXY_SESSION_COOKIE_MINIMAL
value: "true"
- name: OAUTH2_PROXY_PROXY_PREFIX
value: "/oauth2"
value: "/client-registration/oauth2"
- name: OAUTH2_PROXY_ALLOW_RELATIVE_REDIRECT_URL
value: "true"
- name: OAUTH2_PROXY_FORCE_JSON_ERRORS
value: "true"
---
apiVersion: v1
kind: Service
Expand Down Expand Up @@ -173,7 +175,7 @@ spec:
- websecure
routes:
- kind: Rule
match: PathPrefix(`/client-registration`) && !PathPrefix(`/client-registration/metrics`)
match: PathPrefix(`/client-registration`) && !PathPrefix(`/client-registration/metrics`) && !PathPrefix(`/client-registration/oauth2`)
services:
- kind: Service
name: client-registration-api
Expand All @@ -182,7 +184,7 @@ spec:
- name: client-registration-auth
- name: stripprefix-client-registration
- kind: Rule
match: PathPrefix(`/oauth2`) && !PathPrefix(`/oauth2/metrics`)
match: PathPrefix(`/client-registration/oauth2`) && !PathPrefix(`/client-registration/oauth2/metrics`)
services:
- kind: Service
name: client-registration-api
Expand Down