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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//! Refresh-token family domain primitives.
//!
//! Persistence and rotation are handled by the auth service adapter; this module
//! owns the credential format so parsing/formatting can be tested without tonic
//! request/response types or a database.
/// Opaque prefix for a token-family refresh credential.
///
/// Deliberately not `sess_` or `udbk_`: raw session IDs and API keys are separate
/// credential surfaces and must never be accepted as token-family credentials.
pub const REFRESH_TOKEN_PREFIX: &str = "rt_";
/// Parsed `rt_<family_id>.<jti>` refresh credential.
/// Format an opaque token-family refresh credential.
/// Parse `rt_<family_id>.<jti>` into its domain parts.
///
/// Returns `None` for values from other credential surfaces (legacy session IDs,
/// API keys, empty input, malformed token-family values).