@Test public void testShouldCreateKnownUser() { String identity = "someone"; NiFiUser user = X509AuthenticationProvider.createUser(identity, null, null, null, false); assert user != null; assert user instanceof StandardNiFiUser; assert user.getIdentity().equals(identity); assert !user.isAnonymous(); }
protected static NiFiUser createUser(String identity, Set<String> groups, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new Builder().identity(identity).groups(groups).chain(chain).clientAddress(clientAddress).build(); } }
X509AuthenticationProvider extends NiFiAuthenticationProvider { protected static NiFiUser createUser(String identity, Set<String> groups, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new Builder().identity(identity).groups(groups).chain(chain).clientAddress(clientAddress).build(); } } }
X509AuthenticationProvider extends NiFiAuthenticationProvider { protected static NiFiUser createUser(String identity, Set<String> groups, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new Builder().identity(identity).groups(groups).chain(chain).clientAddress(clientAddress).build(); } } X509AuthenticationProvider(final X509IdentityProvider certificateIdentityProvider, final Authorizer authorizer, final NiFiProperties nifiProperties); }
X509AuthenticationProvider extends NiFiAuthenticationProvider { protected static NiFiUser createUser(String identity, Set<String> groups, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new Builder().identity(identity).groups(groups).chain(chain).clientAddress(clientAddress).build(); } } 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, Set<String> groups, NiFiUser chain, String clientAddress, boolean isAnonymous) { if (isAnonymous) { return StandardNiFiUser.populateAnonymousUser(chain, clientAddress); } else { return new Builder().identity(identity).groups(groups).chain(chain).clientAddress(clientAddress).build(); } } X509AuthenticationProvider(final X509IdentityProvider certificateIdentityProvider, final Authorizer authorizer, final NiFiProperties nifiProperties); @Override Authentication authenticate(Authentication authentication); @Override boolean supports(Class<?> authentication);  }