mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 07:01:09 +02:00
* 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
49 lines
1.5 KiB
TypeScript
49 lines
1.5 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 { SystemWriteSyncDestinationsGcpSmNameRequest } from '@hashicorp/vault-client-typescript';
|
|
|
|
type GcpSmFormData = SystemWriteSyncDestinationsGcpSmNameRequest & {
|
|
name: string;
|
|
};
|
|
|
|
export default class GcpSmForm extends Form<GcpSmFormData> {
|
|
formFieldGroups = [
|
|
new FormFieldGroup('default', [
|
|
commonFields.name,
|
|
new FormField('project_id', 'string', {
|
|
label: 'Project ID',
|
|
subText:
|
|
'The target project to manage secrets in. If set, overrides the project derived from the service account JSON credentials or application default credentials.',
|
|
}),
|
|
]),
|
|
new FormFieldGroup('Credentials', [
|
|
new FormField('credentials', 'string', {
|
|
label: 'JSON credentials',
|
|
subText:
|
|
'If empty, Vault will use the GOOGLE_APPLICATION_CREDENTIALS environment variable if configured.',
|
|
editType: 'file',
|
|
docLink: '/vault/docs/secrets/gcp#authentication',
|
|
}),
|
|
]),
|
|
new FormFieldGroup('Advanced configuration', [
|
|
commonFields.granularity,
|
|
commonFields.secretNameTemplate,
|
|
commonFields.customTags,
|
|
]),
|
|
];
|
|
|
|
toJSON() {
|
|
const formState = super.toJSON();
|
|
const data = getPayload<GcpSmFormData>('gcp-sm', this.data, this.isNew);
|
|
return { ...formState, data };
|
|
}
|
|
}
|