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

support client credentials being loaded from file #48

Merged
merged 1 commit into from
May 7, 2024

Conversation

mikemrm
Copy link
Contributor

@mikemrm mikemrm commented May 7, 2024

The client creds secret, previously had to be specified in the config. When deploying this with the helm chart, this would require the value to be stored in plain text in the config map.

To solve this, we now accept a file path for both clientID and clientSecret.

If either attributes value is prefixed with file:// the defined file is attempted to be loaded. If no file is found, or the file fails to be read, an error is returned.

Currently the file is only read once at startup.
However a future improvement could provide support for allowing hot reloading of the file.

The client creds secret, previously had to be specified in the config.
When deploying this with the helm chart, this would require the value
to be stored in plain text in the config map.

To solve this, we now accept a file path for both clientID and clientSecret.

If either attributes value is prefixed with `file://` the defined file is attempted to be loaded.
If no file is found, or the file fails to be read, an error is returned.

Currently the file is only read once at startup.
However a future improvement could provide support for allowing hot reloading of the file.

Signed-off-by: Mike Mason <[email protected]>
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 16 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (main@c45d6b4). Click here to learn what that means.

Files Patch % Lines
internal/accesstoken/tokensource.go 0.00% 16 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #48   +/-   ##
=======================================
  Coverage        ?   10.89%           
=======================================
  Files           ?       22           
  Lines           ?      679           
  Branches        ?        0           
=======================================
  Hits            ?       74           
  Misses          ?      600           
  Partials        ?        5           
Flag Coverage Δ
unittests 10.89% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mikemrm mikemrm marked this pull request as ready for review May 7, 2024 19:00
@mikemrm mikemrm requested review from a team as code owners May 7, 2024 19:00
@mikemrm mikemrm merged commit 45ba684 into infratographer:main May 7, 2024
4 checks passed
@mikemrm mikemrm deleted the client-creds-from-file branch May 7, 2024 19:13
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.

3 participants