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

Override library for authenticated patron requests #45

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

attemoi
Copy link
Contributor

@attemoi attemoi commented Apr 15, 2024

Each patron is assigned one library based on municipality. The clients are currently sending all requests towards the default library. For patrons assigned to a library, this fails due to authorization.

The clients don't need to have access to multiple libraries so we can just override the library for the requests coming from authenticated patrons.

The alternative would be to make the clients choose the library based on the authentication response.

  • I have updated the documentation accordingly.
  • All new and existing tests passed.

@attemoi attemoi force-pushed the feature/simplye-263/custom-lane-management branch 3 times, most recently from 3055bd5 to 265e070 Compare April 15, 2024 08:31
Each patron is assigned one library based on municipality. The clients
are currently sending all requests towards the default library, which
fails due to authorization.

The alternative to this change would be to make the clients choose
the correct library based on the authentication response.
# Finland: For authenticated patrons, override the library defined in the request
# and use the library assigned to that patron.
#
# This is a bit sketchy as the authentication requires library to be set already.
Copy link
Contributor

Choose a reason for hiding this comment

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

Any risk to get duplicate records?

Copy link
Contributor Author

@attemoi attemoi Apr 15, 2024

Choose a reason for hiding this comment

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

I don't think duplicate records are a risk here. The risk is I might've missed some detail that would make this break in some specific cases. Pretty sure it's fine though. Selecting the library (automatically) on client side might be a bit safer as the requests would then use the default (upstream) logic.

@attemoi attemoi merged commit 370ba4c into main Apr 15, 2024
24 checks passed
@attemoi attemoi deleted the feature/simplye-263/custom-lane-management branch April 15, 2024 09: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