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

Make api key enablement configurable in runtime #1335

Merged
merged 2 commits into from
Apr 17, 2023
Merged

Conversation

arbulu89
Copy link
Contributor

Make api_key usage enabled option configurable in runtime. It will come handy for e2e testing scenarios.

PD:
The other option was to provide the option to use a configurable api_key base value, but we decided to not implement this, as the current api_key implementation is not that good, and we might change it at some point, so going with the easy disable option was preferred. In any case, the api_key depends on the secret_key_base, so both this and the custom api_key should be fixed to have a unique key

@arbulu89 arbulu89 marked this pull request as draft April 17, 2023 12:52
@arbulu89
Copy link
Contributor Author

@fabriziosestito At the end, I have changed strategy 😅
We cannot change a variable that was fetched during compilation (compile_env).
I have opted to go with unplug as we do with wanda so we can enable/disable phoenix plugs on demand with runtime changes.
This time I tested properly and it works 🐰

@arbulu89 arbulu89 marked this pull request as ready for review April 17, 2023 13:47
@arbulu89 arbulu89 merged commit d1d0e85 into main Apr 17, 2023
@arbulu89 arbulu89 deleted the disable-api-key-runtime branch April 17, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants