Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.31 KB

File metadata and controls

45 lines (32 loc) · 1.31 KB
name spring-vault-oracle-app
description Spring Boot sample that loads OCI Vault secrets into the application context.
tags
Database
Java
OCI
security
SpringBoot
blog_post

spring-vault-oracle-app

The Spring Vault Oracle App sample demonstrates dynamically loading secrets from OCI Vault into the Spring Boot context during startup. All secrets loaded this way are made available by name as application properties, accessible using @Value annotations.

Prerequisites

Setup

  1. Create an OCI Vault, and add two secrets to the vault named s1 and s2.

  2. Set the following environment variables, using values for your OCI Compartment, Region, and Vault.

OCI_COMPARTMENT_ID=<OCI Compartment ID>
OCI_REGION=<OCI Region>
OCI_VAULT_ID=<OCI Vault OCID>

Run the app

Using Maven, start the app:

mvn spring-boot:run

Now, query the app to see if the Vault secrets were successfully loaded:

curl localhost:9001/values