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
-
-
Constructor Summary
Constructors Constructor Description SecurityInterceptor(org.springframework.security.access.SecurityMetadataSource securityMetadataSource, AuthenticationSchemeSelector schemeSelector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetOrder()java.lang.Class<?>getSecureObjectClass()<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.SecurityMetadataSourceobtainSecurityMetadataSource()voidsetConfig(GRpcServerProperties.SecurityProperties.Auth authCfg)voidsetFailureHandlingSupport(FailureHandlingSupport failureHandlingSupport)voidsetGRpcServicesRegistry(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, setValidateConfigAttributes
-
-
-
-
Constructor Detail
-
SecurityInterceptor
public SecurityInterceptor(org.springframework.security.access.SecurityMetadataSource securityMetadataSource, AuthenticationSchemeSelector schemeSelector)
-
-
Method Detail
-
setGRpcServicesRegistry
@Autowired public void setGRpcServicesRegistry(GRpcServicesRegistry registry)
-
setFailureHandlingSupport
@Autowired public void setFailureHandlingSupport(@Lazy FailureHandlingSupport failureHandlingSupport)
-
setConfig
public void setConfig(GRpcServerProperties.SecurityProperties.Auth authCfg)
-
getOrder
public int getOrder()
- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-
getSecureObjectClass
public java.lang.Class<?> getSecureObjectClass()
- Specified by:
getSecureObjectClassin classorg.springframework.security.access.intercept.AbstractSecurityInterceptor
-
obtainSecurityMetadataSource
public org.springframework.security.access.SecurityMetadataSource obtainSecurityMetadataSource()
- Specified by:
obtainSecurityMetadataSourcein 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:
interceptCallin interfaceio.grpc.ServerInterceptor
-
-