vault/ui/app/models/pki/urls.js
claire bontempo 9afac14f08
UI: remove references to comma separation for string array edit types (#20163)
* remove intercepting helpText

* add subtext directly to StringList input component

* update tests and add coverage for new openapi-attrs util

* update test

* add warning validation to input

* lol is this right i dont know go

* literally no idea what im doing

* add Description to display attrs struct

* update struct comment

* add descriptions to remaining go fields

* add missing comma

* remaining commas..."

* add description to display attrs

* update tests

* update tests

* add changelog;

* Update ui/app/utils/openapi-to-attrs.js

* update tests following backend changes

* clearly name variable

* format files

* no longer need to test for modified tooltip since coming from backend now
2023-04-19 16:16:30 +00:00

51 lines
1.3 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Model, { attr } from '@ember-data/model';
import { withFormFields } from 'vault/decorators/model-form-fields';
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
@withFormFields()
export default class PkiUrlsModel extends Model {
// This model uses the backend value as the model ID
get useOpenAPI() {
return true;
}
getHelpUrl(backendPath) {
return `/v1/${backendPath}/config/urls?help=1`;
}
@attr({
label: 'Issuing certificates',
subText:
'The URL values for the Issuing Certificate field; these are different URLs for the same resource.',
showHelpText: false,
editType: 'stringArray',
})
issuingCertificates;
@attr({
label: 'CRL distribution points',
subText: 'Specifies the URL values for the CRL Distribution Points field.',
showHelpText: false,
editType: 'stringArray',
})
crlDistributionPoints;
@attr({
label: 'OSCP Servers',
subText: 'Specifies the URL values for the OCSP Servers field.',
showHelpText: false,
editType: 'stringArray',
})
ocspServers;
@lazyCapabilities(apiPath`${'id'}/config/urls`, 'id') urlsPath;
get canSet() {
return this.urlsPath.get('canCreate') !== false;
}
}