public interface ProtocolAuthService<R>
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
enableAuth(Secured secured)
Judgement whether enable auth feature according to secured information.
|
void |
initialize()
Init protocol auth service.
|
IdentityContext |
parseIdentity(R request)
Parse identity context from protocol request.
|
Resource |
parseResource(R request,
Secured secured)
Parse resource from protocol request and secured annotation.
|
boolean |
validateAuthority(IdentityContext identityContext,
Permission permission)
Validate identity whether had permission for the resource and action.
|
boolean |
validateIdentity(IdentityContext identityContext,
Resource resource)
Validate identity whether is legal.
|
void initialize()
boolean enableAuth(Secured secured)
configuration authEnabled in AuthConfigs is the main switch.
If authEnabled is false, this method and other follow methods should not be called.
This method is only for plugin to judge whether auth this Secured.
For example, plugins can only auth for write action or only for naming type request.
secured - secured informationtrue if enable auth, otherwise falseResource parseResource(R request, Secured secured)
request - protocol requestsecured - api secured annotationIdentityContext parseIdentity(R request)
request - protocol requestboolean validateIdentity(IdentityContext identityContext, Resource resource) throws AccessException
identityContext - identity contextresource - resourcetrue if legal, otherwise falseAccessException - exception during validatingboolean validateAuthority(IdentityContext identityContext, Permission permission) throws AccessException
identityContext - identity contextpermission - permission include resource and actiontrue if legal, otherwise falseAccessException - exception during validatingCopyright © 2018–2023 Alibaba Group. All rights reserved.