Package io.micronaut.oraclecloud.core
Class OracleCloudCoreFactory
java.lang.Object
io.micronaut.oraclecloud.core.OracleCloudCoreFactory
Sets up core beans for integration with Oracle cloud clients. The following beans are exposed:
AuthenticationDetailsProvider
ClientConfiguration.ClientConfigurationBuilder
ClientConfiguration
- See Also:
-
ConfigFileAuthenticationDetailsProvider
ResourcePrincipalAuthenticationDetailsProvider
SimpleAuthenticationDetailsProvider
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
OracleCloudCoreFactory
(@Nullable OracleCloudConfigFileConfigurationProperties ociConfigFileConfiguration) protected
OracleCloudCoreFactory
(@Nullable String profile, @Nullable String configPath) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.oracle.bmc.ClientConfiguration
clientConfiguration
(com.oracle.bmc.ClientConfiguration.ClientConfigurationBuilder builder) Configures the defaultClientConfiguration
if no other configuration is present.protected com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider
Configures aConfigFileAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present and a file is found at$USER_HOME/.oci/config
or specified by the user withoci.config.path
.protected com.oracle.bmc.ClientConfiguration.ClientConfigurationBuilder
Produces aClientConfiguration.ClientConfigurationBuilder
bean for the given properties.protected com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider
instancePrincipalAuthenticationDetailsProvider
(InstancePrincipalConfiguration instancePrincipalConfiguration) Configures aInstancePrincipalsAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present and the specified by the user withoci.config.use-instance-principal
.protected com.oracle.bmc.auth.ResourcePrincipalAuthenticationDetailsProvider
Configures aResourcePrincipalAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present and theOCI_RESOURCE_PRINCIPAL_VERSION
variable is available in the environment.protected com.oracle.bmc.auth.SessionTokenAuthenticationDetailsProvider
Configures aSessionTokenAuthenticationDetailsProvider
.protected com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider
Configures aSimpleAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present.protected TenancyIdProvider
tenantIdProvider
(@Nullable com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider, @Nullable OracleCloudMetadataConfiguration metadataConfiguration) Provides aTenancyIdProvider
bean.
-
Field Details
-
ORACLE_CLOUD
- See Also:
-
ORACLE_CLOUD_CONFIG_PATH
- See Also:
-
METADATA_SERVICE_URL
Deprecated, for removal: This API element is subject to removal in a future version.UseOracleCloudMetadataConfiguration
instead.- See Also:
-
OKE_WORKLOAD_IDENTITY_PREFIX
- See Also:
-
-
Constructor Details
-
OracleCloudCoreFactory
@Deprecated(forRemoval=true, since="3.6.0") protected OracleCloudCoreFactory(@Nullable @Property(name="oci.config.profile") @Nullable String profile, @Nullable @Property(name="oci.config.path") @Nullable String configPath) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
profile
- The configured profileconfigPath
- The configuration file path
-
OracleCloudCoreFactory
@Inject protected OracleCloudCoreFactory(@Nullable @Nullable OracleCloudConfigFileConfigurationProperties ociConfigFileConfiguration) - Parameters:
ociConfigFileConfiguration
- The OCI config file configuration properties
-
-
Method Details
-
configFileAuthenticationDetailsProvider
@Singleton @Requires(condition=OracleCloudConfigCondition.class) @Requires(missingProperty="oci.tenant-id") @Requires(missingProperty="oci.config.instance-principal") @Requires(missingProperty="oci.config.oke-workload-identity") @Requires(missingBeans=com.oracle.bmc.auth.SessionTokenAuthenticationDetailsProvider.class) @Requires(property="oci.config.enabled",notEquals="false",defaultValue="true") @Primary protected com.oracle.bmc.auth.ConfigFileAuthenticationDetailsProvider configFileAuthenticationDetailsProvider() throws IOExceptionConfigures aConfigFileAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present and a file is found at$USER_HOME/.oci/config
or specified by the user withoci.config.path
.- Returns:
- The
ConfigFileAuthenticationDetailsProvider
. - Throws:
IOException
- If an exception occurs reading configuration.- See Also:
-
ConfigFileAuthenticationDetailsProvider
-
simpleAuthenticationDetailsProvider
@Singleton @Requires(missingProperty="oci.config.instance-principal") @Requires(missingProperty="oci.config.oke-workload-identity") @Requires(missingBeans=com.oracle.bmc.auth.SessionTokenAuthenticationDetailsProvider.class) @Requires(property="oci.tenant-id") @Primary protected com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider simpleAuthenticationDetailsProvider(OracleCloudAuthConfigurationProperties config) Configures aSimpleAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present.- Parameters:
config
- The config to use- Returns:
- The
SimpleAuthenticationDetailsProvider
. - See Also:
-
SimpleAuthenticationDetailsProvider
-
resourcePrincipalAuthenticationDetailsProvider
@Singleton @Requires(missingProperty="oci.config.instance-principal") @Requires(missingProperty="oci.config.oke-workload-identity") @Requires(property="OCI_RESOURCE_PRINCIPAL_VERSION") @Primary protected com.oracle.bmc.auth.ResourcePrincipalAuthenticationDetailsProvider resourcePrincipalAuthenticationDetailsProvider()Configures aResourcePrincipalAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present and theOCI_RESOURCE_PRINCIPAL_VERSION
variable is available in the environment.- Returns:
- The
ResourcePrincipalAuthenticationDetailsProvider
. - See Also:
-
ResourcePrincipalAuthenticationDetailsProvider
-
instancePrincipalAuthenticationDetailsProvider
@Singleton @Requires(beans=InstancePrincipalConfiguration.class) @Primary protected com.oracle.bmc.auth.InstancePrincipalsAuthenticationDetailsProvider instancePrincipalAuthenticationDetailsProvider(InstancePrincipalConfiguration instancePrincipalConfiguration) Configures aInstancePrincipalsAuthenticationDetailsProvider
if no otherAuthenticationDetailsProvider
is present and the specified by the user withoci.config.use-instance-principal
.- Parameters:
instancePrincipalConfiguration
- The configuration- Returns:
- The
InstancePrincipalsAuthenticationDetailsProvider
. - See Also:
-
InstancePrincipalsAuthenticationDetailsProvider
-
configurationBuilder
@Singleton @Primary protected com.oracle.bmc.ClientConfiguration.ClientConfigurationBuilder configurationBuilder(OracleCloudClientConfigurationProperties props) Produces aClientConfiguration.ClientConfigurationBuilder
bean for the given properties.- Parameters:
props
- The props- Returns:
- The builder
-
tenantIdProvider
@Singleton @Primary @Context protected TenancyIdProvider tenantIdProvider(@Nullable @Nullable com.oracle.bmc.auth.BasicAuthenticationDetailsProvider authenticationDetailsProvider, @Nullable @Nullable OracleCloudMetadataConfiguration metadataConfiguration) Provides aTenancyIdProvider
bean.- Parameters:
authenticationDetailsProvider
- The authentication provider.metadataConfiguration
- The metadata configuration;- Returns:
- The tenancy id provider
-
clientConfiguration
@Singleton @Requires(missingBeans=com.oracle.bmc.ClientConfiguration.class) @Primary protected com.oracle.bmc.ClientConfiguration clientConfiguration(com.oracle.bmc.ClientConfiguration.ClientConfigurationBuilder builder) Configures the defaultClientConfiguration
if no other configuration is present.- Parameters:
builder
- The builder- Returns:
- The default client configuration.
-
sessionTokenAuthenticationDetailsProvider
@Singleton @Requires(condition=OracleCloudConfigCondition.class) @Requires(property="oci.config.session-token",notEquals="false",defaultValue="false") @Requires(property="oci.config.enabled",notEquals="false",defaultValue="true") @Primary protected com.oracle.bmc.auth.SessionTokenAuthenticationDetailsProvider sessionTokenAuthenticationDetailsProvider() throws IOExceptionConfigures aSessionTokenAuthenticationDetailsProvider
.- Returns:
- The
SessionTokenAuthenticationDetailsProvider
. - Throws:
IOException
- If an exception occurs reading configuration.
-
getProfile
- Returns:
- The configured profile.
-
getConfigPath
- Returns:
- The configured config path.
-
OracleCloudMetadataConfiguration
instead.