2023-03-15 16:00:52 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2023-01-23 19:36:34 +00:00
|
|
|
import Model, { attr } from '@ember-data/model';
|
|
|
|
import { withFormFields } from 'vault/decorators/model-form-fields';
|
|
|
|
import lazyCapabilities, { apiPath } from 'vault/macros/lazy-capabilities';
|
|
|
|
|
|
|
|
@withFormFields()
|
2023-05-23 22:24:53 +00:00
|
|
|
export default class PkiConfigUrlsModel extends Model {
|
2023-01-23 19:36:34 +00:00
|
|
|
// 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:
|
2023-04-19 16:16:30 +00:00
|
|
|
'The URL values for the Issuing Certificate field; these are different URLs for the same resource.',
|
2023-01-23 19:36:34 +00:00
|
|
|
showHelpText: false,
|
2023-02-02 17:23:15 +00:00
|
|
|
editType: 'stringArray',
|
2023-01-23 19:36:34 +00:00
|
|
|
})
|
|
|
|
issuingCertificates;
|
|
|
|
|
|
|
|
@attr({
|
|
|
|
label: 'CRL distribution points',
|
|
|
|
subText: 'Specifies the URL values for the CRL Distribution Points field.',
|
|
|
|
showHelpText: false,
|
2023-02-02 17:23:15 +00:00
|
|
|
editType: 'stringArray',
|
2023-01-23 19:36:34 +00:00
|
|
|
})
|
|
|
|
crlDistributionPoints;
|
|
|
|
|
|
|
|
@attr({
|
|
|
|
label: 'OSCP Servers',
|
|
|
|
subText: 'Specifies the URL values for the OCSP Servers field.',
|
|
|
|
showHelpText: false,
|
2023-02-02 17:23:15 +00:00
|
|
|
editType: 'stringArray',
|
2023-01-23 19:36:34 +00:00
|
|
|
})
|
|
|
|
ocspServers;
|
|
|
|
|
|
|
|
@lazyCapabilities(apiPath`${'id'}/config/urls`, 'id') urlsPath;
|
|
|
|
|
|
|
|
get canSet() {
|
|
|
|
return this.urlsPath.get('canCreate') !== false;
|
|
|
|
}
|
|
|
|
}
|