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

Allow to set multiple client ids/secrets in a same K8s secret #157

Open
4 of 5 tasks
burahimu opened this issue Feb 7, 2025 · 0 comments
Open
4 of 5 tasks

Allow to set multiple client ids/secrets in a same K8s secret #157

burahimu opened this issue Feb 7, 2025 · 0 comments
Labels
feat New feature or request.

Comments

@burahimu
Copy link

burahimu commented Feb 7, 2025

Preflight checklist

Ory Network Project

No response

Describe your problem

In a specific context, I want to be able to define client_id_key and client_secret_key per client definition. Currently, it's only possible to define a env var to override the key for all clients.

Describe your ideal solution

Add clientIdKey and clientSecretKey in Oauth2Client spec

---
apiVersion: hydra.ory.sh/v1alpha1
kind: OAuth2Client
metadata:
  name: my-client-1
spec:
  secretName: my-secret
  clientIdKey: client-id-2
  clientSecretKey: client-secret-2
...
---
apiVersion: hydra.ory.sh/v1alpha1
kind: OAuth2Client
metadata:
  name: my-client-2
spec:
  secretName: my-secret
  clientIdKey: client-id-2
  clientSecretKey: client-secret-2
...

Workarounds or alternatives

I made a loop in my chart to load secrets

{{- range $clientName, $clientConfig := .Values.oauth2client.clients }}
- name: {{ $clientConfig.clientIdEnvVarName  }}
  valueFrom:
    secretKeyRef:
      name: {{ $clientName }}-oauth2client-secret
      key: CLIENT_ID
- name: {{ $clientConfig.clientSecretEnvVarName }}
  valueFrom:
    secretKeyRef:
      name: {{ $clientName }}-oauth2client-secret
      key: CLIENT_SECRET
{{- end }}

WDYT to do the following:

envFrom:
    - secretRef:
        name: my-secret

Version

0.0.36

Additional Context

No response

@burahimu burahimu added the feat New feature or request. label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request.
Projects
None yet
Development

No branches or pull requests

1 participant