Class OracleCloudCoreFactory

java.lang.Object
io.micronaut.oraclecloud.core.OracleCloudCoreFactory

@Factory public class OracleCloudCoreFactory extends Object
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 Details

  • Constructor Details

  • 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 IOException
      Configures a ConfigFileAuthenticationDetailsProvider if no other AuthenticationDetailsProvider is present and a file is found at $USER_HOME/.oci/config or specified by the user with oci.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 a SimpleAuthenticationDetailsProvider if no other AuthenticationDetailsProvider 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 a ResourcePrincipalAuthenticationDetailsProvider if no other AuthenticationDetailsProvider is present and the OCI_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 a InstancePrincipalsAuthenticationDetailsProvider if no other AuthenticationDetailsProvider is present and the specified by the user with oci.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 a ClientConfiguration.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 a TenancyIdProvider 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 default ClientConfiguration 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 IOException
      Configures a SessionTokenAuthenticationDetailsProvider.
      Returns:
      The SessionTokenAuthenticationDetailsProvider.
      Throws:
      IOException - If an exception occurs reading configuration.
    • getProfile

      public Optional<String> getProfile()
      Returns:
      The configured profile.
    • getConfigPath

      public Optional<String> getConfigPath()
      Returns:
      The configured config path.