From 17eea3fb8f3f33ec8ef676b6b0fc035c8aa55f1c Mon Sep 17 00:00:00 2001 From: lohit_user Date: Mon, 22 Jun 2026 21:29:32 +0530 Subject: [PATCH] feat(oc-types): add per-environment external secrets types Add the on-disk types for environment-scoped external secrets: the SecretProviderType union (hashicorp-vault-cloud/server, aws-secrets-manager, azure-key-vault), per-provider secret variable shapes (path / secretName / vaultName), and the ExternalSecrets block on Environment. --- packages/oc-types/src/common/variables.ts | 34 ++++++++++++++++++++ packages/oc-types/src/config/environments.ts | 3 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/packages/oc-types/src/common/variables.ts b/packages/oc-types/src/common/variables.ts index 2ec8fca..1dbcf8f 100644 --- a/packages/oc-types/src/common/variables.ts +++ b/packages/oc-types/src/common/variables.ts @@ -35,3 +35,37 @@ export interface SecretVariable { disabled?: boolean; type?: VariableValueType; } + +interface BaseExternalSecretVariable { + name: string; + description?: Description; + disabled?: boolean; +} + +export interface HashicorpVaultExternalSecret extends BaseExternalSecretVariable { + path: string; +} + +export interface AwsSecretsManagerExternalSecret extends BaseExternalSecretVariable { + secretName: string; +} + +export interface AzureKeyVaultExternalSecret extends BaseExternalSecretVariable { + vaultName: string; +} + +export type ExternalSecretVariable = + | HashicorpVaultExternalSecret + | AwsSecretsManagerExternalSecret + | AzureKeyVaultExternalSecret; + +export type SecretProviderType = + | 'hashicorp-vault-cloud' + | 'hashicorp-vault-server' + | 'aws-secrets-manager' + | 'azure-key-vault'; + +export interface ExternalSecrets { + type: SecretProviderType; + variables?: ExternalSecretVariable[]; +} diff --git a/packages/oc-types/src/config/environments.ts b/packages/oc-types/src/config/environments.ts index 880801d..0bd6775 100644 --- a/packages/oc-types/src/config/environments.ts +++ b/packages/oc-types/src/config/environments.ts @@ -3,7 +3,7 @@ */ import type { Description } from '../common/description'; -import type { Variable, SecretVariable } from '../common/variables'; +import type { Variable, SecretVariable, ExternalSecrets } from '../common/variables'; import type { ClientCertificate } from './certificates'; export interface Environment { @@ -11,6 +11,7 @@ export interface Environment { color?: string; description?: Description; variables?: (Variable | SecretVariable)[]; + externalSecrets?: ExternalSecrets; clientCertificates?: ClientCertificate[]; extends?: string; dotEnvFilePath?: string;