2018-09-25 16:28:26 +00:00
|
|
|
import { computed } from '@ember/object';
|
2018-04-03 14:16:57 +00:00
|
|
|
import DS from 'ember-data';
|
2018-06-12 21:06:37 +00:00
|
|
|
import { expandAttributeMeta } from 'vault/utils/field-to-attrs';
|
2018-04-03 14:16:57 +00:00
|
|
|
|
|
|
|
const { attr } = DS;
|
|
|
|
|
|
|
|
export default DS.Model.extend({
|
|
|
|
backend: attr('string'),
|
|
|
|
der: attr(),
|
|
|
|
pem: attr('string'),
|
|
|
|
caChain: attr('string'),
|
|
|
|
attrList(keys) {
|
2018-06-12 21:06:37 +00:00
|
|
|
return expandAttributeMeta(this, keys);
|
2018-04-03 14:16:57 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
//urls
|
|
|
|
urlsAttrs: computed(function() {
|
|
|
|
let keys = ['issuingCertificates', 'crlDistributionPoints', 'ocspServers'];
|
|
|
|
return this.attrList(keys);
|
|
|
|
}),
|
|
|
|
issuingCertificates: attr({
|
|
|
|
editType: 'stringArray',
|
|
|
|
}),
|
|
|
|
crlDistributionPoints: attr({
|
|
|
|
label: 'CRL Distribution Points',
|
|
|
|
editType: 'stringArray',
|
|
|
|
}),
|
|
|
|
ocspServers: attr({
|
|
|
|
label: 'OCSP Servers',
|
|
|
|
editType: 'stringArray',
|
|
|
|
}),
|
|
|
|
|
|
|
|
//tidy
|
|
|
|
tidyAttrs: computed(function() {
|
|
|
|
let keys = ['tidyCertStore', 'tidyRevocationList', 'safetyBuffer'];
|
|
|
|
return this.attrList(keys);
|
|
|
|
}),
|
|
|
|
tidyCertStore: attr('boolean', {
|
|
|
|
defaultValue: false,
|
|
|
|
label: 'Tidy the Certificate Store',
|
|
|
|
}),
|
|
|
|
tidyRevocationList: attr('boolean', {
|
|
|
|
defaultValue: false,
|
|
|
|
label: 'Tidy the Revocation List (CRL)',
|
|
|
|
}),
|
|
|
|
safetyBuffer: attr({
|
|
|
|
defaultValue: '72h',
|
|
|
|
editType: 'ttl',
|
|
|
|
}),
|
|
|
|
|
|
|
|
crlAttrs: computed(function() {
|
|
|
|
let keys = ['expiry'];
|
|
|
|
return this.attrList(keys);
|
|
|
|
}),
|
|
|
|
//crl
|
|
|
|
expiry: attr({
|
|
|
|
defaultValue: '72h',
|
|
|
|
editType: 'ttl',
|
|
|
|
}),
|
|
|
|
});
|