greentic_oauth_core/
lib.rs

1//! Greentic OAuth core primitives shared across services.
2//!
3//! The crate exposes a consistent provider interface, including optional PKCE
4//! verifier forwarding and pass-through `extra_params` so higher-level brokers
5//! can enrich authorization and token requests for specific providers without
6//! reinventing serialization concerns.
7
8pub mod constants;
9pub mod oidc;
10pub mod pkce;
11pub mod provider;
12pub mod state;
13pub mod types;
14pub mod verifier;
15
16#[cfg(feature = "schemas")]
17pub mod schemas;
18
19pub use oidc::{IdClaims, OidcClient, OidcError, PkceState};
20pub use pkce::PkcePair;
21pub use provider::{Provider, ProviderError, ProviderResult};
22pub use state::{DEFAULT_STATE_TTL, StateClaims, StateError, sign_state, verify_state};
23pub use types::{
24    OAuthFlowRequest, OAuthFlowResult, OAuthRequestCtx, OwnerKind, ProviderId, TenantCtx,
25    TokenHandleClaims, TokenSet,
26};
27pub use verifier::{CodeVerifierStore, InMemoryCodeVerifierStore};
28
29/// Lightweight probe to ensure the crate is wired in correctly.
30pub fn health_check() -> &'static str {
31    "ok"
32}
33
34#[cfg(test)]
35mod tests {
36    use super::*;
37
38    #[test]
39    fn health_check_returns_ok() {
40        assert_eq!(health_check(), "ok");
41    }
42}