Skip to main content

authnz_common/
lib.rs

1//! Authnz common library.
2//!
3//! Contains common types and utils for Impulse Authnz server & SDKs.
4
5#![deny(warnings, missing_docs, clippy::todo, clippy::unimplemented, clippy::unwrap_used)]
6#![feature(if_let_guard)]
7
8mod types;
9pub use types::*;
10
11mod utils;
12pub use utils::*;
13
14/// Sign header name.
15///
16/// Used to sign app requests and Authnz server responses.
17pub const SIGN: &str = "Authnz-Sign";
18
19/// Stateless hints header name.
20///
21/// Provides signed hints and stateless checks on user registration to avoid DoS attacks.
22pub const SIGNUP_HINTS: &str = "Authnz-Hints";
23
24/// Client challenge token header name.
25///
26/// Used to store challenge signed by Authnz server during client token update process.
27pub const CLIENT_CHALLENGE_TOKEN: &str = "Authnz-Challenge-State";
28
29/// Client challenge header name.
30///
31/// Used to transfer challenge to client during client token update process.
32pub const CLIENT_CHALLENGE: &str = "Authnz-Challenge";
33
34/// Client challenge sign header name.
35///
36/// Used to transfer challenge sign to Authnz server during client token update process.
37pub const CLIENT_CHALLENGE_SIGN: &str = "Authnz-Challenge-Sign";
38
39/// Access token header/cookie name.
40pub const ACCESS_TOKEN: &str = "Authnz-Access";
41/// Refresh token header/cookie name.
42pub const REFRESH_TOKEN: &str = "Authnz-Refresh";
43/// Client token header/cookie name.
44pub const CLIENT_TOKEN: &str = "Authnz-Client";
45
46/// Forwarded from header name.
47pub const FORWARDED_FROM: &str = "Authnz-Forwarded-From";
48
49pub use chrono;