Skip to content

docs: document step.authz_add_policy, step.authz_remove_policy, step.authz_role_assign#13

Merged
intel352 merged 3 commits intomainfrom
copilot/docs-add-authz-step-documentation
Mar 12, 2026
Merged

docs: document step.authz_add_policy, step.authz_remove_policy, step.authz_role_assign#13
intel352 merged 3 commits intomainfrom
copilot/docs-add-authz-step-documentation

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

plugin.json declares four step types but README only documented step.authz_check_casbin, leaving the three runtime policy-mutation steps undiscoverable.

Changes

  • Capabilities table — lists all four step types
  • step.authz_add_policy — config reference (module, rule), static and Go-template rule examples, success output (authz_policy_added, authz_rule)
  • step.authz_remove_policy — same shape as add; success output uses authz_policy_removed
  • step.authz_role_assign — config table covering module, action ("add"/"remove"), and assignments; three examples: static assign, template-driven assign, revoke

Template-driven tenant onboarding example:

steps:
  - type: step.authz_add_policy
    config:
      module: authz
      rule: ["{{.tenant_role}}", "{{.resource}}", "{{.method}}"]

  - type: step.authz_role_assign
    config:
      module: authz
      action: add
      assignments:
        - ["{{.new_user_id}}", "{{.tenant_role}}"]
Original prompt

This section details on the original issue you should resolve

<issue_title>docs: document step.authz_add_policy, step.authz_remove_policy, step.authz_role_assign</issue_title>
<issue_description>## Problem

The plugin.json manifest declares four step types, but the README only documents step.authz_check. The following steps are undocumented:

  • step.authz_add_policy — adds a policy rule at runtime
  • step.authz_remove_policy — removes a policy rule at runtime
  • step.authz_role_assign — adds/removes role mappings at runtime

These are essential for multi-tenant applications that need to provision authorization policies dynamically when new tenants are onboarded.

Proposed Solution

Add documentation sections for each step type with config examples, including template-based rule definitions.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…authz_role_assign

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for step.authz_add_policy, step.authz_remove_policy, and step.authz_role_assign docs: document step.authz_add_policy, step.authz_remove_policy, step.authz_role_assign Mar 12, 2026
@intel352 intel352 marked this pull request as ready for review March 12, 2026 12:05
Copilot AI review requested due to automatic review settings March 12, 2026 12:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the README so all step types declared by the plugin manifest are discoverable and have usage guidance, focusing on the runtime policy-mutation steps for Casbin-backed RBAC.

Changes:

  • Expand the Capabilities table to list all four provided step types.
  • Add documentation sections for step.authz_add_policy and step.authz_remove_policy, including config and output examples.
  • Add documentation for step.authz_role_assign, including config fields and examples for add/remove role mappings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@intel352
Copy link
Contributor

@copilot apply changes based on the comments in this thread

…g policy row shape

Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 12, 2026

@copilot apply changes based on the comments in this thread

Applied both reviewer suggestions in commit 87bda79:

  1. step.authz_add_policy description — now explains that when the rule is newly added the step persists it via the module's Casbin adapter (file/GORM adapters write to their backing store; in-memory changes last for the process lifetime).
  2. assignments config table — updated to "list of grouping policy rows, each with at least [user, role]" to match the actual minimum-2-element validation and accommodate models that use domain-based rows with 3+ fields.

@intel352 intel352 merged commit 8660dda into main Mar 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: document step.authz_add_policy, step.authz_remove_policy, step.authz_role_assign

3 participants