Skip to main content

static_authn_plugin/
lib.rs

1//! Static `AuthN` Resolver Plugin
2//!
3//! This plugin provides static token-to-identity mapping for development and testing.
4//!
5//! ## Modes
6//!
7//! - **`accept_all`** (default): Accepts any non-empty token, returns configured default identity.
8//!   Replaces the `auth_disabled` use case for scenarios that still need a `SecurityContext`.
9//!
10//! - **`static_tokens`**: Maps specific tokens to specific identities. Useful for E2E tests
11//!   with distinct users.
12//!
13//! ## Configuration
14//!
15//! ```yaml
16//! modules:
17//!   static_authn_plugin:
18//!     config:
19//!       vendor: "hyperspot"
20//!       priority: 100
21//!       mode: accept_all
22//!       default_identity:
23//!         subject_id: "11111111-6a88-4768-9dfc-6bcd5187d9ed"
24//!         subject_tenant_id: "00000000-df51-5b42-9538-d2b56b7ee953"
25//!         token_scopes: ["*"]
26//!       tokens: []
27//! ```
28#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
29
30pub mod config;
31pub mod domain;
32pub mod module;
33
34pub use module::StaticAuthNPlugin;