Skip to content

feat(vault): add OCI Vault secrets provider - #5712

Open
flozano wants to merge 2 commits into
Dokploy:canaryfrom
flozano:feat/oci-vault-provider
Open

flozano wants to merge 2 commits into
Dokploy:canaryfrom
flozano:feat/oci-vault-provider

Conversation

@flozano

@flozano flozano commented Oct 20, 2026 •

Copy link
Copy Markdown

Closes #5713.

What

Adds OCI Vault (Oracle Cloud Infrastructure) as a secrets provider next to AWS Secrets Manager and AWS Parameter Store. References use the same syntax as the AWS Secrets Manager provider:

${{vault.<provider>.secret-name}}
${{vault.<provider>.secret-name:field}}   # one key of a JSON secret

How the AWS providers map to OCI

OCI has a single secrets service (Vault secrets) and no Parameter Store equivalent, so this adds one provider type, oci, rather than one per AWS provider.

AWS OCI
Secrets Manager secret Vault secret, read back as a secret bundle
Parameter Store SecureString Also a Vault secret (no separate service, no plain String type)
Parameter paths (/prod/app/x) None: names are flat (A-Z a-z 0-9 . _ -); compartments are the grouping
name:field for JSON secrets Same. OCI names can't contain :, so parsing is unambiguous
AWSCURRENT CURRENT stage (the default)
region region (e.g. eu-madrid-1)
Access key ID + secret access key Tenancy OCID, user OCID, API key fingerprint, PEM private key (+ optional passphrase)
Optional endpoint Not needed: hosts are derived from the region
Account-wide scope Vault OCID (to read by name) and compartment OCID (to list)
secretsmanager:GetSecretValue / ListSecrets, kms:Decrypt read secret-bundles / inspect secrets; decryption is part of reading

The vault type (Default vs Virtual Private) and the master key's protection mode (software vs HSM) don't change the API used to read secrets. The config doesn't take a key OCID at all: the key only matters when a secret is created, which Dokploy never does. A Default vault with a software-protected key is the free setup.

