2018-09-25 16:28:26 +00:00
|
|
|
import { copy } from 'ember-copy';
|
|
|
|
import { computed } from '@ember/object';
|
2018-04-03 14:16:57 +00:00
|
|
|
import DS from 'ember-data';
|
|
|
|
import Certificate from './pki-certificate';
|
|
|
|
|
|
|
|
const { attr } = DS;
|
|
|
|
|
|
|
|
export default Certificate.extend({
|
|
|
|
signVerbatim: attr('boolean', {
|
|
|
|
readOnly: true,
|
|
|
|
defaultValue: false,
|
|
|
|
}),
|
|
|
|
|
|
|
|
csr: attr('string', {
|
|
|
|
label: 'Certificate Signing Request (CSR)',
|
|
|
|
editType: 'textarea',
|
|
|
|
}),
|
|
|
|
|
|
|
|
fieldGroups: computed('signVerbatim', function() {
|
|
|
|
const options = { Options: ['altNames', 'ipSans', 'ttl', 'excludeCnFromSans', 'otherSans'] };
|
|
|
|
const groups = [
|
|
|
|
{
|
|
|
|
default: ['csr', 'commonName', 'format', 'signVerbatim'],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
if (this.get('signVerbatim') === false) {
|
|
|
|
groups.push(options);
|
|
|
|
}
|
|
|
|
|
2018-09-25 16:28:26 +00:00
|
|
|
return this.fieldsToAttrs(copy(groups, true));
|
2018-04-03 14:16:57 +00:00
|
|
|
}),
|
|
|
|
});
|