public class ZMSAuthorizer extends Object implements com.yahoo.athenz.auth.Authorizer, Closeable
| Constructor and Description |
|---|
ZMSAuthorizer(String serviceDomain)
Constructs a new ZMSAuthorizer object with the given resource service domain
name.
|
ZMSAuthorizer(String endpoint,
String serviceDomain)
Constructs a new ZMSAuthorizer object with the given ZMS Server endpoint and
given resource service domain name
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
access(String action,
String resource,
com.yahoo.athenz.auth.Principal principal,
String trustDomain)
Requests the ZMS to indicate whether or not the specific request for the
specified resource with authentication details will be granted or not.
|
boolean |
access(String action,
String resource,
String token,
String trustDomain)
Requests the ZMS to indicate whether or not the specific request for the
specified resource with authentication details will be granted or not.
|
void |
close()
Close the ZMS Client object
|
void |
setZMSClient(ZMSClient client)
Set the authorizer to use the specified zms client object
|
protected ZMSClient client
public ZMSAuthorizer(String serviceDomain)
serviceDomain - resource service domain namepublic ZMSAuthorizer(String endpoint, String serviceDomain)
endpoint - ZMS Server url (e.g. http://server.athenzcompany.com:4443/zms/v1)serviceDomain - resource service domain namepublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void setZMSClient(ZMSClient client)
client - ZMSClient object to use for authorization checkspublic boolean access(String action, String resource, String token, String trustDomain)
action - value of the action to be carried out (e.g. "UPDATE", "DELETE")resource - resource valuetoken - either principal token (NToken) or role token (ZToken) that will
be authenticated and checked for requested accesstrustDomain - (optional - usually null) if the access checks involves cross
domain check only check the specified trusted domain and ignore all others
If the token is a role token, this argument must be null.public boolean access(String action, String resource, com.yahoo.athenz.auth.Principal principal, String trustDomain)
access in interface com.yahoo.athenz.auth.Authorizeraction - value of the action to be carried out (e.g. "UPDATE", "DELETE")resource - resource valueprincipal - principal object that will be authenticated and checked for
requested accesstrustDomain - (optional - usually null) if the access checks involves cross
domain check only check the specified trusted domain and ignore all othersCopyright © 2016–2021 Yahoo Inc.. All rights reserved.