"Rustify-Auth is a lightweight OAuth 2.0 & 2.1 authorization server in Rust, designed with educational goals in mind. It supports Authorization Code + PKCE, Client Credentials, Refresh Tokens, secure JWT token generation, and Post-Quantum Cryptography (PQC) for enhanced future-proof security.
MIT License
8
stars
4
forks
source link
Add tests for authorize endpoint; update mocks and traits #20
Implemented comprehensive tests for the
/authorize
endpoint insrc/endpoints/authorize.rs
, covering scenarios such as:Updated
MockSessionManager
inmock.rs
:add_session
async method to facilitate session management in tests.Modified trait definitions in
authentication.rs
:Send + Sync
bounds toUserAuthenticator
andSessionManager
traits to ensure compatibility with Actix Web's data extraction requirements.Adjusted tests to ensure proper type casting and handling of async functions:
Arc<MockUserAuthenticator>
andArc<MockSessionManager>
toArc<dyn UserAuthenticator>
andArc<dyn SessionManager>
when adding toapp_data
.add_session
where necessary.Ensured all tests pass successfully after the changes.