java.lang.Object
iu.auth.config.AuthConfig
Authentication and authorization root configuration utility.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> IuJsonAdapter
<T> Provides additional JSON adapters for configuring the authorization module.static IuJsonAdapter
<?> Provides JSON adapters for components that usedregisterInterface(String, Class, Consumer, IuVault...)
to register configuration interfaces for authentication and authorization.static <T extends IuAuthConfig>
Iterable<T> Finds configuration registered by interface.static <T extends IuAuthConfig>
TGets the configuration registered for a realm.static <T> T
Loads a configuration object from vault.static void
register
(IuAuthConfig config) Registers a configuration descriptor for an authentication realm.static <T> void
registerAdapter
(Class<T> type, IuJsonAdapter<T> adapter) Registers a JSON type adapter for a non-interface configuration class, for example a custom enum.static <T> void
registerInterface
(Class<T> configInterface) Registers an authorization configuration interface that doesn't tie to a vault configuration name.static <T> void
registerInterface
(String prefix, Class<T> configInterface, IuVault... vault) Registers a vault for loading authorization configuration.static <T> void
registerInterface
(String prefix, Class<T> configInterface, Consumer<? super T> verifier, IuVault... vault) Registers a vault for loading authorization configuration.static void
seal()
Seals the authentication and authorization configuration.
-
Method Details
-
register
Registers a configuration descriptor for an authentication realm.Only one verifier may be registered per realm
- Parameters:
config
- principal identity verifier
-
registerAdapter
Registers a JSON type adapter for a non-interface configuration class, for example a custom enum.- Type Parameters:
T
- type- Parameters:
type
- classadapter
-IuJsonAdapter
-
registerInterface
Registers an authorization configuration interface that doesn't tie to a vault configuration name.- Type Parameters:
T
- configuration type- Parameters:
configInterface
- configuration interface
-
registerInterface
Registers a vault for loading authorization configuration.- Type Parameters:
T
- configuration type- Parameters:
prefix
- prefix to append to vault key to classify the resource names used byload(Class, String)
configInterface
- configuration interfacevault
- vault to use for loading configuration
-
registerInterface
public static <T> void registerInterface(String prefix, Class<T> configInterface, Consumer<? super T> verifier, IuVault... vault) Registers a vault for loading authorization configuration.- Type Parameters:
T
- configuration type- Parameters:
prefix
- prefix to append to vault key to classify the resource names used byload(Class, String)
configInterface
- configuration interfaceverifier
- provides additional verification logic to be apply before returning each loaded instancevault
- vault to use for loading configuration
-
load
Loads a configuration object from vault.- Type Parameters:
T
- configuration type- Parameters:
configInterface
- configuration interfacekey
- vault key- Returns:
- loaded configuration
-
get
Gets the configuration registered for a realm.- Type Parameters:
T
- configuration type- Parameters:
realm
- authentication realm- Returns:
IuAuthConfig
by realm
-
get
Finds configuration registered by interface.- Type Parameters:
T
- configuration type- Parameters:
type
- type- Returns:
IuAuthConfig
by type
-
seal
public static void seal()Seals the authentication and authorization configuration.Until sealed, no per-realm configurations can be used. Once sealed, no new configurations can be registered. Configuration state is controlled by the auth module.
-
adaptJson
Provides additional JSON adapters for configuring the authorization module.- Type Parameters:
T
- target type- Parameters:
type
- type- Returns:
IuJsonAdapter
-
adaptJson
Provides JSON adapters for components that usedregisterInterface(String, Class, Consumer, IuVault...)
to register configuration interfaces for authentication and authorization.- Parameters:
type
- type- Returns:
IuJsonAdapter
-