#[register_scopes]Expand description
Attribute macro for automatic scope registration.
Scans all #[authorize] attributes in the impl block and generates
inventory::submit! statements for each unique (action, resource) pair.
This ensures that all scopes are automatically registered at compile-time, making it impossible to forget scope registration.
§Example
ⓘ
#[register_scopes]
impl InferenceService {
#[authorize(action = "infer", resource = "model", identifier_field = "model")]
fn handle_generate(...) { }
#[authorize(action = "read", resource = "model", identifier_field = "model")]
fn handle_config(...) { }
}
// Automatically generates:
// inventory::submit! {
// hyprstream_rpc::auth::ScopeDefinition::new("infer", "model", "infer:model:*", "infer on model")
// }
// inventory::submit! {
// hyprstream_rpc::auth::ScopeDefinition::new("read", "model", "read:model:*", "read on model")
// }