mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-18 21:21:06 +02:00
* Add map between model types and helpUrls, update tests * replace modelProto.getHelpUrl with new helper util * Remove all useOpenApi and getHelpUrl instances from models * Add missing auth config model type
39 lines
954 B
JavaScript
39 lines
954 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { attr } from '@ember-data/model';
|
|
import { withFormFields } from 'vault/decorators/model-form-fields';
|
|
import PkiCertificateBaseModel from './base';
|
|
|
|
const generateFromRole = [
|
|
{
|
|
default: ['commonName', 'userIds', 'customTtl', 'format', 'privateKeyFormat'],
|
|
},
|
|
{
|
|
'Subject Alternative Name (SAN) Options': [
|
|
'excludeCnFromSans',
|
|
'altNames',
|
|
'ipSans',
|
|
'uriSans',
|
|
'otherSans',
|
|
],
|
|
},
|
|
];
|
|
// Extra fields returned on the /issue endpoint
|
|
const certDisplayFields = [
|
|
'certificate',
|
|
'commonName',
|
|
'revocationTime',
|
|
'serialNumber',
|
|
'caChain',
|
|
'issuingCa',
|
|
'privateKey',
|
|
'privateKeyType',
|
|
];
|
|
@withFormFields(certDisplayFields, generateFromRole)
|
|
export default class PkiCertificateGenerateModel extends PkiCertificateBaseModel {
|
|
@attr('string') role; // role name to issue certificate against for request URL
|
|
}
|