Files
threshold-ui/ui/admin/app/components/form/credential-library/vault-generic/index.js
T

32 lines
671 B
JavaScript
Raw Normal View History

/**
* 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}
*/
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}
*/
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
}
}