mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
* 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>
54 lines
1.9 KiB
TypeScript
54 lines
1.9 KiB
TypeScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import FormField from 'vault/utils/forms/field';
|
|
import FormFieldGroup from 'vault/utils/forms/field-group';
|
|
import { DestinationType } from 'sync/utils/constants';
|
|
|
|
import type { SystemWriteSyncDestinationsVercelProjectNameRequest } from '@hashicorp/vault-client-typescript';
|
|
import CreateDestinationForm from './create-destination';
|
|
|
|
type VercelProjectFormData = SystemWriteSyncDestinationsVercelProjectNameRequest & {
|
|
name: string;
|
|
};
|
|
|
|
export default class VercelProjectForm extends CreateDestinationForm<VercelProjectFormData> {
|
|
formFieldGroups = [
|
|
new FormFieldGroup('default', [
|
|
this.commonFields.name,
|
|
new FormField('project_id', 'string', {
|
|
label: 'Project ID',
|
|
subText: 'Project ID where to manage environment variables.',
|
|
editDisabled: true,
|
|
}),
|
|
new FormField('team_id', 'string', {
|
|
label: 'Team ID',
|
|
subText: 'Team ID the project belongs to. Optional.',
|
|
}),
|
|
new FormField('deployment_environments', 'string', {
|
|
subText: 'Deployment environments where the environment variables are available.',
|
|
editType: 'checkboxList',
|
|
possibleValues: ['development', 'preview', 'production'],
|
|
}),
|
|
]),
|
|
new FormFieldGroup('Credentials', [
|
|
new FormField('access_token', 'string', {
|
|
subText: 'Vercel API access token with the permissions to manage environment variables.',
|
|
sensitive: true,
|
|
noCopy: true,
|
|
}),
|
|
]),
|
|
new FormFieldGroup('Advanced configuration', [
|
|
this.commonFields.granularity,
|
|
this.commonFields.secretNameTemplate,
|
|
]),
|
|
];
|
|
|
|
toJSON() {
|
|
const formState = super.toJSON();
|
|
const data = this.getPayload<VercelProjectFormData>(DestinationType.VercelProject, this.data, this.isNew);
|
|
return { ...formState, data };
|
|
}
|
|
}
|