mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-17 20:17:00 +02:00
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import Model, { attr } from '@ember-data/model';
|
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
|
import { withModelValidations } from 'vault/decorators/model-validations';
|
|
|
|
const validations = {
|
|
name: [
|
|
{ type: 'presence', message: 'Name is required.' },
|
|
{
|
|
type: 'containsWhiteSpace',
|
|
message: 'Name cannot contain whitespace.',
|
|
},
|
|
],
|
|
};
|
|
|
|
@withModelValidations(validations)
|
|
export default class PkiIssuerEngineModel extends Model {
|
|
@attr('string', { readOnly: true }) backend;
|
|
@attr('string', {
|
|
label: 'Issuer name',
|
|
fieldValue: 'id',
|
|
})
|
|
name;
|
|
|
|
get useOpenAPI() {
|
|
return true;
|
|
}
|
|
getHelpUrl(backend) {
|
|
return `/v1/${backend}/issuer/example?help=1`;
|
|
}
|
|
|
|
@attr('boolean') isDefault;
|
|
@attr('string') issuerName;
|
|
|
|
// Form Fields not hidden in toggle options
|
|
_attributeMeta = null;
|
|
get formFields() {
|
|
if (!this._attributeMeta) {
|
|
this._attributeMeta = expandAttributeMeta(this, [
|
|
'name',
|
|
'leafNotAfterBehavior',
|
|
'usage',
|
|
'manualChain',
|
|
'issuingCertifications',
|
|
'crlDistributionPoints',
|
|
'ocspServers',
|
|
'deltaCrlUrls', // new endpoint, mentioned in RFC, but need to confirm it's there.
|
|
]);
|
|
}
|
|
return this._attributeMeta;
|
|
}
|
|
}
|