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

fix: Avoid query during import time to set add_user endpoint scopes #1241

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

adamantike
Copy link
Collaborator

The add_user endpoint was querying the database at import time, to decide whether to enforce the users.write scope or not. This is problematic because the database might not be ready at import time.

Also, the decided scopes was being maintained for the entire application lifetime, which is not ideal, as users can be created without having the users.write scope, until the application is restarted.

The `add_user` endpoint was querying the database at import time, to
decide whether to enforce the `users.write` scope or not. This is
problematic because the database might not be ready at import time.

Also, the decided `scopes` was being maintained for the entire
application lifetime, which is not ideal, as users can be created
without having the `users.write` scope, until the application is
restarted.
Copy link

Test Results

87 tests   87 ✅  26s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit 1df2707.

Copy link
Member

@gantoine gantoine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow yeah great catch!

@adamantike adamantike merged commit 2a24f5f into master Oct 14, 2024
8 checks passed
@adamantike adamantike deleted the fix/avoid-query-add_user-at-import-time branch October 14, 2024 03:43
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