Skip to main content

reifydb_auth/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4//! Turns a wire-level credential into a verified `IdentityId`. Authorisation belongs to the policy engine, so a
5//! deployment can swap authentication methods without touching policy enforcement.
6//!
7//! Invariant: a successful authentication yields an `IdentityId` that resolves through the catalog to a real,
8//! non-revoked identity. Minting one outside this crate bypasses revocation and is a security regression.
9
10#![cfg_attr(not(debug_assertions), deny(clippy::disallowed_methods))]
11#![cfg_attr(debug_assertions, warn(clippy::disallowed_methods))]
12#![cfg_attr(not(debug_assertions), deny(warnings))]
13#![allow(clippy::tabs_in_doc_comments)]
14extern crate core;
15
16use reifydb_core::interface::version::{ComponentType, HasVersion, SystemVersion};
17
18pub mod challenge;
19pub mod error;
20pub mod github;
21pub mod method;
22pub mod registry;
23pub mod service;
24
25pub struct AuthVersion;
26
27impl HasVersion for AuthVersion {
28	fn version(&self) -> SystemVersion {
29		SystemVersion {
30			name: env!("CARGO_PKG_NAME")
31				.strip_prefix("reifydb-")
32				.unwrap_or(env!("CARGO_PKG_NAME"))
33				.to_string(),
34			version: env!("CARGO_PKG_VERSION").to_string(),
35			description: "Authentication and authorization module".to_string(),
36			r#type: ComponentType::Module,
37		}
38	}
39}