Package io.vertx.ext.auth.abac
Interface Attribute
-
public interface AttributeAn attribute is a simple matcher for policies. A Attribute is created from a JsonPointer to theUserobject and a logical operator:has(String, Object)- the value must be in the JsonArray or JsonObjecteq(String, Object)- the value must be equals to the pointed locationne(String, Object)- the value must not be equals to the pointed location
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Attributecreate(Function<User,Boolean> function)A custom function to be used during matching.static Attributeeq(String pointer, Object value)Verifies whether the attribute matches the specified.static Attributehas(String pointer, Object value)Verifies whether the attribute matches the specified.booleanmatch(User user)Verifies whether the attribute matches the specified user.static Attributene(String pointer, Object value)Verifies whether the attribute matches the specified.JsonObjecttoJson()
-
-
-
Method Detail
-
has
static Attribute has(String pointer, Object value)
Verifies whether the attribute matches the specified. The value must be in the JsonArray or JsonObject referenced by the json pointer.
-
eq
static Attribute eq(String pointer, Object value)
Verifies whether the attribute matches the specified. The value must be equal to the value referenced by the json pointer.
-
ne
static Attribute ne(String pointer, Object value)
Verifies whether the attribute matches the specified. The value must not be equal to the value referenced by the json pointer.
-
create
static Attribute create(Function<User,Boolean> function)
A custom function to be used during matching.
-
match
boolean match(User user)
Verifies whether the attribute matches the specified user.- Parameters:
user- the user.- Returns:
- true if there's a match
-
toJson
JsonObject toJson()
-
-