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

Avoid global usersettings #58

Merged
merged 6 commits into from
Feb 5, 2021
Merged

Avoid global usersettings #58

merged 6 commits into from
Feb 5, 2021

Conversation

aspic
Copy link
Collaborator

@aspic aspic commented Feb 3, 2021

Have a bad feeling about setting userSettings in the node-express-auth handler, and then re-using that global variable for a specific user. Mitigates this by:

  • Extracting getting user settings from username/password into it's own module ProxyAuthorizer
  • Uses that module for authorizing in myAuthorizer
  • Re-uses the module when getting specific user settings in processRequest (access the req.auth header there)

This also made testing simpler, and we can now test the default config files directly, instead of copying them into test scope.

@aspic aspic added the enhancement New feature or request label Feb 3, 2021
@aspic aspic requested a review from Joohansson February 3, 2021 20:26
@Joohansson Joohansson merged commit 25aa908 into master Feb 5, 2021
@Joohansson Joohansson deleted the avoid-global-usersettings branch February 5, 2021 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants