vault/ui/lib/sync/addon/utils/constants.ts
Vault Automation 31fb778a51
[UI] VAULT-42756 - Secret sync WIF implementation (#14001) (#14167)
* VAULT-42427 - initial code updates for aws form

* VAULT-42756 - implemented wif support for secret sync

* VAULT-42756 - added acceptance and integration test cases for WIF support

* refactor: streamline WIF credential handling and enhance destination details management

* added changelog

* fixed review comments

* updated changelog

* fixed failing tests

* fixed review comments

* fixed validation for Edit scenario

* fixed region field to have no default value selected

* Refactor: updated string literals with centralized enums and some other refactors

Co-authored-by: mohit-hashicorp <mohit.ojha@hashicorp.com>
2026-04-22 12:46:13 +05:30

39 lines
1.1 KiB
TypeScript

/**
* Copyright IBM Corp. 2016, 2025
* SPDX-License-Identifier: BUSL-1.1
*/
export enum CredentialType {
ACCOUNT = 'account',
WIF = 'wif',
}
export enum DestinationType {
AwsSm = 'aws-sm',
AzureKv = 'azure-kv',
GcpSm = 'gcp-sm',
Gh = 'gh',
VercelProject = 'vercel-project',
}
export const CLOUD_DESTINATION_TYPES = [
DestinationType.AwsSm,
DestinationType.AzureKv,
DestinationType.GcpSm,
] as const;
export type CloudDestinationType = (typeof CLOUD_DESTINATION_TYPES)[number];
const COMMON_WIF_FIELDS = ['identity_token_audience', 'identity_token_ttl', 'identity_token_key'];
export const ACCOUNT_CREDENTIAL_FIELDS: Record<CloudDestinationType, string[]> = {
[DestinationType.AwsSm]: ['access_key_id', 'secret_access_key'],
[DestinationType.AzureKv]: ['client_secret'],
[DestinationType.GcpSm]: ['credentials'],
};
export const WIF_CREDENTIAL_FIELDS: Record<CloudDestinationType, string[]> = {
[DestinationType.AwsSm]: [...COMMON_WIF_FIELDS],
[DestinationType.AzureKv]: [...COMMON_WIF_FIELDS],
[DestinationType.GcpSm]: [...COMMON_WIF_FIELDS, 'service_account_email'],
};