Skip to content

Improve crate bootstrap and tighten ignore rules#55

Merged
Mehrn0ush merged 5 commits intomainfrom
develop
Apr 8, 2026
Merged

Improve crate bootstrap and tighten ignore rules#55
Mehrn0ush merged 5 commits intomainfrom
develop

Conversation

@Mehrn0ush
Copy link
Copy Markdown
Owner

Summary

  • add a real binary entrypoint with src/main.rs
  • clean up library bootstrap and route wiring
  • fix Redis token-store compile blockers
  • update README to match actual startup flow
  • tighten .gitignore to exclude local noise without hiding tracked certs

Validation

  • cargo fmt
  • cargo check --lib
  • cargo check --bins

…Flows with Configuration Flags and Tests

- **OIDC Flows Implemented:**
  - **Authorization Code Flow:**
    - Support for generating and validating authorization codes.
    - Integrated PKCE (Proof Key for Code Exchange) for enhanced security.
    - Controlled via 'authorization_code_flow' flag.

  - **Implicit Flow:**
    - Token issuance without intermediate authorization codes.
    - Controlled via 'implicit_flow' flag.

  - **Hybrid Flow:**
    - Combination of Authorization Code and Implicit flows.
    - Controlled via 'hybrid_flow' flag.

  - **CIBA Flow:**
    - Placeholder for Client-Initiated Backchannel Authentication.
    - Controlled via 'ciba_flow' flag.

- **Configuration Flags:**
  - Updated 'OidcConfig' to include:
    - 'authorization_code_flow: bool'
    - 'implicit_flow: bool'
    - 'hybrid_flow: bool'
    - 'ciba_flow: bool'
  - These flags enable or disable respective OIDC flows based on application needs.

- **Testing Enhancements:**
  - Developed comprehensive tests for each OIDC flow:
    - Valid and invalid client scenarios.
    - PKCE parameter validations.
    - Session management and user authentication.
    - Response type handling based on enabled flows.

  - Resolved ownership and trait object issues by:
    - Ensuring handler signatures include 'Send + Sync' bounds.
    - Accessing response headers and status before reading the body to prevent ownership moves.
    - Retaining access to concrete mock types to utilize mock-specific methods like 'add_session'.

  - Enhanced logging within handlers and tests for improved traceability and debugging.

- **Bug Fixes and Improvements:**
  - Aligned handler signatures with trait object bounds to prevent internal server errors during tests.
  - Refactored tests to handle response ownership correctly, avoiding 'Option::unwrap()' panics.
  - Ensured mock implementations are thread-safe and correctly implement 'Send + Sync'.

- **Miscellaneous:**
  - Added helper functions for token generation and validation.
  - Organized code structure for better readability and maintainability.
  - Ensured all traits are object-safe and adhere to necessary bounds.

This commit establishes robust OIDC support within the application, providing flexibility through configuration flags and ensuring secure and reliable authentication flows with thorough testing.
@Mehrn0ush Mehrn0ush merged commit 2aaf39d into main Apr 8, 2026
3 checks passed
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.

1 participant