greentic_oauth_core/
lib.rs

1//! Greentic OAuth core primitives shared across services.
2
3pub mod constants;
4pub mod oidc;
5pub mod pkce;
6pub mod provider;
7pub mod state;
8pub mod types;
9pub mod verifier;
10
11#[cfg(feature = "schemas")]
12pub mod schemas;
13
14pub use oidc::{IdClaims, OidcClient, OidcError, PkceState};
15pub use pkce::PkcePair;
16pub use provider::{Provider, ProviderError, ProviderResult};
17pub use state::{DEFAULT_STATE_TTL, StateClaims, StateError, sign_state, verify_state};
18pub use types::{
19    OAuthFlowRequest, OAuthFlowResult, OAuthRequestCtx, OwnerKind, ProviderId, TenantCtx,
20    TokenHandleClaims, TokenSet,
21};
22pub use verifier::{CodeVerifierStore, InMemoryCodeVerifierStore};
23
24/// Lightweight probe to ensure the crate is wired in correctly.
25pub fn health_check() -> &'static str {
26    "ok"
27}
28
29#[cfg(test)]
30mod tests {
31    use super::*;
32
33    #[test]
34    fn health_check_returns_ok() {
35        assert_eq!(health_check(), "ok");
36    }
37}