vault/ui/app/forms/mfa/method/okta.ts
Vault Automation 0a27857988
[UI] Ember Data Migration - MFA (#14721) (#14894)
* 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>
2026-05-20 13:36:35 +00:00

44 lines
1.4 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 { MfaCreateOktaMethodRequest } from '@hashicorp/vault-client-typescript';
type MfaCreateOktaMethodFormData = MfaCreateOktaMethodRequest & {
name: string;
};
export default class MfaCreateOktaMethodForm extends Form<MfaCreateOktaMethodFormData> {
type = 'okta';
formFields = [
new FormField('username_format', 'string', {
label: 'Username format',
subText: 'How to map identity names to MFA method names. ',
}),
new FormField('mount_accessor', 'string'),
new FormField('org_name', 'string', {
label: 'Organization name',
subText: 'Name of the organization to be used in the Okta API.',
}),
new FormField('api_token', 'string', {
label: 'Okta API key',
}),
new FormField('base_url', 'string', {
label: 'Base URL',
subText:
'If set, will be used as the base domain for API requests. Example are okta.com, oktapreview.com and okta-emea.com.',
}),
new FormField('primary_email', 'boolean'),
];
validations: Validations = {
org_name: [{ type: 'presence', message: 'Org name is required.' }],
api_token: [{ type: 'presence', message: 'API token is required.' }],
};
}