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
use TokenStream;
use ;
/// Derive macro that generates `AuthSchemaMetadata` implementations.
///
/// Reads `#[requires("capability_name")]` attributes from struct fields
/// or enum variants and produces a static requirements table used by
/// the schema shaper to filter fields/variants per-request.
///
/// # On structs (input schema shaping)
///
/// ```ignore
/// #[derive(AuthSchema)]
/// struct AdvanceStepInput {
/// pub applicant_id: String,
/// #[requires("backward_routing")]
/// pub stage_id: Option<String>,
/// }
/// ```
///
/// # On enums (output variant shaping)
///
/// ```ignore
/// #[derive(AuthSchema)]
/// enum AdvanceStepOutput {
/// Success { applicant_id: String },
/// #[requires("backward_routing")]
/// ReroutedSuccess { applicant_id: String, previous_stage: String },
/// }
/// ```