mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-28 04:10:44 -04:00
* Update mfa index route beforeModel to use api instead of store * MFA form... * Remove mfa method * WIP * first arg.. * Working form submit * Working create forms.. * Put model back in original state.. * Working edit * Update methods list * Working detail.. * Working infotablerows * Use form arg instead of model * Set up new enforcements form * MFA enforcement... * Update remaining pages... * Add more util helpers * Refactor * Update targets initial values * Update targets to use api * Update useExisting * Patch SearchSelect and fix mfa-login-enforcement-form test * Some more tests fixed.. * Working mfa-method tests * Passing method-form-test * Update editDisabled * Address feedback.. * Add attribute to data for display * Update displayFields * Add defaultValue * Update tests.. * Conditionally show onClose * Add defaultvalue Co-authored-by: Kianna <30884335+kiannaquach@users.noreply.github.com>
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import Form from 'vault/forms/form';
|
|
import FormField from 'vault/utils/forms/field';
|
|
|
|
import type { Validations } from 'vault/app-types';
|
|
import type { MfaCreateDuoMethodRequest } from '@hashicorp/vault-client-typescript';
|
|
|
|
type MfaCreateDuoMethodFormData = MfaCreateDuoMethodRequest & {
|
|
name: string;
|
|
};
|
|
|
|
export default class MfaCreateDuoMethodForm extends Form<MfaCreateDuoMethodFormData> {
|
|
type = 'duo';
|
|
|
|
formFields = [
|
|
new FormField('username_format', 'string', {
|
|
label: 'Username format',
|
|
subText: 'How to map identity names to MFA method names. ',
|
|
}),
|
|
new FormField('secret_key', 'string', {
|
|
label: 'Duo secret key',
|
|
sensitive: true,
|
|
}),
|
|
new FormField('integration_key', 'string', {
|
|
label: 'Duo integration key',
|
|
sensitive: true,
|
|
}),
|
|
new FormField('api_hostname', 'string', {
|
|
label: 'Duo API hostname',
|
|
}),
|
|
new FormField('push_info', 'string', {
|
|
label: 'Duo push information',
|
|
subText: 'Additional information displayed to the user when the push is presented to them.',
|
|
}),
|
|
new FormField('use_passcode', 'boolean', {
|
|
label: 'Passcode reminder',
|
|
subText: 'If this is turned on, the user is reminded to use the passcode upon MFA validation.',
|
|
}),
|
|
];
|
|
|
|
validations: Validations = {
|
|
secret_key: [{ type: 'presence', message: 'Secret key is required.' }],
|
|
integration_key: [{ type: 'presence', message: 'Integration key is required.' }],
|
|
api_hostname: [{ type: 'presence', message: 'API hostname is required.' }],
|
|
};
|
|
}
|