target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testMessageStoreStoreLocation() { String location = "/path/to/the/message/store.files"; _logMessage = MessageStoreMessages.STORE_LOCATION(location); List<Object> log = performLog(); String[] expected = {"Store location :", location}; validateLogMessage(log, "MST-1002", expected); }
public static LogMessage STORE_LOCATION(String param1) { String rawMessage = _messages.getString("STORE_LOCATION"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); return new LogMessage() { @O...
MessageStoreMessages { public static LogMessage STORE_LOCATION(String param1) { String rawMessage = _messages.getString("STORE_LOCATION"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); retur...
MessageStoreMessages { public static LogMessage STORE_LOCATION(String param1) { String rawMessage = _messages.getString("STORE_LOCATION"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); retur...
MessageStoreMessages { public static LogMessage STORE_LOCATION(String param1) { String rawMessage = _messages.getString("STORE_LOCATION"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); retur...
MessageStoreMessages { public static LogMessage STORE_LOCATION(String param1) { String rawMessage = _messages.getString("STORE_LOCATION"); final Object[] messageArguments = {param1}; MessageFormat formatter = new MessageFormat(rawMessage, _currentLocale); final String message = formatter.format(messageArguments); retur...
@Test public void testMessageStoreClosed() { _logMessage = MessageStoreMessages.CLOSED(); List<Object> log = performLog(); String[] expected = {"Closed"}; validateLogMessage(log, "MST-1003", expected); }
public static LogMessage CLOSED() { String rawMessage = _messages.getString("CLOSED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CLOSED_LOG_HIERARCHY; } @Override public boolean equals(final Obje...
MessageStoreMessages { public static LogMessage CLOSED() { String rawMessage = _messages.getString("CLOSED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CLOSED_LOG_HIERARCHY; } @Override public bo...
MessageStoreMessages { public static LogMessage CLOSED() { String rawMessage = _messages.getString("CLOSED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CLOSED_LOG_HIERARCHY; } @Override public bo...
MessageStoreMessages { public static LogMessage CLOSED() { String rawMessage = _messages.getString("CLOSED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CLOSED_LOG_HIERARCHY; } @Override public bo...
MessageStoreMessages { public static LogMessage CLOSED() { String rawMessage = _messages.getString("CLOSED"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return CLOSED_LOG_HIERARCHY; } @Override public bo...
@Test public void testMessageStoreRecoveryStart() { _logMessage = MessageStoreMessages.RECOVERY_START(); List<Object> log = performLog(); String[] expected = {"Recovery Start"}; validateLogMessage(log, "MST-1004", expected); }
public static LogMessage RECOVERY_START() { String rawMessage = _messages.getString("RECOVERY_START"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return RECOVERY_START_LOG_HIERARCHY; } @Override public b...
MessageStoreMessages { public static LogMessage RECOVERY_START() { String rawMessage = _messages.getString("RECOVERY_START"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return RECOVERY_START_LOG_HIERARCH...
MessageStoreMessages { public static LogMessage RECOVERY_START() { String rawMessage = _messages.getString("RECOVERY_START"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return RECOVERY_START_LOG_HIERARCH...
MessageStoreMessages { public static LogMessage RECOVERY_START() { String rawMessage = _messages.getString("RECOVERY_START"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return RECOVERY_START_LOG_HIERARCH...
MessageStoreMessages { public static LogMessage RECOVERY_START() { String rawMessage = _messages.getString("RECOVERY_START"); final String message = rawMessage; return new LogMessage() { @Override public String toString() { return message; } @Override public String getLogHierarchy() { return RECOVERY_START_LOG_HIERARCH...
@Test public void testAddConsumer() throws Exception { final EnumSet<ConsumerOption> options = EnumSet.noneOf(ConsumerOption.class); final ConsumerTarget target = mock(ConsumerTarget.class); when(target.allocateCredit(any(ServerMessage.class))).thenReturn(true); MessageInstanceConsumer consumer = _trustStoreMessageSour...
@Override public <T extends ConsumerTarget<T>> Consumer<T> addConsumer(final T target, final FilterManager filters, final Class<? extends ServerMessage> messageClass, final String consumerName, final EnumSet<ConsumerOption> options, final Integer priority) throws ExistingExclusiveConsumer, ExistingConsumerPreventsExclu...
TrustStoreMessageSource extends AbstractSystemMessageSource { @Override public <T extends ConsumerTarget<T>> Consumer<T> addConsumer(final T target, final FilterManager filters, final Class<? extends ServerMessage> messageClass, final String consumerName, final EnumSet<ConsumerOption> options, final Integer priority) t...
TrustStoreMessageSource extends AbstractSystemMessageSource { @Override public <T extends ConsumerTarget<T>> Consumer<T> addConsumer(final T target, final FilterManager filters, final Class<? extends ServerMessage> messageClass, final String consumerName, final EnumSet<ConsumerOption> options, final Integer priority) t...
TrustStoreMessageSource extends AbstractSystemMessageSource { @Override public <T extends ConsumerTarget<T>> Consumer<T> addConsumer(final T target, final FilterManager filters, final Class<? extends ServerMessage> messageClass, final String consumerName, final EnumSet<ConsumerOption> options, final Integer priority) t...
TrustStoreMessageSource extends AbstractSystemMessageSource { @Override public <T extends ConsumerTarget<T>> Consumer<T> addConsumer(final T target, final FilterManager filters, final Class<? extends ServerMessage> messageClass, final String consumerName, final EnumSet<ConsumerOption> options, final Integer priority) t...
@Test public void testCreateKeyInDefaultLocation() throws Exception { if(isStrongEncryptionEnabled() && supportsPosixFileAttributes()) { ConfigurationSecretEncrypter encrypter = _factory.createEncrypter(_broker); KeyFilePathChecker keyFilePathChecker = new KeyFilePathChecker(); doChecks(encrypter, keyFilePathChecker); ...
@Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue(String.class, ENCRYPTER_KEY_FILE); } else { fileLocation = object.getContextValue(String.class, Sys...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
@Test public void testSettingContextKeyLeadsToFileCreation() throws Exception { if(isStrongEncryptionEnabled() && supportsPosixFileAttributes()) { String filename = UUID.randomUUID().toString() + ".key"; String subdirName = getTestName() + File.separator + "test"; String fileLocation = _tmpDir.toString() + File.separat...
@Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue(String.class, ENCRYPTER_KEY_FILE); } else { fileLocation = object.getContextValue(String.class, Sys...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
@Test public void testUnableToCreateFileInSpecifiedLocation() throws Exception { if(isStrongEncryptionEnabled()) { String filename = UUID.randomUUID().toString() + ".key"; String subdirName = getTestName() + File.separator + "test"; String fileLocation = _tmpDir.toString() + File.separator + subdirName + File.separator...
@Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue(String.class, ENCRYPTER_KEY_FILE); } else { fileLocation = object.getContextValue(String.class, Sys...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
@Test public void testPermissionsAreChecked() throws Exception { if(isStrongEncryptionEnabled() && supportsPosixFileAttributes()) { String filename = UUID.randomUUID().toString() + ".key"; String subdirName = getTestName() + File.separator + "test"; String fileLocation = _tmpDir.toString() + File.separator + subdirName...
@Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue(String.class, ENCRYPTER_KEY_FILE); } else { fileLocation = object.getContextValue(String.class, Sys...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
@Test public void testInvalidKey() throws Exception { if(isStrongEncryptionEnabled() && supportsPosixFileAttributes()) { String filename = UUID.randomUUID().toString() + ".key"; String subdirName = getTestName() + File.separator + "test"; String fileLocation = _tmpDir.toString() + File.separator + subdirName + File.sep...
@Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue(String.class, ENCRYPTER_KEY_FILE); } else { fileLocation = object.getContextValue(String.class, Sys...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
AESKeyFileEncrypterFactory implements ConfigurationSecretEncrypterFactory, ConditionallyAvailable { @Override public ConfigurationSecretEncrypter createEncrypter(final ConfiguredObject<?> object) { String fileLocation; if(object.getContextKeys(false).contains(ENCRYPTER_KEY_FILE)) { fileLocation = object.getContextValue...
@Test public void testEncryptingNullFails() throws Exception { if(isStrongEncryptionEnabled()) { try { SecretKeySpec secretKey = createSecretKey(); AESKeyFileEncrypter encrypter = new AESKeyFileEncrypter(secretKey); String encrypted = encrypter.encrypt(null); fail("Attempting to encrypt null should fail"); } catch (Nul...
@Override public String encrypt(final String unencrypted) { byte[] unencryptedBytes = unencrypted.getBytes(StandardCharsets.UTF_8); try { byte[] ivbytes = new byte[AES_INITIALIZATION_VECTOR_LENGTH]; _random.nextBytes(ivbytes); Cipher cipher = Cipher.getInstance(CIPHER_NAME); cipher.init(Cipher.ENCRYPT_MODE, _secretKey,...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String encrypt(final String unencrypted) { byte[] unencryptedBytes = unencrypted.getBytes(StandardCharsets.UTF_8); try { byte[] ivbytes = new byte[AES_INITIALIZATION_VECTOR_LENGTH]; _random.nextBytes(ivbytes); Cipher cipher = Cipher.getInsta...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String encrypt(final String unencrypted) { byte[] unencryptedBytes = unencrypted.getBytes(StandardCharsets.UTF_8); try { byte[] ivbytes = new byte[AES_INITIALIZATION_VECTOR_LENGTH]; _random.nextBytes(ivbytes); Cipher cipher = Cipher.getInsta...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String encrypt(final String unencrypted) { byte[] unencryptedBytes = unencrypted.getBytes(StandardCharsets.UTF_8); try { byte[] ivbytes = new byte[AES_INITIALIZATION_VECTOR_LENGTH]; _random.nextBytes(ivbytes); Cipher cipher = Cipher.getInsta...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String encrypt(final String unencrypted) { byte[] unencryptedBytes = unencrypted.getBytes(StandardCharsets.UTF_8); try { byte[] ivbytes = new byte[AES_INITIALIZATION_VECTOR_LENGTH]; _random.nextBytes(ivbytes); Cipher cipher = Cipher.getInsta...
@Test public void testLogToConsole() throws Exception { ILoggingEvent event1 = createMockLoggingEvent("org.apache.qpid.Test", Level.WARN, "Test1", "Test-Thread-1"); _startupAppender.doAppend(event1); ILoggingEvent event2 = createMockLoggingEvent("non.qpid.Test",Level.DEBUG, "Test2", "Test-Thread-2"); _startupAppender.d...
public void logToConsole() { Context context = getContext(); ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>(); consoleAppender.setContext(context); PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder(); patternLayoutEncoder.setContext(context); patternLayoutEncoder.setPattern("%...
StartupAppender extends AppenderBase<ILoggingEvent> { public void logToConsole() { Context context = getContext(); ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>(); consoleAppender.setContext(context); PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder(); patternLayoutEncoder.s...
StartupAppender extends AppenderBase<ILoggingEvent> { public void logToConsole() { Context context = getContext(); ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>(); consoleAppender.setContext(context); PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder(); patternLayoutEncoder.s...
StartupAppender extends AppenderBase<ILoggingEvent> { public void logToConsole() { Context context = getContext(); ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>(); consoleAppender.setContext(context); PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder(); patternLayoutEncoder.s...
StartupAppender extends AppenderBase<ILoggingEvent> { public void logToConsole() { Context context = getContext(); ConsoleAppender<ILoggingEvent> consoleAppender = new ConsoleAppender<>(); consoleAppender.setContext(context); PatternLayoutEncoder patternLayoutEncoder = new PatternLayoutEncoder(); patternLayoutEncoder.s...
@Test public void testDecryptNonsense() throws Exception { if(isStrongEncryptionEnabled()) { SecretKeySpec secretKey = createSecretKey(); AESKeyFileEncrypter encrypter = new AESKeyFileEncrypter(secretKey); try { encrypter.decrypt(null); fail("Should not decrypt a null value"); } catch (NullPointerException e) { } try {...
@Override public String decrypt(final String encrypted) { if(!isValidBase64(encrypted)) { throw new IllegalArgumentException("Encrypted value is not valid Base 64 data: '" + encrypted + "'"); } byte[] encryptedBytes = Strings.decodeBase64(encrypted); try { Cipher cipher = Cipher.getInstance(CIPHER_NAME); IvParameterSpe...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String decrypt(final String encrypted) { if(!isValidBase64(encrypted)) { throw new IllegalArgumentException("Encrypted value is not valid Base 64 data: '" + encrypted + "'"); } byte[] encryptedBytes = Strings.decodeBase64(encrypted); try { C...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String decrypt(final String encrypted) { if(!isValidBase64(encrypted)) { throw new IllegalArgumentException("Encrypted value is not valid Base 64 data: '" + encrypted + "'"); } byte[] encryptedBytes = Strings.decodeBase64(encrypted); try { C...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String decrypt(final String encrypted) { if(!isValidBase64(encrypted)) { throw new IllegalArgumentException("Encrypted value is not valid Base 64 data: '" + encrypted + "'"); } byte[] encryptedBytes = Strings.decodeBase64(encrypted); try { C...
AESKeyFileEncrypter implements ConfigurationSecretEncrypter { @Override public String decrypt(final String encrypted) { if(!isValidBase64(encrypted)) { throw new IllegalArgumentException("Encrypted value is not valid Base 64 data: '" + encrypted + "'"); } byte[] encryptedBytes = Strings.decodeBase64(encrypted); try { C...
@Test public void testGetName() { final GroupPrincipal principal = new GroupPrincipal("group", (GroupProvider) null); assertEquals("group", principal.getName()); }
@Override public String getName() { return _groupName; }
GroupPrincipal implements QpidPrincipal { @Override public String getName() { return _groupName; } }
GroupPrincipal implements QpidPrincipal { @Override public String getName() { return _groupName; } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); }
GroupPrincipal implements QpidPrincipal { @Override public String getName() { return _groupName; } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); @Override String getName(); boolean addMember(Principal user); boolean removeMember(Principal user); boolean isMember(Principal member); Enumeratio...
GroupPrincipal implements QpidPrincipal { @Override public String getName() { return _groupName; } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); @Override String getName(); boolean addMember(Principal user); boolean removeMember(Principal user); boolean isMember(Principal member); Enumeratio...
@Test public void testAddRejected() { final GroupPrincipal principal = new GroupPrincipal("group", (GroupProvider) null); final UsernamePrincipal user = new UsernamePrincipal("name", null); try { principal.addMember(user); fail("Exception not thrown"); } catch (UnsupportedOperationException uso) { } }
public boolean addMember(Principal user) { throw new UnsupportedOperationException(msgException); }
GroupPrincipal implements QpidPrincipal { public boolean addMember(Principal user) { throw new UnsupportedOperationException(msgException); } }
GroupPrincipal implements QpidPrincipal { public boolean addMember(Principal user) { throw new UnsupportedOperationException(msgException); } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); }
GroupPrincipal implements QpidPrincipal { public boolean addMember(Principal user) { throw new UnsupportedOperationException(msgException); } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); @Override String getName(); boolean addMember(Principal user); boolean removeMember(Principal user); boo...
GroupPrincipal implements QpidPrincipal { public boolean addMember(Principal user) { throw new UnsupportedOperationException(msgException); } GroupPrincipal(final String groupName, final ConfiguredObject<?> origin); @Override String getName(); boolean addMember(Principal user); boolean removeMember(Principal user); boo...
@Test public void testEqualitySameName() { final String string = "string"; final GroupPrincipal principal1 = new GroupPrincipal(string, (GroupProvider) null); final GroupPrincipal principal2 = new GroupPrincipal(string, (GroupProvider) null); assertTrue(principal1.equals(principal2)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _origin.equals(that._origin) : that._origin...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
@Test public void testEqualityEqualName() { final GroupPrincipal principal1 = new GroupPrincipal(new String("string"), (GroupProvider) null); final GroupPrincipal principal2 = new GroupPrincipal(new String("string"), (GroupProvider) null); assertTrue(principal1.equals(principal2)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _origin.equals(that._origin) : that._origin...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
@Test public void testInequalityDifferentGroupPrincipals() { GroupPrincipal principal1 = new GroupPrincipal("string1", (GroupProvider) null); GroupPrincipal principal2 = new GroupPrincipal("string2", (GroupProvider) null); assertFalse(principal1.equals(principal2)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _origin.equals(that._origin) : that._origin...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
@Test public void testInequalityNonGroupPrincipal() { GroupPrincipal principal = new GroupPrincipal("string", (GroupProvider) null); assertFalse(principal.equals(new UsernamePrincipal("string", null))); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _origin.equals(that._origin) : that._origin...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
@Test public void testInequalityNull() { GroupPrincipal principal = new GroupPrincipal("string", (GroupProvider) null); assertFalse(principal.equals(null)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _origin.equals(that._origin) : that._origin...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
GroupPrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GroupPrincipal that = (GroupPrincipal) o; if (!_groupName.equals(that._groupName)) { return false; } return _origin != null ? _...
@Test public void testGetAllGroups() throws Exception { _util.writeAndSetGroupFile("myGroup.users", USER1); Set<String> groups = _fileGroupDatabase.getAllGroups(); assertEquals(1, groups.size()); assertTrue(groups.contains(MY_GROUP)); }
@Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); }
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } }
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } FileGroupDatabase(FileBasedGroupProvider<?> groupProvider); }
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } FileGroupDatabase(FileBasedGroupProvider<?> groupProvider); @Override Set<String> getAllGroups(); synchronized void setGroupFile(String groupFile); @Override Set<Str...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } FileGroupDatabase(FileBasedGroupProvider<?> groupProvider); @Override Set<String> getAllGroups(); synchronized void setGroupFile(String groupFile); @Override Set<Str...
@Test public void testGetAllGroupsWhenGroupFileEmpty() { Set<String> groups = _fileGroupDatabase.getAllGroups(); assertTrue(groups.isEmpty()); }
@Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); }
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } }
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } FileGroupDatabase(FileBasedGroupProvider<?> groupProvider); }
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } FileGroupDatabase(FileBasedGroupProvider<?> groupProvider); @Override Set<String> getAllGroups(); synchronized void setGroupFile(String groupFile); @Override Set<Str...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getAllGroups() { return Collections.unmodifiableSet(_groupToUserMap.keySet()); } FileGroupDatabase(FileBasedGroupProvider<?> groupProvider); @Override Set<String> getAllGroups(); synchronized void setGroupFile(String groupFile); @Override Set<Str...
@SuppressWarnings("unchecked") @Test public void testReplayAccumulatedEvents() { ILoggingEvent event1 = createMockLoggingEvent("org.apache.qpid.Test", Level.DEBUG, "Test1", "Test-Thread-1"); _startupAppender.doAppend(event1); ILoggingEvent event2 = createMockLoggingEvent("non.qpid.Test", Level.INFO, "Test2", "Test-Thre...
public synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender) { for (ILoggingEvent event: _accumulatedLoggingEvents) { appender.doAppend(event); } }
StartupAppender extends AppenderBase<ILoggingEvent> { public synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender) { for (ILoggingEvent event: _accumulatedLoggingEvents) { appender.doAppend(event); } } }
StartupAppender extends AppenderBase<ILoggingEvent> { public synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender) { for (ILoggingEvent event: _accumulatedLoggingEvents) { appender.doAppend(event); } } StartupAppender(); }
StartupAppender extends AppenderBase<ILoggingEvent> { public synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender) { for (ILoggingEvent event: _accumulatedLoggingEvents) { appender.doAppend(event); } } StartupAppender(); synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender); ...
StartupAppender extends AppenderBase<ILoggingEvent> { public synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender) { for (ILoggingEvent event: _accumulatedLoggingEvents) { appender.doAppend(event); } } StartupAppender(); synchronized void replayAccumulatedEvents(Appender<ILoggingEvent> appender); ...
@Test public void testMissingGroupFile() throws Exception { try { _fileGroupDatabase.setGroupFile("/not/a/file"); fail("Exception not thrown"); } catch (FileNotFoundException fnfe) { } }
public synchronized void setGroupFile(String groupFile) throws IOException { File file = new File(groupFile); if (!file.canRead()) { throw new FileNotFoundException(groupFile + " cannot be found or is not readable"); } readGroupFile(groupFile); }
FileGroupDatabase implements GroupDatabase { public synchronized void setGroupFile(String groupFile) throws IOException { File file = new File(groupFile); if (!file.canRead()) { throw new FileNotFoundException(groupFile + " cannot be found or is not readable"); } readGroupFile(groupFile); } }
FileGroupDatabase implements GroupDatabase { public synchronized void setGroupFile(String groupFile) throws IOException { File file = new File(groupFile); if (!file.canRead()) { throw new FileNotFoundException(groupFile + " cannot be found or is not readable"); } readGroupFile(groupFile); } FileGroupDatabase(FileBasedG...
FileGroupDatabase implements GroupDatabase { public synchronized void setGroupFile(String groupFile) throws IOException { File file = new File(groupFile); if (!file.canRead()) { throw new FileNotFoundException(groupFile + " cannot be found or is not readable"); } readGroupFile(groupFile); } FileGroupDatabase(FileBasedG...
FileGroupDatabase implements GroupDatabase { public synchronized void setGroupFile(String groupFile) throws IOException { File file = new File(groupFile); if (!file.canRead()) { throw new FileNotFoundException(groupFile + " cannot be found or is not readable"); } readGroupFile(groupFile); } FileGroupDatabase(FileBasedG...
@Test public void testGetUsersInGroup() throws Exception { _util.writeAndSetGroupFile("myGroup.users", "user1,user2,user3"); Set<String> users = _fileGroupDatabase.getUsersInGroup(MY_GROUP); assertNotNull(users); assertEquals(3, users.size()); }
@Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (set == null) { return Collections.emptySet(); ...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
@Test public void testDuplicateUsersInGroupAreConflated() throws Exception { _util.writeAndSetGroupFile("myGroup.users", "user1,user1,user3,user1"); Set<String> users = _fileGroupDatabase.getUsersInGroup(MY_GROUP); assertNotNull(users); assertEquals(2, users.size()); }
@Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (set == null) { return Collections.emptySet(); ...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
@Test public void testGetUsersWithEmptyGroup() throws Exception { _util.writeAndSetGroupFile("myGroup.users", ""); Set<String> users = _fileGroupDatabase.getUsersInGroup(MY_GROUP); assertNotNull(users); assertTrue(users.isEmpty()); }
@Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (set == null) { return Collections.emptySet(); ...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
@Test public void testGetUsersInNonExistentGroup() throws Exception { _util.writeAndSetGroupFile("myGroup.users", "user1,user2,user3"); Set<String> users = _fileGroupDatabase.getUsersInGroup("groupDoesntExist"); assertNotNull(users); assertTrue(users.isEmpty()); }
@Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (set == null) { return Collections.emptySet(); ...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
@Test public void testGetUsersInNullGroup() throws Exception { _util.writeAndSetGroupFile(); assertTrue(_fileGroupDatabase.getUsersInGroup(null).isEmpty()); }
@Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (set == null) { return Collections.emptySet(); ...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getUsersInGroup(String group) { if (group == null) { LOGGER.warn("Requested user set for null group. Returning empty set."); return Collections.emptySet(); } Set<String> set = _groupToUserMap.get(keySearch(_groupToUserMap.keySet(), group)); if (s...
@Test public void testGetGroupPrincipalsForUserWhenUserBelongsToOneGroup() throws Exception { _util.writeAndSetGroupFile("myGroup.users", "user1,user2"); Set<String> groups = _fileGroupDatabase.getGroupsForUser(USER1); assertEquals(1, groups.size()); assertTrue(groups.contains(MY_GROUP)); }
@Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (groups == null) { return Collections.emptySet...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
@Test public void testGetGroupPrincipalsForUserWhenUserBelongsToTwoGroup() throws Exception { _util.writeAndSetGroupFile("myGroup1.users", "user1,user2", "myGroup2.users", "user1,user3"); Set<String> groups = _fileGroupDatabase.getGroupsForUser(USER1); assertEquals(2, groups.size()); assertTrue(groups.contains(MY_GROUP...
@Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (groups == null) { return Collections.emptySet...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
@Test public void testGetGroupPrincipalsForUserWhenUserNotKnown() throws Exception { _util.writeAndSetGroupFile("myGroup.users", "user1,user2"); Set<String> groups = _fileGroupDatabase.getGroupsForUser(USER3); assertTrue(groups.isEmpty()); }
@Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (groups == null) { return Collections.emptySet...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
@Test public void testGetGroupPrincipalsForNullUser() throws Exception { _util.writeAndSetGroupFile(); assertTrue(_fileGroupDatabase.getGroupsForUser(null).isEmpty()); }
@Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (groups == null) { return Collections.emptySet...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
FileGroupDatabase implements GroupDatabase { @Override public Set<String> getGroupsForUser(String user) { if (user == null) { LOGGER.warn("Requested group set for null user. Returning empty set."); return Collections.emptySet(); } Set<String> groups = _userToGroupMap.get(keySearch(_userToGroupMap.keySet(), user)); if (...
@Test public void testDecideOnVirtualHostLogEventNotExcludedAndNullSubject() throws Exception { FilterReply reply = _filter.decide(_loggingEvent); assertEquals(" BrokerLogger#virtualHostLogEventExcluded=false and subject=null", FilterReply.NEUTRAL, reply); assertNull("Subject should not be set in test environment", Sub...
@Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; }
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } }
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } Virtua...
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } Virtua...
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } Virtua...
@Test public void testGetMechanisms() { List<String> mechanisms = _authenticationManager.getMechanisms(); assertEquals("Unexpected number of mechanisms", (long) 4, (long) mechanisms.size()); assertTrue("PLAIN was not present: " + mechanisms, mechanisms.contains("PLAIN")); assertTrue("CRAM-MD5 was not present: " + mecha...
@Override public List<String> getMechanisms() { return Collections.unmodifiableList(Arrays.asList(PLAIN_MECHANISM, CRAM_MD5_MECHANISM, SCRAM_SHA1_MECHANISM, SCRAM_SHA256_MECHANISM)); }
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.unmodifiableList(Arrays.asList(PLAIN_MECHANISM, CRAM_MD5_MECHANISM,...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.unmodifiableList(Arrays.asList(PLAIN_MECHANISM, CRAM_MD5_MECHANISM,...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.unmodifiableList(Arrays.asList(PLAIN_MECHANISM, CRAM_MD5_MECHANISM,...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.unmodifiableList(Arrays.asList(PLAIN_MECHANISM, CRAM_MD5_MECHANISM,...
@Test public void testCreateSaslNegotiatorForUnsupportedMechanisms() throws Exception { String[] unsupported = new String[] { "EXTERNAL", "CRAM-MD5-HEX", "CRAM-MD5-HASHED", "ANONYMOUS", "GSSAPI"}; for (int i = 0; i < unsupported.length; i++) { String mechanism = unsupported[i]; SaslNegotiator negotiator = _authenticati...
@Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if (PlainNegotiator.MECHANISM.equals(mechanism)) { return new PlainNegotiator(this); } else if (CramMd5Negotiator.MECHANISM.equals(mechanism)) { return new CramMd5Negotia...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace ...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace ...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace ...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace ...
@Test public void testAuthenticateValidCredentials() { AuthenticationResult result = _authenticationManager.authenticate(TEST_USER, TEST_PASSWORD); assertEquals("Unexpected authentication result", AuthenticationStatus.SUCCESS, result.getStatus()); assertAuthenticated(result); }
@Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String userPassword = _users.get(username); if (userPassword.equals(password)) { return new AuthenticationResult(new UsernamePrincipal(username, this)); } } return new AuthenticationResult(Authenti...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
@Test public void testAuthenticateInvalidPassword() { AuthenticationResult result = _authenticationManager.authenticate(TEST_USER, "invalid"); assertUnauthenticated(result); }
@Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String userPassword = _users.get(username); if (userPassword.equals(password)) { return new AuthenticationResult(new UsernamePrincipal(username, this)); } } return new AuthenticationResult(Authenti...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
@Test public void testAuthenticateInvalidUserName() { AuthenticationResult result = _authenticationManager.authenticate("invalid", TEST_PASSWORD); assertUnauthenticated(result); }
@Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String userPassword = _users.get(username); if (userPassword.equals(password)) { return new AuthenticationResult(new UsernamePrincipal(username, this)); } } return new AuthenticationResult(Authenti...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
SimpleAuthenticationManager extends AbstractAuthenticationManager<SimpleAuthenticationManager> implements PasswordCredentialManagingAuthenticationProvider<SimpleAuthenticationManager> { @Override public AuthenticationResult authenticate(String username, String password) { if (_users.containsKey(username)) { String user...
@Test public void testGetMechanisms() throws Exception { assertEquals(Collections.singletonList("ANONYMOUS"), _manager.getMechanisms()); }
@Override public List<String> getMechanisms() { return Collections.singletonList(MECHANISM_NAME); }
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.singletonList(MECHANISM_NAME); } }
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.singletonList(MECHANISM_NAME); } @ManagedObjectFactoryConstructor protected AnonymousAuthenticationManager(final Map<String, Object> attributes, fina...
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.singletonList(MECHANISM_NAME); } @ManagedObjectFactoryConstructor protected AnonymousAuthenticationManager(final Map<String, Object> attributes, fina...
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public List<String> getMechanisms() { return Collections.singletonList(MECHANISM_NAME); } @ManagedObjectFactoryConstructor protected AnonymousAuthenticationManager(final Map<String, Object> attributes, fina...
@Test public void testCreateSaslNegotiator() throws Exception { SaslNegotiator negotiator = _manager.createSaslNegotiator("ANONYMOUS", null, null); assertNotNull("Could not create SASL negotiator for mechanism 'ANONYMOUS'", negotiator); negotiator = _manager.createSaslNegotiator("PLAIN", null, null); assertNull("Should...
@Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(MECHANISM_NAME.equals(mechanism)) { return new AnonymousNegotiator(_anonymousAuthenticationResult); } else { return null; } }
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(MECHANISM_NAME.equals(mechanism)) { return new AnonymousNegotiat...
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(MECHANISM_NAME.equals(mechanism)) { return new AnonymousNegotiat...
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(MECHANISM_NAME.equals(mechanism)) { return new AnonymousNegotiat...
AnonymousAuthenticationManager extends AbstractAuthenticationManager<AnonymousAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(MECHANISM_NAME.equals(mechanism)) { return new AnonymousNegotiat...
@Test public void testAuthenticate() throws Exception { final String token = Base64.getEncoder().encodeToString(buildToken(SERVICE_PRINCIPAL_NAME)); final String authenticationHeader = SpnegoAuthenticator.NEGOTIATE_PREFIX + token; final AuthenticationResult result = _spnegoAuthenticator.authenticate(authenticationHeade...
public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiatePrefix(authorizationHe...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
@Test public void testAuthenticateNoAuthenticationHeader() { final AuthenticationResult result = _spnegoAuthenticator.authenticate((String) null); assertNotNull(result); assertEquals(AuthenticationResult.AuthenticationStatus.ERROR, result.getStatus()); }
public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiatePrefix(authorizationHe...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
@Test public void testAuthenticateNoNegotiatePrefix() throws Exception { final String token = Base64.getEncoder().encodeToString(buildToken(SERVICE_PRINCIPAL_NAME)); final AuthenticationResult result = _spnegoAuthenticator.authenticate(token); assertNotNull(result); assertEquals(AuthenticationResult.AuthenticationStatu...
public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiatePrefix(authorizationHe...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
@Test public void testDecideOnVirtualHostLogEventExcludedAndNullSubject() throws Exception { when(_brokerLogger.isVirtualHostLogEventExcluded()).thenReturn(true); FilterReply reply = _filter.decide(_loggingEvent); assertEquals(" BrokerLogger#virtualHostLogEventExcluded=true and subject=null", FilterReply.NEUTRAL, reply...
@Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; }
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } }
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } Virtua...
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } Virtua...
VirtualHostLogEventExcludingFilter extends Filter<ILoggingEvent> implements LogBackLogInclusionRule { @Override public FilterReply decide(ILoggingEvent event) { if (!_brokerLogger.isVirtualHostLogEventExcluded() || !subjectContainsVirtualHostPrincipal()) { return FilterReply.NEUTRAL; } return FilterReply.DENY; } Virtua...
@Test public void testAuthenticateEmptyToken() { final AuthenticationResult result = _spnegoAuthenticator.authenticate(SpnegoAuthenticator.NEGOTIATE_PREFIX + ""); assertNotNull(result); assertEquals(AuthenticationResult.AuthenticationStatus.ERROR, result.getStatus()); }
public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiatePrefix(authorizationHe...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
@Test public void testAuthenticateInvalidToken() { final AuthenticationResult result = _spnegoAuthenticator.authenticate(SpnegoAuthenticator.NEGOTIATE_PREFIX + "Zm9v"); assertNotNull(result); assertEquals(AuthenticationResult.AuthenticationStatus.ERROR, result.getStatus()); }
public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiatePrefix(authorizationHe...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
@Test public void testAuthenticateWrongConfigName() throws Exception { when(_kerberosAuthenticationManager.getSpnegoLoginConfigScope()).thenReturn("foo"); final String token = Base64.getEncoder().encodeToString(buildToken(SERVICE_PRINCIPAL_NAME)); final String authenticationHeader = SpnegoAuthenticator.NEGOTIATE_PREFIX...
public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiatePrefix(authorizationHe...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
@Test public void testAuthenticateWrongServer() throws Exception { final String token = Base64.getEncoder().encodeToString(buildToken(ANOTHER_SERVICE)); final String authenticationHeader = SpnegoAuthenticator.NEGOTIATE_PREFIX + token; final AuthenticationResult result = _spnegoAuthenticator.authenticate(authenticationH...
public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiatePrefix(authorizationHe...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
SpnegoAuthenticator { public AuthenticationResult authenticate(String authorizationHeader) { if (authorizationHeader == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("'Authorization' header is not set"); } return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR); } else { if (!hasNegotiate...
@Test public void testPackageAndClassName() throws Exception { Class<? extends SocketFactory> socketFactoryClass = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory); assertEquals("MyNewClass", socketFactoryClass.getSimpleName()); assertEquals(TARGET_PACKAGE_NAME, socketFactoryClass.getPackag...
public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader = new LDAPSSLSocketFactoryAware...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
@Test public void testLoadingWithClassForName() throws Exception { Class<? extends AbstractLDAPSSLSocketFactory> socketFactoryClass = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory); String fqcn = socketFactoryClass.getName(); try { Class.forName(fqcn); fail("Class loading by name should n...
public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader = new LDAPSSLSocketFactoryAware...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
@Test public void testClassloaderDelegatesToParent() throws Exception { ClassLoader classLoader = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory).getClassLoader(); assertEquals(String.class, classLoader.loadClass("java.lang.String")); assertEquals(TestClassForLoading.class, classLoader.loa...
public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader = new LDAPSSLSocketFactoryAware...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
@Test public void testGetDefaultCreatesInstance() throws Exception { Class<? extends AbstractLDAPSSLSocketFactory> socketFactoryClass = LDAPSSLSocketFactoryGenerator.createSubClass("MyNewClass", _sslSocketFactory); AbstractLDAPSSLSocketFactory socketFactory = invokeGetDefaultMethod(socketFactoryClass); final boolean co...
public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader = new LDAPSSLSocketFactoryAware...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
LDAPSSLSocketFactoryGenerator { public static Class<? extends AbstractLDAPSSLSocketFactory> createSubClass(String simpleName, final SSLSocketFactory sslSocketFactory) { final String fqcn = TARGET_PACKAGE_NAME + "." + simpleName; final byte[] classBytes = createSubClassByteCode(fqcn); try { final ClassLoader classLoader...
@Test public void testAuthenticateViaSasl() throws Exception { _server.setEndpoints(Collections.singletonMap(TEST_IDENTITY_RESOLVER_ENDPOINT_PATH, createMockIdentityResolverEndpoint())); final SaslNegotiator negotiator = _authProvider.createSaslNegotiator(OAuth2Negotiator.MECHANISM, null, null); AuthenticationResult au...
@Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(OAuth2Negotiator.MECHANISM.equals(mechanism)) { return new OAuth2Negotiator(this, addressSpace); } else { return null; } }
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
@Test public void testFailAuthenticateViaSasl() throws Exception { OAuth2MockEndpoint mockIdentityResolverEndpoint = createMockIdentityResolverEndpoint(); mockIdentityResolverEndpoint.putExpectedParameter("token", TEST_INVALID_ACCESS_TOKEN); mockIdentityResolverEndpoint.setResponse(400, "{\"error\":\"invalid_token\"}")...
@Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(OAuth2Negotiator.MECHANISM.equals(mechanism)) { return new OAuth2Negotiator(this, addressSpace); } else { return null; } }
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addre...
@Test public void testOnRollover() throws Exception { String[] files = {"test1", "test2"}; _rolloverWatcher.onRollover(_baseFolder.toPath(), files); assertEquals("Unexpected rolled files. Expected " + Arrays.toString(files) + " but got " + _rolloverWatcher.getRolledFiles(), new HashSet<>(Arrays.asList(files)), new Hash...
@Override public void onRollover(Path baseFolder, String[] relativeFileNames) { _rolledFiles = Collections.unmodifiableCollection(Arrays.asList(relativeFileNames)); _baseFolder = baseFolder; }
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { @Override public void onRollover(Path baseFolder, String[] relativeFileNames) { _rolledFiles = Collections.unmodifiableCollection(Arrays.asList(relativeFileNames)); _baseFolder = baseFolder; } }
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { @Override public void onRollover(Path baseFolder, String[] relativeFileNames) { _rolledFiles = Collections.unmodifiableCollection(Arrays.asList(relativeFileNames)); _baseFolder = baseFolder; } RolloverWatcher(final String activeFileName); }
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { @Override public void onRollover(Path baseFolder, String[] relativeFileNames) { _rolledFiles = Collections.unmodifiableCollection(Arrays.asList(relativeFileNames)); _baseFolder = baseFolder; } RolloverWatcher(final String activeFileName); @Override vo...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { @Override public void onRollover(Path baseFolder, String[] relativeFileNames) { _rolledFiles = Collections.unmodifiableCollection(Arrays.asList(relativeFileNames)); _baseFolder = baseFolder; } RolloverWatcher(final String activeFileName); @Override vo...
@Test public void testAuthenticateViaAuthorizationCode() throws Exception { Map<String, OAuth2MockEndpoint> mockEndpoints = new HashMap<>(); mockEndpoints.put(TEST_TOKEN_ENDPOINT_PATH, createMockTokenEndpoint()); mockEndpoints.put(TEST_IDENTITY_RESOLVER_ENDPOINT_PATH, createMockIdentityResolverEndpoint()); _server.setE...
@Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddressSpace addressSpace) { URL tokenEndpoint; HttpURLConnection connection; byte[] body; try { tokenEndpoint = getTokenEndpointURI(addressSpace).toURL(); ConnectionBuilder connectionBu...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
@Test public void testFailAuthenticateViaInvalidAuthorizationCode() throws Exception { Map<String, OAuth2MockEndpoint> mockEndpoints = new HashMap<>(); final OAuth2MockEndpoint mockTokenEndpoint = createMockTokenEndpoint(); mockTokenEndpoint.putExpectedParameter("code", TEST_INVALID_AUTHORIZATION_CODE); mockTokenEndpoi...
@Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddressSpace addressSpace) { URL tokenEndpoint; HttpURLConnection connection; byte[] body; try { tokenEndpoint = getTokenEndpointURI(addressSpace).toURL(); ConnectionBuilder connectionBu...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAuthorizationCode(final String authorizationCode, final String redirectUri, NamedAddre...
@Test public void testAuthenticateViaAccessToken() throws Exception { _server.setEndpoints(Collections.singletonMap(TEST_IDENTITY_RESOLVER_ENDPOINT_PATH, createMockIdentityResolverEndpoint())); AuthenticationResult authenticationResult = _authProvider.authenticateViaAccessToken(TEST_VALID_ACCESS_TOKEN, null); assertSuc...
@Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _authenticationResultCacher.getOrLoad(new String[]{accessToken}, () -> { try { final Principal userPrincipal = _identityResolverService.getUserPrincipal(OAuth2AuthenticationProviderI...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
@Test public void testFailAuthenticateViaInvalidAccessToken() throws Exception { OAuth2MockEndpoint mockIdentityResolverEndpoint = createMockIdentityResolverEndpoint(); mockIdentityResolverEndpoint.putExpectedParameter("token", TEST_INVALID_ACCESS_TOKEN); mockIdentityResolverEndpoint.setResponse(400, "{\"error\":\"inva...
@Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _authenticationResultCacher.getOrLoad(new String[]{accessToken}, () -> { try { final Principal userPrincipal = _identityResolverService.getUserPrincipal(OAuth2AuthenticationProviderI...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
OAuth2AuthenticationProviderImpl extends AbstractAuthenticationManager<OAuth2AuthenticationProviderImpl> implements OAuth2AuthenticationProvider<OAuth2AuthenticationProviderImpl> { @Override public AuthenticationResult authenticateViaAccessToken(final String accessToken, final NamedAddressSpace addressSpace) { return _...
@Test public void testCreateSaslNegotiator() throws Exception { final SaslSettings saslSettings = mock(SaslSettings.class); when(saslSettings.getLocalFQDN()).thenReturn(HOST_NAME); final SaslNegotiator negotiator = _kerberosAuthenticationProvider.createSaslNegotiator(GSSAPI_MECHANISM, saslSettings, null); assertNotNull...
@Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(GSSAPI_MECHANISM.equals(mechanism)) { final String serverName = _serverName == null ? saslSettings.getLocalFQDN(): _serverName; return new KerberosNegotiator(this, ser...
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(GSSAPI_MECHANISM.equals(mechanism)) { final String serverName = _s...
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(GSSAPI_MECHANISM.equals(mechanism)) { final String serverName = _s...
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(GSSAPI_MECHANISM.equals(mechanism)) { final String serverName = _s...
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { if(GSSAPI_MECHANISM.equals(mechanism)) { final String serverName = _s...
@Test public void testAuthenticateUsingNegotiationToken() throws Exception { byte[] negotiationTokenBytes = UTILS.buildToken(CLIENT_PRINCIPAL_NAME, _clientKeyTabFile, SERVICE_PRINCIPAL_NAME); final String token = Base64.getEncoder().encodeToString(negotiationTokenBytes); final String authenticationHeader = SpnegoAuthen...
public AuthenticationResult authenticate(String authorizationHeader) { return _authenticator.authenticate(authorizationHeader); }
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { public AuthenticationResult authenticate(String authorizationHeader) { return _authenticator.authenticate(authorizationHeader); } }
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { public AuthenticationResult authenticate(String authorizationHeader) { return _authenticator.authenticate(authorizationHeader); } @ManagedObjectFactoryConstructor protected KerberosAuthenticationManager(final Map<Strin...
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { public AuthenticationResult authenticate(String authorizationHeader) { return _authenticator.authenticate(authorizationHeader); } @ManagedObjectFactoryConstructor protected KerberosAuthenticationManager(final Map<Strin...
KerberosAuthenticationManager extends AbstractAuthenticationManager<KerberosAuthenticationManager> { public AuthenticationResult authenticate(String authorizationHeader) { return _authenticator.authenticate(authorizationHeader); } @ManagedObjectFactoryConstructor protected KerberosAuthenticationManager(final Map<Strin...
@Test public void testInitialiseWhenPasswordFileNotFound() throws Exception { PasswordCredentialManagingAuthenticationProvider mockAuthProvider = mock(PasswordCredentialManagingAuthenticationProvider.class); when(mockAuthProvider.getContextValue(Integer.class, AbstractScramAuthenticationManager.QPID_AUTHMANAGER_SCRAM_I...
public void initialise() { try { _principalDatabase.open(new File(_path)); } catch (FileNotFoundException e) { throw new IllegalConfigurationException("Exception opening password database: " + e.getMessage(), e); } catch (IOException e) { throw new IllegalConfigurationException("Cannot use password database at :" + _pa...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { public void initialise() { try { _principalDatabase.open(new File(_path)); } catch (FileNotFoundException e) { throw new IllegalConfigurationException("Exception opening password databa...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { public void initialise() { try { _principalDatabase.open(new File(_path)); } catch (FileNotFoundException e) { throw new IllegalConfigurationException("Exception opening password databa...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { public void initialise() { try { _principalDatabase.open(new File(_path)); } catch (FileNotFoundException e) { throw new IllegalConfigurationException("Exception opening password databa...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { public void initialise() { try { _principalDatabase.open(new File(_path)); } catch (FileNotFoundException e) { throw new IllegalConfigurationException("Exception opening password databa...
@Test public void testSaslMechanismCreation() throws Exception { setupMocks(); SaslSettings saslSettings = mock(SaslSettings.class); SaslNegotiator saslNegotiator = _manager.createSaslNegotiator(MOCK_MECH_NAME, saslSettings, null); assertNotNull(saslNegotiator); }
@Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { return _principalDatabase.createSaslNegotiator(mechanism, saslSettings); }
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { return _principalDatabase.createSas...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { return _principalDatabase.createSas...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { return _principalDatabase.createSas...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public SaslNegotiator createSaslNegotiator(final String mechanism, final SaslSettings saslSettings, final NamedAddressSpace addressSpace) { return _principalDatabase.createSas...
@Test public void testNonSaslAuthenticationSuccess() throws Exception { setupMocks(); when(_principalDatabase.verifyPassword("guest", "guest".toCharArray())).thenReturn(true); AuthenticationResult result = _manager.authenticate("guest", "guest"); UsernamePrincipal expectedPrincipal = new UsernamePrincipal("guest", _man...
@Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { return new AuthenticationResult(new UsernamePrincipal(username, this)); } else { return new AuthenticationResult(AuthenticationStatus.ERROR)...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
@Test public void testNonSaslAuthenticationErrored() throws Exception { setupMocks(); when(_principalDatabase.verifyPassword("guest", "wrongpassword".toCharArray())).thenReturn(false); AuthenticationResult result = _manager.authenticate("guest", "wrongpassword"); assertEquals("Principals was not expected size", (long) ...
@Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { return new AuthenticationResult(new UsernamePrincipal(username, this)); } else { return new AuthenticationResult(AuthenticationStatus.ERROR)...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override public AuthenticationResult authenticate(final String username, final String password) { try { if (_principalDatabase.verifyPassword(username, password.toCharArray())) { retur...
@Test public void testGetTypedForNullFile() throws Exception { try { _rolloverWatcher.getFileContent(null); fail("IllegalArgumentException is expected for null file name"); } catch (IllegalArgumentException e) { } }
public PathContent getFileContent(String fileName) { if (fileName == null) { throw new IllegalArgumentException("File name cannot be null"); } Path path = getPath(fileName); return new PathContent(path, getContentType(fileName)); }
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public PathContent getFileContent(String fileName) { if (fileName == null) { throw new IllegalArgumentException("File name cannot be null"); } Path path = getPath(fileName); return new PathContent(path, getContentType(fileName)); } }
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public PathContent getFileContent(String fileName) { if (fileName == null) { throw new IllegalArgumentException("File name cannot be null"); } Path path = getPath(fileName); return new PathContent(path, getContentType(fileName)); } RolloverWatcher(fin...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public PathContent getFileContent(String fileName) { if (fileName == null) { throw new IllegalArgumentException("File name cannot be null"); } Path path = getPath(fileName); return new PathContent(path, getContentType(fileName)); } RolloverWatcher(fin...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public PathContent getFileContent(String fileName) { if (fileName == null) { throw new IllegalArgumentException("File name cannot be null"); } Path path = getPath(fileName); return new PathContent(path, getContentType(fileName)); } RolloverWatcher(fin...
@Test public void testOnCreate() throws Exception { setupMocks(); assertTrue("Password file was not created", new File(_passwordFileLocation).exists()); }
@Override protected void onCreate() { super.onCreate(); File passwordFile = new File(_path); if (!passwordFile.exists()) { try { Path path = new FileHelper().createNewFile(passwordFile, getContextValue(String.class, SystemConfig.POSIX_FILE_PERMISSIONS)); if (!Files.exists(path)) { throw new IllegalConfigurationExceptio...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected void onCreate() { super.onCreate(); File passwordFile = new File(_path); if (!passwordFile.exists()) { try { Path path = new FileHelper().createNewFile(passwordFile,...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected void onCreate() { super.onCreate(); File passwordFile = new File(_path); if (!passwordFile.exists()) { try { Path path = new FileHelper().createNewFile(passwordFile,...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected void onCreate() { super.onCreate(); File passwordFile = new File(_path); if (!passwordFile.exists()) { try { Path path = new FileHelper().createNewFile(passwordFile,...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected void onCreate() { super.onCreate(); File passwordFile = new File(_path); if (!passwordFile.exists()) { try { Path path = new FileHelper().createNewFile(passwordFile,...
@Test public void testOnDelete() throws Exception { setupMocks(); assertTrue("Password file was not created", new File(_passwordFileLocation).exists()); _manager.delete(); assertFalse("Password file was not deleted", new File(_passwordFileLocation).exists()); }
@Override protected ListenableFuture<Void> onDelete() { return doAfterAlways(closeChildren(), () -> { File file = new File(_path); if (file.exists() && file.isFile()) { file.delete(); } }); }
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected ListenableFuture<Void> onDelete() { return doAfterAlways(closeChildren(), () -> { File file = new File(_path); if (file.exists() && file.isFile()) { file.delete(); }...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected ListenableFuture<Void> onDelete() { return doAfterAlways(closeChildren(), () -> { File file = new File(_path); if (file.exists() && file.isFile()) { file.delete(); }...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected ListenableFuture<Void> onDelete() { return doAfterAlways(closeChildren(), () -> { File file = new File(_path); if (file.exists() && file.isFile()) { file.delete(); }...
PrincipalDatabaseAuthenticationManager extends AbstractAuthenticationManager<T> implements ExternalFileBasedAuthenticationManager<T> { @Override protected ListenableFuture<Void> onDelete() { return doAfterAlways(closeChildren(), () -> { File file = new File(_path); if (file.exists() && file.isFile()) { file.delete(); }...
@Test public void testCacheHit() throws Exception { Subject.doAs(_subject, new PrivilegedAction<Void>() { @Override public Void run() { AuthenticationResult result; result = _authenticationResultCacher.getOrLoad(new String[]{"credentials"}, _loader); assertEquals("Unexpected AuthenticationResult", _successfulAuthentica...
public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDigest, new Callable<Authenticatio...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
@Test public void testCacheMissDifferentCredentials() throws Exception { Subject.doAs(_subject, new PrivilegedAction<Void>() { @Override public Void run() { AuthenticationResult result; result = _authenticationResultCacher.getOrLoad(new String[]{"credentials"}, _loader); assertEquals("Unexpected AuthenticationResult", ...
public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDigest, new Callable<Authenticatio...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
AuthenticationResultCacher { public AuthenticationResult getOrLoad(final String[] credentials, final Callable<AuthenticationResult> loader) { try { if (_authenticationCache == null) { return loader.call(); } else { String credentialDigest = digestCredentials(credentials); return _authenticationCache.get(credentialDiges...
@Test public void testGetAuthenticatedPrincipalFromSubject() { final Subject subject = createSubjectContainingAuthenticatedPrincipal(); final AuthenticatedPrincipal actual = AuthenticatedPrincipal.getAuthenticatedPrincipalFromSubject(subject); assertSame(_authenticatedPrincipal, actual); }
public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentUser(); ...
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentUser(); ...
@Test public void testAuthenticatedPrincipalNotInSubject() { try { AuthenticatedPrincipal.getAuthenticatedPrincipalFromSubject(new Subject()); fail("Exception not thrown"); } catch (IllegalArgumentException iae) { } }
public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentUser(); ...
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentUser(); ...
@Test public void testGetOptionalAuthenticatedPrincipalFromSubject() { final Subject subject = createSubjectContainingAuthenticatedPrincipal(); final AuthenticatedPrincipal actual = AuthenticatedPrincipal.getOptionalAuthenticatedPrincipalFromSubject(subject); assertSame(_authenticatedPrincipal, actual); }
public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } AuthenticatedPrincipal(Principal wrappedPrincipal); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentU...
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentU...
@Test public void testGetOptionalAuthenticatedPrincipalFromSubjectReturnsNullIfMissing() { Subject subjectWithNoPrincipals = new Subject(); assertNull(AuthenticatedPrincipal.getOptionalAuthenticatedPrincipalFromSubject(subjectWithNoPrincipals)); Subject subjectWithoutAuthenticatedPrincipal = new Subject(); subjectWitho...
public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } AuthenticatedPrincipal(Principal wrappedPrincipal); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentU...
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getOptionalAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, true); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentU...
@Test public void testTooManyAuthenticatedPrincipalsInSubject() { final Subject subject = new Subject(); subject.getPrincipals().add(new AuthenticatedPrincipal(new UsernamePrincipal("name1", null))); subject.getPrincipals().add(new AuthenticatedPrincipal(new UsernamePrincipal("name2", null))); try { AuthenticatedPrinci...
public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); }
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentUser(); ...
AuthenticatedPrincipal implements QpidPrincipal { public static AuthenticatedPrincipal getAuthenticatedPrincipalFromSubject(final Subject authSubject) { return getAuthenticatedPrincipalFromSubject(authSubject, false); } AuthenticatedPrincipal(Principal wrappedPrincipal); static AuthenticatedPrincipal getCurrentUser(); ...
@Test public void testEqualsWithDifferentUsernames() { AuthenticatedPrincipal user1principal1 = new AuthenticatedPrincipal(new UsernamePrincipal("user1", null)); AuthenticatedPrincipal user1principal2 = new AuthenticatedPrincipal(new UsernamePrincipal("user2", null)); assertFalse(user1principal1.equals(user1principal2)...
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); }
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } }
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } Authe...
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } Authe...
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } Authe...
@Test public void testGetContentType() throws Exception { assertEquals("Unexpected content type for log file", "text/plain", _rolloverWatcher.getContentType("test.log")); assertEquals("Unexpected content type for gzip file", "application/x-gzip", _rolloverWatcher.getContentType("test.gz")); assertEquals("Unexpected con...
public String getContentType(String fileName) { String fileNameLower = fileName.toLowerCase(); if (fileNameLower.endsWith(".gz")) { return "application/x-gzip"; } else if (fileNameLower.endsWith(".zip")) { return "application/x-zip"; } else { return "text/plain"; } }
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public String getContentType(String fileName) { String fileNameLower = fileName.toLowerCase(); if (fileNameLower.endsWith(".gz")) { return "application/x-gzip"; } else if (fileNameLower.endsWith(".zip")) { return "application/x-zip"; } else { return "...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public String getContentType(String fileName) { String fileNameLower = fileName.toLowerCase(); if (fileNameLower.endsWith(".gz")) { return "application/x-gzip"; } else if (fileNameLower.endsWith(".zip")) { return "application/x-zip"; } else { return "...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public String getContentType(String fileName) { String fileNameLower = fileName.toLowerCase(); if (fileNameLower.endsWith(".gz")) { return "application/x-gzip"; } else if (fileNameLower.endsWith(".zip")) { return "application/x-zip"; } else { return "...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public String getContentType(String fileName) { String fileNameLower = fileName.toLowerCase(); if (fileNameLower.endsWith(".gz")) { return "application/x-gzip"; } else if (fileNameLower.endsWith(".zip")) { return "application/x-zip"; } else { return "...
@Test public void testEqualsWithDissimilarObjects() { UsernamePrincipal wrappedPrincipal = new UsernamePrincipal("user1", null); AuthenticatedPrincipal authenticatedPrincipal = new AuthenticatedPrincipal(wrappedPrincipal); assertFalse(authenticatedPrincipal.equals(wrappedPrincipal)); assertFalse(wrappedPrincipal.equals...
@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); }
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } }
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } Authe...
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } Authe...
AuthenticatedPrincipal implements QpidPrincipal { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof AuthenticatedPrincipal)) { return false; } AuthenticatedPrincipal other = (AuthenticatedPrincipal) obj; return _wrappedPrincipal.equals(other._wrappedPrincipal); } Authe...
@Test public void testVerifyPassword() throws IOException, AccountNotFoundException { createUserPrincipal(); assertFalse(_database.verifyPassword(TEST_USERNAME, new char[]{})); assertFalse(_database.verifyPassword(TEST_USERNAME, "massword".toCharArray())); assertTrue(_database.verifyPassword(TEST_USERNAME, TEST_PASSWOR...
@Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the specified users password"); } return compareCharArray(pwd, password); }
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
@Test public void testUpdatePassword() throws IOException, AccountNotFoundException { createUserPrincipal(); char[] newPwd = "newpassword".toCharArray(); _database.updatePassword(_principal, newPwd); assertFalse(_database.verifyPassword(TEST_USERNAME, TEST_PASSWORD_CHARS)); assertTrue(_database.verifyPassword(TEST_USER...
@Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the specified users password"); } return compareCharArray(pwd, password); }
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
PlainPasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<PlainUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the s...
@Test public void testVerifyPassword() throws IOException, AccountNotFoundException { testCreateUserPrincipal(); assertFalse(_database.verifyPassword(PRINCIPAL_USERNAME, new char[]{})); assertFalse(_database.verifyPassword(PRINCIPAL_USERNAME, (PASSWORD + "z").toCharArray())); assertTrue(_database.verifyPassword(PRINCIP...
@Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the specified users password"); } byte[] byteArray = new byte[password.length]; int index = 0; for ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
@Test public void testUpdatePassword() throws IOException, AccountNotFoundException { testCreateUserPrincipal(); char[] newPwd = "newpassword".toCharArray(); _database.updatePassword(PRINCIPAL, newPwd); assertFalse(_database.verifyPassword(PRINCIPAL_USERNAME, PASSWORD.toCharArray())); assertTrue(_database.verifyPasswor...
@Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup the specified users password"); } byte[] byteArray = new byte[password.length]; int index = 0; for ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
Base64MD5PasswordFilePrincipalDatabase extends AbstractPasswordFilePrincipalDatabase<HashedUser> { @Override public boolean verifyPassword(String principal, char[] password) throws AccountNotFoundException { char[] pwd = lookupPassword(principal); if (pwd == null) { throw new AccountNotFoundException("Unable to lookup ...
@Test public void testEqualitySameObject() { final UsernamePrincipal principal = new UsernamePrincipal("string", null); assertTrue(principal.equals(principal)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider == null || that._authenticationProvider == n...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
@Test public void testEqualitySameName() { final String string = "string"; final UsernamePrincipal principal1 = new UsernamePrincipal(string, null); final UsernamePrincipal principal2 = new UsernamePrincipal(string, null); assertTrue(principal1.equals(principal2)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider == null || that._authenticationProvider == n...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
@Test public void testEqualityEqualName() { final UsernamePrincipal principal1 = new UsernamePrincipal(new String("string"), null); final UsernamePrincipal principal2 = new UsernamePrincipal(new String("string"), null); assertTrue(principal1.equals(principal2)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider == null || that._authenticationProvider == n...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
@Test public void testInequalityDifferentUserPrincipals() { UsernamePrincipal principal1 = new UsernamePrincipal("string1", null); UsernamePrincipal principal2 = new UsernamePrincipal("string2", null); assertFalse(principal1.equals(principal2)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider == null || that._authenticationProvider == n...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
@Test public void testInequalityNonUserPrincipal() { UsernamePrincipal principal = new UsernamePrincipal("string", null); assertFalse(principal.equals(new String("string"))); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider == null || that._authenticationProvider == n...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
@Test public void testGetLogFileDetails() throws Exception { String[] files = createTestRolledFilesAndNotifyWatcher(); List<LogFileDetails> logFileDetails = _rolloverWatcher.getLogFileDetails(); final int expectedNumberOfEntries = files.length + 1; assertEquals("getLogFileDetails returned unexpected number of entries",...
public List<LogFileDetails> getLogFileDetails() { List<LogFileDetails> results = new ArrayList<>(); results.add(getFileDetails(_activeFilePath)); List<String> rolledFiles = new ArrayList<>(_rolledFiles); for (String fileName : rolledFiles) { Path file = _baseFolder.resolve(fileName); LogFileDetails details = getFileDet...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public List<LogFileDetails> getLogFileDetails() { List<LogFileDetails> results = new ArrayList<>(); results.add(getFileDetails(_activeFilePath)); List<String> rolledFiles = new ArrayList<>(_rolledFiles); for (String fileName : rolledFiles) { Path file...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public List<LogFileDetails> getLogFileDetails() { List<LogFileDetails> results = new ArrayList<>(); results.add(getFileDetails(_activeFilePath)); List<String> rolledFiles = new ArrayList<>(_rolledFiles); for (String fileName : rolledFiles) { Path file...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public List<LogFileDetails> getLogFileDetails() { List<LogFileDetails> results = new ArrayList<>(); results.add(getFileDetails(_activeFilePath)); List<String> rolledFiles = new ArrayList<>(_rolledFiles); for (String fileName : rolledFiles) { Path file...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public List<LogFileDetails> getLogFileDetails() { List<LogFileDetails> results = new ArrayList<>(); results.add(getFileDetails(_activeFilePath)); List<String> rolledFiles = new ArrayList<>(_rolledFiles); for (String fileName : rolledFiles) { Path file...
@Test public void testInequalityNull() { UsernamePrincipal principal = new UsernamePrincipal("string", null); assertFalse(principal.equals(null)); }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider == null || that._authenticationProvider == n...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
UsernamePrincipal implements QpidPrincipal { @Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final UsernamePrincipal that = (UsernamePrincipal) o; if (!_name.equals(that._name)) { return false; } if (_authenticationProvider...
@Test public void testHandleResponse_ResponseAuthAbsent() throws Exception { AuthenticationResult actualResult = _negotiator.handleResponse(RESPONSE_WITH_NO_TOKEN); assertEquals("Unexpected result status", AuthenticationResult.AuthenticationStatus.ERROR, actualResult.getStatus()); assertNull("Unexpected result principa...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_state == State.INITIAL && (response == null ||...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
@Test public void testHandleResponse_ResponseAuthMalformed() throws Exception { AuthenticationResult actualResult = _negotiator.handleResponse(RESPONSE_WITH_MALFORMED_AUTH); assertEquals("Unexpected result status", AuthenticationResult.AuthenticationStatus.ERROR, actualResult.getStatus()); assertNull("Unexpected result...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_state == State.INITIAL && (response == null ||...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
@Test public void testHandleNoInitialResponse() throws Exception { final AuthenticationResult result = _negotiator.handleResponse(new byte[0]); assertEquals("Unexpected authentication status", AuthenticationResult.AuthenticationStatus.CONTINUE, result.getStatus()); assertArrayEquals("Unexpected authentication challenge...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_state == State.INITIAL && (response == null ||...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
@Test public void testHandleNoInitialResponseNull() throws Exception { final AuthenticationResult result = _negotiator.handleResponse(null); assertEquals("Unexpected authentication status", AuthenticationResult.AuthenticationStatus.CONTINUE, result.getStatus()); assertArrayEquals("Unexpected authentication challenge", ...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_state == State.INITIAL && (response == null ||...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
OAuth2Negotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_state == State.COMPLETE) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException("Multiple Authentications not permitted.")); } else if (_s...
@Test public void testHandleResponseUseFullDNValidExternalPrincipal() throws Exception { ExternalAuthenticationManager<?> externalAuthenticationManager = mock(ExternalAuthenticationManager.class); when(externalAuthenticationManager.getUseFullDN()).thenReturn(true); X500Principal externalPrincipal = new X500Principal(VA...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = true; } return _result; }
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
@Test public void testHandleResponseNotUseFullDNValidExternalPrincipal() throws Exception { ExternalAuthenticationManager<?> externalAuthenticationManager = mock(ExternalAuthenticationManager.class); when(externalAuthenticationManager.getUseFullDN()).thenReturn(false); X500Principal externalPrincipal = new X500Principa...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = true; } return _result; }
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
@Test public void testHandleResponseNotUseFullDN_No_CN_DC_In_ExternalPrincipal() throws Exception { ExternalAuthenticationManager<?> externalAuthenticationManager = mock(ExternalAuthenticationManager.class); when(externalAuthenticationManager.getUseFullDN()).thenReturn(false); X500Principal externalPrincipal = new X500...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = true; } return _result; }
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
@Test public void testHandleResponseUseFullDN_No_CN_DC_In_ExternalPrincipal() throws Exception { ExternalAuthenticationManager<?> externalAuthenticationManager = mock(ExternalAuthenticationManager.class); when(externalAuthenticationManager.getUseFullDN()).thenReturn(true); X500Principal externalPrincipal = new X500Prin...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = true; } return _result; }
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
@Test public void testHandleResponseFailsWithoutExternalPrincipal() throws Exception { ExternalAuthenticationManager<?> externalAuthenticationManager = mock(ExternalAuthenticationManager.class); when(externalAuthenticationManager.getUseFullDN()).thenReturn(true); ExternalNegotiator negotiator = new ExternalNegotiator(e...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = true; } return _result; }
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
@Test public void testGetFilesAsZippedContentWithNonLogFile() throws Exception { String[] fileNames = createTestRolledFilesAndNotifyWatcher(); String nonLogFileName = "nonLogFile.txt"; TestFileUtils.saveTextContentInFile(nonLogFileName, new File(_baseFolder, nonLogFileName)); String[] requestedFiles = new String[]{ fil...
public ZippedContent getFilesAsZippedContent(Set<String> fileNames) { if (fileNames == null) { throw new IllegalArgumentException("File name cannot be null"); } Map<String, Path> paths = new TreeMap<>(); for (String name: fileNames) { Path filePath = getPath(name); if (filePath != null) { paths.put(name, filePath); } }...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public ZippedContent getFilesAsZippedContent(Set<String> fileNames) { if (fileNames == null) { throw new IllegalArgumentException("File name cannot be null"); } Map<String, Path> paths = new TreeMap<>(); for (String name: fileNames) { Path filePath = ...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public ZippedContent getFilesAsZippedContent(Set<String> fileNames) { if (fileNames == null) { throw new IllegalArgumentException("File name cannot be null"); } Map<String, Path> paths = new TreeMap<>(); for (String name: fileNames) { Path filePath = ...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public ZippedContent getFilesAsZippedContent(Set<String> fileNames) { if (fileNames == null) { throw new IllegalArgumentException("File name cannot be null"); } Map<String, Path> paths = new TreeMap<>(); for (String name: fileNames) { Path filePath = ...
RolloverWatcher implements RollingPolicyDecorator.RolloverListener { public ZippedContent getFilesAsZippedContent(Set<String> fileNames) { if (fileNames == null) { throw new IllegalArgumentException("File name cannot be null"); } Map<String, Path> paths = new TreeMap<>(); for (String name: fileNames) { Path filePath = ...
@Test public void testHandleResponseSucceedsForNonX500Principal() throws Exception { ExternalAuthenticationManager<?> externalAuthenticationManager = mock(ExternalAuthenticationManager.class); when(externalAuthenticationManager.getUseFullDN()).thenReturn(true); Principal principal = mock(Principal.class); ExternalNegot...
@Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = true; } return _result; }
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...
ExternalNegotiator implements SaslNegotiator { @Override public AuthenticationResult handleResponse(final byte[] response) { if (_isComplete) { return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR, new IllegalStateException( "Multiple Authentications not permitted.")); } else { _isComplete = ...