Search in sources :

Example 11 with ReqContext

use of org.apache.storm.security.auth.ReqContext in project storm by apache.

the class DRPCSimpleACLAuthorizerTest method makeMockContext.

private static ReqContext makeMockContext(String user) {
    ReqContext mockContext = Mockito.mock(ReqContext.class);
    Mockito.when(mockContext.principal()).thenReturn(new SingleUserPrincipal(user));
    return mockContext;
}
Also used : ReqContext(org.apache.storm.security.auth.ReqContext) SingleUserPrincipal(org.apache.storm.security.auth.SingleUserPrincipal)

Aggregations

ReqContext (org.apache.storm.security.auth.ReqContext)11 HashMap (java.util.HashMap)7 Subject (javax.security.auth.Subject)6 Test (org.junit.Test)6 HashSet (java.util.HashSet)5 Principal (java.security.Principal)4 IAuthorizer (org.apache.storm.security.auth.IAuthorizer)4 SingleUserPrincipal (org.apache.storm.security.auth.SingleUserPrincipal)3 IOException (java.io.IOException)2 Map (java.util.Map)2 AuthorizationException (org.apache.storm.generated.AuthorizationException)2 DefaultPrincipalToLocal (org.apache.storm.security.auth.DefaultPrincipalToLocal)2 DRPCSimpleACLAuthorizer (org.apache.storm.security.auth.authorizer.DRPCSimpleACLAuthorizer)2 AclFunctionEntry (org.apache.storm.security.auth.authorizer.DRPCSimpleACLAuthorizer.AclFunctionEntry)2 TException (org.apache.storm.thrift.TException)2 InterruptedIOException (java.io.InterruptedIOException)1 BindException (java.net.BindException)1 InetAddress (java.net.InetAddress)1 List (java.util.List)1 NavigableMap (java.util.NavigableMap)1