Class Policy
java.lang.Object
io.vertx.ext.auth.abac.Policy
Simple definition of ABAC policies. A policy is a set of rules that are evaluated against a set of attributes.
On successful evaluation the policy is considered to be satisfied and the listed authorizations are granted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute(Attribute attribute) Add an attribute to the policy.addAuthorization(Authorization authorization) Add an authorization to the policy.addSubject(String subject) Add a subject to the current policy.Get the attributes of the policy.Get the authorizations of the policy.getName()Get the name of the policyGet the subjects of the policy.setAttributes(Set<Attribute> attributes) Set the attributes of the policy.setAuthorizations(Set<Authorization> authorizations) Set the authorizations of the policy.Set the policy name.setSubjects(Set<String> subjects) Replaces all active subjects with the given set.toJson()Encode this policy as a JSON document to facilitate storage and retrieval.toString()
-
Constructor Details
-
Policy
public Policy() -
Policy
-
-
Method Details
-
getName
Get the name of the policy -
setName
-
getSubjects
-
addSubject
Add a subject to the current policy.- Parameters:
subject- the subject id as in the return ofUser.subject()
-
setSubjects
-
getAttributes
Get the attributes of the policy. Attributes are environmental values that are extracted from theUser. Attributes are used to filter the amount of policies to be evaluated. For example, if a policy has an attribute:{/principal/amr: {"in: ["pwd"]}}It will filter out any user that wasn't authenticated with a
username/password. -
setAttributes
-
addAttribute
-
getAuthorizations
Get the authorizations of the policy. Authorizations are the actual permissions that are granted to the user. If a user matches the policy (meaning the subjects and attributes match) then the authorizations applied to the user so they can be later evaluated. -
setAuthorizations
Set the authorizations of the policy. Authorizations are the actual permissions that are granted to the user. Composite authorizations (AndAuthorizationandOrAuthorization) are not allowed in a policy. -
addAuthorization
Add an authorization to the policy. Composite authorizations (AndAuthorizationandOrAuthorization) are not allowed in a policy. -
toJson
Encode this policy as a JSON document to facilitate storage and retrieval. -
toString
-