vault/ui/app/forms/sync/azure-kv.ts
Jordan Reimer 8700becc45
[UI] Ember Data Migration - API Property Casing (#31325)
* updates api client vars to snake_case for custom messages

* updates api client vars to snake_case for tools

* updates api client vars to snake_case for sync

* updates api client vars to snake_case for secrets engine

* updates api client vars to snake_case for auth

* updates api client vars to snake_case for usage

* updates api client dep to point to gh repo

* fixes custom-messages service unit tests

* fixes configure-ssh test

* fixes configure-ssh test...again
2025-07-18 09:32:01 -06:00

64 lines
2.2 KiB
TypeScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: BUSL-1.1
*/
import Form from 'vault/forms/form';
import FormField from 'vault/utils/forms/field';
import FormFieldGroup from 'vault/utils/forms/field-group';
import { commonFields, getPayload } from './shared';
import type { SystemWriteSyncDestinationsAzureKvNameRequest } from '@hashicorp/vault-client-typescript';
type AzureKvFormData = SystemWriteSyncDestinationsAzureKvNameRequest & {
name: string;
};
export default class AzureKvForm extends Form<AzureKvFormData> {
formFieldGroups = [
new FormFieldGroup('default', [
commonFields.name,
new FormField('key_vault_uri', 'string', {
label: 'Key Vault URI',
subText:
'URI of an existing Azure Key Vault instance. If empty, Vault will use the KEY_VAULT_URI environment variable if configured.',
editDisabled: true,
}),
new FormField('tenant_id', 'string', {
label: 'Tenant ID',
subText:
'ID of the target Azure tenant. If empty, Vault will use the AZURE_TENANT_ID environment variable if configured.',
editDisabled: true,
}),
new FormField('cloud', 'string', {
subText: 'Specifies a cloud for the client. The default is Azure Public Cloud.',
editDisabled: true,
}),
new FormField('client_id', 'string', {
label: 'Client ID',
subText:
'Client ID of an Azure app registration. If empty, Vault will use the AZURE_CLIENT_ID environment variable if configured.',
}),
]),
new FormFieldGroup('Credentials', [
new FormField('client_secret', 'string', {
subText:
'Client secret of an Azure app registration. If empty, Vault will use the AZURE_CLIENT_SECRET environment variable if configured.',
sensitive: true,
noCopy: true,
}),
]),
new FormFieldGroup('Advanced configuration', [
commonFields.granularity,
commonFields.secretNameTemplate,
commonFields.customTags,
]),
];
toJSON() {
const formState = super.toJSON();
const data = getPayload<AzureKvFormData>('azure-kv', this.data, this.isNew);
return { ...formState, data };
}
}