reifydb_core/interface/
auth.rs1use std::collections::HashMap;
5
6use reifydb_runtime::context::rng::Rng;
7use reifydb_type::Result;
8
9#[derive(Debug, Clone, PartialEq, Eq)]
10pub enum AuthStep {
11 Authenticated,
12
13 Failed,
14
15 Challenge {
16 payload: HashMap<String, String>,
17 },
18}
19
20pub trait AuthenticationProvider: Send + Sync {
21 fn method(&self) -> &str;
22
23 fn create(&self, rng: &Rng, config: &HashMap<String, String>) -> Result<HashMap<String, String>>;
24
25 fn authenticate(
26 &self,
27 stored: &HashMap<String, String>,
28 credentials: &HashMap<String, String>,
29 ) -> Result<AuthStep>;
30}