Class MongoAclAuthorizer
- java.lang.Object
-
- org.restheart.security.plugins.authorizers.MongoAclAuthorizer
-
- All Implemented Interfaces:
ConfigurablePlugin,Plugin,Authorizer
public class MongoAclAuthorizer extends Object implements Authorizer
- Author:
- Andrea Di Cesare <andrea@softinstigate.com>
-
-
Field Summary
Fields Modifier and Type Field Description static String$UNAUTHENTICATEDstatic StringACL_COLLECTION_NAMEstatic io.undertow.util.AttachmentKey<FilterPredicate>MATCHING_ACL_PREDICATEstatic StringMREST_SUPERUSER_ROLEstatic StringX_FORWARDED_ACCOUNT_IDstatic StringX_FORWARDED_ROLE
-
Constructor Summary
Constructors Constructor Description MongoAclAuthorizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckAclCollection()LinkedHashSet<FilterPredicate>getRoleFilterPredicates(String role)booleanisAllowed(Request request)booleanisAuthenticationRequired(Request request)voidsetConf(Map<String,Object> args)voidsetMongoClient(com.mongodb.MongoClient mclient)
-
-
-
Field Detail
-
X_FORWARDED_ACCOUNT_ID
public static final String X_FORWARDED_ACCOUNT_ID
- See Also:
- Constant Field Values
-
X_FORWARDED_ROLE
public static final String X_FORWARDED_ROLE
- See Also:
- Constant Field Values
-
MATCHING_ACL_PREDICATE
public static final io.undertow.util.AttachmentKey<FilterPredicate> MATCHING_ACL_PREDICATE
-
ACL_COLLECTION_NAME
public static final String ACL_COLLECTION_NAME
- See Also:
- Constant Field Values
-
MREST_SUPERUSER_ROLE
public static String MREST_SUPERUSER_ROLE
-
$UNAUTHENTICATED
public static final String $UNAUTHENTICATED
- See Also:
- Constant Field Values
-
-
Method Detail
-
setMongoClient
public void setMongoClient(com.mongodb.MongoClient mclient)
-
isAllowed
public boolean isAllowed(Request request)
- Specified by:
isAllowedin interfaceAuthorizer- Parameters:
request-- Returns:
-
isAuthenticationRequired
public boolean isAuthenticationRequired(Request request)
- Specified by:
isAuthenticationRequiredin interfaceAuthorizer
-
getRoleFilterPredicates
public LinkedHashSet<FilterPredicate> getRoleFilterPredicates(String role)
- Parameters:
role-- Returns:
- the acl
-
checkAclCollection
public boolean checkAclCollection()
-
-