Casbin Authorization Configuration
The authz-casbin plugin authorizes requests on routes and services with Casbin models and policies using a request header, path, and HTTP method. Configuration covers plugin parameters and plugin metadata.
Parameters
See plugin common configurations for configuration options available to all plugins.
model_path
Path to a Casbin model file accessible to the gateway process.
Mount the model and policy files at the configured paths on every gateway instance. Changing file contents alone does not rebuild the cached enforcer.
Configure
model_path,policy_path, andusernametogether, or use one of the text-based configurations described below.policy_path
Path to a Casbin policy file accessible to the gateway process.
Configure
model_path,policy_path, andusernametogether.model
Casbin model in text format.
Configure
model,policy, andusernametogether. A route-level model and policy take precedence over plugin metadata.policy
Casbin policy in text format.
Configure
model,policy, andusernametogether. A route-level model and policy take precedence over plugin metadata.username
Request header whose value is used as the Casbin subject. A request without the header uses
anonymousas the subject.
Plugin Metadata
Routes configured with only username depend on complete model and policy metadata. If the metadata is unavailable or incomplete, requests return 503 Service Unavailable.
model
Shared Casbin model in text format. Routes can use it by configuring the plugin with only
username.policy
Shared Casbin policy in text format. Updating the metadata applies the new policy to routes that use the shared configuration.