@Test public void testShouldCreateAnonymousUser() { String identity = "someone"; NiFiUser user = X509AuthenticationProvider.createUser(identity, null, null, true); assert user != null; assert user instanceof StandardNiFiUser; assert user.getIdentity().equals(StandardNiFiUser.ANONYMOUS_IDENTITY); assert user.isAnonymous(); }
protected static NiFiUser createUser(String identity, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new StandardNiFiUser(identity, chain, clientAddress); } }
X509AuthenticationProvider extends NiFiAuthenticationProvider { protected static NiFiUser createUser(String identity, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new StandardNiFiUser(identity, chain, clientAddress); } } }
X509AuthenticationProvider extends NiFiAuthenticationProvider { protected static NiFiUser createUser(String identity, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new StandardNiFiUser(identity, chain, clientAddress); } } X509AuthenticationProvider(final X509IdentityProvider certificateIdentityProvider, final Authorizer authorizer, final NiFiProperties nifiProperties); }
X509AuthenticationProvider extends NiFiAuthenticationProvider { protected static NiFiUser createUser(String identity, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new StandardNiFiUser(identity, chain, clientAddress); } } X509AuthenticationProvider(final X509IdentityProvider certificateIdentityProvider, final Authorizer authorizer, final NiFiProperties nifiProperties); @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication); }
X509AuthenticationProvider extends NiFiAuthenticationProvider { protected static NiFiUser createUser(String identity, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new StandardNiFiUser(identity, chain, clientAddress); } } X509AuthenticationProvider(final X509IdentityProvider certificateIdentityProvider, final Authorizer authorizer, final NiFiProperties nifiProperties); @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication);  }