@Test(expected = IllegalStateException.class) public void testThrowIllegalStateExceptionIfNodeNotFoundInDiscoCache() { GridKernalContext ctx = mock(GridKernalContext.class); when(ctx.config()).thenReturn(new IgniteConfiguration()); when(ctx.discovery()).thenReturn(mock(GridDiscoveryManager.class)); GridSecurityProcessor secPrc = mock(GridSecurityProcessor.class); IgniteSecurityProcessor ignSecPrc = new IgniteSecurityProcessor(ctx, secPrc); ignSecPrc.withContext(UUID.randomUUID()); }
@Override public OperationSecurityContext withContext(SecurityContext secCtx) { assert secCtx != null; secPrc.touch(secCtx); SecurityContext old = curSecCtx.get(); curSecCtx.set(secCtx); return new OperationSecurityContext(this, old); }
IgniteSecurityProcessor implements IgniteSecurity, GridProcessor { @Override public OperationSecurityContext withContext(SecurityContext secCtx) { assert secCtx != null; secPrc.touch(secCtx); SecurityContext old = curSecCtx.get(); curSecCtx.set(secCtx); return new OperationSecurityContext(this, old); } }
IgniteSecurityProcessor implements IgniteSecurity, GridProcessor { @Override public OperationSecurityContext withContext(SecurityContext secCtx) { assert secCtx != null; secPrc.touch(secCtx); SecurityContext old = curSecCtx.get(); curSecCtx.set(secCtx); return new OperationSecurityContext(this, old); } IgniteSecurityProcessor(GridKernalContext ctx, GridSecurityProcessor secPrc); }
IgniteSecurityProcessor implements IgniteSecurity, GridProcessor { @Override public OperationSecurityContext withContext(SecurityContext secCtx) { assert secCtx != null; secPrc.touch(secCtx); SecurityContext old = curSecCtx.get(); curSecCtx.set(secCtx); return new OperationSecurityContext(this, old); } IgniteSecurityProcessor(GridKernalContext ctx, GridSecurityProcessor secPrc); @Override OperationSecurityContext withContext(SecurityContext secCtx); @Override OperationSecurityContext withContext(UUID subjId); @Override SecurityContext securityContext(); @Override SecurityContext authenticateNode(ClusterNode node, SecurityCredentials cred); @Override boolean isGlobalNodeAuthentication(); @Override SecurityContext authenticate(AuthenticationContext ctx); @Override Collection<SecuritySubject> authenticatedSubjects(); @Override SecuritySubject authenticatedSubject(UUID subjId); @Override void onSessionExpired(UUID subjId); @Override void authorize(String name, SecurityPermission perm); @Override boolean enabled(); @Override void start(); @Override void stop(boolean cancel); @Override void onKernalStart(boolean active); @Override void onKernalStop(boolean cancel); @Override void collectJoiningNodeData(DiscoveryDataBag dataBag); @Override void collectGridNodeData(DiscoveryDataBag dataBag); @Override void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data); @Override void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data); @Override void printMemoryStats(); @Override @Nullable IgniteNodeValidationResult validateNode(ClusterNode node); @Override @Nullable IgniteNodeValidationResult validateNode(ClusterNode node,
        DiscoveryDataBag.JoiningNodeDiscoveryData discoData); @Override @Nullable DiscoveryDataExchangeType discoveryDataType(); @Override void onDisconnected(IgniteFuture<?> reconnectFut); @Override @Nullable IgniteInternalFuture<?> onReconnected(
        boolean clusterRestarted); GridSecurityProcessor gridSecurityProcessor(); }
IgniteSecurityProcessor implements IgniteSecurity, GridProcessor { @Override public OperationSecurityContext withContext(SecurityContext secCtx) { assert secCtx != null; secPrc.touch(secCtx); SecurityContext old = curSecCtx.get(); curSecCtx.set(secCtx); return new OperationSecurityContext(this, old); } IgniteSecurityProcessor(GridKernalContext ctx, GridSecurityProcessor secPrc); @Override OperationSecurityContext withContext(SecurityContext secCtx); @Override OperationSecurityContext withContext(UUID subjId); @Override SecurityContext securityContext(); @Override SecurityContext authenticateNode(ClusterNode node, SecurityCredentials cred); @Override boolean isGlobalNodeAuthentication(); @Override SecurityContext authenticate(AuthenticationContext ctx); @Override Collection<SecuritySubject> authenticatedSubjects(); @Override SecuritySubject authenticatedSubject(UUID subjId); @Override void onSessionExpired(UUID subjId); @Override void authorize(String name, SecurityPermission perm); @Override boolean enabled(); @Override void start(); @Override void stop(boolean cancel); @Override void onKernalStart(boolean active); @Override void onKernalStop(boolean cancel); @Override void collectJoiningNodeData(DiscoveryDataBag dataBag); @Override void collectGridNodeData(DiscoveryDataBag dataBag); @Override void onGridDataReceived(DiscoveryDataBag.GridDiscoveryData data); @Override void onJoiningNodeDataReceived(DiscoveryDataBag.JoiningNodeDiscoveryData data); @Override void printMemoryStats(); @Override @Nullable IgniteNodeValidationResult validateNode(ClusterNode node); @Override @Nullable IgniteNodeValidationResult validateNode(ClusterNode node,
        DiscoveryDataBag.JoiningNodeDiscoveryData discoData); @Override @Nullable DiscoveryDataExchangeType discoveryDataType(); @Override void onDisconnected(IgniteFuture<?> reconnectFut); @Override @Nullable IgniteInternalFuture<?> onReconnected(
        boolean clusterRestarted); GridSecurityProcessor gridSecurityProcessor(); static final String ATTR_GRID_SEC_PROC_CLASS; }