Interface PasswordIdentityProvider
- All Known Subinterfaces:
AuthenticationIdentitiesProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PasswordIdentityProvider
An "emptyinvalid input: '"' implementation ofPasswordIdentityProvider
that returns an empty group of passwords -
Method Summary
Modifier and TypeMethodDescriptioniterableOf
(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProvider
into anIterable
of their combined passwordsiteratorOf
(SessionContext session, PasswordIdentityProvider provider) Resolves a non-null
iterator of the available passwordsiteratorOf
(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) Creates a "unified"Iterator
of passwords out of 2 possiblePasswordIdentityProvider
loadPasswords
(SessionContext session) static PasswordIdentityProvider
multiProvider
(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProvider
into a single onestatic PasswordIdentityProvider
multiProvider
(SessionContext session, PasswordIdentityProvider... providers) Wraps a group ofPasswordIdentityProvider
into a single onestatic PasswordIdentityProvider
resolvePasswordIdentityProvider
(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) Creates a "unified"PasswordIdentityProvider
out of 2 possible ones as follows:static PasswordIdentityProvider
wrapPasswords
(Iterable<String> passwords) Wraps a group of passwords into aPasswordIdentityProvider
static PasswordIdentityProvider
wrapPasswords
(String... passwords) Wraps a group of passwords into aPasswordIdentityProvider
-
Field Details
-
EMPTY_PASSWORDS_PROVIDER
An "emptyinvalid input: '"' implementation ofPasswordIdentityProvider
that returns an empty group of passwords
-
-
Method Details
-
loadPasswords
- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).- Returns:
- The currently available passwords - ignored if
null
- Throws:
IOException
- If failed to load the passwordsGeneralSecurityException
- If some security issue with the passwords
-
iteratorOf
static Iterator<String> iteratorOf(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) throws IOException, GeneralSecurityException Creates a "unified"Iterator
of passwords out of 2 possiblePasswordIdentityProvider
- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).identities
- The registered passwordspasswords
- Extra available passwords- Returns:
- The wrapping iterator
- Throws:
IOException
- If failed to load the passwordsGeneralSecurityException
- If some security issue with the passwords- See Also:
-
iteratorOf
static Iterator<String> iteratorOf(SessionContext session, PasswordIdentityProvider provider) throws IOException, GeneralSecurityException Resolves a non-null
iterator of the available passwords- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).provider
- ThePasswordIdentityProvider
- ignored ifnull
(i.e., return an empty iterator)- Returns:
- A non-
null
iterator - which may be empty if no provider or no passwords - Throws:
IOException
- If failed to load the passwordsGeneralSecurityException
- If some security issue with the passwords
-
resolvePasswordIdentityProvider
static PasswordIdentityProvider resolvePasswordIdentityProvider(SessionContext session, PasswordIdentityProvider identities, PasswordIdentityProvider passwords) Creates a "unified"
PasswordIdentityProvider
out of 2 possible ones as follows:- If both are
null
then returnnull
. - If either one is
null
then use the non-null
one. - If both are the same instance then use it.
- Otherwise, returns a wrapper that groups both providers.
- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).identities
- The registered passwordspasswords
- The extra available passwords- Returns:
- The resolved provider
- See Also:
- If both are
-
multiProvider
static PasswordIdentityProvider multiProvider(SessionContext session, PasswordIdentityProvider... providers) Wraps a group ofPasswordIdentityProvider
into a single one- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).providers
- The providers - ignored ifnull
/empty (i.e., returnsEMPTY_PASSWORDS_PROVIDER
- Returns:
- The wrapping provider
- See Also:
-
multiProvider
static PasswordIdentityProvider multiProvider(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProvider
into a single one- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).providers
- The providers - ignored ifnull
/empty (i.e., returnsEMPTY_PASSWORDS_PROVIDER
- Returns:
- The wrapping provider
-
iterableOf
static Iterable<String> iterableOf(SessionContext session, Collection<? extends PasswordIdentityProvider> providers) Wraps a group ofPasswordIdentityProvider
into anIterable
of their combined passwords- Parameters:
session
- TheSessionContext
for invoking this load command - may benull
if not invoked within a session context (e.g., offline tool).providers
- The providers - ignored ifnull
/empty (i.e., returns an empty iterable instance)- Returns:
- The wrapping iterable
-
wrapPasswords
Wraps a group of passwords into aPasswordIdentityProvider
- Parameters:
passwords
- The passwords - ignored ifnull
/empty (i.e., returnsEMPTY_PASSWORDS_PROVIDER
)- Returns:
- The provider wrapper
-
wrapPasswords
Wraps a group of passwords into aPasswordIdentityProvider
- Parameters:
passwords
- The passwordsIterable
- ignored ifnull
(i.e., returnsEMPTY_PASSWORDS_PROVIDER
)- Returns:
- The provider wrapper
-