mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-19 13:41:10 +02:00
* VAULT-13782 move keys tab next to issuers * VAULT-13794 move private_key_format to key paramter toggle * Fix failing tests! * Move format and private key format out * Address feedback and fix not valid after spacing * Add more spacing and code cleanup * Remove engines stylesheet * Remove class conditional logic
17 lines
626 B
JavaScript
17 lines
626 B
JavaScript
/**
|
|
* keyParamsByType
|
|
* @param {string} type - refers to `type` attribute on the pki/action model. Should be one of 'exported', 'internal', 'existing', 'kms'
|
|
* @returns array of valid key-related attribute names (camelCase). NOTE: Key params are not used on all action endpoints
|
|
*/
|
|
export function keyParamsByType(type) {
|
|
let fields = ['keyName', 'keyType', 'keyBits'];
|
|
if (type === 'existing') {
|
|
fields = ['keyRef'];
|
|
} else if (type === 'kms') {
|
|
fields = ['keyName', 'managedKeyName', 'managedKeyId'];
|
|
} else if (type === 'exported') {
|
|
fields = [...fields, 'privateKeyFormat'];
|
|
}
|
|
return fields;
|
|
}
|