1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! Authentication and tenancy service.
//!
//! This module provides authentication and multi-tenancy support for agent execution.
//! The [`AuthService`] trait defines the interface for obtaining the current authentication
//! context, which is used by other runtime services to namespace operations.
//!
//! # Examples
//!
//! ```ignore
//! use radkit::runtime::auth::{AuthService, StaticAuthService};
//!
//! let auth_service = StaticAuthService::new("my-app", "alice");
//! let auth_ctx = auth_service.get_auth_context();
//! println!("App: {}, User: {}", auth_ctx.app_name, auth_ctx.user_name);
//! ```
pub use StaticAuthService;
use crate;
use crateAuthContext;
/// Service for providing authentication and tenancy context.
///
/// Implementations of this trait are responsible for identifying the current
/// user and tenant (application) for any given request. This is fundamental
/// for security and multi-tenancy, ensuring that one user or application
/// cannot access another's data.
///
/// # Multi-tenancy
///
/// The [`AuthContext`] returned by this service is used by other runtime
/// services (like [`MemoryService`](crate::runtime::memory::MemoryService) and
/// [`TaskManager`](crate::runtime::task_manager::TaskManager)) to namespace
/// their operations, guaranteeing data isolation.