├── settings-build-logic ├── settings.gradle.kts ├── src │ └── main │ │ └── kotlin │ │ └── io.micronaut.build.internal.ocisdk.settings.gradle.kts └── build.gradle.kts ├── oraclecloud-logging ├── src │ ├── test │ │ ├── resources │ │ │ ├── application.yml │ │ │ └── logback.xml │ │ └── groovy │ │ │ └── io │ │ │ └── micronaut │ │ │ └── oraclecloud │ │ │ └── logging │ │ │ └── OracleCloudLoggingClientSpec.groovy │ └── main │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── logging │ │ └── package-info.java └── build.gradle ├── .github ├── workflows │ └── .rsync-filter ├── ISSUE_TEMPLATE │ ├── other.yaml │ ├── new_feature.yaml │ └── config.yml ├── renovate.json └── release.yml ├── docs-examples ├── example-java │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application-oraclecloud.yml │ │ │ │ └── logback.xml │ │ │ └── java │ │ │ │ └── example │ │ │ │ ├── Application.java │ │ │ │ ├── DatabaseOperations.java │ │ │ │ └── BucketOperations.java │ │ └── test │ │ │ └── java │ │ │ └── example │ │ │ └── mock │ │ │ ├── MockTenancyIdProvider.java │ │ │ ├── MockData.java │ │ │ └── MockAuthenticationDetailsProvider.java │ └── build.gradle ├── example-groovy │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application-oraclecloud.yml │ │ │ │ └── logback.xml │ │ │ └── groovy │ │ │ │ └── example │ │ │ │ ├── Application.groovy │ │ │ │ ├── DatabaseOperations.groovy │ │ │ │ └── BucketOperations.groovy │ │ └── test │ │ │ └── groovy │ │ │ └── example │ │ │ ├── BucketClient.groovy │ │ │ ├── mock │ │ │ ├── MockTenancyIdProvider.groovy │ │ │ ├── MockData.groovy │ │ │ └── MockAuthenticationDetailsProvider.groovy │ │ │ └── BucketControllerSpec.groovy │ └── build.gradle ├── example-kotlin │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ ├── application-oraclecloud.yml │ │ │ │ └── logback.xml │ │ │ └── kotlin │ │ │ │ └── example │ │ │ │ ├── Application.kt │ │ │ │ ├── DatabaseOperations.kt │ │ │ │ └── BucketOperations.kt │ │ └── test │ │ │ └── kotlin │ │ │ └── example │ │ │ └── mock │ │ │ ├── MockTenancyIdProvider.kt │ │ │ ├── MockData.kt │ │ │ └── MockAuthenticationDetailsProvider.kt │ └── build.gradle ├── example-http-function-groovy │ ├── func.yml │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── simplelogger.properties │ │ │ └── groovy │ │ │ │ └── example │ │ │ │ └── Book.groovy │ │ └── test │ │ │ ├── resources │ │ │ └── logback.xml │ │ │ └── groovy │ │ │ └── example │ │ │ └── mock │ │ │ ├── MockTenancyIdProvider.groovy │ │ │ ├── MockData.groovy │ │ │ └── MockAuthenticationDetailsProvider.groovy │ └── build.gradle ├── example-http-function-java │ ├── func.yml │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── simplelogger.properties │ │ │ └── java │ │ │ │ └── example │ │ │ │ └── Book.java │ │ └── test │ │ │ ├── resources │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── example │ │ │ └── mock │ │ │ ├── MockTenancyIdProvider.java │ │ │ ├── MockData.java │ │ │ └── MockAuthenticationDetailsProvider.java │ └── build.gradle ├── example-http-function-kotlin │ ├── func.yml │ ├── src │ │ ├── main │ │ │ ├── resources │ │ │ │ └── simplelogger.properties │ │ │ └── kotlin │ │ │ │ └── example │ │ │ │ └── Book.kt │ │ └── test │ │ │ ├── resources │ │ │ └── logback.xml │ │ │ └── kotlin │ │ │ └── example │ │ │ └── mock │ │ │ ├── MockTenancyIdProvider.kt │ │ │ ├── MockData.kt │ │ │ └── MockAuthenticationDetailsProvider.kt │ └── build.gradle ├── example-function-groovy │ ├── README.md │ ├── build.gradle │ └── src │ │ └── test │ │ ├── resources │ │ └── logback.xml │ │ └── groovy │ │ └── example │ │ ├── mock │ │ ├── MockData.groovy │ │ ├── MockTenancyIdProvider.groovy │ │ ├── MockAuthenticationDetailsProvider.groovy │ │ └── MockObjectStorageClient.groovy │ │ └── ListBucketsFunctionSpec.groovy ├── example-function-java │ ├── README.md │ ├── build.gradle │ └── src │ │ └── test │ │ ├── java │ │ └── example │ │ │ ├── mock │ │ │ ├── MockData.java │ │ │ ├── MockTenancyIdProvider.java │ │ │ └── MockAuthenticationDetailsProvider.java │ │ │ └── ListBucketsFunctionTest.java │ │ └── resources │ │ └── logback.xml └── example-function-kotlin │ ├── README.md │ ├── build.gradle │ └── src │ └── test │ ├── kotlin │ └── example │ │ ├── mock │ │ ├── MockData.kt │ │ ├── MockTenancyIdProvider.kt │ │ ├── MockAuthenticationDetailsProvider.kt │ │ └── MockObjectStorageClient.kt │ │ └── ListBucketsFunctionTest.kt │ └── resources │ └── logback.xml ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── oraclecloud-sdk-processor ├── src │ └── main │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── javax.annotation.processing.Processor └── build.gradle ├── oraclecloud-httpclient-netty └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ ├── services │ │ │ └── com.oracle.bmc.http.client.HttpProvider │ │ │ └── native-image │ │ │ └── io.micronaut.oci │ │ │ └── micronaut-oraclecloud-httpclient-netty │ │ │ └── resource-config.json │ └── java │ │ ├── com │ │ └── oracle │ │ │ └── bmc │ │ │ └── graalvm │ │ │ ├── HK2UtilsReplacements.java │ │ │ ├── ServiceFinderReplacement.java │ │ │ ├── DescriptorImplReplacements.java │ │ │ └── SystemDescriptorReplacements.java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ ├── httpclient │ │ └── netty │ │ │ └── DiscardingHandler.java │ │ └── serde │ │ └── OciSerdeConfiguration.java │ └── test │ ├── resources │ └── logback.xml │ ├── groovy │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ ├── serde │ │ ├── NoJacksonOnClasspath.groovy │ │ ├── EnumSerdeSpec.groovy │ │ ├── AuthSerdeSpec.groovy │ │ ├── model │ │ │ └── TestStateEnum.java │ │ └── ErrorResponseSerdeSpec.groovy │ │ └── httpclient │ │ └── netty │ │ └── NettyClientSetupSpec.groovy │ └── java │ └── io │ └── micronaut │ └── oraclecloud │ └── httpclient │ └── netty │ ├── MockData.java │ ├── MockTenancyIdProvider.java │ ├── DemoBootstrapBeanTest.java │ ├── FirstTestNettyClientFilter.java │ ├── SecondTestNettyClientFilter.java │ ├── LegacyNettyManagedTest.java │ ├── NettyManagedTest.java │ └── DemoBootstrapBean.java ├── oraclecloud-serde-processor ├── src │ ├── main │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── io.micronaut.inject.visitor.TypeElementVisitor │ └── test │ │ ├── resources │ │ └── logback.xml │ │ └── groovy │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── httpclient │ │ └── netty │ │ └── visitor │ │ └── SdkImportVisitorSpec.groovy └── build.gradle ├── src └── main │ └── docs │ ├── resources │ └── img │ │ ├── api-gateway-menu.png │ │ ├── create-gateway.png │ │ ├── gateway-details.png │ │ ├── oci_logging_ocid.png │ │ ├── deployment-details.png │ │ ├── deployment-review.png │ │ ├── deployment-routes.png │ │ ├── deployment-creating.png │ │ ├── deployment-invocation.png │ │ ├── oci_certificate_ocid.png │ │ ├── oci_console_apm_admin.png │ │ ├── oci_console_apm_domains.png │ │ ├── oci_logging_custom_log.png │ │ ├── oci_logging_explore_log.png │ │ ├── create-deployment-button.png │ │ ├── deployment-details-basic.png │ │ ├── oci_console_span_details.png │ │ ├── oci_console_trace_explorer.png │ │ ├── oci_logging_create_log_group.png │ │ ├── oci_console_apm_domain_details.png │ │ ├── oci_console_create_apm_domain.png │ │ ├── oci_console_trace_explorer_traces.png │ │ ├── oci_logging_custom_log_create_step_1.png │ │ ├── oci_logging_custom_log_create_step_2.png │ │ ├── oci_console_create_apm_domain_details.png │ │ ├── oci_console_trace_explorer_choose_domain.png │ │ ├── oci_console_trace_explorer_choose_query.png │ │ └── oci_console_trace_explorer_trace_details.png │ └── guide │ ├── repository.adoc │ ├── releaseHistory.adoc │ ├── oracleCloudGuides.adoc │ ├── introduction.adoc │ ├── quickStart.adoc │ ├── breaks.adoc │ ├── toc.yml │ ├── cloudStorage.adoc │ └── reactive.adoc ├── oraclecloud-httpclient-apache-http-core └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ ├── services │ │ │ └── com.oracle.bmc.http.client.HttpProvider │ │ │ └── native-image │ │ │ └── io.micronaut.oci │ │ │ └── micronaut-oraclecloud-httpclient-netty │ │ │ └── resource-config.json │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── httpclient │ │ └── apache │ │ └── core │ │ └── ApacheCoreSerializer.java │ └── test │ └── java │ └── io │ └── micronaut │ └── oraclecloud │ └── httpclient │ └── apache │ └── core │ ├── UnmanagedSerdeNettyTest.java │ ├── UnmanagedJacksonNettyTest.java │ ├── ManagedSerdeNettyTest.java │ └── ManagedJacksonNettyTest.java ├── oraclecloud-serde-internal-processor ├── src │ ├── main │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── io.micronaut.inject.visitor.TypeElementVisitor │ └── test │ │ └── resources │ │ └── logback.xml └── build.gradle ├── oraclecloud-sdk └── src │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── native-image │ │ │ └── io.micronaut.oci │ │ │ └── micronaut-oci-sdk │ │ │ └── resource-config.json │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── clients │ │ └── SdkProcessorDummy.java │ └── test │ ├── resources │ └── logback.xml │ └── java │ └── io │ └── micronaut │ └── oraclecloud │ └── mock │ ├── MockData.java │ ├── MockTenancyIdProvider.java │ ├── MockAuthenticationDetailsProvider.java │ └── MockObjectStorageClient.java ├── test-suite-http-server-tck-oraclecloud-function-http ├── src │ └── test │ │ ├── resources │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── io.micronaut.http.tck.ServerUnderTestProvider │ │ └── logback.xml │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── http │ │ └── server │ │ └── tck │ │ └── oraclecloud │ │ └── function │ │ └── OracleCloudFunctionServerUnderTestProvider.java └── build.gradle.kts ├── oraclecloud-sdk-base ├── build.gradle └── src │ └── main │ └── java │ └── io │ └── micronaut │ └── oraclecloud │ └── clients │ └── SdkClients.java ├── oraclecloud-function-http-test └── build.gradle ├── oraclecloud-atp ├── src │ ├── main │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── native-image │ │ │ │ └── io.micronaut.oraclecloud │ │ │ │ └── micronaut-oraclecloud-atp │ │ │ │ ├── resource-config.json │ │ │ │ └── reflect-config.json │ │ └── java │ │ │ └── io │ │ │ └── micronaut │ │ │ └── oraclecloud │ │ │ └── atp │ │ │ └── wallet │ │ │ ├── package-info.java │ │ │ ├── WalletException.java │ │ │ ├── ZipArchive.java │ │ │ └── ZipArchives.java │ └── test │ │ └── resources │ │ └── logback.xml └── build.gradle.kts ├── test-suite-graal-logging ├── build.gradle └── src │ └── main │ └── resources │ └── logback.xml ├── oraclecloud-common ├── src │ ├── test │ │ ├── groovy │ │ │ └── io │ │ │ │ └── micronaut │ │ │ │ └── discovery │ │ │ │ └── cloud │ │ │ │ └── instanceNetworkMetadata.json │ │ ├── resources │ │ │ ├── logback.xml │ │ │ └── oci_api_key.pem │ │ └── java │ │ │ └── io │ │ │ └── micronaut │ │ │ └── oraclecloud │ │ │ └── core │ │ │ ├── OracleCloudCoreDefaultConfigTest.java │ │ │ ├── OracleCloudCustomConfigTest.java │ │ │ ├── RetryDefaultConfigTest.java │ │ │ ├── OracleCloudCustomAuthConfigTest.java │ │ │ └── OracleCloudCustomConfigPerClientTest.java │ └── main │ │ └── java │ │ └── io │ │ └── micronaut │ │ ├── discovery │ │ └── cloud │ │ │ └── oraclecloud │ │ │ └── package-info.java │ │ └── oraclecloud │ │ └── core │ │ ├── TenancyIdProvider.java │ │ ├── sdk │ │ └── SdkImport.java │ │ └── OracleCloudConverterRegistrar.java └── build.gradle ├── oraclecloud-function ├── src │ ├── main │ │ └── resources │ │ │ └── META-INF │ │ │ └── native-image │ │ │ └── io.micronaut.oraclecloud │ │ │ └── micronaut-oraclecloud-function │ │ │ └── native-image.properties │ └── test │ │ ├── resources │ │ └── logback.xml │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── function │ │ ├── mock │ │ ├── MockData.java │ │ └── MockTenancyIdProvider.java │ │ ├── ObjectStorageFunctionTest.java │ │ └── ObjectStorageFunction.java └── build.gradle ├── test-suite-http-client ├── src │ └── main │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── httpclient │ │ └── ExpectedRequestHandler.java └── build.gradle.kts ├── test-suite-java ├── src │ └── test │ │ ├── resources │ │ ├── META-INF │ │ │ └── native-image │ │ │ │ └── io.micronaut.oraclecloud │ │ │ │ └── test-suite-java │ │ │ │ └── reflect-config.json │ │ └── logback.xml │ │ └── java │ │ └── example │ │ └── VaultSerializationTest.java └── build.gradle ├── oraclecloud-certificates ├── src │ ├── test │ │ ├── resources │ │ │ └── logback.xml │ │ └── groovy │ │ │ └── io │ │ │ └── micronaut │ │ │ └── oraclecloud │ │ │ └── certificates │ │ │ ├── OracleCloudCertificateRefresherTaskSpec.groovy │ │ │ ├── ObjectStorageClientBuilderCustomizer.groovy │ │ │ └── CertificatesClientBuilderCustomizer.groovy │ └── main │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── certificates │ │ ├── package-info.java │ │ ├── ssl │ │ └── package-info.java │ │ ├── events │ │ └── package-info.java │ │ ├── services │ │ └── package-info.java │ │ └── background │ │ └── package-info.java └── build.gradle ├── oraclecloud-sdk-reactor └── src │ ├── test │ └── resources │ │ └── logback.xml │ └── main │ └── java │ └── io │ └── micronaut │ └── oraclecloud │ └── clients │ └── reactor │ └── SdkProcessorDummy.java ├── oraclecloud-sdk-rxjava2 └── src │ ├── test │ └── resources │ │ └── logback.xml │ └── main │ └── java │ └── io │ └── micronaut │ └── oraclecloud │ └── clients │ └── rxjava2 │ └── SdkProcessorDummy.java ├── test-suite-graal-function ├── src │ ├── test │ │ ├── resources │ │ │ └── logback.xml │ │ └── java │ │ │ └── example │ │ │ └── FunctionTest.java │ └── main │ │ └── java │ │ └── example │ │ └── Function.java └── build.gradle ├── oraclecloud-oke-kubernetes-client ├── src │ └── test │ │ └── resources │ │ └── logback.xml └── build.gradle ├── oraclecloud-oke-workload-identity ├── src │ ├── test │ │ ├── resources │ │ │ └── logback.xml │ │ └── java │ │ │ └── io │ │ │ └── micronaut │ │ │ └── oraclecloud │ │ │ └── oke │ │ │ └── workload │ │ │ └── identity │ │ │ └── MicronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilderTest.java │ └── main │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── oke │ │ └── workload │ │ └── identity │ │ └── OkeHttpClientConfiguration.java └── build.gradle ├── oraclecloud-vault ├── build.gradle └── src │ ├── test │ └── resources │ │ └── logback.xml │ └── main │ └── java │ └── io │ └── micronaut │ └── oraclecloud │ └── discovery │ └── vault │ └── package-info.java ├── oraclecloud-atp-ucp-test ├── build.gradle └── src │ └── test │ └── resources │ └── logback.xml ├── oraclecloud-atp-hikari-test ├── build.gradle └── src │ └── test │ └── resources │ └── logback.xml ├── config ├── checkstyle │ ├── suppressions.xml │ └── custom-suppressions.xml ├── HEADER └── spotless.license.java ├── oraclecloud-micrometer ├── src │ ├── test │ │ ├── resources │ │ │ └── logback.xml │ │ └── groovy │ │ │ └── io │ │ │ └── micronaut │ │ │ └── oraclecloud │ │ │ └── monitoring │ │ │ └── sdk │ │ │ ├── VaultRegionProviderMock.java │ │ │ └── MonitorRegionProviderSpec.groovy │ └── main │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── monitoring │ │ ├── primitives │ │ └── OracleCloudDatapointProducer.java │ │ └── micrometer │ │ └── MetricDataDetailsPartition.java └── build.gradle ├── setup.sh ├── .gitattributes ├── .editorconfig ├── .clineignore ├── oraclecloud-function-http ├── src │ └── test │ │ ├── groovy │ │ └── io │ │ │ └── micronaut │ │ │ └── oraclecloud │ │ │ └── function │ │ │ └── http │ │ │ ├── EnvController.java │ │ │ └── MockFnHttpServerSpec.groovy │ │ ├── resources │ │ └── logback.xml │ │ └── java │ │ └── io │ │ └── micronaut │ │ └── oraclecloud │ │ └── function │ │ └── http │ │ ├── Person.java │ │ └── ParameterBindingTest.java └── build.gradle ├── SECURITY.md ├── .gitignore ├── ISSUE_TEMPLATE.md ├── gradle.properties └── oraclecloud-bom └── build.gradle /settings-build-logic/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "settings-build-logic" 2 | -------------------------------------------------------------------------------- /settings-build-logic/src/main/kotlin/io.micronaut.build.internal.ocisdk.settings.gradle.kts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /oraclecloud-logging/src/test/resources/application.yml: -------------------------------------------------------------------------------- 1 | micronaut: 2 | application: 3 | name: testapp 4 | -------------------------------------------------------------------------------- /.github/workflows/.rsync-filter: -------------------------------------------------------------------------------- 1 | - files-sync.yml 2 | - test-files-sync.yml 3 | - update-gradle-wrapper.yml 4 | - .rsync-filter -------------------------------------------------------------------------------- /docs-examples/example-java/src/main/resources/application-oraclecloud.yml: -------------------------------------------------------------------------------- 1 | oci: 2 | config: 3 | instance-principal: 4 | enabled: true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/main/resources/application-oraclecloud.yml: -------------------------------------------------------------------------------- 1 | oci: 2 | config: 3 | instance-principal: 4 | enabled: true -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/main/resources/application-oraclecloud.yml: -------------------------------------------------------------------------------- 1 | oci: 2 | config: 3 | instance-principal: 4 | enabled: true -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/func.yml: -------------------------------------------------------------------------------- 1 | schema_version: 20180708 2 | name: example-java-http-native 3 | version: 0.0.52 4 | timeout: 120 5 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/func.yml: -------------------------------------------------------------------------------- 1 | schema_version: 20180708 2 | name: example-java-http-native 3 | version: 0.0.52 4 | timeout: 120 5 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/func.yml: -------------------------------------------------------------------------------- 1 | schema_version: 20180708 2 | name: example-java-http-native 3 | version: 0.0.52 4 | timeout: 120 5 | -------------------------------------------------------------------------------- /oraclecloud-sdk-processor/src/main/resources/META-INF/services/javax.annotation.processing.Processor: -------------------------------------------------------------------------------- 1 | io.micronaut.oraclecloud.clients.processor.OracleCloudSdkProcessor -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/resources/META-INF/services/com.oracle.bmc.http.client.HttpProvider: -------------------------------------------------------------------------------- 1 | io.micronaut.oraclecloud.httpclient.netty.NettyHttpProvider 2 | -------------------------------------------------------------------------------- /oraclecloud-serde-processor/src/main/resources/META-INF/services/io.micronaut.inject.visitor.TypeElementVisitor: -------------------------------------------------------------------------------- 1 | io.micronaut.oraclecloud.sdk.processor.SdkImportVisitor 2 | -------------------------------------------------------------------------------- /src/main/docs/resources/img/api-gateway-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/api-gateway-menu.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/create-gateway.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/create-gateway.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/gateway-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/gateway-details.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_logging_ocid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_logging_ocid.png -------------------------------------------------------------------------------- /src/main/docs/guide/repository.adoc: -------------------------------------------------------------------------------- 1 | You can find the source code of this project in this repository: 2 | 3 | https://github.com/{githubSlug}[https://github.com/{githubSlug}] 4 | -------------------------------------------------------------------------------- /src/main/docs/resources/img/deployment-details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/deployment-details.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/deployment-review.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/deployment-review.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/deployment-routes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/deployment-routes.png -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/README.md: -------------------------------------------------------------------------------- 1 | ## Deployment 2 | 3 | To build and deploy the function run: 4 | 5 | ``` 6 | $ gradle buildLayers 7 | $ fn deploy --app MY_APP 8 | ``` -------------------------------------------------------------------------------- /docs-examples/example-function-java/README.md: -------------------------------------------------------------------------------- 1 | ## Deployment 2 | 3 | To build and deploy the function run: 4 | 5 | ``` 6 | $ gradle buildLayers 7 | $ fn deploy --app MY_APP 8 | ``` -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/README.md: -------------------------------------------------------------------------------- 1 | ## Deployment 2 | 3 | To build and deploy the function run: 4 | 5 | ``` 6 | $ gradle buildLayers 7 | $ fn deploy --app MY_APP 8 | ``` -------------------------------------------------------------------------------- /src/main/docs/resources/img/deployment-creating.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/deployment-creating.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/deployment-invocation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/deployment-invocation.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_certificate_ocid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_certificate_ocid.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_apm_admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_apm_admin.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_apm_domains.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_apm_domains.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_logging_custom_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_logging_custom_log.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_logging_explore_log.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_logging_explore_log.png -------------------------------------------------------------------------------- /oraclecloud-httpclient-apache-http-core/src/main/resources/META-INF/services/com.oracle.bmc.http.client.HttpProvider: -------------------------------------------------------------------------------- 1 | io.micronaut.oraclecloud.httpclient.apache.core.ApacheCoreHttpProvider 2 | -------------------------------------------------------------------------------- /src/main/docs/resources/img/create-deployment-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/create-deployment-button.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/deployment-details-basic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/deployment-details-basic.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_span_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_span_details.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_trace_explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_trace_explorer.png -------------------------------------------------------------------------------- /oraclecloud-serde-internal-processor/src/main/resources/META-INF/services/io.micronaut.inject.visitor.TypeElementVisitor: -------------------------------------------------------------------------------- 1 | io.micronaut.oraclecloud.httpclient.netty.visitor.OciSdkModelSerdeVisitor 2 | -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_logging_create_log_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_logging_create_log_group.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_apm_domain_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_apm_domain_details.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_create_apm_domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_create_apm_domain.png -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-example-function' 3 | id 'io.micronaut.build.internal.oraclecloud-groovy-example' 4 | } 5 | -------------------------------------------------------------------------------- /docs-examples/example-function-java/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-example-function' 3 | id 'io.micronaut.build.internal.oraclecloud-java-example' 4 | } 5 | -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-example-function' 3 | id 'io.micronaut.build.internal.oraclecloud-kotlin-example' 4 | } 5 | -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_trace_explorer_traces.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_trace_explorer_traces.png -------------------------------------------------------------------------------- /oraclecloud-sdk/src/main/resources/META-INF/native-image/io.micronaut.oci/micronaut-oci-sdk/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources":[ 3 | {"pattern":"\\Qcom/oracle/bmc/sdk.properties\\E"} 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /src/main/docs/guide/releaseHistory.adoc: -------------------------------------------------------------------------------- 1 | For this project, you can find a list of releases (with release notes) here: 2 | 3 | https://github.com/{githubSlug}/releases[https://github.com/{githubSlug}/releases] 4 | -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_logging_custom_log_create_step_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_logging_custom_log_create_step_1.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_logging_custom_log_create_step_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_logging_custom_log_create_step_2.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_create_apm_domain_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_create_apm_domain_details.png -------------------------------------------------------------------------------- /src/main/docs/guide/oracleCloudGuides.adoc: -------------------------------------------------------------------------------- 1 | See the following list of guides to learn more about working with Oracle Cloud in the Micronaut Framework: 2 | 3 | https://guides.micronaut.io/latest/tag-oracle_cloud.html 4 | -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_trace_explorer_choose_domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_trace_explorer_choose_domain.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_trace_explorer_choose_query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_trace_explorer_choose_query.png -------------------------------------------------------------------------------- /src/main/docs/resources/img/oci_console_trace_explorer_trace_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/micronaut-projects/micronaut-oracle-cloud/HEAD/src/main/docs/resources/img/oci_console_trace_explorer_trace_details.png -------------------------------------------------------------------------------- /test-suite-http-server-tck-oraclecloud-function-http/src/test/resources/META-INF/services/io.micronaut.http.tck.ServerUnderTestProvider: -------------------------------------------------------------------------------- 1 | io.micronaut.http.server.tck.oraclecloud.function.OracleCloudFunctionServerUnderTestProvider 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other.yaml: -------------------------------------------------------------------------------- 1 | name: Other 2 | description: Something different 3 | body: 4 | - type: textarea 5 | attributes: 6 | label: Issue description 7 | validations: 8 | required: true 9 | 10 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/resources/META-INF/native-image/io.micronaut.oci/micronaut-oraclecloud-httpclient-netty/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources":[ 3 | {"pattern":"\\Qcom/oracle/bmc/sdk.properties\\E"} 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-apache-http-core/src/main/resources/META-INF/native-image/io.micronaut.oci/micronaut-oraclecloud-httpclient-netty/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "resources":[ 3 | {"pattern":"\\Qcom/oracle/bmc/sdk.properties\\E"} 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /oraclecloud-sdk-base/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | id("io.micronaut.build.internal.oraclecloud-bom") 4 | } 5 | 6 | spotlessJavaMiscCheck.enabled = false 7 | compileJava.options.fork = true 8 | -------------------------------------------------------------------------------- /settings-build-logic/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget 2 | 3 | plugins { 4 | `kotlin-dsl` 5 | } 6 | 7 | repositories { 8 | mavenCentral() 9 | } 10 | 11 | kotlin { 12 | compilerOptions { 13 | jvmTarget = JvmTarget.JVM_21 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /oraclecloud-function-http-test/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | compileOnly(projects.micronautOraclecloudFunctionHttp) 7 | implementation(libs.fn.testing.junit4) 8 | implementation(mn.micronaut.http.server) 9 | } 10 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/src/main/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | org.slf4j.simpleLogger.defaultLogLevel=info 2 | org.slf4j.simpleLogger.log.io.micronaut.oraclecloud.function.http=trace 3 | org.slf4j.simpleLogger.log.io.micronaut.servlet.http=debug 4 | #org.slf4j.simpleLogger.log.io.micronaut.web.router=trace -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/src/main/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | org.slf4j.simpleLogger.defaultLogLevel=info 2 | org.slf4j.simpleLogger.log.io.micronaut.oraclecloud.function.http=trace 3 | org.slf4j.simpleLogger.log.io.micronaut.servlet.http=debug 4 | #org.slf4j.simpleLogger.log.io.micronaut.web.router=trace -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/src/main/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | org.slf4j.simpleLogger.defaultLogLevel=info 2 | org.slf4j.simpleLogger.log.io.micronaut.oraclecloud.function.http=trace 3 | org.slf4j.simpleLogger.log.io.micronaut.servlet.http=debug 4 | #org.slf4j.simpleLogger.log.io.micronaut.web.router=trace -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-example-httpfunction' 3 | id 'io.micronaut.build.internal.oraclecloud-groovy-example' 4 | id 'com.gradleup.shadow' 5 | } 6 | 7 | dependencies { 8 | compileOnly(mnSerde.micronaut.serde.processor) 9 | } 10 | -------------------------------------------------------------------------------- /oraclecloud-atp/src/main/resources/META-INF/native-image/io.micronaut.oraclecloud/micronaut-oraclecloud-atp/resource-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "bundles":[{ 3 | "name":"oracle.security.pki.resources.OraclePKIMsg", 4 | "classNames":["oracle.security.pki.resources.OraclePKIMsg", "oracle.security.pki.resources.OraclePKIMsg_en"] 5 | }] 6 | } 7 | -------------------------------------------------------------------------------- /test-suite-graal-logging/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-native-tests' 3 | } 4 | 5 | dependencies { 6 | implementation(projects.micronautOraclecloudLogging) 7 | } 8 | 9 | application { 10 | mainClass.set("example.Application") 11 | } 12 | 13 | micronaut { 14 | runtime("netty") 15 | } 16 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-example-httpfunction' 3 | id 'io.micronaut.build.internal.oraclecloud-kotlin-example' 4 | } 5 | 6 | dependencies { 7 | annotationProcessor(mn.micronaut.graal) 8 | annotationProcessor(mnSerde.micronaut.serde.processor) 9 | } 10 | -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/src/test/kotlin/example/mock/MockData.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | object MockData { 4 | 5 | @JvmField 6 | val bucketNames: MutableList = ArrayList() 7 | 8 | @JvmField 9 | var namespace: String = "test-namespace" 10 | 11 | @JvmField 12 | var tenancyId: String = "test-tenancyId" 13 | } 14 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/groovy/io/micronaut/discovery/cloud/instanceNetworkMetadata.json: -------------------------------------------------------------------------------- 1 | [ { 2 | "vnicId" : "ocid1.vnic.oc1.phx.abyhqljrdpeodblmzaipwmdgusajz7a5rlbd7xp6k7s4nq74h3ozrg3svvhq", 3 | "privateIp" : "10.0.0.19", 4 | "vlanTag" : 2337, 5 | "macAddr" : "02:00:17:03:1C:BA", 6 | "virtualRouterIp" : "10.0.0.1", 7 | "subnetCidrBlock" : "10.0.0.0/24" 8 | } ] -------------------------------------------------------------------------------- /oraclecloud-sdk-processor/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.common' 3 | id 'io.micronaut.build.internal.oraclecloud-base' 4 | } 5 | 6 | dependencies { 7 | implementation(libs.javapoet) 8 | implementation(libs.oci.common) { 9 | transitive = false 10 | } 11 | implementation(mn.micronaut.inject.java) 12 | } 13 | -------------------------------------------------------------------------------- /oraclecloud-function/src/main/resources/META-INF/native-image/io.micronaut.oraclecloud/micronaut-oraclecloud-function/native-image.properties: -------------------------------------------------------------------------------- 1 | Args = --features=io.micronaut.oraclecloud.function.nativeimage.OciFunctionFeature \ 2 | --initialize-at-build-time=io.micronaut.core.reflect.ReflectionUtils \ 3 | --initialize-at-build-time=io.micronaut.core.reflect.ClassUtils 4 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-example-httpfunction' 3 | id 'io.micronaut.build.internal.oraclecloud-java-example' 4 | id 'com.gradleup.shadow' 5 | } 6 | 7 | dependencies { 8 | annotationProcessor(mn.micronaut.graal) 9 | annotationProcessor(mnSerde.micronaut.serde.processor) 10 | } 11 | -------------------------------------------------------------------------------- /test-suite-http-client/src/main/java/io/micronaut/oraclecloud/httpclient/ExpectedRequestHandler.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient; 2 | 3 | import io.netty.channel.ChannelHandlerContext; 4 | import io.netty.handler.codec.http.HttpRequest; 5 | 6 | public interface ExpectedRequestHandler { 7 | void handle(ChannelHandlerContext ctx, HttpRequest request) throws Exception; 8 | } 9 | -------------------------------------------------------------------------------- /docs-examples/example-function-java/src/test/java/example/mock/MockData.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class MockData { 7 | public static final List bucketNames = new ArrayList<>(); 8 | public static String namespace = "test-namespace"; 9 | public static String tenancyId = "test-tenancyId"; 10 | } 11 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/test/groovy/example/BucketClient.groovy: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import io.micronaut.http.client.annotation.Client 4 | import reactor.core.publisher.Mono 5 | 6 | @Client('/os') 7 | interface BucketClient extends BucketOperations { 8 | @Override 9 | Mono createBucket(String name) 10 | 11 | @Override 12 | Mono deleteBucket(String name) 13 | } 14 | -------------------------------------------------------------------------------- /test-suite-java/src/test/resources/META-INF/native-image/io.micronaut.oraclecloud/test-suite-java/reflect-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "javax.ws.rs.core.Context", 4 | "allDeclaredConstructors" : true, 5 | "allPublicConstructors" : true, 6 | "allDeclaredFields" : true, 7 | "allPublicFields" : true, 8 | "allDeclaredMethods" : true, 9 | "allPublicMethods" : true 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /oraclecloud-sdk/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test-suite-java/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-function/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-sdk-reactor/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-sdk-rxjava2/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-serde-processor/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test-suite-graal-function/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs-examples/example-function-java/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-oke-kubernetes-client/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-oke-workload-identity/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-serde-internal-processor/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/groovy/io/micronaut/oraclecloud/serde/NoJacksonOnClasspath.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.serde 2 | 3 | import spock.lang.Specification 4 | 5 | class NoJacksonOnClasspath extends Specification { 6 | def 'no jackson on classpath'() { 7 | when: 8 | Class.forName("com.fasterxml.jackson.databind.ObjectMapper") 9 | then: 10 | thrown ClassNotFoundException 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test-suite-http-server-tck-oraclecloud-function-http/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/docs/guide/introduction.adoc: -------------------------------------------------------------------------------- 1 | This module provides integration between Micronaut and the 2 | Oracle Cloud Infrastructure (OCI) SDK by allowing you to easily inject SDK clients into your Micronaut services and controllers. 3 | 4 | In addition to supporting the SDK's blocking clients, the module provides reactive clients that use RxJava to provide async alternatives to the blocking clients in the SDK (an improvement upon the SDK's 'out-of-the-box' async clients). 5 | -------------------------------------------------------------------------------- /oraclecloud-vault/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | api(mn.micronaut.discovery.core) 7 | api(mn.micronaut.inject) 8 | api(projects.micronautOraclecloudBmcSecrets) 9 | api(projects.micronautOraclecloudBmcVault) 10 | implementation(mn.reactor) 11 | implementation(mnDiscoveryClient.micronaut.discovery.client) 12 | testImplementation(mnTest.micronaut.test.spock) 13 | } 14 | -------------------------------------------------------------------------------- /oraclecloud-atp-ucp-test/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.common' 3 | id 'io.micronaut.build.internal.oraclecloud-base' 4 | } 5 | 6 | dependencies { 7 | annotationProcessor(mn.micronaut.inject.java) 8 | api(mn.micronaut.inject) 9 | testImplementation(mnSql.micronaut.jdbc.ucp) 10 | testImplementation(mnTest.micronaut.test.spock) 11 | testImplementation(projects.micronautOraclecloudAtp) 12 | testRuntimeOnly(mnSql.h2) 13 | } 14 | -------------------------------------------------------------------------------- /oraclecloud-atp-hikari-test/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.common' 3 | id 'io.micronaut.build.internal.oraclecloud-base' 4 | } 5 | 6 | dependencies { 7 | annotationProcessor(mn.micronaut.inject.java) 8 | api(mn.micronaut.inject) 9 | testImplementation(mnSql.micronaut.jdbc.hikari) 10 | testImplementation(mnTest.micronaut.test.spock) 11 | testImplementation(projects.micronautOraclecloudAtp) 12 | testRuntimeOnly(mnSql.h2) 13 | } 14 | -------------------------------------------------------------------------------- /oraclecloud-function/src/test/java/io/micronaut/oraclecloud/function/mock/MockData.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function.mock; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class MockData { 7 | public static final List bucketNames = new ArrayList<>(); 8 | public static String namespace = "test-namespace"; 9 | public static String tenancyId = "test-tenancyId"; 10 | public static String bucketLocation = "test-location"; 11 | } 12 | -------------------------------------------------------------------------------- /oraclecloud-atp-ucp-test/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /oraclecloud-atp/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs-examples/example-java/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /oraclecloud-vault/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /config/checkstyle/suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /oraclecloud-atp-hikari-test/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/resources/oci_api_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Iq55yeKhH5Bjk+UUr53 3 | 7WZnWAyZBGLNm8gI0F/4+wht1PDuWq/ovx5Y9OONc3bcyGphYhUgBhEE94XHthqb 4 | FQzF7zc9MKH1IK6B7rimZ/J0/0WRnW7PI+xuTHyKGBZ+jJq5hV9T5WMk1hxGCMWh 5 | zEBqxQKLjU3BEUHp7A2DRQOT52uhkFNTut7koAGIJGfQQdyDFhK2jdm8J9u+C1OF 6 | WXyCOTQjpaZaMJpDSdZWhGmSTfwvU/4564KIkKGBsW9MfML/HI2f+Lm9Fijycrhw 7 | Ls6ysZkbS7pocqLAwq2Ou3QeoHReuuMySGd6Q721RlvzGbRSx2dWG4WXbSL67iF/ 8 | EwIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/src/test/groovy/example/mock/MockData.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import groovy.transform.CompileStatic 4 | 5 | @CompileStatic 6 | class MockData { 7 | 8 | public static final List bucketNames = [] 9 | public static String namespace = 'test-namespace' 10 | public static String tenancyId = 'test-tenancyId' 11 | 12 | static void reset() { 13 | bucketNames.clear() 14 | namespace = 'test-namespace' 15 | tenancyId = 'test-tenancyId' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /oraclecloud-serde-internal-processor/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.common' 3 | id 'io.micronaut.build.internal.oraclecloud-base' 4 | } 5 | 6 | dependencies { 7 | // Transitive dependencies 8 | implementation(mn.micronaut.inject) 9 | implementation(mn.micronaut.inject.java) 10 | implementation(mnSerde.micronaut.serde.api) 11 | implementation(mnSerde.micronaut.serde.processor) 12 | 13 | testImplementation(libs.oci.common) 14 | testImplementation(mn.micronaut.inject.java.test) 15 | } 16 | -------------------------------------------------------------------------------- /oraclecloud-micrometer/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/test/groovy/example/mock/MockTenancyIdProvider.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import groovy.transform.CompileStatic 4 | import io.micronaut.context.annotation.Context 5 | import io.micronaut.context.annotation.Replaces 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider 7 | 8 | import jakarta.inject.Singleton 9 | 10 | @CompileStatic 11 | @Context 12 | @Singleton 13 | @Replaces(TenancyIdProvider) 14 | class MockTenancyIdProvider implements TenancyIdProvider { 15 | String tenancyId = MockData.tenancyId 16 | } 17 | -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Configuration $HOME/.oci" 4 | 5 | mkdir $HOME/.oci 6 | echo "[DEFAULT]" >> $HOME/.oci/config 7 | echo "user=${OCI_USER_ID}" >> $HOME/.oci/config 8 | echo "fingerprint=${OCI_FINGERPRINT}" >> $HOME/.oci/config 9 | echo "pass_phrase=${OCI_PASSPHRASE}" >> $HOME/.oci/config 10 | echo "region=${OCI_REGION}" >> $HOME/.oci/config 11 | echo "tenancy=${OCI_TENANT_ID}" >> $HOME/.oci/config 12 | echo "key_file=$HOME/.oci/key.pem" >> $HOME/.oci/config 13 | echo "${OCI_PRIVATE_KEY}" >> $HOME/.oci/key.pem 14 | chmod 400 $HOME/.oci/key.pem -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/src/test/groovy/example/mock/MockTenancyIdProvider.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import groovy.transform.CompileStatic 4 | import io.micronaut.context.annotation.Context 5 | import io.micronaut.context.annotation.Replaces 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider 7 | 8 | import jakarta.inject.Singleton 9 | 10 | @CompileStatic 11 | @Context 12 | @Singleton 13 | @Replaces(TenancyIdProvider) 14 | class MockTenancyIdProvider implements TenancyIdProvider { 15 | String tenancyId = MockData.tenancyId 16 | } 17 | -------------------------------------------------------------------------------- /oraclecloud-function/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | annotationProcessor(mn.micronaut.graal) 7 | api(libs.fn.api) 8 | api(mn.micronaut.function) 9 | api(projects.micronautOraclecloudCommon) 10 | compileOnly(libs.graal.svm) 11 | compileOnly(mn.micronaut.jackson.databind) 12 | testImplementation(libs.fn.testing.junit4) 13 | testImplementation(mnTest.micronaut.test.spock) 14 | testImplementation(projects.micronautOraclecloudBmcObjectstorage) 15 | } 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new_feature.yaml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Create a new feature request 3 | body: 4 | - type: markdown 5 | attributes: 6 | value: | 7 | Please describe the feature you want for Micronaut to implement, before that check if there is already an existing issue to add it. 8 | - type: textarea 9 | attributes: 10 | label: Feature description 11 | placeholder: Tell us what feature you would like for Micronaut to have and what problem is it going to solve 12 | validations: 13 | required: true 14 | 15 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/src/test/groovy/example/mock/MockTenancyIdProvider.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import groovy.transform.CompileStatic 4 | import io.micronaut.context.annotation.Context 5 | import io.micronaut.context.annotation.Replaces 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider 7 | 8 | import jakarta.inject.Singleton 9 | 10 | @CompileStatic 11 | @Context 12 | @Singleton 13 | @Replaces(TenancyIdProvider) 14 | class MockTenancyIdProvider implements TenancyIdProvider { 15 | String tenancyId = MockData.tenancyId 16 | } 17 | -------------------------------------------------------------------------------- /test-suite-graal-function/src/test/java/example/FunctionTest.java: -------------------------------------------------------------------------------- 1 | package example; 2 | 3 | import io.micronaut.context.ApplicationContext; 4 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 5 | import jakarta.inject.Inject; 6 | import org.junit.jupiter.api.Assertions; 7 | import org.junit.jupiter.api.Test; 8 | 9 | @MicronautTest 10 | public class FunctionTest { 11 | 12 | @Inject 13 | ApplicationContext context; 14 | 15 | @Test 16 | void testFunction() { 17 | Assertions.assertTrue(context.isRunning()); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /oraclecloud-sdk/src/test/java/io/micronaut/oraclecloud/mock/MockData.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.mock; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class MockData { 7 | 8 | public static final List bucketNames = new ArrayList<>(); 9 | public static String namespace = "test-namespace"; 10 | public static String tenancyId = "test-tenancyId"; 11 | 12 | public static void reset() { 13 | bucketNames.clear(); 14 | namespace = "test-namespace"; 15 | tenancyId = "test-tenancyId"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/test/kotlin/example/mock/MockTenancyIdProvider.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import io.micronaut.context.annotation.Context 4 | import io.micronaut.context.annotation.Replaces 5 | import io.micronaut.core.annotation.Nullable 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider 7 | import jakarta.inject.Singleton 8 | 9 | @Context 10 | @Singleton 11 | @Replaces(TenancyIdProvider::class) 12 | class MockTenancyIdProvider : TenancyIdProvider { 13 | override fun getTenancyId(): @Nullable String { 14 | return MockData.tenancyId 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | *.java text eol=lf 5 | *.groovy text eol=lf 6 | *.html text eol=lf 7 | *.kt text eol=lf 8 | *.kts text eol=lf 9 | *.md text diff=markdown eol=lf 10 | *.py text diff=python executable 11 | *.pl text diff=perl executable 12 | *.pm text diff=perl 13 | *.css text diff=css eol=lf 14 | *.js text eol=lf 15 | *.sql text eol=lf 16 | *.q text eol=lf 17 | 18 | *.sh text eol=lf 19 | gradlew text eol=lf 20 | 21 | *.bat text eol=crlf 22 | *.cmd text eol=crlf 23 | -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/src/test/kotlin/example/mock/MockTenancyIdProvider.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import io.micronaut.context.annotation.Context 4 | import io.micronaut.context.annotation.Replaces 5 | import io.micronaut.core.annotation.Nullable 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider 7 | import jakarta.inject.Singleton 8 | 9 | @Context 10 | @Singleton 11 | @Replaces(TenancyIdProvider::class) 12 | class MockTenancyIdProvider : TenancyIdProvider { 13 | override fun getTenancyId(): @Nullable String { 14 | return MockData.tenancyId 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/src/test/kotlin/example/mock/MockTenancyIdProvider.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import io.micronaut.context.annotation.Context 4 | import io.micronaut.context.annotation.Replaces 5 | import io.micronaut.core.annotation.Nullable 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider 7 | import jakarta.inject.Singleton 8 | 9 | @Context 10 | @Singleton 11 | @Replaces(TenancyIdProvider::class) 12 | class MockTenancyIdProvider : TenancyIdProvider { 13 | override fun getTenancyId(): @Nullable String { 14 | return MockData.tenancyId 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/test/kotlin/example/mock/MockData.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | object MockData { 4 | @JvmField 5 | val bucketNames: MutableList = ArrayList() 6 | @JvmField 7 | var namespace: String = "test-namespace" 8 | @JvmField 9 | var tenancyId: String = "test-tenancyId" 10 | @JvmField 11 | var bucketLocation: String = "test-location" 12 | 13 | fun reset() { 14 | bucketNames.clear() 15 | namespace = "test-namespace" 16 | tenancyId = "test-tenancyId" 17 | bucketLocation = "test-location" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | charset = utf-8 7 | indent_style = space 8 | 9 | [{*.sh,gradlew}] 10 | end_of_line = lf 11 | 12 | [{*.bat,*.cmd}] 13 | end_of_line = crlf 14 | 15 | [{*.mustache,*.ftl}] 16 | insert_final_newline = false 17 | 18 | [*.java] 19 | indent_size = 4 20 | tab_width = 4 21 | max_line_length = 100 22 | # Import order can be configured with ij_java_imports_layout=... 23 | # See documentation https://youtrack.jetbrains.com/issue/IDEA-170643#focus=streamItem-27-3708697.0-0 24 | 25 | [*.xml] 26 | indent_size = 4 27 | -------------------------------------------------------------------------------- /config/HEADER: -------------------------------------------------------------------------------- 1 | Copyright ${year} original authors 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | https://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /oraclecloud-logging/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | api(mn.micronaut.inject) 7 | api(mnSerde.micronaut.serde.jackson) 8 | api(projects.micronautOraclecloudBmcLoggingingestion) 9 | implementation(mnLogging.logback.classic) 10 | implementation(libs.logback.json.classic) { 11 | exclude group: 'ch.qos.logback', module: 'logback-classic' 12 | } 13 | testImplementation(mn.micronaut.inject.groovy) 14 | testImplementation(mn.snakeyaml) 15 | testImplementation(mnTest.micronaut.test.spock) 16 | } 17 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/MockData.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class MockData { 7 | 8 | public static final List bucketNames = new ArrayList<>(); 9 | public static String namespace = "test-namespace"; 10 | public static String tenancyId = "test-tenancyId"; 11 | 12 | public static void reset() { 13 | bucketNames.clear(); 14 | namespace = "test-namespace"; 15 | tenancyId = "test-tenancyId"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Micronaut Core Discussions 3 | url: https://github.com/micronaut-projects/micronaut-core/discussions 4 | about: Ask questions about Micronaut on Github 5 | - name: Micronaut Data Discussions 6 | url: https://github.com/micronaut-projects/micronaut-data/discussions 7 | about: Ask Micronaut Data related questions on Github 8 | - name: Stack Overflow 9 | url: https://stackoverflow.com/tags/micronaut 10 | about: Ask questions on Stack Overflow 11 | - name: Chat 12 | url: https://gitter.im/micronautfw/ 13 | about: Chat with us on Gitter. -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/test/groovy/example/mock/MockData.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import groovy.transform.CompileStatic 4 | 5 | @CompileStatic 6 | class MockData { 7 | 8 | public static final List bucketNames = [] 9 | public static String namespace = 'test-namespace' 10 | public static String tenancyId = 'test-tenancyId' 11 | public static String bucketLocation = 'test-location' 12 | 13 | static void reset() { 14 | bucketNames.clear() 15 | namespace = 'test-namespace' 16 | tenancyId = 'test-tenancyId' 17 | bucketLocation = 'test-location' 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /docs-examples/example-java/src/test/java/example/mock/MockTenancyIdProvider.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import org.jspecify.annotations.Nullable; 4 | import io.micronaut.context.annotation.Context; 5 | import io.micronaut.context.annotation.Replaces; 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 7 | 8 | import jakarta.inject.Singleton; 9 | 10 | @Context 11 | @Singleton 12 | @Replaces(TenancyIdProvider.class) 13 | public class MockTenancyIdProvider implements TenancyIdProvider { 14 | 15 | @Nullable 16 | @Override 17 | public String getTenancyId() { 18 | return MockData.tenancyId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs-examples/example-function-java/src/test/java/example/mock/MockTenancyIdProvider.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import org.jspecify.annotations.Nullable; 4 | import io.micronaut.context.annotation.Context; 5 | import io.micronaut.context.annotation.Replaces; 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 7 | 8 | import jakarta.inject.Singleton; 9 | 10 | @Context 11 | @Singleton 12 | @Replaces(TenancyIdProvider.class) 13 | public class MockTenancyIdProvider implements TenancyIdProvider { 14 | 15 | @Nullable 16 | @Override 17 | public String getTenancyId() { 18 | return MockData.tenancyId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/docs/guide/quickStart.adoc: -------------------------------------------------------------------------------- 1 | To get started quickly, https://docs.cloud.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm[setup the Oracle Cloud CLI] making sure you have run `oci setup config` to configure local access to Oracle Cloud. 2 | 3 | Then add dependencies on the Micronaut Oracle Cloud modules corresponding to OCI SDK clients you wish to use, for example, Vault: 4 | 5 | dependency:io.micronaut.oraclecloud:micronaut-oraclecloud-bmc-vault[] 6 | 7 | Use Micronaut Injection to get an instance of the client in your application, e.g.: 8 | ```java 9 | @Inject 10 | Vault vault 11 | ``` 12 | 13 | All OCI SDK clients are supported. 14 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/src/test/java/example/mock/MockTenancyIdProvider.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import org.jspecify.annotations.Nullable; 4 | import io.micronaut.context.annotation.Context; 5 | import io.micronaut.context.annotation.Replaces; 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 7 | 8 | import jakarta.inject.Singleton; 9 | 10 | @Context 11 | @Singleton 12 | @Replaces(TenancyIdProvider.class) 13 | public class MockTenancyIdProvider implements TenancyIdProvider { 14 | 15 | @Nullable 16 | @Override 17 | public String getTenancyId() { 18 | return MockData.tenancyId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/groovy/io/micronaut/oraclecloud/httpclient/netty/NettyClientSetupSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty 2 | 3 | import com.oracle.bmc.http.client.HttpProvider 4 | import com.oracle.bmc.monitoring.MonitoringClient 5 | import io.micronaut.context.ApplicationContext 6 | import spock.lang.Specification 7 | 8 | class NettyClientSetupSpec extends Specification { 9 | def test() { 10 | given: 11 | def ctx = ApplicationContext.run() 12 | 13 | expect: 14 | ctx.getBean(MonitoringClient) 15 | HttpProvider.getDefault() instanceof NettyHttpProvider 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.clineignore: -------------------------------------------------------------------------------- 1 | # .clineignore - Cline AI ignore file for Micronaut projects 2 | # This file tells Cline which files/directories to ignore for code intelligence and automation 3 | 4 | # === Build outputs === 5 | build/ 6 | */build/ 7 | !build/docs/ 8 | !build/docs/** 9 | !build/generated/ 10 | !build/generated/** 11 | 12 | # === Dependency/Cache directories === 13 | .gradle/ 14 | */.gradle/ 15 | 16 | # === IDE/Editor/OS Metadata === 17 | .vscode/ 18 | .idea/ 19 | .DS_Store 20 | *.swp 21 | *.swo 22 | *.bak 23 | *.tmp 24 | *.orig 25 | 26 | # === Tool-specific/Config artifacts === 27 | *.log 28 | 29 | # === Gradle Wrappers/Binaries === 30 | gradlew 31 | gradlew.bat 32 | -------------------------------------------------------------------------------- /oraclecloud-sdk/src/test/java/io/micronaut/oraclecloud/mock/MockTenancyIdProvider.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.mock; 2 | 3 | import org.jspecify.annotations.Nullable; 4 | import io.micronaut.context.annotation.Context; 5 | import io.micronaut.context.annotation.Replaces; 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 7 | 8 | import jakarta.inject.Singleton; 9 | 10 | @Context 11 | @Singleton 12 | @Replaces(TenancyIdProvider.class) 13 | public class MockTenancyIdProvider implements TenancyIdProvider { 14 | 15 | @Nullable 16 | @Override 17 | public String getTenancyId() { 18 | return MockData.tenancyId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /config/checkstyle/custom-suppressions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs-examples/example-java/src/test/java/example/mock/MockData.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class MockData { 7 | 8 | public static final List bucketNames = new ArrayList<>(); 9 | public static String namespace = "test-namespace"; 10 | public static String tenancyId = "test-tenancyId"; 11 | public static String bucketLocation = "test-location"; 12 | 13 | public static void reset() { 14 | bucketNames.clear(); 15 | namespace = "test-namespace"; 16 | tenancyId = "test-tenancyId"; 17 | bucketLocation = "test-location"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /oraclecloud-function-http/src/test/groovy/io/micronaut/oraclecloud/function/http/EnvController.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function.http; 2 | 3 | import io.micronaut.context.env.Environment; 4 | import io.micronaut.http.annotation.Controller; 5 | import io.micronaut.http.annotation.Get; 6 | 7 | import java.util.Set; 8 | 9 | @Controller("/env") 10 | public class EnvController { 11 | private final Environment environment; 12 | 13 | public EnvController(Environment environment) { 14 | this.environment = environment; 15 | } 16 | 17 | @Get 18 | Set index() { 19 | return environment.getActiveNames(); 20 | } 21 | } 22 | 23 | -------------------------------------------------------------------------------- /config/spotless.license.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-$YEAR original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ -------------------------------------------------------------------------------- /oraclecloud-function/src/test/java/io/micronaut/oraclecloud/function/mock/MockTenancyIdProvider.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function.mock; 2 | 3 | import org.jspecify.annotations.Nullable; 4 | import io.micronaut.context.annotation.Context; 5 | import io.micronaut.context.annotation.Replaces; 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 7 | 8 | import jakarta.inject.Singleton; 9 | 10 | @Context 11 | @Singleton 12 | @Replaces(TenancyIdProvider.class) 13 | public class MockTenancyIdProvider implements TenancyIdProvider { 14 | 15 | @Nullable 16 | @Override 17 | public String getTenancyId() { 18 | return MockData.tenancyId; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /oraclecloud-function-http/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/MockTenancyIdProvider.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import io.micronaut.context.annotation.Context; 4 | import io.micronaut.context.annotation.Replaces; 5 | import org.jspecify.annotations.Nullable; 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 7 | import jakarta.inject.Singleton; 8 | 9 | @Context 10 | @Singleton 11 | @Replaces(TenancyIdProvider.class) 12 | public class MockTenancyIdProvider implements TenancyIdProvider { 13 | 14 | @Nullable 15 | @Override 16 | public String getTenancyId() { 17 | return MockData.tenancyId; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /oraclecloud-micrometer/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | api(mn.micronaut.inject) 7 | api(mn.micronaut.runtime) 8 | api(mnMicrometer.micrometer.core) 9 | api(mnMicrometer.micronaut.micrometer.core) 10 | api(projects.micronautOraclecloudBmcMonitoring) 11 | implementation(mn.micronaut.http.client) 12 | testImplementation(mn.micronaut.management) 13 | testImplementation(mnTest.micronaut.test.spock) 14 | testImplementation(projects.micronautOraclecloudHttpclientNetty) 15 | testImplementation(projects.micronautOraclecloudSdk) 16 | testRuntimeOnly(mn.micronaut.http.server.netty) 17 | } 18 | -------------------------------------------------------------------------------- /oraclecloud-function-http/src/test/java/io/micronaut/oraclecloud/function/http/Person.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function.http; 2 | 3 | import io.micronaut.core.annotation.Creator; 4 | import io.micronaut.serde.annotation.Serdeable; 5 | 6 | @Serdeable 7 | public class Person { 8 | 9 | private final String name; 10 | private int age = 18; 11 | 12 | public Person(String name) { 13 | this.name = name; 14 | } 15 | 16 | @Creator 17 | public Person(String name, int age) { 18 | this.name = name; 19 | this.age = age; 20 | } 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public int getAge() { 27 | return age; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/src/test/groovy/example/mock/MockData.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import groovy.transform.CompileStatic 4 | 5 | @CompileStatic 6 | class MockData { 7 | 8 | public static final List bucketNames = [] 9 | public static final List objectNames = [] 10 | public static String namespace = 'test-namespace' 11 | public static String tenancyId = 'test-tenancyId' 12 | public static String bucketLocation = 'test-location' 13 | 14 | static void reset() { 15 | bucketNames.clear() 16 | objectNames.clear() 17 | namespace = 'test-namespace' 18 | tenancyId = 'test-tenancyId' 19 | bucketLocation = 'test-location' 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /oraclecloud-certificates/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | api(projects.micronautOraclecloudBmcCertificates) 7 | compileOnly(mn.micronaut.http.client) 8 | implementation(mn.micronaut.http.server.netty) 9 | implementation(mn.micronaut.inject.java) 10 | implementation(mn.micronaut.retry) 11 | implementation(mnReactor.micronaut.reactor) 12 | testImplementation(mn.micronaut.http.client) 13 | testImplementation(mn.micronaut.inject.groovy) 14 | testImplementation(mnSecurity.micronaut.security) 15 | testImplementation(mnTest.micronaut.test.spock) 16 | testImplementation(projects.micronautOraclecloudBmcObjectstorage) 17 | } 18 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-apache-http-core/src/test/java/io/micronaut/oraclecloud/httpclient/apache/core/UnmanagedSerdeNettyTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.apache.core; 2 | 3 | import com.oracle.bmc.http.client.HttpProvider; 4 | import org.junit.jupiter.api.Disabled; 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class UnmanagedSerdeNettyTest extends ApacheNettyTest { 8 | @Override 9 | HttpProvider provider() { 10 | return new ApacheCoreHttpProvider(new SerdeSerializer(), null); 11 | } 12 | 13 | @Override 14 | @Disabled("Disabled in subclass") 15 | @Test 16 | public void fullSetupTestManagedCustomProperties() { 17 | // Test is for only managed clients 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-apache-http-core/src/test/java/io/micronaut/oraclecloud/httpclient/apache/core/UnmanagedJacksonNettyTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.apache.core; 2 | 3 | import com.oracle.bmc.http.client.HttpProvider; 4 | import org.junit.jupiter.api.Disabled; 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class UnmanagedJacksonNettyTest extends ApacheNettyTest { 8 | @Override 9 | HttpProvider provider() { 10 | return new ApacheCoreHttpProvider(new JacksonSerializer(), null); 11 | } 12 | 13 | @Override 14 | @Disabled("Disabled in subclass") 15 | @Test 16 | public void fullSetupTestManagedCustomProperties() { 17 | // Test is for only managed clients 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test-suite-graal-function/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-native-tests' 3 | } 4 | 5 | dependencies { 6 | annotationProcessor(mnSerde.micronaut.serde.processor) 7 | implementation(libs.fn.api) 8 | implementation(libs.fn.runtime) 9 | implementation(projects.micronautOraclecloudFunction) 10 | implementation(projects.micronautOraclecloudHttpclientNetty) 11 | } 12 | 13 | application { 14 | mainClass = "com.fnproject.fn.runtime.EntryPoint" 15 | } 16 | 17 | graalvmNative { 18 | binaries.configureEach { 19 | buildArgs.addAll( 20 | "-H:+StaticExecutableWithDynamicLibC", 21 | "-Dfn.handler=example.Function::handleRequest" 22 | ) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "config:recommended" 4 | ], 5 | "addLabels": [ 6 | "type: dependency-upgrade" 7 | ], 8 | "schedule": [ 9 | "after 10pm" 10 | ], 11 | "prHourlyLimit": 1, 12 | "prConcurrentLimit": 20, 13 | "timezone": "Europe/Prague", 14 | "packageRules": [ 15 | { 16 | "dependencyDashboardApproval": true, 17 | "matchUpdateTypes": [ 18 | "patch" 19 | ], 20 | "matchCurrentVersion": "!/^0/", 21 | "automerge": true, 22 | "matchPackageNames": [ 23 | "/actions.*/" 24 | ] 25 | }, 26 | { 27 | "matchUpdateTypes": [ 28 | "patch" 29 | ], 30 | "matchCurrentVersion": "!/^0/", 31 | "automerge": true 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-groovy-example' 3 | } 4 | 5 | dependencies { 6 | implementation(mn.micronaut.http.server.netty) 7 | implementation(mnReactor.micronaut.reactor) 8 | implementation(mnSerde.micronaut.serde.jackson) 9 | implementation(mnSerde.micronaut.serde.support) 10 | implementation(projects.micronautOraclecloudBmcDatabase) 11 | implementation(projects.micronautOraclecloudBmcObjectstorage) 12 | runtimeOnly(mn.snakeyaml) 13 | runtimeOnly(mnLogging.logback.classic) 14 | testImplementation(libs.commons.lang3) 15 | } 16 | 17 | application { 18 | mainClass = 'example.Application' 19 | } 20 | 21 | test { 22 | exclude '**/*Test$Intercepted*' 23 | } 24 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/src/test/kotlin/example/mock/MockData.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | object MockData { 4 | 5 | @JvmField 6 | val bucketNames: MutableList = ArrayList() 7 | 8 | @JvmField 9 | val objectNames: MutableList = ArrayList() 10 | 11 | @JvmField 12 | var namespace: String = "test-namespace" 13 | 14 | @JvmField 15 | var tenancyId: String = "test-tenancyId" 16 | 17 | @JvmField 18 | var bucketLocation: String = "test-location" 19 | 20 | @JvmStatic 21 | fun reset() { 22 | bucketNames.clear() 23 | objectNames.clear() 24 | namespace = "test-namespace" 25 | tenancyId = "test-tenancyId" 26 | bucketLocation = "test-location" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | We release patches for security vulnerabilities. Which versions are eligible 4 | receiving such patches depend on the CVSS v3.0 Rating: 5 | 6 | | CVSS v3.0 | Supported Versions | 7 | |-----------|-------------------------------------------| 8 | | 9.0-10.0 | Releases within the previous three months | 9 | | 4.0-8.9 | Most recent release | 10 | 11 | ## Reporting a Vulnerability 12 | 13 | Please responsibly disclose (suspected) security vulnerabilities to 14 | **[The Micronaut Foundation](foundation@micronaut.io)**. You will receive a response from 15 | us within 48 hours. If the issue is confirmed, we will release a patch as soon 16 | as possible depending on complexity but historically within a few days. 17 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/src/test/java/example/mock/MockData.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class MockData { 7 | 8 | public static final List bucketNames = new ArrayList<>(); 9 | public static final List objectNames = new ArrayList<>(); 10 | public static String namespace = "test-namespace"; 11 | public static String tenancyId = "test-tenancyId"; 12 | public static String bucketLocation = "test-location"; 13 | 14 | public static void reset() { 15 | bucketNames.clear(); 16 | objectNames.clear(); 17 | namespace = "test-namespace"; 18 | tenancyId = "test-tenancyId"; 19 | bucketLocation = "test-location"; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/docs/guide/breaks.adoc: -------------------------------------------------------------------------------- 1 | This section will document breaking changes that may happen during milestone or release candidate releases, as well as major releases eg (1.x.x → 2.x.x). 2 | 3 | == Micronaut Oracle Cloud 2.2.0 breaking changes 4 | 5 | In version 2.33.0, Oracle removed some dependencies from their Oracle Cloud SDK. 6 | If you relied on those dependencies being available but did not declare them in your build file explicitly, they may now be missing. 7 | The solution is to add those dependencies to your own build file. 8 | 9 | **In general, we do not recommend depending on transitive dependencies of the Oracle Cloud SDK, as future versions may remove further dependencies.** 10 | 11 | The affected dependencies for this release are `commons-codec`, `commons-io`, and `commons-logging`. 12 | -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/src/test/groovy/example/mock/MockAuthenticationDetailsProvider.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider 5 | import groovy.transform.CompileStatic 6 | import io.micronaut.context.annotation.Replaces 7 | 8 | import jakarta.inject.Singleton 9 | 10 | @CompileStatic 11 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 12 | @Singleton 13 | @Replaces(AuthenticationDetailsProvider) 14 | class MockAuthenticationDetailsProvider implements AuthenticationDetailsProvider { 15 | String keyId 16 | InputStream privateKey 17 | String passPhrase 18 | char[] passphraseCharacters 19 | String fingerprint 20 | String tenantId 21 | String userId 22 | } 23 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/src/test/groovy/example/mock/MockAuthenticationDetailsProvider.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider 5 | import groovy.transform.CompileStatic 6 | import io.micronaut.context.annotation.Replaces 7 | 8 | import jakarta.inject.Singleton 9 | 10 | @CompileStatic 11 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 12 | @Singleton 13 | @Replaces(AuthenticationDetailsProvider) 14 | class MockAuthenticationDetailsProvider implements AuthenticationDetailsProvider { 15 | String keyId 16 | InputStream privateKey 17 | String passPhrase 18 | char[] passphraseCharacters 19 | String fingerprint 20 | String tenantId 21 | String userId 22 | } 23 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-kotlin-example' 3 | id 'io.micronaut.minimal.application' 4 | } 5 | 6 | dependencies { 7 | implementation(mn.micronaut.http.server.netty) 8 | implementation(mnReactor.micronaut.reactor) 9 | implementation(mnSerde.micronaut.serde.jackson) 10 | implementation(mnSerde.micronaut.serde.support) 11 | implementation(projects.micronautOraclecloudBmcDatabase) 12 | implementation(projects.micronautOraclecloudBmcObjectstorage) 13 | runtimeOnly(mn.snakeyaml) 14 | runtimeOnly(mnLogging.logback.classic) 15 | testImplementation(libs.commons.lang3) 16 | } 17 | 18 | application { 19 | mainClass = 'example.ApplicationKt' 20 | } 21 | 22 | test { 23 | exclude '**/*Test$Intercepted*' 24 | } 25 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/java/io/micronaut/oraclecloud/core/OracleCloudCoreDefaultConfigTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.core; 2 | 3 | import com.oracle.bmc.ClientConfiguration; 4 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | import static org.junit.jupiter.api.Assertions.assertNotNull; 9 | 10 | @MicronautTest 11 | public class OracleCloudCoreDefaultConfigTest { 12 | 13 | /* 14 | * This tests that the default configurations can be setup. 15 | */ 16 | @Test 17 | void testDefaultConfig(ClientConfiguration clientConfiguration) { 18 | assertNotNull(clientConfiguration); 19 | assertEquals(60000, clientConfiguration.getReadTimeoutMillis()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /oraclecloud-oke-kubernetes-client/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | api(mnKubernetes.micronaut.kubernetes.client.openapi.common) 7 | api(projects.micronautOraclecloudCommon) 8 | implementation(mnValidation.validation) 9 | implementation(projects.micronautOraclecloudBmcContainerengine) 10 | testImplementation(mn.micronaut.context) 11 | testImplementation(mn.micronaut.http.server.netty) 12 | testImplementation(mn.micronaut.inject.groovy) 13 | testImplementation(mn.micronaut.inject.groovy.test) 14 | testImplementation(mn.micronaut.inject.java) 15 | testImplementation(mnKubernetes.micronaut.kubernetes.client.openapi) 16 | } 17 | 18 | micronautBuild { 19 | binaryCompatibility { 20 | enabled = false 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/java/io/micronaut/oraclecloud/core/OracleCloudCustomConfigTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.core; 2 | 3 | import com.oracle.bmc.ClientConfiguration; 4 | import io.micronaut.context.annotation.Property; 5 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import static org.junit.jupiter.api.Assertions.*; 9 | 10 | @MicronautTest 11 | @Property(name = "oci.client.read-timeout-millis", value = "25000") 12 | public class OracleCloudCustomConfigTest { 13 | 14 | @Test 15 | void testCustomConfig( 16 | ClientConfiguration clientConfiguration, 17 | OracleCloudCoreFactory factory) { 18 | assertNotNull(clientConfiguration); 19 | assertEquals(25000, clientConfiguration.getReadTimeoutMillis()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/src/test/groovy/example/ListBucketsFunctionSpec.groovy: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import com.fnproject.fn.testing.FnTestingRule 4 | import example.mock.MockData 5 | import spock.lang.Specification 6 | 7 | class ListBucketsFunctionSpec extends Specification { 8 | 9 | void 'test function'() { 10 | given: 11 | MockData.bucketNames << 'b1' << 'b2' 12 | 13 | FnTestingRule fn = FnTestingRule.createDefault() 14 | 15 | when: 'the function is invoked' 16 | fn.givenEvent().enqueue() 17 | fn.addSharedClass MockData 18 | fn.thenRun ListBucketsFunction, 'handleRequest' 19 | 20 | then: 'the expected result is returned' 21 | fn.onlyResult.bodyAsString == '["b1","b2"]' 22 | } 23 | 24 | void cleanup() { 25 | MockData.reset() 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /oraclecloud-logging/src/main/java/io/micronaut/oraclecloud/logging/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2022 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Logging classes for integration with Oracle Cloud. 18 | */ 19 | package io.micronaut.oraclecloud.logging; 20 | -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/src/test/kotlin/example/ListBucketsFunctionTest.kt: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import com.fnproject.fn.testing.FnTestingRule 4 | import example.mock.MockData 5 | import org.junit.jupiter.api.Assertions.assertEquals 6 | import org.junit.jupiter.api.Test 7 | 8 | class ListBucketsFunctionTest { 9 | 10 | var fn: FnTestingRule = FnTestingRule.createDefault() 11 | 12 | @Test 13 | fun testFunction() { 14 | MockData.bucketNames.clear() 15 | MockData.bucketNames.add("b1") 16 | MockData.bucketNames.add("b2") 17 | 18 | fn.givenEvent().enqueue() 19 | .addSharedClass(MockData::class.java) 20 | .thenRun(ListBucketsFunction::class.java, "handleRequest") 21 | 22 | val body = fn.onlyResult.bodyAsString 23 | assertEquals("[\"b1\",\"b2\"]", body) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/test/groovy/example/mock/MockAuthenticationDetailsProvider.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider 5 | import groovy.transform.CompileStatic 6 | import io.micronaut.context.annotation.Primary 7 | import io.micronaut.context.annotation.Replaces 8 | 9 | import jakarta.inject.Singleton 10 | 11 | @CompileStatic 12 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 13 | @Singleton 14 | @Replaces(AuthenticationDetailsProvider) 15 | @Primary 16 | class MockAuthenticationDetailsProvider implements AuthenticationDetailsProvider { 17 | String keyId 18 | InputStream privateKey 19 | String passPhrase 20 | char[] passphraseCharacters 21 | String fingerprint 22 | String tenantId 23 | String userId 24 | } 25 | -------------------------------------------------------------------------------- /src/main/docs/guide/toc.yml: -------------------------------------------------------------------------------- 1 | introduction: Introduction 2 | releaseHistory: Release History 3 | breaks: Breaking Changes 4 | quickStart: Quick Start 5 | authentication: Authentication 6 | modules: Available Modules 7 | httpclient: OCI SDK Netty HTTP Client 8 | reactive: Reactive Support 9 | functions: Oracle Functions (Serverless) 10 | httpFunctions: Oracle Functions HTTP (Serverless) 11 | autonomousDatabase: Oracle Autonomous Database 12 | micrometer: Micrometer Support For Oracle Monitoring 13 | tracing: OCI Application Performance Monitoring as a Tracing Endpoint 14 | logging: OCI Logging service 15 | vault: Secure Distributed Configuration with Oracle Cloud Vault 16 | cloudStorage: Oracle Cloud Storage Support 17 | certificates: OCI Certificate SSL Support 18 | okeKubernetesClient: OCI OKE Kubernetes Client 19 | oracleCloudGuides: Guides 20 | repository: Repository 21 | -------------------------------------------------------------------------------- /.github/release.yml: -------------------------------------------------------------------------------- 1 | changelog: 2 | exclude: 3 | authors: 4 | - micronaut-build 5 | categories: 6 | - title: Breaking Changes 🛠 7 | labels: 8 | - 'type: breaking' 9 | - title: New Features 🎉 10 | labels: 11 | - 'type: enhancement' 12 | - title: Bug Fixes 🐞 13 | labels: 14 | - 'type: bug' 15 | - title: Improvements ⭐ 16 | labels: 17 | - 'type: improvement' 18 | - title: Docs 📖 19 | labels: 20 | - 'type: docs' 21 | - title: Dependency updates 🚀 22 | labels: 23 | - 'type: dependency-upgrade' 24 | - 'dependency-upgrade' 25 | - title: Regressions 🧐 26 | labels: 27 | - 'type: regression' 28 | - title: GraalVM 🏆 29 | labels: 30 | - 'relates-to: graal' 31 | - title: Other Changes 💡 32 | labels: 33 | - "*" 34 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/java/com/oracle/bmc/graalvm/HK2UtilsReplacements.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2022 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.oracle.bmc.graalvm; 17 | 18 | final class HK2UtilsReplacements { 19 | // replaces oci sdk class that needs jersey 20 | } 21 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/DemoBootstrapBeanTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import io.micronaut.context.ApplicationContext; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import java.util.Map; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertTrue; 9 | 10 | class DemoBootstrapBeanTest { 11 | 12 | @Test 13 | void defaultHttpProviderDelegatesToManagedNetty() { 14 | try (ApplicationContext ctx = ApplicationContext.run(Map.of( 15 | "oci.netty.use-managed-provider-globally", "true" 16 | ))) { 17 | DemoBootstrapBean demo = ctx.getBean(DemoBootstrapBean.class); 18 | assertTrue(demo.usesManaged(), "Expected HttpProvider.getDefault() to delegate to ManagedNettyHttpProvider (non-default serializer)"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /oraclecloud-logging/src/test/groovy/io/micronaut/oraclecloud/logging/OracleCloudLoggingClientSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.logging 2 | 3 | import io.micronaut.context.ApplicationContext 4 | import io.micronaut.context.annotation.Property 5 | import io.micronaut.context.env.Environment 6 | import spock.lang.Specification 7 | 8 | @Property(name = "spec.name", value = "OracleCloudLoggingClientSpec") 9 | class OracleCloudLoggingClientSpec extends Specification { 10 | 11 | def "test it not loads when globally disabled"() { 12 | given: 13 | ApplicationContext context = ApplicationContext.run([ 14 | "oci.logging.enabled": "false", 15 | ], Environment.ORACLE_CLOUD) 16 | 17 | expect: 18 | !context.containsBean(OracleCloudLoggingClient) 19 | 20 | cleanup: 21 | context.close() 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-atp/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("io.micronaut.build.internal.oraclecloud-module") 3 | } 4 | 5 | dependencies { 6 | annotationProcessor(mnValidation.micronaut.validation.processor) 7 | api(mn.micronaut.inject) 8 | api(mnSql.ojdbc11) 9 | api(mnValidation.micronaut.validation) 10 | api(projects.micronautOraclecloudBmcDatabase) 11 | compileOnly(mnSql.micronaut.jdbc) 12 | compileOnly(mnSql.micronaut.jdbc.hikari) 13 | compileOnly(mnSql.micronaut.jdbc.ucp) 14 | implementation(libs.oracle.security.cert) 15 | implementation(libs.oracle.security.core) 16 | implementation(libs.oracle.security.oraclepki) 17 | implementation(libs.oracle.xml.xdb) 18 | implementation(platform("${libs.oracle.jdbc.bom.get()}:${mnSql.versions.ojdbc.get()}")) 19 | runtimeOnly(libs.slf4j.jcl) 20 | testImplementation(mnTest.junit.jupiter.params) 21 | } 22 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/java/com/oracle/bmc/graalvm/ServiceFinderReplacement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2022 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.oracle.bmc.graalvm; 17 | 18 | final class ServiceFinderReplacement { 19 | // replaces oci sdk class that needs jersey 20 | } 21 | -------------------------------------------------------------------------------- /oraclecloud-serde-processor/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.common' 3 | id 'io.micronaut.build.internal.oraclecloud-module' 4 | } 5 | 6 | dependencies { 7 | // Transitive dependencies 8 | implementation(mn.micronaut.inject) 9 | implementation(mn.micronaut.inject.java) 10 | implementation(mnSerde.micronaut.serde.api) 11 | implementation(mnSerde.micronaut.serde.processor) 12 | implementation(mnSourcegen.micronaut.sourcegen.annotations) 13 | implementation(mnSourcegen.micronaut.sourcegen.generator) 14 | 15 | testImplementation(libs.oci.objectstorage) 16 | testImplementation(mn.micronaut.inject.java.test) 17 | testImplementation(mnSourcegen.micronaut.sourcegen.generator.java) 18 | testImplementation(projects.micronautOraclecloudCommon) 19 | } 20 | 21 | micronautBuild { 22 | binaryCompatibility.enabled = false 23 | } 24 | -------------------------------------------------------------------------------- /docs-examples/example-function-java/src/test/java/example/ListBucketsFunctionTest.java: -------------------------------------------------------------------------------- 1 | package example; 2 | 3 | import com.fnproject.fn.testing.FnTestingRule; 4 | import example.mock.MockData; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | public class ListBucketsFunctionTest { 10 | 11 | FnTestingRule fn = FnTestingRule.createDefault(); 12 | 13 | @Test 14 | void testFunction() { 15 | 16 | MockData.bucketNames.clear(); 17 | MockData.bucketNames.add("b1"); 18 | MockData.bucketNames.add("b2"); 19 | 20 | fn.givenEvent().enqueue() 21 | .addSharedClass(MockData.class) 22 | .thenRun(ListBucketsFunction.class, "handleRequest"); 23 | 24 | String body = fn.getOnlyResult().getBodyAsString(); 25 | assertEquals("[\"b1\",\"b2\"]", body); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/java/com/oracle/bmc/graalvm/DescriptorImplReplacements.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2022 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.oracle.bmc.graalvm; 17 | 18 | final class DescriptorImplReplacements { 19 | // replaces oci sdk class that needs jersey 20 | } 21 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/java/com/oracle/bmc/graalvm/SystemDescriptorReplacements.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2022 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.oracle.bmc.graalvm; 17 | 18 | final class SystemDescriptorReplacements { 19 | // replaces oci sdk class that needs jersey 20 | } 21 | -------------------------------------------------------------------------------- /oraclecloud-micrometer/src/test/groovy/io/micronaut/oraclecloud/monitoring/sdk/VaultRegionProviderMock.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.monitoring.sdk; 2 | 3 | import com.oracle.bmc.Region; 4 | import com.oracle.bmc.auth.RegionProvider; 5 | import io.micronaut.context.annotation.BootstrapContextCompatible; 6 | import io.micronaut.context.annotation.Primary; 7 | import io.micronaut.context.annotation.Property; 8 | import io.micronaut.context.annotation.Replaces; 9 | import io.micronaut.context.annotation.Requires; 10 | import jakarta.inject.Singleton; 11 | 12 | @Replaces(RegionProvider.class) 13 | @BootstrapContextCompatible 14 | @Singleton 15 | @Requires(property = "spec.name", value = "MonitorRegionProviderSpec") 16 | public class VaultRegionProviderMock implements RegionProvider { 17 | @Override 18 | public Region getRegion() { 19 | return Region.EU_JOVANOVAC_1; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/test/groovy/io/micronaut/oraclecloud/certificates/OracleCloudCertificateRefresherTaskSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.certificates 2 | 3 | import io.micronaut.oraclecloud.certificates.background.OracleCloudCertificationRefresherTask 4 | import io.micronaut.oraclecloud.certificates.services.OracleCloudCertificateService 5 | import spock.lang.Specification 6 | 7 | class OracleCloudCertificateRefresherTaskSpec extends Specification { 8 | 9 | def "task refreshCertificate calls refreshCertificate on the service"() { 10 | given: 11 | def mockOracleCloudService = Mock(OracleCloudCertificateService) 12 | def task = new OracleCloudCertificationRefresherTask(mockOracleCloudService) 13 | 14 | when: 15 | task.backgroundRenewal() 16 | 17 | then: 18 | 1 * mockOracleCloudService.refreshCertificate() 19 | 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /oraclecloud-common/src/main/java/io/micronaut/discovery/cloud/oraclecloud/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Oracle cloud configuration. 18 | * 19 | * @author Todd Sharp 20 | * @since 1.2.0 21 | */ 22 | package io.micronaut.discovery.cloud.oraclecloud; 23 | 24 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/main/groovy/example/Application.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import io.micronaut.runtime.Micronaut 19 | 20 | class Application { 21 | 22 | static void main(String... args) { 23 | Micronaut.run(args) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/main/java/io/micronaut/oraclecloud/certificates/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Integration with Oracle Cloud Certificates service. 18 | * @author Nemanja Mikic 19 | * @since 3.0.0 20 | */ 21 | package io.micronaut.oraclecloud.certificates; 22 | -------------------------------------------------------------------------------- /docs-examples/example-java/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-java-example' 3 | id 'io.micronaut.build.internal.oraclecloud-native-tests' 4 | id 'io.micronaut.application' 5 | } 6 | 7 | dependencies { 8 | implementation(mn.micronaut.http.server.netty) 9 | implementation(mnReactor.micronaut.reactor) 10 | implementation(mnSerde.micronaut.serde.jackson) 11 | implementation(mnSerde.micronaut.serde.support) 12 | implementation(projects.micronautOraclecloudBmcDatabase) 13 | implementation(projects.micronautOraclecloudBmcObjectstorage) 14 | runtimeOnly(mn.snakeyaml) 15 | runtimeOnly(mnLogging.logback.classic) 16 | testImplementation(libs.commons.lang3) 17 | } 18 | 19 | application { 20 | mainClass = 'example.Application' 21 | } 22 | 23 | micronaut { 24 | enableNativeImage false 25 | } 26 | 27 | test { 28 | exclude '**/*Test$Intercepted*' 29 | } 30 | -------------------------------------------------------------------------------- /docs-examples/example-java/src/main/java/example/Application.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example; 17 | 18 | import io.micronaut.runtime.Micronaut; 19 | 20 | public class Application { 21 | 22 | public static void main(String... args) { 23 | Micronaut.run(args); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/docs/guide/cloudStorage.adoc: -------------------------------------------------------------------------------- 1 | Micronaut provides a high-level, uniform object storage API that works across the major cloud providers: https://micronaut-projects.github.io/micronaut-object-storage/latest/guide/[Micronaut Object Storage]. 2 | 3 | To get started, select the `object-storage-oracle-cloud` feature in https://micronaut.io/launch?features=object-storage-oracle-cloud[Micronaut Launch], or add the following dependency: 4 | 5 | dependency:io.micronaut.objectstorage:micronaut-object-storage-oracle-cloud[] 6 | 7 | For more information, see the https://micronaut-projects.github.io/micronaut-object-storage/latest/guide/#oracleCloud[Micronaut Object Storage Oracle Cloud support] documentation. 8 | 9 | TIP: See the guide for https://guides.micronaut.io/latest/micronaut-object-storage-oracle-cloud.html[Use the Micronaut Object Storage API to Store Files in Oracle Cloud Infrastructure (OCI) Object Storage] to learn more. 10 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/main/java/io/micronaut/oraclecloud/certificates/ssl/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Events used by Oracle Cloud Certificate tasks. 18 | * 19 | * @author Nemanja Mikic 20 | * @since 3.0.0 21 | */ 22 | package io.micronaut.oraclecloud.certificates.ssl; 23 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/main/java/io/micronaut/oraclecloud/certificates/events/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Events used by Oracle Cloud Certificate tasks. 18 | * 19 | * @author Nemanja Mikic 20 | * @since 3.0.0 21 | */ 22 | package io.micronaut.oraclecloud.certificates.events; 23 | -------------------------------------------------------------------------------- /oraclecloud-sdk/src/main/java/io/micronaut/oraclecloud/clients/SdkProcessorDummy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.clients; 17 | 18 | import io.micronaut.core.annotation.Internal; 19 | 20 | @Internal 21 | @SdkClients(SdkClients.Kind.ASYNC) 22 | final class SdkProcessorDummy { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/main/kotlin/example/Application.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import io.micronaut.runtime.Micronaut.build 19 | 20 | fun main(args: Array) { 21 | build() 22 | .args(*args) 23 | .packages("example") 24 | .start() 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/main/java/io/micronaut/oraclecloud/certificates/services/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Service classes used to integrate with Oracle Cloud Certificates. 18 | * 19 | * @author Nemanja Mikic 20 | * @since 3.0.0 21 | */ 22 | package io.micronaut.oraclecloud.certificates.services; 23 | -------------------------------------------------------------------------------- /oraclecloud-atp/src/main/java/io/micronaut/oraclecloud/atp/wallet/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * All classes in this package are considered internal and should not be used publicly. 18 | */ 19 | @Internal 20 | package io.micronaut.oraclecloud.atp.wallet; 21 | 22 | import io.micronaut.core.annotation.Internal; 23 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/main/java/io/micronaut/oraclecloud/certificates/background/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Background jobs used to integrate with Oracle Cloud Certificates. 18 | * 19 | * @author Nemanja Mikic 20 | * @since 3.0.0 21 | */ 22 | package io.micronaut.oraclecloud.certificates.background; 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | .DS_Store 3 | target/ 4 | .gradle/ 5 | .idea/ 6 | build/ 7 | !build-logic/src/main/java/io/micronaut/build 8 | !build-logic/src/main/kotlin/io/micronaut/build 9 | classes/ 10 | out/ 11 | *.db 12 | *.log 13 | *.iml 14 | .classpath 15 | .factorypath 16 | bin/ 17 | .settings/ 18 | .project 19 | */test/ 20 | */META-INF/ 21 | *.ipr 22 | *.iws 23 | .kotlintest 24 | */.kotlintest/ 25 | 26 | # ignore resources, are downloaded via a gradle task from micronaut_docs 27 | src/main/docs/resources/css/highlight/*.css 28 | src/main/docs/resources/css/highlight/*.png 29 | src/main/docs/resources/css/highlight/*.jpg 30 | src/main/docs/resources/css/*.css 31 | src/main/docs/resources/js/*.js 32 | src/main/docs/resources/style/*.html 33 | src/main/docs/resources/img/micronaut-logo-white.svg 34 | 35 | # Ignore files generated by test-resources 36 | **/.micronaut/test-resources/ 37 | 38 | # Ignore gradle.properties generated by micronaut-build 39 | /buildSrc/gradle.properties 40 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/test/groovy/io/micronaut/oraclecloud/certificates/ObjectStorageClientBuilderCustomizer.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.certificates 2 | 3 | import com.oracle.bmc.objectstorage.ObjectStorageClient 4 | import io.micronaut.context.event.BeanCreatedEvent 5 | import io.micronaut.context.event.BeanCreatedEventListener 6 | import io.micronaut.runtime.server.EmbeddedServer 7 | import jakarta.inject.Singleton 8 | 9 | @Singleton 10 | class ObjectStorageClientBuilderCustomizer implements BeanCreatedEventListener { 11 | 12 | private final String url 13 | 14 | ObjectStorageClientBuilderCustomizer(EmbeddedServer embeddedServer) { 15 | this.url = embeddedServer.getURL() 16 | } 17 | 18 | @Override 19 | ObjectStorageClient.Builder onCreated(BeanCreatedEvent event) { 20 | def builder = event.bean 21 | builder.endpoint(url) 22 | return builder 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /oraclecloud-oke-workload-identity/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | api(libs.oci.oke.workload.identity) 7 | api(projects.micronautOraclecloudCommon) 8 | implementation(mn.reactor) 9 | implementation(libs.oci.common) 10 | implementation(mn.micronaut.http.client) 11 | implementation(projects.micronautOraclecloudHttpclientNetty) 12 | testImplementation(mn.micronaut.context) 13 | testImplementation(mnTest.mockito.core) 14 | } 15 | 16 | test { 17 | environment "KUBERNETES_SERVICE_HOST", "http://localhost" 18 | } 19 | 20 | micronautBuild { 21 | binaryCompatibility { 22 | int dash = version.indexOf('-') 23 | String v = dash > 0 ? version.substring(0, dash) : version 24 | def (major, minor, patch) = v.split('[.]').collect { it.toInteger() } 25 | enabled = major > 3 || (major == 3 && minor > 1) || (major == 3 && minor == 1 && patch > 0) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /oraclecloud-certificates/src/test/groovy/io/micronaut/oraclecloud/certificates/CertificatesClientBuilderCustomizer.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.certificates 2 | 3 | import com.oracle.bmc.certificates.CertificatesClient 4 | import io.micronaut.context.annotation.Value 5 | import io.micronaut.context.event.BeanCreatedEvent 6 | import io.micronaut.context.event.BeanCreatedEventListener 7 | import io.micronaut.runtime.server.EmbeddedServer 8 | import jakarta.inject.Singleton 9 | 10 | @Singleton 11 | class CertificatesClientBuilderCustomizer implements BeanCreatedEventListener { 12 | 13 | private final String url 14 | 15 | CertificatesClientBuilderCustomizer(@Value('${test.client.url}') String url) { 16 | this.url = url 17 | } 18 | 19 | @Override 20 | CertificatesClient.Builder onCreated(BeanCreatedEvent event) { 21 | def builder = event.bean 22 | builder.endpoint(url) 23 | return builder 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-function-http/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | annotationProcessor(mn.micronaut.graal) 7 | api(mnServlet.micronaut.servlet.core) 8 | api(projects.micronautOraclecloudFunction) 9 | implementation(libs.fn.runtime) 10 | implementation(mn.micronaut.http.netty) 11 | implementation(mn.micronaut.http.server) 12 | implementation(mnReactor.micronaut.reactor) 13 | testAnnotationProcessor(mnSerde.micronaut.serde.processor) 14 | testImplementation(mn.micronaut.http.client) 15 | testImplementation(mnSerde.micronaut.serde.jackson) 16 | testImplementation(mnTest.micronaut.test.spock) 17 | testImplementation(projects.micronautOraclecloudFunctionHttpTest) 18 | testRuntimeOnly(mnLogging.logback.classic) 19 | } 20 | 21 | //compileTestGroovy.groovyOptions.forkOptions.jvmArgs = ['-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'] 22 | //compileTestGroovy.groovyOptions.fork = true 23 | -------------------------------------------------------------------------------- /test-suite-http-server-tck-oraclecloud-function-http/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("io.micronaut.build.internal.oraclecloud-tests") 3 | id("java-library") 4 | } 5 | 6 | dependencies { 7 | testAnnotationProcessor(platform(mn.micronaut.core.bom)) 8 | testImplementation(libs.fn.runtime) 9 | testImplementation(mn.micronaut.http.client) 10 | testImplementation(mn.micronaut.http.server.tck) 11 | testImplementation(mn.micronaut.inject.java) 12 | testImplementation(mn.micronaut.jackson.databind) 13 | testImplementation(mnTest.junit.platform.engine) 14 | testImplementation(mnTest.junit.platform.suite) 15 | testImplementation(platform(mn.micronaut.core.bom)) 16 | testImplementation(projects.micronautOraclecloudFunctionHttp) 17 | testImplementation(projects.micronautOraclecloudFunctionHttpTest) 18 | testRuntimeOnly(mnLogging.logback.classic) 19 | testRuntimeOnly(mnValidation.micronaut.validation) 20 | } 21 | 22 | tasks.named("test") { 23 | useJUnitPlatform() 24 | } 25 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/src/main/kotlin/example/Book.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import io.micronaut.serde.annotation.Serdeable 19 | import jakarta.validation.constraints.Min 20 | import jakarta.validation.constraints.NotBlank 21 | 22 | @Serdeable 23 | data class Book(@field:NotBlank val title: String, 24 | @field:Min(100) val pages: Int) 25 | -------------------------------------------------------------------------------- /oraclecloud-sdk-reactor/src/main/java/io/micronaut/oraclecloud/clients/reactor/SdkProcessorDummy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.clients.reactor; 17 | 18 | import io.micronaut.core.annotation.Internal; 19 | import io.micronaut.oraclecloud.clients.SdkClients; 20 | 21 | @Internal 22 | @SdkClients(SdkClients.Kind.REACTOR) 23 | final class SdkProcessorDummy { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-sdk-rxjava2/src/main/java/io/micronaut/oraclecloud/clients/rxjava2/SdkProcessorDummy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.clients.rxjava2; 17 | 18 | import io.micronaut.core.annotation.Internal; 19 | import io.micronaut.oraclecloud.clients.SdkClients; 20 | 21 | @Internal 22 | @SdkClients(SdkClients.Kind.RXJAVA2) 23 | final class SdkProcessorDummy { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-apache-http-core/src/test/java/io/micronaut/oraclecloud/httpclient/apache/core/ManagedSerdeNettyTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.apache.core; 2 | 3 | import com.oracle.bmc.http.client.HttpProvider; 4 | import io.micronaut.context.ApplicationContext; 5 | import org.junit.jupiter.api.AfterEach; 6 | import org.junit.jupiter.api.Assertions; 7 | import org.junit.jupiter.api.BeforeEach; 8 | 9 | import java.util.Map; 10 | 11 | public class ManagedSerdeNettyTest extends ApacheNettyTest { 12 | ApplicationContext ctx; 13 | 14 | @BeforeEach 15 | public void setUp() { 16 | ctx = ApplicationContext.run(Map.of("spec.name", "ManagedSerdeNettyTest")); 17 | Assertions.assertInstanceOf(SerdeSerializer.class, ctx.getBean(ApacheCoreSerializer.class)); 18 | } 19 | 20 | @AfterEach 21 | public void tearDown() { 22 | ctx.close(); 23 | } 24 | 25 | @Override 26 | HttpProvider provider() { 27 | return ctx.getBean(ApacheCoreHttpProvider.class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-apache-http-core/src/test/java/io/micronaut/oraclecloud/httpclient/apache/core/ManagedJacksonNettyTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.apache.core; 2 | 3 | import com.oracle.bmc.http.client.HttpProvider; 4 | import io.micronaut.context.ApplicationContext; 5 | import org.junit.jupiter.api.AfterEach; 6 | import org.junit.jupiter.api.Assertions; 7 | import org.junit.jupiter.api.BeforeEach; 8 | 9 | import java.util.Map; 10 | 11 | public class ManagedJacksonNettyTest extends ApacheNettyTest { 12 | ApplicationContext ctx; 13 | 14 | @BeforeEach 15 | public void setUp() { 16 | ctx = ApplicationContext.run(Map.of("spec.name", "ManagedJacksonNettyTest")); 17 | Assertions.assertInstanceOf(JacksonSerializer.class, ctx.getBean(ApacheCoreSerializer.class)); 18 | } 19 | 20 | @AfterEach 21 | public void tearDown() { 22 | ctx.close(); 23 | } 24 | 25 | @Override 26 | HttpProvider provider() { 27 | return ctx.getBean(ApacheCoreHttpProvider.class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/groovy/io/micronaut/oraclecloud/serde/EnumSerdeSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.serde 2 | 3 | 4 | import io.micronaut.oraclecloud.serde.model.TestStateEnum 5 | 6 | class EnumSerdeSpec extends SerdeSpecBase { 7 | 8 | void "test enum serialization"() { 9 | expect: 10 | serialize(TestStateEnum.Active) == '"active"' 11 | serialize(TestStateEnum.Inactive) == '"inactive"' 12 | serialize(TestStateEnum.Deleted) == '"deleted"' 13 | serialize(TestStateEnum.UnknownEnumValue) == 'null' 14 | } 15 | 16 | void "test enum deserialization"() { 17 | expect: 18 | deserialize('"active"', TestStateEnum) == TestStateEnum.Active 19 | deserialize('"inactive"', TestStateEnum) == TestStateEnum.Inactive 20 | deserialize('"deleted"', TestStateEnum) == TestStateEnum.Deleted 21 | deserialize('null', TestStateEnum) == TestStateEnum.UnknownEnumValue 22 | deserialize('"unknown value"', TestStateEnum) == TestStateEnum.UnknownEnumValue 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-function/src/test/java/io/micronaut/oraclecloud/function/ObjectStorageFunctionTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function; 2 | 3 | import com.fnproject.fn.testing.FnTestingRule; 4 | import io.micronaut.oraclecloud.function.mock.MockData; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | public class ObjectStorageFunctionTest { 10 | 11 | @Test 12 | void testObjectStorageFunction() { 13 | 14 | MockData.bucketNames.clear(); 15 | MockData.bucketNames.add("b1"); 16 | MockData.bucketNames.add("b2"); 17 | 18 | FnTestingRule fn = FnTestingRule.createDefault(); 19 | fn.addSharedClassPrefix("org.slf4j."); 20 | fn.addSharedClassPrefix("com.sun."); 21 | fn.addSharedClass(MockData.class); 22 | 23 | fn.givenEvent().enqueue(); 24 | fn.thenRun(ObjectStorageFunction.class, "handleRequest"); 25 | 26 | String result = fn.getOnlyResult().getBodyAsString(); 27 | assertEquals("[b1, b2]", result); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test-suite-java/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-native-tests' 3 | } 4 | 5 | application { 6 | mainClass = "helloworld.Application" 7 | } 8 | 9 | // ensure Jackson databind is not on the classpath for tests 10 | configurations.configureEach { 11 | exclude(group: "com.fasterxml.jackson.core", module: "jackson-databind") 12 | } 13 | 14 | dependencies { 15 | implementation(mn.micronaut.context) 16 | implementation(mn.micronaut.management) 17 | implementation(mn.reactor) 18 | implementation(mnMicrometer.micrometer.core) 19 | implementation(mnMicrometer.micronaut.micrometer.core) 20 | implementation(mnSerde.micronaut.serde.jackson) 21 | implementation(mnSql.micronaut.jdbc.hikari) 22 | implementation(platform(libs.oci.bom)) 23 | implementation(projects.micronautOraclecloudAtp) 24 | implementation(projects.micronautOraclecloudMicrometer) 25 | implementation(projects.micronautOraclecloudSdk) 26 | implementation(projects.micronautOraclecloudVault) 27 | runtimeOnly(mnLogging.logback.classic) 28 | } 29 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/main/groovy/example/DatabaseOperations.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import io.micronaut.core.annotation.Nullable 19 | import io.micronaut.http.annotation.Get 20 | import io.micronaut.http.annotation.PathVariable 21 | import reactor.core.publisher.Mono 22 | 23 | interface DatabaseOperations { 24 | @Get('/list{/compartmentId}') 25 | Mono> listDatabases(@PathVariable @Nullable String compartmentId) 26 | } 27 | -------------------------------------------------------------------------------- /oraclecloud-atp/src/main/java/io/micronaut/oraclecloud/atp/wallet/WalletException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.atp.wallet; 17 | 18 | import java.io.IOException; 19 | 20 | public class WalletException extends IOException { 21 | 22 | private WalletException(final Throwable cause) { 23 | super(cause); 24 | } 25 | 26 | static WalletException of(final Throwable cause) { 27 | return new WalletException(cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/main/kotlin/example/DatabaseOperations.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import io.micronaut.core.annotation.Nullable 19 | import io.micronaut.http.annotation.Get 20 | import io.micronaut.http.annotation.PathVariable 21 | import org.reactivestreams.Publisher 22 | 23 | interface DatabaseOperations { 24 | @Get("/list{/compartmentId}") 25 | fun listDatabases(@PathVariable @Nullable compartmentId: String?): Publisher> 26 | } 27 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/FirstTestNettyClientFilter.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import com.oracle.bmc.http.client.HttpRequest; 4 | import com.oracle.bmc.http.client.HttpResponse; 5 | import jakarta.inject.Singleton; 6 | 7 | @Singleton 8 | public class FirstTestNettyClientFilter implements OciNettyClientFilter { 9 | 10 | private long startTime; 11 | 12 | private long endTime; 13 | 14 | @Override 15 | public Object beforeRequest(HttpRequest request) { 16 | startTime = System.nanoTime(); 17 | return new Object(); 18 | } 19 | 20 | @Override 21 | public HttpResponse afterResponse(HttpRequest request, HttpResponse response, Throwable throwable, Object ignored) { 22 | endTime = System.nanoTime(); 23 | return response; 24 | } 25 | 26 | public long getStartTime() { 27 | return startTime; 28 | } 29 | 30 | public long getEndTime() { 31 | return endTime; 32 | } 33 | 34 | @Override 35 | public int getOrder() { 36 | return 0; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/SecondTestNettyClientFilter.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import com.oracle.bmc.http.client.HttpRequest; 4 | import com.oracle.bmc.http.client.HttpResponse; 5 | import jakarta.inject.Singleton; 6 | 7 | @Singleton 8 | public class SecondTestNettyClientFilter implements OciNettyClientFilter { 9 | 10 | private long startTime; 11 | 12 | private long endTime; 13 | 14 | @Override 15 | public Object beforeRequest(HttpRequest request) { 16 | startTime = System.nanoTime(); 17 | return new Object(); 18 | } 19 | 20 | @Override 21 | public HttpResponse afterResponse(HttpRequest request, HttpResponse response, Throwable throwable, Object ignored) { 22 | endTime = System.nanoTime(); 23 | return response; 24 | } 25 | 26 | public long getStartTime() { 27 | return startTime; 28 | } 29 | 30 | public long getEndTime() { 31 | return endTime; 32 | } 33 | 34 | @Override 35 | public int getOrder() { 36 | return 1; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs-examples/example-java/src/main/java/example/DatabaseOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | import io.micronaut.http.annotation.Get; 20 | import io.micronaut.http.annotation.PathVariable; 21 | import org.reactivestreams.Publisher; 22 | 23 | import java.util.List; 24 | 25 | public interface DatabaseOperations { 26 | @Get("/list{/compartmentId}") 27 | Publisher> listDatabases(@PathVariable @Nullable String compartmentId); 28 | } 29 | -------------------------------------------------------------------------------- /oraclecloud-common/src/main/java/io/micronaut/oraclecloud/core/TenancyIdProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.core; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | /** 21 | * Interface that supplies the Tenant ID. 22 | * 23 | * @author graemerocher 24 | * @since 1.0.0 25 | */ 26 | @FunctionalInterface 27 | public interface TenancyIdProvider { 28 | /** 29 | * @return Returns the configured tenant id. 30 | */ 31 | @Nullable 32 | String getTenancyId(); 33 | } 34 | -------------------------------------------------------------------------------- /oraclecloud-atp/src/main/java/io/micronaut/oraclecloud/atp/wallet/ZipArchive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.atp.wallet; 17 | 18 | import java.io.ByteArrayInputStream; 19 | import java.util.zip.ZipInputStream; 20 | 21 | class ZipArchive { 22 | 23 | private byte[] bytes; 24 | 25 | ZipArchive(final byte[] bytes) { 26 | this.bytes = bytes; 27 | } 28 | 29 | ZipInputStream toZipInputStream() { 30 | return new ZipInputStream(new ByteArrayInputStream(bytes)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /oraclecloud-sdk/src/test/java/io/micronaut/oraclecloud/mock/MockAuthenticationDetailsProvider.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.mock; 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy; 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider; 5 | import com.oracle.bmc.auth.BasicAuthenticationDetailsProvider; 6 | import io.micronaut.context.annotation.Primary; 7 | import io.micronaut.context.annotation.Replaces; 8 | 9 | import jakarta.inject.Singleton; 10 | import java.io.InputStream; 11 | 12 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 13 | @Singleton 14 | @Replaces(AuthenticationDetailsProvider.class) 15 | @Primary 16 | public class MockAuthenticationDetailsProvider implements BasicAuthenticationDetailsProvider { 17 | 18 | @Override 19 | public String getKeyId() { 20 | return null; 21 | } 22 | 23 | @Override 24 | public InputStream getPrivateKey() { 25 | return null; 26 | } 27 | 28 | @Override 29 | public String getPassPhrase() { 30 | return null; 31 | } 32 | 33 | @Override 34 | public char[] getPassphraseCharacters() { 35 | return null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /oraclecloud-serde-processor/src/test/groovy/io/micronaut/oraclecloud/httpclient/netty/visitor/SdkImportVisitorSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty.visitor 2 | 3 | import io.micronaut.annotation.processing.test.AbstractTypeElementSpec 4 | import io.micronaut.inject.BeanDefinition 5 | import io.micronaut.serde.annotation.SerdeImport 6 | 7 | class SdkImportVisitorSpec extends AbstractTypeElementSpec { 8 | 9 | void "test generate OCI SDK factory"() { 10 | given: 11 | def definition = buildBeanDefinition("test.ObjectStorageClientFactory", """ 12 | package test; 13 | 14 | import com.oracle.bmc.objectstorage.ObjectStorageClient; 15 | import io.micronaut.oraclecloud.core.sdk.SdkImport; 16 | 17 | @SdkImport(ObjectStorageClient.class) 18 | class Test {} 19 | """) 20 | 21 | expect: 22 | definition != null 23 | definition.stringValue(SerdeImport, "packageName").get() == 'com.oracle.bmc.objectstorage.model' 24 | // check introspections are generated 25 | definition.beanType.classLoader.loadClass('test.$com_oracle_bmc_objectstorage_model_ReencryptObjectDetails$Introspection') 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thanks for reporting an issue, please review the task list below before submitting the 2 | issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed. 3 | 4 | NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (https://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions. 5 | 6 | ### Task List 7 | 8 | - [ ] Steps to reproduce provided 9 | - [ ] Stacktrace (if present) provided 10 | - [ ] Example that reproduces the problem uploaded to Github 11 | - [ ] Full description of the issue provided (see below) 12 | 13 | ### Steps to Reproduce 14 | 15 | 1. TODO 16 | 2. TODO 17 | 3. TODO 18 | 19 | ### Expected Behaviour 20 | 21 | Tell us what should happen 22 | 23 | ### Actual Behaviour 24 | 25 | Tell us what happens instead 26 | 27 | ### Environment Information 28 | 29 | - **Operating System**: TODO 30 | - **Micronaut Version:** TODO 31 | - **JDK Version:** TODO 32 | 33 | ### Example Application 34 | 35 | - TODO: link to github repository with example that reproduces the issue 36 | 37 | -------------------------------------------------------------------------------- /oraclecloud-function-http/src/test/groovy/io/micronaut/oraclecloud/function/http/MockFnHttpServerSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function.http 2 | 3 | import io.micronaut.core.type.Argument 4 | import io.micronaut.http.HttpRequest 5 | import io.micronaut.http.HttpStatus 6 | import io.micronaut.http.client.HttpClient 7 | import io.micronaut.http.client.annotation.Client 8 | import io.micronaut.test.extensions.spock.annotation.MicronautTest 9 | import reactor.core.publisher.Mono 10 | import spock.lang.Specification 11 | 12 | import jakarta.inject.Inject 13 | 14 | /** 15 | * @author Pavol Gressa 16 | * @since 2.3* 17 | */ 18 | @MicronautTest(environments = ["custom-env"]) 19 | class MockFnHttpServerSpec extends Specification { 20 | 21 | @Inject 22 | @Client("/env") 23 | HttpClient client 24 | 25 | void "test env forwarded"() { 26 | given: 27 | def response = Mono.from(client.exchange(HttpRequest.GET("/"), Argument.setOf(String))).block() 28 | 29 | expect: 30 | response.status == HttpStatus.OK 31 | 32 | ["function","oraclecloud", "custom-env"].stream().allMatch(it -> response.body().contains(it)) 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /oraclecloud-atp/src/main/resources/META-INF/native-image/io.micronaut.oraclecloud/micronaut-oraclecloud-atp/reflect-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "oracle.security.crypto.cert.ext.ExtKeyUsageExtension", 4 | "allDeclaredConstructors" : true, 5 | "allPublicConstructors" : true, 6 | "allDeclaredFields" : true, 7 | "allPublicFields" : true, 8 | "allDeclaredMethods" : true, 9 | "allPublicMethods" : true 10 | }, 11 | { 12 | "name":"oracle.security.pki.OracleSSOKeyStoreSpi", 13 | "methods":[{"name":"","parameterTypes":[] }] 14 | }, 15 | { 16 | "name":"oracle.security.pki.internal.cert.ext.AuthorityKeyIDExtension", 17 | "methods":[{"name":"","parameterTypes":[] }] 18 | }, 19 | { 20 | "name":"oracle.security.pki.internal.cert.ext.KeyUsageExtension", 21 | "methods":[{"name":"","parameterTypes":[] }] 22 | }, 23 | { 24 | "name":"oracle.security.pki.internal.cert.ext.BasicConstraintsExtension", 25 | "methods":[{"name":"","parameterTypes":[] }] 26 | }, 27 | { 28 | "name":"oracle.security.pki.internal.cert.ext.SubjectKeyIDExtension", 29 | "methods":[{"name":"","parameterTypes":[] }] 30 | } 31 | ] 32 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/groovy/io/micronaut/oraclecloud/serde/AuthSerdeSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.serde 2 | 3 | import com.oracle.bmc.auth.SessionTokenAuthenticationDetailsProvider 4 | 5 | class AuthSerdeSpec extends SerdeSpecBase { 6 | 7 | // We cannot change the session token authentication details provider's endpoint 8 | // so we just verify that we can serialize the needed beans. 9 | void "session token authentication request serialization test"() throws IOException { 10 | when: 11 | String request = serialize( 12 | new SessionTokenAuthenticationDetailsProvider.SessionTokenRefreshRequest.SessionTokenRequest("my-token")) 13 | 14 | then: 15 | "{\"currentToken\":\"my-token\"}" == request 16 | } 17 | 18 | void "session token authentication response deserialization test"() throws IOException { 19 | when: 20 | SessionTokenAuthenticationDetailsProvider.SessionToken response = 21 | deserialize("{\"token\":\"new-token\"}", SessionTokenAuthenticationDetailsProvider.SessionToken.class) 22 | 23 | then: 24 | "new-token" == response.getToken() 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/groovy/io/micronaut/oraclecloud/serde/model/TestStateEnum.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.serde.model; 2 | 3 | import com.fasterxml.jackson.annotation.JsonCreator; 4 | import com.fasterxml.jackson.annotation.JsonValue; 5 | import com.oracle.bmc.http.internal.BmcEnum; 6 | 7 | import java.util.Arrays; 8 | import java.util.Map; 9 | import java.util.function.Function; 10 | import java.util.stream.Collectors; 11 | 12 | public enum TestStateEnum implements BmcEnum { 13 | Active("active"), 14 | Inactive("inactive"), 15 | Deleted("deleted"), 16 | UnknownEnumValue(null); 17 | 18 | private String value; 19 | 20 | private static final Map valueMap = Arrays.stream(values()) 21 | .collect(Collectors.toMap(v -> v.getValue(), Function.identity())); 22 | 23 | TestStateEnum(String value) { 24 | this.value = value; 25 | } 26 | 27 | @Override 28 | @JsonValue 29 | public String getValue() { 30 | return value; 31 | } 32 | 33 | @JsonCreator 34 | public static TestStateEnum create(String value) { 35 | return valueMap.getOrDefault(value, UnknownEnumValue); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /oraclecloud-logging/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 10 | 11 | test-log-id 12 | name1 13 | name2 14 | 300 15 | 120 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/test/kotlin/example/mock/MockAuthenticationDetailsProvider.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider 5 | import io.micronaut.context.annotation.Primary 6 | import io.micronaut.context.annotation.Replaces 7 | import jakarta.inject.Singleton 8 | import java.io.InputStream 9 | 10 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 11 | @Singleton 12 | @Replaces(AuthenticationDetailsProvider::class) 13 | @Primary 14 | class MockAuthenticationDetailsProvider : AuthenticationDetailsProvider { 15 | override fun getKeyId(): String? { 16 | return null 17 | } 18 | 19 | override fun getPrivateKey(): InputStream? { 20 | return null 21 | } 22 | 23 | override fun getPassPhrase(): String? { 24 | return null 25 | } 26 | 27 | override fun getPassphraseCharacters(): CharArray? { 28 | return null 29 | } 30 | 31 | override fun getFingerprint(): String { 32 | return "" 33 | } 34 | 35 | override fun getTenantId(): String { 36 | return "" 37 | } 38 | 39 | override fun getUserId(): String { 40 | return "" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /oraclecloud-common/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'io.micronaut.build.internal.oraclecloud-module' 3 | } 4 | 5 | dependencies { 6 | api(libs.oci.common) { 7 | exclude group: 'org.javassist', module: 'javassist' 8 | exclude(group: "com.fasterxml.jackson.core", module: "jackson-databind") 9 | } 10 | api(mn.micronaut.inject) 11 | api(mn.micronaut.json.core) 12 | compileOnly("com.oracle.oci.sdk:oci-java-sdk-common:$gradle.ociVersion") 13 | compileOnly(libs.graal.svm) 14 | compileOnly(mn.micronaut.context) 15 | compileOnly(mn.micronaut.discovery.core) 16 | compileOnly(mn.micronaut.http.client) 17 | compileOnly(mn.micronaut.jackson.databind) 18 | compileOnly(mn.reactor) 19 | compileOnly(mnReactor.micronaut.reactor) 20 | compileOnly(mnRxjava2.rxjava2) 21 | runtimeOnly(libs.slf4j.jcl) 22 | testImplementation(mn.micronaut.context) 23 | testImplementation(mn.micronaut.discovery.core) 24 | testImplementation(mn.micronaut.http.client) 25 | testImplementation(mn.micronaut.http.server.netty) 26 | testImplementation(mnTest.micronaut.test.spock) 27 | testImplementation(mnTest.mockito.core) 28 | testImplementation(projects.micronautOraclecloudHttpclientNetty) 29 | } 30 | -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/src/test/kotlin/example/mock/MockAuthenticationDetailsProvider.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider 5 | import io.micronaut.context.annotation.Primary 6 | import io.micronaut.context.annotation.Replaces 7 | import jakarta.inject.Singleton 8 | import java.io.InputStream 9 | 10 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 11 | @Singleton 12 | @Replaces(AuthenticationDetailsProvider::class) 13 | @Primary 14 | class MockAuthenticationDetailsProvider : AuthenticationDetailsProvider { 15 | override fun getKeyId(): String? { 16 | return null 17 | } 18 | 19 | override fun getPrivateKey(): InputStream? { 20 | return null 21 | } 22 | 23 | override fun getPassPhrase(): String? { 24 | return null 25 | } 26 | 27 | override fun getPassphraseCharacters(): CharArray? { 28 | return null 29 | } 30 | 31 | override fun getFingerprint(): String { 32 | return "" 33 | } 34 | 35 | override fun getTenantId(): String { 36 | return "" 37 | } 38 | 39 | override fun getUserId(): String { 40 | return "" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /test-suite-graal-logging/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | testLogger1 17 | testLogger2 18 | testLogId 19 | testSource 20 | testSubject 21 | testType 22 | 50 23 | 200 24 | 15 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-kotlin/src/test/kotlin/example/mock/MockAuthenticationDetailsProvider.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider 5 | import io.micronaut.context.annotation.Primary 6 | import io.micronaut.context.annotation.Replaces 7 | import jakarta.inject.Singleton 8 | import java.io.InputStream 9 | 10 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 11 | @Singleton 12 | @Replaces(AuthenticationDetailsProvider::class) 13 | @Primary 14 | class MockAuthenticationDetailsProvider : AuthenticationDetailsProvider { 15 | override fun getKeyId(): String? { 16 | return null 17 | } 18 | 19 | override fun getPrivateKey(): InputStream? { 20 | return null 21 | } 22 | 23 | override fun getPassPhrase(): String? { 24 | return null 25 | } 26 | 27 | override fun getPassphraseCharacters(): CharArray? { 28 | return null 29 | } 30 | 31 | override fun getFingerprint(): String { 32 | return "" 33 | } 34 | 35 | override fun getTenantId(): String { 36 | return "" 37 | } 38 | 39 | override fun getUserId(): String { 40 | return "" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /oraclecloud-common/src/main/java/io/micronaut/oraclecloud/core/sdk/SdkImport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.core.sdk; 17 | 18 | /** 19 | * Annotation used to import an SDK if it is generated with OCI SDK v3, but without Micronaut compatibility. 20 | */ 21 | public @interface SdkImport { 22 | /** 23 | * The type of the client. This should reference a type that extends from either 24 | * {@link com.oracle.bmc.http.internal.BaseAsyncClient} or {@link com.oracle.bmc.http.internal.BaseSyncClient}. 25 | * 26 | * @return The type of a client to import. 27 | */ 28 | Class value(); 29 | } 30 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/test/groovy/example/BucketControllerSpec.groovy: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import example.mock.MockData 4 | import io.micronaut.context.annotation.Requires 5 | import io.micronaut.test.extensions.spock.annotation.MicronautTest 6 | import org.apache.commons.lang3.RandomStringUtils 7 | import spock.lang.Specification 8 | 9 | import jakarta.inject.Inject 10 | 11 | @MicronautTest 12 | @Requires(missingProperty = "micronaut.test.server.executable") 13 | class BucketControllerSpec extends Specification { 14 | 15 | @Inject BucketClient client 16 | 17 | void 'test buckets'() { 18 | given: 19 | MockData.bucketNames << 'b1' << 'b2' 20 | String bucketName = 'test-bucket-' + RandomStringUtils.randomAlphanumeric(10) 21 | 22 | when: 23 | List names = client.listBuckets(null).block() 24 | 25 | then: 26 | names == ['b1', 'b2'] 27 | 28 | when: 29 | String location = client.createBucket(bucketName).block() 30 | 31 | then: 32 | location == MockData.bucketLocation 33 | 34 | when: 35 | boolean result = client.deleteBucket(bucketName).block() 36 | 37 | then: 38 | result 39 | } 40 | 41 | void cleanup() { 42 | MockData.reset() 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-groovy/src/main/groovy/example/Book.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import groovy.transform.CompileStatic 19 | import io.micronaut.serde.annotation.Serdeable; 20 | 21 | import jakarta.validation.constraints.Min 22 | import jakarta.validation.constraints.NotBlank 23 | import jakarta.validation.constraints.NotNull 24 | 25 | @Serdeable 26 | @CompileStatic 27 | class Book { 28 | 29 | @NotBlank 30 | @NotNull 31 | final String title 32 | 33 | @Min(100L) 34 | final int pages 35 | 36 | Book(String title, int pages) { 37 | this.title = title 38 | this.pages = pages 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /oraclecloud-micrometer/src/main/java/io/micronaut/oraclecloud/monitoring/primitives/OracleCloudDatapointProducer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2024 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.monitoring.primitives; 17 | 18 | import com.oracle.bmc.monitoring.model.Datapoint; 19 | import io.micrometer.core.instrument.Meter; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * A Meter that collects raw {@link Datapoint}. 25 | */ 26 | public interface OracleCloudDatapointProducer extends Meter { 27 | 28 | /** 29 | * Returns list of datapoints that will be sent. 30 | * 31 | * @return list of {@link Datapoint} 32 | */ 33 | List getDatapoints(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /test-suite-http-client/build.gradle.kts: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("io.micronaut.build.internal.oraclecloud-tests") 3 | id("java-library") 4 | } 5 | 6 | dependencies { 7 | api(mn.netty.codec.http) 8 | 9 | implementation(mnTest.junit.jupiter.api) 10 | implementation(mnTest.junit.jupiter.engine) 11 | 12 | annotationProcessor(mn.micronaut.inject.java) 13 | annotationProcessor(mnSerde.micronaut.serde.processor) 14 | 15 | listOf( 16 | projects.micronautOraclecloudBmcMonitoring, 17 | projects.micronautOraclecloudBmcIdentity, 18 | projects.micronautOraclecloudBmcObjectstorage, 19 | projects.micronautOraclecloudBmcKeymanagement, 20 | projects.micronautOraclecloudBmcSecrets, 21 | projects.micronautOraclecloudBmcVault, 22 | projects.micronautOraclecloudBmcLogging, 23 | projects.micronautOraclecloudBmcLoggingingestion, 24 | projects.micronautOraclecloudBmcLoggingsearch, 25 | projects.micronautOraclecloudBmcStreaming, 26 | projects.micronautOraclecloudBmcFunctions, 27 | projects.micronautOraclecloudBmcEncryption 28 | ).forEach { implementation(it) } 29 | 30 | testImplementation(libs.oci.common.httpclient.jersey3) 31 | } 32 | 33 | tasks.named("test") { 34 | useJUnitPlatform() 35 | } 36 | -------------------------------------------------------------------------------- /docs-examples/example-groovy/src/main/groovy/example/BucketOperations.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import io.micronaut.core.annotation.Nullable 19 | import io.micronaut.http.annotation.Delete 20 | import io.micronaut.http.annotation.Get 21 | import io.micronaut.http.annotation.Post 22 | import reactor.core.publisher.Mono 23 | 24 | interface BucketOperations { 25 | @Get("/buckets{/compartmentId}") 26 | Mono> listBuckets(@Nullable String compartmentId) 27 | 28 | @Post("/buckets/{name}") 29 | Mono createBucket(String name) 30 | 31 | @Delete("/buckets/{name}") 32 | Mono deleteBucket(String name) 33 | } 34 | -------------------------------------------------------------------------------- /oraclecloud-function/src/test/java/io/micronaut/oraclecloud/function/ObjectStorageFunction.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function; 2 | 3 | import com.oracle.bmc.objectstorage.ObjectStorageClient; 4 | import com.oracle.bmc.objectstorage.model.BucketSummary; 5 | import com.oracle.bmc.objectstorage.requests.ListBucketsRequest; 6 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 7 | 8 | import jakarta.inject.Inject; 9 | import jakarta.inject.Singleton; 10 | import java.util.List; 11 | import java.util.stream.Collectors; 12 | 13 | @Singleton 14 | public class ObjectStorageFunction extends OciFunction { 15 | 16 | @Inject 17 | ObjectStorageClient client; 18 | 19 | @Inject 20 | TenancyIdProvider tenancyIdProvider; 21 | 22 | public String handleRequest() { 23 | ListBucketsRequest request = ListBucketsRequest.builder() 24 | .namespaceName("kg") 25 | .compartmentId(tenancyIdProvider.getTenancyId()) 26 | .build(); 27 | final List items = client 28 | .listBuckets(request) 29 | .getItems(); 30 | 31 | return items.stream() 32 | .map(BucketSummary::getName) 33 | .collect(Collectors.toList()) 34 | .toString(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test-suite-http-server-tck-oraclecloud-function-http/src/test/java/io/micronaut/http/server/tck/oraclecloud/function/OracleCloudFunctionServerUnderTestProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.http.server.tck.oraclecloud.function; 17 | 18 | import io.micronaut.http.tck.ServerUnderTest; 19 | import io.micronaut.http.tck.ServerUnderTestProvider; 20 | 21 | import java.util.Map; 22 | 23 | public class OracleCloudFunctionServerUnderTestProvider implements ServerUnderTestProvider { 24 | 25 | @Override 26 | public ServerUnderTest getServer(Map properties) { 27 | return new OracleCloudFunctionServerUnderTest(properties); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/groovy/io/micronaut/oraclecloud/serde/ErrorResponseSerdeSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.serde 2 | 3 | 4 | import com.oracle.bmc.http.internal.ResponseHelper 5 | 6 | class ErrorResponseSerdeSpec extends SerdeSpecBase { 7 | 8 | void "ErrorCodeAndMessage deserialization test"() throws Exception { 9 | when: 10 | var response = deserialize(body, ResponseHelper.ErrorCodeAndMessage) 11 | 12 | then: 13 | builder.build() == response 14 | 15 | where: 16 | body | builder 17 | '{"code":"Unauthorized","message":"Access not allowed"}' 18 | | ResponseHelper.ErrorCodeAndMessage.builder().code("Unauthorized").message("Access not allowed") 19 | '{"code":null}' 20 | | ResponseHelper.ErrorCodeAndMessage.builder().code(null) 21 | '{"code":"Unauthorized","originalMessage":"message","originalMessageTemplate":"template"}' 22 | | ResponseHelper.ErrorCodeAndMessage.builder().code("Unauthorized").originalMessage("message").originalMessageTemplate("template") 23 | '{"code":"Unauthorized","messageArguments":{"arg":"val"}}' 24 | | ResponseHelper.ErrorCodeAndMessage.builder().code("Unauthorized").messageArguments(["arg": "val"]) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/LegacyNettyManagedTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import io.micronaut.context.ApplicationContext; 4 | import org.junit.jupiter.api.BeforeEach; 5 | import org.junit.jupiter.api.Disabled; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.security.cert.CertificateException; 9 | import java.util.Map; 10 | 11 | @Deprecated 12 | public class LegacyNettyManagedTest extends NettyManagedTest { 13 | @Override 14 | @BeforeEach 15 | public void setUp() { 16 | ctx = ApplicationContext.run(Map.of("oci.netty.legacy-netty-client", true)); 17 | } 18 | 19 | @Override 20 | @Test 21 | @Disabled // response filter order was fixed in the new client impl 22 | void simpleRequestTestFilters() throws Exception { 23 | super.simpleRequestTestFilters(); 24 | } 25 | 26 | @Override 27 | @Disabled // not supported 28 | public void fullSetupErrorParseFailure() throws CertificateException { 29 | super.fullSetupErrorParseFailure(); 30 | } 31 | 32 | @Override 33 | @Disabled // behavior change not done in legacy client 34 | public void functionsClientTest() throws CertificateException { 35 | super.functionsClientTest(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test-suite-graal-function/src/main/java/example/Function.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2024 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example; 17 | 18 | import io.micronaut.core.annotation.ReflectiveAccess; 19 | import io.micronaut.oraclecloud.core.TenancyIdProvider; 20 | import io.micronaut.oraclecloud.function.OciFunction; 21 | import jakarta.inject.Inject; 22 | import jakarta.inject.Singleton; 23 | 24 | @Singleton 25 | @ReflectiveAccess 26 | public class Function extends OciFunction { 27 | 28 | @Inject 29 | TenancyIdProvider tenantIdProvider; 30 | 31 | public String handleRequest() { 32 | String tenancyId = tenantIdProvider.getTenancyId(); 33 | return "Your tenancy is: " + tenancyId; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/NettyManagedTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import com.oracle.bmc.http.client.HttpProvider; 4 | import io.micronaut.context.ApplicationContext; 5 | import io.micronaut.core.util.StringUtils; 6 | import org.junit.jupiter.api.AfterEach; 7 | import org.junit.jupiter.api.BeforeEach; 8 | import org.junit.jupiter.api.Test; 9 | import org.junit.jupiter.api.condition.DisabledIfEnvironmentVariable; 10 | 11 | public class NettyManagedTest extends NettyUnmanagedTest { 12 | ApplicationContext ctx; 13 | 14 | @BeforeEach 15 | public void setUp() { 16 | ctx = ApplicationContext.run(); 17 | } 18 | 19 | @AfterEach 20 | public void tearDown() { 21 | ctx.close(); 22 | } 23 | 24 | @Override 25 | HttpProvider provider() { 26 | return ctx.getBean(HttpProvider.class); 27 | } 28 | 29 | @DisabledIfEnvironmentVariable(named = "CI", matches = StringUtils.TRUE, 30 | disabledReason = "It is flaky https://ge.micronaut.io/scans/tests?tests.container=io.micronaut.oraclecloud.httpclient.netty.NettyManagedTest&tests.test=connectionReuse()") 31 | @Test 32 | public void connectionReuse() throws Exception { 33 | super.connectionReuse(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test-suite-java/src/test/java/example/VaultSerializationTest.java: -------------------------------------------------------------------------------- 1 | package example; 2 | 3 | import com.oracle.bmc.vault.model.SecretSummary; 4 | import io.micronaut.context.annotation.Property; 5 | import io.micronaut.json.JsonMapper; 6 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 7 | import org.junit.jupiter.api.Test; 8 | 9 | import java.io.IOException; 10 | 11 | import static io.micronaut.core.util.StringUtils.FALSE; 12 | import static org.junit.jupiter.api.Assertions.assertEquals; 13 | import static org.junit.jupiter.api.Assertions.assertNotNull; 14 | 15 | @MicronautTest 16 | @Property(name = "micronaut.metrics.export.oraclecloud.enabled", value = FALSE) 17 | public class VaultSerializationTest { 18 | @Test 19 | void testSerialization(JsonMapper jsonMapper) throws IOException { 20 | var summary = SecretSummary.builder() 21 | .secretName("foo") 22 | .description("bar") 23 | .build(); 24 | 25 | String result = jsonMapper.writeValueAsString(summary); 26 | assertEquals("{\"description\":\"bar\",\"secretName\":\"foo\"}", result); 27 | 28 | SecretSummary secretSummary = jsonMapper.readValue(result, SecretSummary.class); 29 | assertNotNull(secretSummary); 30 | assertEquals("foo", secretSummary.getSecretName()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /docs-examples/example-java/src/main/java/example/BucketOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | import io.micronaut.http.annotation.Delete; 20 | import io.micronaut.http.annotation.Get; 21 | import io.micronaut.http.annotation.Post; 22 | import reactor.core.publisher.Mono; 23 | 24 | import java.util.List; 25 | 26 | public interface BucketOperations { 27 | @Get("/buckets{/compartmentId}") 28 | Mono> listBuckets(@Nullable String compartmentId); 29 | 30 | @Post("/buckets/{name}") 31 | Mono createBucket(String name); 32 | 33 | @Delete("/buckets/{name}") 34 | Mono deleteBucket(String name); 35 | } 36 | -------------------------------------------------------------------------------- /oraclecloud-sdk/src/test/java/io/micronaut/oraclecloud/mock/MockObjectStorageClient.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.mock; 2 | 3 | import com.oracle.bmc.auth.BasicAuthenticationDetailsProvider; 4 | import com.oracle.bmc.objectstorage.ObjectStorageClient; 5 | import com.oracle.bmc.objectstorage.model.BucketSummary; 6 | import com.oracle.bmc.objectstorage.requests.ListBucketsRequest; 7 | import com.oracle.bmc.objectstorage.responses.ListBucketsResponse; 8 | import io.micronaut.context.annotation.Replaces; 9 | 10 | import jakarta.inject.Singleton; 11 | import java.util.List; 12 | import java.util.stream.Collectors; 13 | 14 | @Singleton 15 | @Replaces(ObjectStorageClient.class) 16 | public class MockObjectStorageClient extends ObjectStorageClient { 17 | 18 | public MockObjectStorageClient(BasicAuthenticationDetailsProvider authDetailsProvider) { 19 | super(authDetailsProvider); 20 | } 21 | 22 | @Override 23 | public ListBucketsResponse listBuckets(ListBucketsRequest request) { 24 | List bucketSummaries = MockData.bucketNames.stream() 25 | .map(name -> BucketSummary.builder().name(name).build()) 26 | .collect(Collectors.toList()); 27 | return ListBucketsResponse.builder() 28 | .items(bucketSummaries) 29 | .build(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /docs-examples/example-java/src/test/java/example/mock/MockAuthenticationDetailsProvider.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy; 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider; 5 | import io.micronaut.context.annotation.Primary; 6 | import io.micronaut.context.annotation.Replaces; 7 | 8 | import jakarta.inject.Singleton; 9 | import java.io.InputStream; 10 | 11 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 12 | @Singleton 13 | @Replaces(AuthenticationDetailsProvider.class) 14 | @Primary 15 | public class MockAuthenticationDetailsProvider implements AuthenticationDetailsProvider { 16 | 17 | @Override 18 | public String getKeyId() { 19 | return null; 20 | } 21 | 22 | @Override 23 | public InputStream getPrivateKey() { 24 | return null; 25 | } 26 | 27 | @Override 28 | public String getPassPhrase() { 29 | return null; 30 | } 31 | 32 | @Override 33 | public char[] getPassphraseCharacters() { 34 | return null; 35 | } 36 | 37 | @Override 38 | public String getFingerprint() { 39 | return ""; 40 | } 41 | 42 | @Override 43 | public String getTenantId() { 44 | return ""; 45 | } 46 | 47 | @Override 48 | public String getUserId() { 49 | return ""; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs-examples/example-function-java/src/test/java/example/mock/MockAuthenticationDetailsProvider.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy; 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider; 5 | import io.micronaut.context.annotation.Primary; 6 | import io.micronaut.context.annotation.Replaces; 7 | 8 | import jakarta.inject.Singleton; 9 | import java.io.InputStream; 10 | 11 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 12 | @Singleton 13 | @Replaces(AuthenticationDetailsProvider.class) 14 | @Primary 15 | public class MockAuthenticationDetailsProvider implements AuthenticationDetailsProvider { 16 | 17 | @Override 18 | public String getKeyId() { 19 | return null; 20 | } 21 | 22 | @Override 23 | public InputStream getPrivateKey() { 24 | return null; 25 | } 26 | 27 | @Override 28 | public String getPassPhrase() { 29 | return null; 30 | } 31 | 32 | @Override 33 | public char[] getPassphraseCharacters() { 34 | return null; 35 | } 36 | 37 | @Override 38 | public String getFingerprint() { 39 | return ""; 40 | } 41 | 42 | @Override 43 | public String getTenantId() { 44 | return ""; 45 | } 46 | 47 | @Override 48 | public String getUserId() { 49 | return ""; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/src/test/java/example/mock/MockAuthenticationDetailsProvider.java: -------------------------------------------------------------------------------- 1 | package example.mock; 2 | 3 | import com.oracle.bmc.auth.AuthCachingPolicy; 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider; 5 | import io.micronaut.context.annotation.Primary; 6 | import io.micronaut.context.annotation.Replaces; 7 | 8 | import jakarta.inject.Singleton; 9 | import java.io.InputStream; 10 | 11 | @AuthCachingPolicy(cacheKeyId = false, cachePrivateKey = false) 12 | @Singleton 13 | @Replaces(AuthenticationDetailsProvider.class) 14 | @Primary 15 | public class MockAuthenticationDetailsProvider implements AuthenticationDetailsProvider { 16 | 17 | @Override 18 | public String getKeyId() { 19 | return null; 20 | } 21 | 22 | @Override 23 | public InputStream getPrivateKey() { 24 | return null; 25 | } 26 | 27 | @Override 28 | public String getPassPhrase() { 29 | return null; 30 | } 31 | 32 | @Override 33 | public char[] getPassphraseCharacters() { 34 | return null; 35 | } 36 | 37 | @Override 38 | public String getFingerprint() { 39 | return ""; 40 | } 41 | 42 | @Override 43 | public String getTenantId() { 44 | return ""; 45 | } 46 | 47 | @Override 48 | public String getUserId() { 49 | return ""; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /docs-examples/example-kotlin/src/main/kotlin/example/BucketOperations.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example 17 | 18 | import io.micronaut.core.annotation.Nullable 19 | import io.micronaut.http.annotation.Delete 20 | import io.micronaut.http.annotation.Get 21 | import io.micronaut.http.annotation.Post 22 | import io.micronaut.validation.Validated 23 | import reactor.core.publisher.Mono 24 | 25 | @Validated 26 | interface BucketOperations { 27 | @Get("/buckets{/compartmentId}") 28 | fun listBuckets(@Nullable compartmentId: String?): Mono> 29 | 30 | @Post("/buckets/{name}") 31 | fun createBucket(name: String): Mono 32 | 33 | @Delete("/buckets/{name}") 34 | fun deleteBucket(name: String): Mono 35 | } 36 | -------------------------------------------------------------------------------- /oraclecloud-atp/src/main/java/io/micronaut/oraclecloud/atp/wallet/ZipArchives.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.atp.wallet; 17 | 18 | import java.io.IOException; 19 | import java.io.InputStream; 20 | import java.nio.file.Files; 21 | import java.nio.file.Path; 22 | 23 | class ZipArchives { 24 | 25 | private final ByteStreams streams; 26 | 27 | ZipArchives(final ByteStreams streams) { 28 | this.streams = streams; 29 | } 30 | 31 | ZipArchive of(final Path path) throws IOException { 32 | return new ZipArchive(Files.readAllBytes(path)); 33 | } 34 | 35 | ZipArchive of(final InputStream content) throws IOException { 36 | return new ZipArchive(streams.asByteArray(content)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/java/io/micronaut/oraclecloud/core/RetryDefaultConfigTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.core; 2 | 3 | import com.oracle.bmc.ClientConfiguration; 4 | import com.oracle.bmc.retrier.RetryConfiguration; 5 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | import static org.junit.jupiter.api.Assertions.assertNotNull; 10 | 11 | @MicronautTest 12 | class RetryDefaultConfigTest { 13 | 14 | @Test 15 | void testRetryDefaultConfig( 16 | ClientConfiguration clientConfiguration, 17 | OracleCloudCoreFactory factory) { 18 | assertNotNull(clientConfiguration); 19 | RetryConfiguration retryConfiguration = clientConfiguration.getRetryConfiguration(); 20 | assertEquals(retryConfiguration.getRetryCondition(), RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION.getRetryCondition()); 21 | assertEquals(retryConfiguration.getRetryOptions(), RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION.getRetryOptions()); 22 | assertEquals(retryConfiguration.getTerminationStrategy(), RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION.getTerminationStrategy()); 23 | assertEquals(retryConfiguration.getDelayStrategy(), RetryConfiguration.SDK_DEFAULT_RETRY_CONFIGURATION.getDelayStrategy()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/java/io/micronaut/oraclecloud/httpclient/netty/DiscardingHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2022 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.httpclient.netty; 17 | 18 | import io.netty.buffer.ByteBuf; 19 | 20 | /** 21 | * Handler that discards incoming data. 22 | */ 23 | @Deprecated 24 | final class DiscardingHandler extends DecidedBodyHandler { 25 | static final DiscardingHandler INSTANCE = new DiscardingHandler(); 26 | 27 | private DiscardingHandler() { 28 | } 29 | 30 | @Override 31 | boolean onError(Throwable cause) { 32 | return false; 33 | } 34 | 35 | @Override 36 | void onData(ByteBuf data) { 37 | data.release(); 38 | } 39 | 40 | @Override 41 | void onComplete() { 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /oraclecloud-oke-workload-identity/src/main/java/io/micronaut/oraclecloud/oke/workload/identity/OkeHttpClientConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2023 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.oke.workload.identity; 17 | 18 | import io.micronaut.context.annotation.BootstrapContextCompatible; 19 | import io.micronaut.context.annotation.ConfigurationProperties; 20 | import io.micronaut.http.client.DefaultHttpClientConfiguration; 21 | 22 | /** 23 | * The HTTP client configuration for OKE Workload Identity client. 24 | */ 25 | @ConfigurationProperties(OkeHttpClientConfiguration.PREFIX) 26 | @BootstrapContextCompatible 27 | public class OkeHttpClientConfiguration extends DefaultHttpClientConfiguration { 28 | public static final String PREFIX = "micronaut.http.oci-oke.client"; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /oraclecloud-oke-workload-identity/src/test/java/io/micronaut/oraclecloud/oke/workload/identity/MicronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilderTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.oke.workload.identity;//package io.micronaut.oraclecloud.core; 2 | 3 | import com.oracle.bmc.auth.SessionKeySupplier; 4 | import com.oracle.bmc.circuitbreaker.CircuitBreakerConfiguration; 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import static org.mockito.Mockito.mock; 9 | 10 | public class MicronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilderTest { 11 | @Test 12 | void testThatIfNotInsideKuberentesPodIllegalArgumentExceptionIsThrown() { 13 | MicronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilder micronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilder = new MicronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilder(); 14 | micronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilder.circuitBreakerConfig(CircuitBreakerConfiguration.builder().build()); 15 | Exception exception = Assertions.assertThrows(IllegalArgumentException.class, () -> micronautOkeWorkloadIdentityAuthenticationDetailsProviderBuilder.createFederationClient(mock(SessionKeySupplier.class))); 16 | Assertions.assertEquals("Kubernetes service account ca cert doesn't exist.", exception.getMessage()); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /docs-examples/example-http-function-java/src/main/java/example/Book.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2021 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example; 17 | 18 | import io.micronaut.serde.annotation.Serdeable; 19 | 20 | import jakarta.validation.constraints.Min; 21 | import jakarta.validation.constraints.NotBlank; 22 | import jakarta.validation.constraints.NotNull; 23 | 24 | @Serdeable 25 | public class Book { 26 | 27 | @NotBlank 28 | @NotNull 29 | private final String title; 30 | 31 | @Min(100) 32 | private final int pages; 33 | 34 | public Book(String title, int pages) { 35 | this.title = title; 36 | this.pages = pages; 37 | } 38 | 39 | public String getTitle() { 40 | return title; 41 | } 42 | 43 | public int getPages() { 44 | return pages; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/docs/guide/reactive.adoc: -------------------------------------------------------------------------------- 1 | In addition to the blocking clients, this module provides clients that use RxJava or Reactor to allow reactive programming with Micronaut for each SDK. 2 | 3 | For RxJava 2, add the following module along with a `micronaut-oraclecloud-sdk-[OCI SDK client]` module: 4 | 5 | dependency:io.micronaut.rxjava2:micronaut-rxjava2[] 6 | 7 | For Reactor, add the following module along with `micronaut-oraclecloud-sdk-[OCI SDK client]` module: 8 | 9 | dependency:micronaut-reactor[groupId="io.micronaut.reactor"] 10 | 11 | For example, instead of `ObjectStorageClient`, you can inject `ObjectStorageRxClient` for RxJava 2 or `ObjectStorageReactorClient` for Reactor to use the Object Storage API: 12 | 13 | snippet::example.BucketController[project-base="docs-examples/example", source="main", tags="imports,class"] 14 | 15 | <1> The `ObjectStorageRxClient` is injected into the constructor. 16 | 17 | Once you have a reference to the relevant reactive client, it is easier to compose non-blocking operations. 18 | The following example creates a bucket: 19 | 20 | snippet::example.BucketController[project-base="docs-examples/example", source="main", tags="method", indent="0"] 21 | 22 | <1> First, a request to obtain the namespace is sent 23 | <2> Then with the response the `flatMap` operator is used to send another request to create a bucket 24 | <3> Finally, the location of the bucket is returned in the response 25 | -------------------------------------------------------------------------------- /oraclecloud-vault/src/main/java/io/micronaut/oraclecloud/discovery/vault/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | /** 17 | * Classes related to using Oracle Cloud Vault as a distributed configuration client. 18 | * 19 | * @author toddsharp 20 | * @since 2.0.0 21 | */ 22 | @Requires(property = ConfigurationClient.ENABLED, value = "true", defaultValue = "false") 23 | @Requires(property = OracleCloudVaultConfiguration.PREFIX + "." + ConfigDiscoveryConfiguration.PREFIX + ".enabled", value = "true") 24 | @Configuration 25 | package io.micronaut.oraclecloud.discovery.vault; 26 | 27 | import io.micronaut.context.annotation.Configuration; 28 | import io.micronaut.context.annotation.Requires; 29 | import io.micronaut.discovery.config.ConfigDiscoveryConfiguration; 30 | import io.micronaut.discovery.config.ConfigurationClient; 31 | -------------------------------------------------------------------------------- /docs-examples/example-function-kotlin/src/test/kotlin/example/mock/MockObjectStorageClient.kt: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.BasicAuthenticationDetailsProvider 4 | import com.oracle.bmc.objectstorage.ObjectStorageClient 5 | import com.oracle.bmc.objectstorage.model.BucketSummary 6 | import com.oracle.bmc.objectstorage.requests.GetNamespaceRequest 7 | import com.oracle.bmc.objectstorage.requests.ListBucketsRequest 8 | import com.oracle.bmc.objectstorage.responses.GetNamespaceResponse 9 | import com.oracle.bmc.objectstorage.responses.ListBucketsResponse 10 | import io.micronaut.context.annotation.Replaces 11 | import jakarta.inject.Singleton 12 | 13 | @Singleton 14 | @Replaces(ObjectStorageClient::class) 15 | class MockObjectStorageClient(authDetailsProvider: BasicAuthenticationDetailsProvider?) : 16 | ObjectStorageClient(authDetailsProvider) { 17 | 18 | override fun getNamespace(request: GetNamespaceRequest?): GetNamespaceResponse? { 19 | return GetNamespaceResponse.builder().value(MockData.namespace).build() 20 | } 21 | 22 | override fun listBuckets(request: ListBucketsRequest?): ListBucketsResponse? { 23 | val bucketSummaries = MockData.bucketNames.stream() 24 | .map { name: String? -> BucketSummary.builder().name(name).build() } 25 | .toList() 26 | return ListBucketsResponse.builder() 27 | .items(bucketSummaries) 28 | .build() 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | projectVersion=6.0.0-SNAPSHOT 2 | projectGroup=io.micronaut.oraclecloud 3 | 4 | title=Micronaut Oracle Cloud 5 | projectDesc=Provides integration between Micronaut and Oracle Cloud 6 | projectUrl=https://micronaut.io 7 | githubSlug=micronaut-projects/micronaut-oracle-cloud 8 | developers=Graeme Rocher 9 | 10 | org.gradle.jvmargs=-XX:MaxMetaspaceSize=1g -Xmx2g 11 | ocidocs=https://docs.oracle.com/en-us/iaas/tools/java/2.2.0/ 12 | org.gradle.caching=true 13 | org.gradle.parallel=true 14 | 15 | # No matter which Java toolchain we use, the Kotlin Daemon is always invoked by the current JDK. 16 | # Therefor to fix Kapt errors when running tests under Java 21, we need to open up some modules for the Kotlin Daemon. 17 | kotlin.daemon.jvmargs=--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED\ 18 | --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \ 19 | --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \ 20 | --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \ 21 | --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \ 22 | --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \ 23 | --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \ 24 | --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \ 25 | --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \ 26 | --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED 27 | kapt.use.worker.api=false 28 | 29 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/main/java/io/micronaut/oraclecloud/serde/OciSerdeConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2024 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.serde; 17 | 18 | import io.micronaut.context.annotation.Bean; 19 | import io.micronaut.context.annotation.BootstrapContextCompatible; 20 | import io.micronaut.context.annotation.ConfigurationProperties; 21 | import io.micronaut.core.annotation.Internal; 22 | import io.micronaut.core.bind.annotation.Bindable; 23 | import io.micronaut.serde.config.SerdeConfiguration; 24 | 25 | @ConfigurationProperties("oci.serde") 26 | @Bean(typed = OciSerdeConfiguration.class) 27 | @Internal 28 | @BootstrapContextCompatible 29 | public interface OciSerdeConfiguration extends SerdeConfiguration { 30 | @Override 31 | @Bindable(defaultValue = "false") 32 | boolean isWriteBinaryAsArray(); 33 | } 34 | -------------------------------------------------------------------------------- /oraclecloud-micrometer/src/test/groovy/io/micronaut/oraclecloud/monitoring/sdk/MonitorRegionProviderSpec.groovy: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.monitoring.sdk 2 | 3 | import com.oracle.bmc.Region 4 | import com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider 5 | import com.oracle.bmc.monitoring.Monitoring 6 | import com.oracle.bmc.monitoring.MonitoringClient 7 | import io.micronaut.context.annotation.Property 8 | import io.micronaut.context.annotation.Requires 9 | import io.micronaut.test.extensions.spock.annotation.MicronautTest 10 | import jakarta.inject.Inject 11 | import org.junit.jupiter.api.Assertions 12 | import spock.lang.Specification 13 | 14 | @MicronautTest(startApplication = false) 15 | @Property(name = "spec.name", value = "MonitorRegionProviderSpec") 16 | @Property(name = "micronaut.metrics.export.oraclecloud.enabled", value = "false") 17 | @Property(name = "oci.vault.config.enabled", value = "false") 18 | @Property(name = "micronaut.config-client.enabled", value = "false") 19 | @Property(name = "datasources.enabled", value = "false") 20 | @Requires(bean = AbstractAuthenticationDetailsProvider.class) 21 | class MonitorRegionProviderSpec extends Specification { 22 | 23 | @Inject 24 | Monitoring monitoring 25 | 26 | void 'test the' () { 27 | when: 28 | String endpoint = monitoring.getEndpoint() 29 | 30 | then: 31 | Region.EU_JOVANOVAC_1.getEndpoint(MonitoringClient.SERVICE).get() == endpoint 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /oraclecloud-sdk-base/src/main/java/io/micronaut/oraclecloud/clients/SdkClients.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.clients; 17 | 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | 21 | /** 22 | * Internal Annotation to trigger the creation of SDK clients. 23 | */ 24 | @Retention(value = RetentionPolicy.SOURCE) 25 | public @interface SdkClients { 26 | /** 27 | * @return The type of client to generate. 28 | */ 29 | Kind value() default Kind.ASYNC; 30 | 31 | /** 32 | * @return The OCI SDK client class names to process. 33 | */ 34 | String[] clientClasses() default {}; 35 | 36 | /** 37 | * the type of client to generate. 38 | */ 39 | enum Kind { 40 | ASYNC, 41 | REACTOR, 42 | RXJAVA2 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /oraclecloud-common/src/main/java/io/micronaut/oraclecloud/core/OracleCloudConverterRegistrar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.core; 17 | 18 | import com.oracle.bmc.Region; 19 | import io.micronaut.core.annotation.Internal; 20 | import io.micronaut.core.convert.MutableConversionService; 21 | import io.micronaut.core.convert.TypeConverterRegistrar; 22 | import jakarta.inject.Singleton; 23 | 24 | /** 25 | * Converters for Oracle Cloud Configuration. 26 | * 27 | * @author graemerocher 28 | * @since 1.0.0 29 | */ 30 | @Singleton 31 | @Internal 32 | final class OracleCloudConverterRegistrar implements TypeConverterRegistrar { 33 | @Override 34 | public void register(MutableConversionService conversionService) { 35 | conversionService.addConverter(String.class, Region.class, Region::fromRegionCodeOrId); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /oraclecloud-bom/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id("io.micronaut.build.internal.bom") 3 | id("io.micronaut.build.internal.oraclecloud-bom") 4 | } 5 | 6 | dependencies { 7 | constraints { 8 | for (name in gradle.ociArtifacts) { 9 | api "com.oracle.oci.sdk:$name:$gradle.ociVersion" 10 | } 11 | 12 | for (module in ['api', 'runtime', 'testing-junit4']) { 13 | api "com.fnproject.fn:$module:${libs.fn.api.get().version}" 14 | } 15 | } 16 | } 17 | 18 | micronautBom { 19 | suppressions { 20 | bomAuthorizedGroupIds.put("io.micronaut.oraclecloud:micronaut-oraclecloud-bom", 21 | ["com.oracle.database.security", 22 | "com.oracle.database.ha", 23 | "com.oracle.database.nls", 24 | "com.oracle.database.xml", 25 | "com.oracle.database.observability"] as Set) 26 | acceptedVersionRegressions.add("ojdbc") 27 | acceptedLibraryRegressions.add("boms-oracle-jdbc") 28 | acceptedLibraryRegressions.add("oracle-jdbc") 29 | acceptedLibraryRegressions.add("micronaut-oraclecloud-bmc-applicationmigration") 30 | acceptedLibraryRegressions.add("micronaut-oraclecloud-bmc-osmanagement") 31 | acceptedLibraryRegressions.add("micronaut-oraclecloud-bmc-aianomalydetection") 32 | acceptedLibraryRegressions.add("micronaut-oraclecloud-bmc-servicemesh") 33 | acceptedLibraryRegressions.add("micronaut-oraclecloud-bmc-dts") 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/java/io/micronaut/oraclecloud/core/OracleCloudCustomAuthConfigTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.core; 2 | 3 | import com.oracle.bmc.Region; 4 | import com.oracle.bmc.auth.AuthenticationDetailsProvider; 5 | import com.oracle.bmc.auth.SimpleAuthenticationDetailsProvider; 6 | import io.micronaut.context.annotation.Property; 7 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 8 | import org.junit.jupiter.api.Test; 9 | 10 | import static org.junit.jupiter.api.Assertions.*; 11 | 12 | @MicronautTest 13 | @Property(name = "oci.tenantId", value = "something") 14 | @Property(name = "oci.region", value = "ap-mumbai-1") 15 | @Property(name = "oci.passphrase", value = "junk") 16 | @Property(name = "oci.config.enabled", value="false") 17 | public class OracleCloudCustomAuthConfigTest { 18 | 19 | @Test 20 | void testCustomAuth(AuthenticationDetailsProvider provider) { 21 | assertNotNull(provider); 22 | assertTrue(provider instanceof SimpleAuthenticationDetailsProvider); 23 | assertEquals( 24 | "something", 25 | provider.getTenantId() 26 | ); 27 | assertArrayEquals( 28 | "junk".toCharArray(), 29 | provider.getPassphraseCharacters() 30 | ); 31 | assertEquals( 32 | Region.fromRegionCodeOrId("ap-mumbai-1"), 33 | ((SimpleAuthenticationDetailsProvider) provider).getRegion() 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-netty/src/test/java/io/micronaut/oraclecloud/httpclient/netty/DemoBootstrapBean.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.httpclient.netty; 2 | 3 | import com.oracle.bmc.http.client.HttpProvider; 4 | import io.micronaut.context.annotation.BootstrapContextCompatible; 5 | import io.micronaut.oraclecloud.serde.OciSdkMicronautSerializer; 6 | import jakarta.inject.Singleton; 7 | 8 | /** 9 | * Demo bean created in the bootstrap context that calls HttpProvider.getDefault() 10 | * as early as possible to verify that the ManagedNettyHttpProvider was eagerly 11 | * initialized and wired into the NettyHttpProvider. 12 | */ 13 | @BootstrapContextCompatible 14 | @Singleton 15 | final class DemoBootstrapBean { 16 | 17 | private final HttpProvider provider; 18 | private final boolean usesManaged; 19 | 20 | /** 21 | * Inject ManagedNettyHttpProvider to ensure it is created before we call HttpProvider.getDefault(). 22 | * This guarantees NettyHttpProvider has the managed reference ASAP. 23 | */ 24 | DemoBootstrapBean() { 25 | this.provider = HttpProvider.getDefault(); 26 | // If NettyHttpProvider delegates to the managed provider, its serializer will NOT be the unmanaged default singleton 27 | this.usesManaged = provider.getSerializer() != OciSdkMicronautSerializer.getDefaultSerializer(); 28 | } 29 | 30 | HttpProvider provider() { 31 | return provider; 32 | } 33 | 34 | boolean usesManaged() { 35 | return usesManaged; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /oraclecloud-function-http/src/test/java/io/micronaut/oraclecloud/function/http/ParameterBindingTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.function.http; 2 | 3 | import io.micronaut.context.annotation.Property; 4 | import io.micronaut.http.HttpRequest; 5 | import io.micronaut.http.HttpResponse; 6 | import io.micronaut.http.client.HttpClient; 7 | import io.micronaut.http.client.annotation.Client; 8 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 9 | import org.junit.jupiter.api.Test; 10 | 11 | import jakarta.inject.Inject; 12 | import reactor.core.publisher.Mono; 13 | 14 | import static org.junit.jupiter.api.Assertions.assertEquals; 15 | 16 | @MicronautTest 17 | @Property(name = "fn.test.config.foo.bar", value = "good") 18 | public class ParameterBindingTest { 19 | 20 | @Client("/") 21 | @Inject 22 | HttpClient client; 23 | 24 | @Test 25 | void testUriParameterBinding() { 26 | HttpResponse response = Mono.from(client.exchange( 27 | HttpRequest.GET("/parameters/uri/Fred"), String.class 28 | )).block(); 29 | String result = response.body(); 30 | assertEquals("Hello Fred", result); 31 | } 32 | 33 | @Test 34 | void testContextBinding() { 35 | HttpResponse response = Mono.from(client.exchange( 36 | HttpRequest.GET("/parameters/context"), String.class 37 | )).block(); 38 | String result = response.body(); 39 | assertEquals("Got good context: myAppID", result); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /oraclecloud-httpclient-apache-http-core/src/main/java/io/micronaut/oraclecloud/httpclient/apache/core/ApacheCoreSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2024 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.httpclient.apache.core; 17 | 18 | import com.oracle.bmc.http.client.Serializer; 19 | import io.micronaut.core.annotation.Internal; 20 | 21 | import java.io.IOException; 22 | import java.io.InputStream; 23 | import java.io.OutputStream; 24 | import java.util.List; 25 | 26 | /** 27 | * Extension to {@link Serializer} for blocking reads/writes. 28 | */ 29 | @Internal 30 | sealed interface ApacheCoreSerializer extends Serializer permits JacksonSerializer, SerdeSerializer { 31 | T readValue(InputStream inputStream, Class type) throws IOException; 32 | 33 | List readList(InputStream inputStream, Class type) throws IOException; 34 | 35 | void writeValue(OutputStream outputStream, Object value) throws IOException; 36 | } 37 | -------------------------------------------------------------------------------- /oraclecloud-micrometer/src/main/java/io/micronaut/oraclecloud/monitoring/micrometer/MetricDataDetailsPartition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2020 original authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package io.micronaut.oraclecloud.monitoring.micrometer; 17 | 18 | import com.oracle.bmc.monitoring.model.MetricDataDetails; 19 | import io.micrometer.core.instrument.util.AbstractPartition; 20 | 21 | import java.util.List; 22 | 23 | /** 24 | * {@link AbstractPartition} for {@link MetricDataDetails}. 25 | * 26 | * @author Pavol Gressa 27 | * @since 1.2 28 | */ 29 | class MetricDataDetailsPartition extends AbstractPartition { 30 | 31 | MetricDataDetailsPartition(List list, int partitionSize) { 32 | super(list, partitionSize); 33 | } 34 | 35 | static List> partition(List list, int partitionSize) { 36 | return new MetricDataDetailsPartition(list, partitionSize); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /docs-examples/example-function-groovy/src/test/groovy/example/mock/MockObjectStorageClient.groovy: -------------------------------------------------------------------------------- 1 | package example.mock 2 | 3 | import com.oracle.bmc.auth.BasicAuthenticationDetailsProvider 4 | import com.oracle.bmc.objectstorage.ObjectStorageClient 5 | import com.oracle.bmc.objectstorage.model.BucketSummary 6 | import com.oracle.bmc.objectstorage.requests.GetNamespaceRequest 7 | import com.oracle.bmc.objectstorage.requests.ListBucketsRequest 8 | import com.oracle.bmc.objectstorage.responses.GetNamespaceResponse 9 | import com.oracle.bmc.objectstorage.responses.ListBucketsResponse 10 | import groovy.transform.CompileStatic 11 | import io.micronaut.context.annotation.Replaces 12 | 13 | import jakarta.inject.Singleton 14 | 15 | @CompileStatic 16 | @Singleton 17 | @Replaces(ObjectStorageClient) 18 | class MockObjectStorageClient extends ObjectStorageClient { 19 | 20 | MockObjectStorageClient(BasicAuthenticationDetailsProvider authDetailsProvider) { 21 | super(authDetailsProvider) 22 | } 23 | 24 | @Override 25 | GetNamespaceResponse getNamespace(GetNamespaceRequest request) { 26 | return GetNamespaceResponse.builder().value(MockData.namespace).build() 27 | } 28 | 29 | @Override 30 | ListBucketsResponse listBuckets(ListBucketsRequest request) { 31 | List bucketSummaries = MockData.bucketNames 32 | .collect { BucketSummary.builder().name(it).build() } 33 | return ListBucketsResponse.builder() 34 | .items(bucketSummaries) 35 | .build() 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /oraclecloud-common/src/test/java/io/micronaut/oraclecloud/core/OracleCloudCustomConfigPerClientTest.java: -------------------------------------------------------------------------------- 1 | package io.micronaut.oraclecloud.core; 2 | 3 | import com.oracle.bmc.ClientConfiguration; 4 | import io.micronaut.context.annotation.Property; 5 | import io.micronaut.test.extensions.junit5.annotation.MicronautTest; 6 | import jakarta.inject.Named; 7 | import org.junit.jupiter.api.Test; 8 | 9 | import static org.junit.jupiter.api.Assertions.assertEquals; 10 | import static org.junit.jupiter.api.Assertions.assertNotEquals; 11 | import static org.junit.jupiter.api.Assertions.assertNotNull; 12 | 13 | @MicronautTest 14 | @Property(name = "oci.clients.identity.read-timeout-millis", value = "25000") 15 | class OracleCloudCustomConfigPerClientTest { 16 | 17 | @Test 18 | void testCustomConfig( 19 | @Named("identity") ClientConfiguration clientConfiguration, 20 | @Named("identity") AbstractOracleCloudClientConfigurationProperties abstractOracleCloudClientConfigurationProperties, 21 | ClientConfiguration defaultClientConfiguration, 22 | OracleCloudCoreFactory factory) { 23 | assertNotNull(clientConfiguration); 24 | assertNotEquals(25000, defaultClientConfiguration.getReadTimeoutMillis()); 25 | assertEquals(25000, clientConfiguration.getReadTimeoutMillis()); 26 | assertEquals(clientConfiguration.getReadTimeoutMillis(), abstractOracleCloudClientConfigurationProperties.getReadTimeout().get().toMillis()); 27 | assertNotNull(abstractOracleCloudClientConfigurationProperties.getRetryDelayStrategy()); 28 | } 29 | } 30 | --------------------------------------------------------------------------------