keycloak.authorization
¶
Authorization module.
Submodules¶
Package Contents¶
Classes¶
Base permission class. |
|
Base policy class. |
|
Authorization Role base class. |
|
Keycloak Authorization (policies, roles, scopes and resources). |
- class keycloak.authorization.Permission(name, type, logic, decision_strategy)[source]¶
Base permission class.
Consider this simple and very common permission:
A permission associates the object being protected with the policies that must be evaluated to determine whether access is granted.
X CAN DO Y ON RESOURCE Z
where
- X represents one or more users, roles, or groups, or a combination of them. You can
also use claims and context here.
Y represents an action to be performed, for example, write, view, and so on.
Z represents a protected resource, for example, “/accounts”.
https://keycloak.gitbooks.io/documentation/authorization_services/topics/permission/overview.html
- __repr__()¶
Repr method.
- __str__()¶
Str method.
- property name¶
Get name.
- property type¶
Get type.
- property logic¶
Get logic.
- property decision_strategy¶
Get decision strategy.
- property resources¶
Get resources.
- property scopes¶
Get scopes.
- class keycloak.authorization.Policy(name, type, logic, decision_strategy)[source]¶
Base policy class.
A policy defines the conditions that must be satisfied to grant access to an object. Unlike permissions, you do not specify the object being protected but rather the conditions that must be satisfied for access to a given object (for example, resource, scope, or both). Policies are strongly related to the different access control mechanisms (ACMs) that you can use to protect your resources. With policies, you can implement strategies for attribute-based access control (ABAC), role-based access control (RBAC), context-based access control, or any combination of these.
https://keycloak.gitbooks.io/documentation/authorization_services/topics/policy/overview.html
- __repr__()¶
Repr method.
- __str__()¶
Str method.
- property name¶
Get name.
- property type¶
Get type.
- property logic¶
Get logic.
- property decision_strategy¶
Get decision strategy.
- property roles¶
Get roles.
- property permissions¶
Get permissions.
- add_role(role)¶
Add keycloak role in policy.
- Parameters
role – keycloak role.
- Returns
- add_permission(permission)¶
Add keycloak permission in policy.
- Parameters
permission – keycloak permission.
- Returns
- class keycloak.authorization.Role(name, required=False)[source]¶
Authorization Role base class.
Roles identify a type or category of user. Admin, user, manager, and employee are all typical roles that may exist in an organization.
https://keycloak.gitbooks.io/documentation/server_admin/topics/roles.html
- get_name()¶
Get name.
- __eq__(other)¶
Eq method.
- class keycloak.authorization.Authorization[source]¶
Keycloak Authorization (policies, roles, scopes and resources).
https://keycloak.gitbooks.io/documentation/authorization_services/index.html