Design

  • Request signing written by hand, no new dependency. This follows the Scaleway, Azure and Phase providers rather than the AWS one. Only three endpoints are needed. The official SDK (oci-common) pulls in node-fetch@2, isomorphic-fetch, opossum, jsonwebtoken, sshpk, http-signature and es6-promise, and its default retry policy would stretch a failing deploy far past VAULT_REQUEST_TIMEOUT_MS. The signer is a short node:crypto function implementing OCI's HTTP Signature scheme (RSA-SHA256 over x-date (request-target) host, plus content-type content-length x-content-sha256 for POST). I checked it against oci-common@2.143.0's DefaultRequestSigner: for the same key and date, both requests produce a byte-identical signature. fetch sets host and content-length itself and ignores explicit values, so those two are signed with the values fetch sends but never set.
  • Endpoints:
    • Reads: POST https://secrets.vaults.{region}.oci.oraclecloud.com/20190301/secretbundles/actions/getByName?secretName=…&vaultId=…, one call per distinct secret, in parallel.
    • Test connection and autocomplete: GET https://vaults.{region}.oci.oraclecloud.com/20180608/secrets?compartmentId=…&vaultId=…&lifecycleState=ACTIVE, paged with opc-next-page, capped at 500 names like the other providers.
  • Authentication: API key only, the same as Dokploy's AWS integrations. None of those can use the host's identity: the Secrets Manager, Parameter Store and Route53 providers and the S3 backup destinations all take explicit keys, and nothing falls back to an EC2 instance profile or the SDK's default credential chain. Instance principals, OCI's equivalent, are left out for the same reason: on a server with several organizations, every one of them would act as the host's identity. If Dokploy adds host identity later, it should cover AWS and OCI together.
  • Validation: the region becomes part of the hostname, and the OCIDs and fingerprint go into the Authorization header's keyId. All of them are checked by the zod schema, so a config value can't change where or how a request is sent. The compartment field accepts a tenancy OCID, because that is the root compartment's OCID.
  • Errors:
    • OCI answers 404 NotAuthorizedOrNotFound both for a missing secret and for a missing permission, so the message names both and the policy verb needed.
    • A 401 points at the tenancy, user, fingerprint, key and server clock.
    • OCI's error code and message and the opc-request-id are included for support cases.
    • A fingerprint that doesn't match the private key is caught locally, before the request becomes an opaque 401.
    • Secrets that aren't valid UTF-8 are rejected, like the AWS provider rejects binary secrets.
    • A leading UTF-8 BOM is dropped (TextDecoder's default). It marks the encoding rather than being part of the value, and JSON.parse would reject it, breaking name:field references.
  • Masking: privateKey and passphrase are masked in API responses and kept on update, like other providers' credentials.
  • Icon: simple-icons no longer ships Oracle's logo, so the icon is a plain capsule outline in Oracle red. Happy to swap it for an official mark.

IAM setup

Allow group <group> to read secret-bundles in compartment <compartment> where target.vault.id = '<vault OCID>'
Allow group <group> to inspect secrets in compartment <compartment>

The second statement is needed only for Test Connection and the env editor's autocomplete. References still resolve with only the first, the same split as the Parameter Store provider's ssm:DescribeParameters.

Migration

0206_oci_vault_provider.sql adds the enum value.

Not in this PR

  • Instance and resource principals (host identity), for the reason under Authentication above
  • Realms other than the commercial oc1 (oraclecloud.com)
  • Choosing a secret version or stage
  • Referencing a secret by OCID
  • User docs for docs.dokploy.com (separate repo)

Testing

  • 16 new unit tests in __test__/env/vault.test.ts:
    • the signature verifies against the public key, and the request URL, method and signed headers are correct
    • JSON field extraction, with each secret fetched once
    • binary secrets rejected, and a leading BOM dropped
    • the 404 and 401 messages
    • invalid references
    • fingerprint mismatch
    • passphrase-protected keys
    • the list endpoint and its 404 hint, and paging
    • end-to-end resolveVaultReferences
    • schema rejection of values that could alter the request
  • Signatures cross-checked against oci-common@2.143.0 (byte-identical for the POST and the GET); fingerprints cross-checked against openssl md5 -c
  • tsc --noEmit passes for packages/server and apps/dokploy. Biome is clean on the changed lines; the two noLabelWithoutControl findings in handle-vault-provider.tsx are on existing lines.
  • Full suite, rebased on current canary: 1910 passed. The 7 failures (deploy/application.real.test.ts, logs-and-metrics/provider-fetch.test.ts) fail the same way on canary in this environment: real git and Docker builds, and undici on Node 26.
  • Tested against a live OCI tenancy (Default vault, software key) in a local Dokploy instance, as a user that only has the two policy statements above:
    • Create the provider in Settings → Secrets, Test Connection and the env editor's autocomplete, then deploy with secret-name and secret-name:field references. The deployed service gets the resolved values, including fields of a JSON secret saved with a leading BOM.
    • Editing a saved provider keeps the masked private key: after renaming the provider, Test Connection and a redeploy still work.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking fix recommended to preserve leading characters in secret values.

Summary

Adds OCI Vault as a secrets provider without adding a dependency.

  • Dokploy can resolve environment-variable secrets from OCI Vault.

Acknowledged scope: flozano explicitly deferred the existing whitelabelingConfig default mismatch to a separate fix and kept it out of this migration.

Reviews (1) · Last reviewed commit: "feat(vault): add OCI Vault secrets provi..." · Reviewed by Greptile

@Siumauricio
Siumauricio marked this pull request as ready for review November 5, 2026 18:46
@Siumauricio
Siumauricio self-requested a review as a code owner November 5, 2026 18:46
Comment thread packages/server/src/utils/vault/oci.ts Resolved
@flozano
flozano force-pushed the feat/oci-vault-provider branch from 10d7c38 to a040288 Compare November 5, 2026 19:55
@flozano

flozano commented Nov 12, 2026

Copy link
Copy Markdown
Author

Live testing against an OCI tenancy is done. Creating the provider, Test Connection, autocomplete and a deploy with references all work in a local instance, using a user that only has the two documented policy statements. Details are in the testing section. Ready for review whenever you have a moment.

flozano and others added 2 commits November 21, 2026 15:51
Adds Oracle Cloud Infrastructure Vault as a vault provider alongside AWS
Secrets Manager, AWS Parameter Store and the others.

- New `oci` provider type with a zod-validated config (region, tenancy,
  user, API key fingerprint, PEM private key with optional passphrase,
  vault and compartment OCIDs) and a migration adding the enum value
- Plain `fetch` client (no new dependency) that signs requests with OCI's
  HTTP Signature scheme via node:crypto: getByName for reads, the secrets
  listing for the connection test and the env editor autocomplete
- Refs are `name[:field]`, the field selector extracting a key from JSON
  secrets like the AWS provider
- Private key and passphrase masked in API responses like every other
  provider credential
- Settings -> Secrets form with reference format and IAM policy help

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@flozano
flozano force-pushed the feat/oci-vault-provider branch from 121e13b to c67d0d8 Compare November 21, 2026 14:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add OCI Vault (Oracle Cloud) as a secrets provider

1 participant