Class SecurityInterceptor

  • All Implemented Interfaces:
    io.grpc.ServerInterceptor, FailureHandlingServerInterceptor, 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 FailureHandlingServerInterceptor, 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getOrder()  
      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); }
      GrpcSecurityMetadataSource obtainSecurityMetadataSource()  
      void setConfig​(GRpcServerProperties.SecurityProperties.Auth authCfg)  
      void setErrorHandler​(java.util.Optional<GRpcErrorHandler> errorHandler)  
      • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setErrorHandler

        @Autowired
        public void setErrorHandler​(java.util.Optional<GRpcErrorHandler> errorHandler)
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • getSecureObjectClass

        public java.lang.Class<?> getSecureObjectClass()
        Specified by:
        getSecureObjectClass in class org.springframework.security.access.intercept.AbstractSecurityInterceptor
      • obtainSecurityMetadataSource

        public GrpcSecurityMetadataSource obtainSecurityMetadataSource()
        Specified by:
        obtainSecurityMetadataSource in class org.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 interface io.grpc.ServerInterceptor