Skip to content

Change oauth2 to mount rather than load secrets #9

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

Merged

Conversation

cbandy
Copy link

@cbandy cbandy commented Mar 12, 2025

Sorry for this wall of text. There's a couple things happening:

  • Change from a list of secret ref to a list-map of secret+key ref
    • this allows the user to select/name the field within their secret
    • they can also store multiple oauth configs in a single secret (different keys)
spec:
  config:
    oauthConfigurations:
      - name: something
        secret:
          name: another
          key: anything
  • Don't annotate the pod with config hash

    • it's better that we reduce the times we have to read a secret directly
    • this rolls out slower, but recent changes reload config without recreating the pod
  • Keep spec order of OAUTH2_CONFIG

    • this might not matter inside pgAdmin, but seems good to do?

I don't have an OAuth environment setup, so I was looking at the results of this command:

kubectl -n cbandy exec pgadmin-79dc40ce-4efe-4495-9c8f-c62922cc751b-0 -- bash -c '
cd /usr/local/lib/python*/site-packages/pgadmin4 &&
python3 -c "import config, pprint; pprint.pp(config.__dict__)"
'

@philrhurst philrhurst merged commit e484f5d into philrhurst:pgadmin-oauth-secrets Mar 12, 2025
@cbandy cbandy deleted the pgadmin-oauth-secrets branch March 12, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants