2023-03-01 09:39:41 -06:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
2021-07-18 14:31:45 -04:00
|
|
|
import Component from '@glimmer/component';
|
2023-02-01 13:46:23 -05:00
|
|
|
import {
|
|
|
|
|
options,
|
|
|
|
|
TYPES_CREDENTIAL_LIBRARY,
|
|
|
|
|
} from 'api/models/credential-library';
|
2021-07-18 14:31:45 -04:00
|
|
|
|
2023-02-01 13:46:23 -05:00
|
|
|
export default class FormCredentialLibraryVaultGenericComponent extends Component {
|
2021-07-18 14:31:45 -04:00
|
|
|
// =properties
|
|
|
|
|
/**
|
|
|
|
|
* @type {object}
|
|
|
|
|
*/
|
2021-07-22 17:42:37 -04:00
|
|
|
httpMethodOptions = options.http_method;
|
2021-07-18 14:31:45 -04:00
|
|
|
|
2023-02-01 13:46:23 -05:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* @type {Array.<string>}
|
|
|
|
|
*/
|
|
|
|
|
types = TYPES_CREDENTIAL_LIBRARY;
|
|
|
|
|
|
2021-07-18 14:31:45 -04:00
|
|
|
/**
|
|
|
|
|
* Only allow HTTP request body field if http_method is set to POST.
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
2021-07-22 17:42:37 -04:00
|
|
|
get isHttpRequestBodyAllowed() {
|
2022-06-28 19:30:26 -04:00
|
|
|
return this.args.model.http_method?.match(/post/i);
|
2021-07-18 14:31:45 -04:00
|
|
|
}
|
|
|
|
|
}
|