Proof of Concept (POC) - Integration examples with OCI Vault Secrets in multiple programming languages.
This repository contains functional implementations to retrieve secrets from Oracle Cloud Infrastructure (OCI) Vaults using different programming languages. Each implementation demonstrates best practices and language-specific patterns.
- Overview
- Prerequisites
- OCI Configuration
- Available Implementations
- Project Structure
- How to Use
- License
This project provides practical examples of how to access secrets stored in OCI Vault through console applications in:
- .NET 9 (C#)
- Python 3.8+
- Node.js 18+ (JavaScript/ES Modules)
- Java 17+ (Maven)
All implementations:
- β Use authentication via OCI configuration file
- β Decode secrets in Base64 format
- β Implement robust error handling
- β Follow best practices for each language
- β Are production-ready
- Active Oracle Cloud Infrastructure account
- Read permissions on OCI Vault
- OCI configuration file (~/.oci/config)
- OCI API private key
| Language | Requirements |
|---|---|
| .NET | .NET 9 SDK |
| Python | Python 3.8+ and pip |
| JavaScript | Node.js 18.0+ and npm |
| Java | Java 17+, Maven 3.6+ |
Before running any implementation, configure your OCI credentials:
mkdir -p ~/.oci
touch ~/.oci/config[DEFAULT]
user=ocid1.user.oc1..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
fingerprint=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
tenancy=ocid1.tenancy.oc1..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
region=sa-saopaulo-1
key_file=~/.oci/oci_api_key.pemPlace your API private key in the path specified in key_file:
chmod 600 ~/.oci/oci_api_key.pemImplementation using .NET 9 with official OCI SDK.
cd dotnet/OciVaultSecretReader
dotnet run -- <secret-ocid>Python implementation using OCI Python SDK with type hints.
cd python/oci-vault-secret-reader
pip install -r requirements.txt
python oci_vault_secret_reader.py <secret-ocid>Node.js implementation using ES Modules and OCI SDK.
cd javascript/oci-vault-secret-reader
npm install
node index.js <secret-ocid>Java 17+ implementation with Maven and OCI Java SDK.
cd java/oci-vault-secret-reader
mvn clean package
java -jar target/oci-vault-secret-reader-1.0.0.jar <secret-ocid>PocOciSdk/
βββ README.md # This file
βββ LICENSE # MIT License
βββ .gitignore
β
βββ dotnet/ # .NET Implementation
β βββ OciVaultSecretReader/
β β βββ Program.cs
β β βββ OciVaultSecretReader.csproj
β β βββ .gitignore
β βββ README.md
β
βββ python/ # Python Implementation
β βββ oci-vault-secret-reader/
β β βββ oci_vault_secret_reader.py
β β βββ requirements.txt
β β βββ .gitignore
β βββ README.md
β
βββ javascript/ # Node.js Implementation
β βββ oci-vault-secret-reader/
β β βββ index.js
β β βββ package.json
β β βββ .gitignore
β βββ README.md
β
βββ java/ # Java Implementation
βββ oci-vault-secret-reader/
β βββ src/main/java/com/example/oci/
β β βββ OciVaultSecretReader.java
β βββ pom.xml
β βββ .gitignore
βββ README.md
git clone <repository-url>
cd PocOciSdkFollow the instructions in OCI Configuration.
Navigate to the desired language directory and follow the specific instructions in the corresponding README.
All implementations follow the same usage pattern:
<execution-command> <secret-ocid>OCID Example:
ocid1.vaultsecret.oc1.sa-saopaulo-1.amaaaaaaaswkexiaspam2smuu5siwrmp346xirulfeyw3qung3xfj5tsbkia
=== OCI Vault Secret Reader ===
Fetching secret: ocid1.vaultsecret.oc1.sa-saopaulo-1.xxxxx...
Secret retrieved successfully!
Secret ID: ocid1.vaultsecret.oc1.sa-saopaulo-1.xxxxx
Version: 1
Stages: CURRENT
Creation time: 2025-10-23T10:00:00.000Z
Secret Value:
<your-secret-value-here>
- OCI Vault Documentation
- OCI SDK for .NET
- OCI SDK for Python
- OCI SDK for Java
- OCI SDK for JavaScript/TypeScript
Contributions are welcome! Feel free to:
- Fork the project
- Create a branch for your feature (git checkout -b feature/MyFeature)
- Commit your changes (git commit -m 'Add MyFeature')
- Push to the branch (git push origin feature/MyFeature)
- Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
| Language | Status | Last Update |
|---|---|---|
| .NET 9 | β Functional | 2025-10-23 |
| Python | β Functional | 2025-10-23 |
| JavaScript | β Functional | 2025-10-23 |
| Java | β Functional | 2025-10-23 |
Developed by Raphael A. F. Cardoso