Class SecurityInterceptor
java.lang.Object
org.springframework.security.access.intercept.AbstractSecurityInterceptor
org.lognet.springboot.grpc.security.SecurityInterceptor
- All Implemented Interfaces:
io.grpc.ServerInterceptor
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.ApplicationEventPublisherAware
,org.springframework.context.MessageSourceAware
,org.springframework.core.Ordered
public class SecurityInterceptor
extends org.springframework.security.access.intercept.AbstractSecurityInterceptor
implements io.grpc.ServerInterceptor, org.springframework.core.Ordered
-
Field Summary
Fields inherited from class org.springframework.security.access.intercept.AbstractSecurityInterceptor
logger, messages
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorsConstructorDescriptionSecurityInterceptor(org.springframework.security.access.SecurityMetadataSource securityMetadataSource, AuthenticationSchemeSelector schemeSelector)
-
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
Class<?>
<ReqT, RespT>
io.grpc.ServerCall.Listener<ReqT>interceptCall(io.grpc.ServerCall<ReqT,RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,RespT> next)
Execute the same interceptor flow as original FilterSecurityInterceptor/MethodSecurityInterceptor { InterceptorStatusToken token = super.beforeInvocation(mi); Object result; try { result = mi.proceed(); } finally { super.finallyInvocation(token); } return super.afterInvocation(token, result); }org.springframework.security.access.SecurityMetadataSource
void
void
setFailureHandlingSupport(FailureHandlingSupport failureHandlingSupport)
void
setGRpcServicesRegistry(GRpcServicesRegistry registry)
Methods inherited from class org.springframework.security.access.intercept.AbstractSecurityInterceptor
afterInvocation, afterPropertiesSet, beforeInvocation, finallyInvocation, getAccessDecisionManager, getAfterInvocationManager, getAuthenticationManager, getRunAsManager, isAlwaysReauthenticate, isRejectPublicInvocations, isValidateConfigAttributes, setAccessDecisionManager, setAfterInvocationManager, setAlwaysReauthenticate, setApplicationEventPublisher, setAuthenticationManager, setMessageSource, setPublishAuthorizationSuccess, setRejectPublicInvocations, setRunAsManager, setSecurityContextHolderStrategy, setValidateConfigAttributes
-
Constructor Details
-
SecurityInterceptor
public SecurityInterceptor(org.springframework.security.access.SecurityMetadataSource securityMetadataSource, AuthenticationSchemeSelector schemeSelector)
-
-
Method Details
-
setGRpcServicesRegistry
-
setFailureHandlingSupport
@Autowired public void setFailureHandlingSupport(@Lazy FailureHandlingSupport failureHandlingSupport) -
setConfig
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
getSecureObjectClass
- Specified by:
getSecureObjectClass
in classorg.springframework.security.access.intercept.AbstractSecurityInterceptor
-
obtainSecurityMetadataSource
public org.springframework.security.access.SecurityMetadataSource obtainSecurityMetadataSource()- Specified by:
obtainSecurityMetadataSource
in classorg.springframework.security.access.intercept.AbstractSecurityInterceptor
-
interceptCall
public <ReqT, RespT> io.grpc.ServerCall.Listener<ReqT> interceptCall(io.grpc.ServerCall<ReqT,RespT> call, io.grpc.Metadata headers, io.grpc.ServerCallHandler<ReqT,RespT> next)Execute the same interceptor flow as original FilterSecurityInterceptor/MethodSecurityInterceptor { InterceptorStatusToken token = super.beforeInvocation(mi); Object result; try { result = mi.proceed(); } finally { super.finallyInvocation(token); } return super.afterInvocation(token, result); }- Specified by:
interceptCall
in interfaceio.grpc.ServerInterceptor
-