Skip to content

feat(vault): add Phase.dev secrets provider - #5123

Open
barrynorman wants to merge 1 commit into
Dokploy:canaryfrom
barrynorman:feat/vault-phase-provider
Open

feat(vault): add Phase.dev secrets provider#5123
barrynorman wants to merge 1 commit into
Dokploy:canaryfrom
barrynorman:feat/vault-phase-provider

Conversation

@barrynorman

@barrynorman barrynorman commented Aug 18, 2026

Copy link
Copy Markdown

Summary

  • Add Phase.dev as a vault secrets provider for deploy-time ${{vault.*}} resolution via the Phase REST API (Service Account token).
  • Schema/migration, UI (provider form + icons + roles), server client, and vault env tests aligned with existing Infisical/Doppler providers.
  • Fixes feat: add Phase.dev as a secrets provider #5122

Caveats

  • Phase apps must have SSE (Server-Side Encryption) enabled for REST secret reads with a Service Account token.
  • Auth uses a Service Account token (not user PAT); configure token + app/env identifiers in the vault provider settings.

Test plan

  • Apply migration 0186_phase_vault_provider.sql / run drizzle migrate
  • Create a Phase vault provider in Settings → Vault with SA token + SSE-enabled app
  • Deploy an app using ${{vault.KEY}} (or equivalent) and confirm secret resolves at deploy time
  • Confirm other providers (Infisical/Doppler/etc.) still work
  • Run apps/dokploy/__test__/env/vault.test.ts

Docs

Docs update for Phase in Dokploy/website secrets-providers will follow (or a linked docs PR/issue).

Made with Cursor

Greptile Summary

The PR adds Phase.dev as a deploy-time vault provider, including persistence, migration metadata, dashboard configuration, provider dispatch, REST secret retrieval, credential masking, and tests.

  • Adds Phase provider schema, enum migration, client registration, masking, and REST API integration.
  • Adds dashboard fields, labels, icon, and custom-role description updates.
  • Adds connection, lookup, missing-secret, authentication, SSE, listing, and end-to-end resolution tests.

Confidence Score: 3/5

This PR should not merge until a create-only caller is prevented from redirecting an existing Phase provider's stored Service Account token to an arbitrary endpoint.

The new client sends stored Phase credentials to a configurable URL, and the existing create-authorized connection-test flow can merge an existing masked credential into an edited config before issuing that request.

Files Needing Attention: packages/server/src/utils/vault/phase.ts, packages/server/src/db/schema/vault-provider.ts, and apps/dokploy/server/api/routers/vault-provider.ts

Security Review

The Phase connection-test path can disclose an existing provider's Service Account token: a create-only caller can submit an attacker-controlled API URL with the masked credential sentinel, causing the stored token to be merged and forwarded to that URL. How this was verified: The create-authorized test route merges the stored masked token into submitted config, and the Phase client sends it in the Authorization header to the submitted apiUrl.

Reviews (1): Last reviewed commit: "feat(vault): add Phase.dev secrets provi..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Context used:

Enable deploy-time ${{vault.*}} resolution from Phase via the REST API
(Service Account token + SSE-enabled apps), matching existing Infisical/Doppler providers.

Fixes Dokploy#5122

Co-authored-by: Cursor <cursoragent@cursor.com>
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 18, 2026
Comment on lines +37 to +42
const url = new URL(`${baseUrl(config)}${path}`);
if (params) {
for (const [key, value] of Object.entries(params)) {
url.searchParams.set(key, value);
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Stored token endpoint redirect

When a custom role has vaultProvider.create but not update access, it can test an existing Phase provider with the masked token and a replacement apiUrl; the route restores the stored token and this request sends it to that URL, disclosing the Service Account credential. How this was verified: The create-authorized test route merges the stored masked token into submitted config, and the Phase client sends it in the Authorization header to the submitted apiUrl.

Knowledge Base Used: DNS and Vault Providers

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add Phase.dev as a secrets provider

1 participant