Add comprehensive tests for IA S3 authentication and loan logic#185
Merged
Conversation
- Implement tests for the `validate_patron_ia_s3` function, covering various scenarios including successful validation, email normalization, error handling for unauthorized access, and fallback mechanisms. - Create tests for the `/oauth/ia-s3` route to ensure proper behavior when authentication is enabled or disabled, including session cookie handling and error responses. - Introduce tests for loan settings, including configuration overrides, due date calculations, and error handling for borrowing limits and unavailable books. - Ensure that all tests utilize mocking to isolate functionality and avoid dependencies on external systems.
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #183 #184
This pull request introduces several significant improvements to authentication, configuration, and development workflows for the Lenny project. The main changes include support for external OAuth/OIDC and IA S3 patron authentication, a refactor of environment variable management into dedicated files, and enhanced documentation for local development. Additionally, the PR adds a database migration for loan due dates and pins frontend dependencies to specific commits for reproducibility.
Authentication Enhancements:
auth.envand the Admin UI. IA S3 patron authentication is now also supported and toggled independently. [1] [2] [3] [4]Environment Configuration Refactor:
.env(core),auth.env(admin credentials and OAuth),ol.env(Open Library/IA credentials), andloan.env(loan policy). Updated Docker and utility scripts to use these files, improving security and maintainability. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]Local Development Improvements:
lenny-appadmin UI locally, including requiredcompose.yamlchanges and.env.localsetup. [1] [2]Database and Versioning:
due_datefield to theloanstable, supporting future loan expiration features.0.2.3.Frontend Dependency Management:
lenny-appandthorium-webDocker builds to specific commit SHAs, ensuring deterministic builds and easier upgrades. [1] [2]These changes collectively improve authentication flexibility, deployment security, and developer experience.
validate_patron_ia_s3function, covering various scenarios including successful validation, email normalization, error handling for unauthorized access, and fallback mechanisms./oauth/ia-s3route to ensure proper behavior when authentication is enabled or disabled, including session cookie handling and error responses.