Skip to main content

Module policy_handlers

Module policy_handlers 

Source
Expand description

Handlers for policy management commands

Cisco-inspired transactional UX for managing access control policies.

Policy states:

  • Running = Current active (HEAD of .registry/policies/)
  • Draft = Uncommitted changes
  • History = Previous versions (HEAD~n)

All commands route through PolicyService RPCs except edit which opens a local editor (but still uses RPC for draft status detection afterward).

Re-exports§

pub use crate::auth::policy_templates::get_template;
pub use crate::auth::policy_templates::get_templates;
pub use crate::auth::policy_templates::PolicyTemplate;

Functions§

handle_policy_apply
Handle policy apply - Commit draft changes via RPC
handle_policy_apply_template
Handle policy apply-template <name> - Apply a built-in template via RPC
handle_policy_check
Handle policy check <user> <resource> <action> - Test permission via RPC
handle_policy_diff
Handle policy diff - Show diff between draft and running policy via RPC
handle_policy_edit
Handle policy edit - Open policy in $VISUAL/$EDITOR
handle_policy_history
Handle policy history - Show policy commit history via RPC
handle_policy_list_templates
Handle policy list-templates - List available templates
handle_policy_role_add
Handle policy role add <user> <role> - Assign a role to a user via RPC
handle_policy_role_list
Handle policy role list - List role assignments (g-lines) via RPC
handle_policy_role_remove
Handle policy role remove <user> <role> - Remove a role from a user via RPC
handle_policy_rollback
Handle policy rollback [ref] - Revert to a previous policy version via RPC
handle_policy_show
Handle policy show - Display the running policy via RPC
handle_token_create
Handle policy token create - Create a new JWT API token
load_or_generate_signing_key
Load or generate the Ed25519 node signing key from the configured secrets directory.