Vault SSH Cert Feature (#1596)

* feat: 🎸 Update models for vault ssh cert feature (#1591)

✅ Closes: ICU-7546

* feat: 🎸 Setup types in cred library forms and use HDS component (#1597)

* feat: 🎸 Setup types in cred library forms and use HDS component

✅ Closes: ICU-7673

* feat: 🎸 Add vault ssh cert type for credential library (#1608)

* feat: 🎸 Add vault ssh cert type for credential library

✅ Closes: ICU-7678

* feat: 🎸 Enable feature flag for vault ssh cert work (#1614)

* fix: 🐛 Change fields to optional as they get default by backend (#1615)

* Chore/cleanup vault ssh cert (#1616)
This commit is contained in:
Zhihe Li authored and GitHub committed 2023-02-01 13:46:23 -05:00
1 parent e3772352ea
commit f0530e1f8f
34 files changed
+1421 -182

No files matched your search

+30 -3
View File
@@ -5,12 +5,20 @@ import GeneratedCredentialLibraryModel from '../generated/models/credential-libr
*/
export const options = {
http_method: ['GET', 'POST'],
key_type: ['ed25519', 'ecdsa', 'rsa'],
};
export const TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC = 'vault-generic';
export const TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE =
'vault-ssh-certificate';
/**
* Supported Credential Library types.
*/
export const types = ['vault'];
export const TYPES_CREDENTIAL_LIBRARY = Object.freeze([
TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE,
]);
export default class CredentialLibraryModel extends GeneratedCredentialLibraryModel {
// =attributes
@@ -20,7 +28,7 @@ export default class CredentialLibraryModel extends GeneratedCredentialLibraryMo
* @type {boolean}
*/
get isUnknown() {
return !types.includes(this.type);
return !TYPES_CREDENTIAL_LIBRARY.includes(this.type);
}
/**
@@ -28,6 +36,25 @@ export default class CredentialLibraryModel extends GeneratedCredentialLibraryMo
* @type {boolean}
*/
get isVault() {
return this.type === 'vault';
return (
this.type === TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC ||
this.type === TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE
);
}
/**
* True if credential is a generic vault type.
* @type {boolean}
*/
get isVaultGeneric() {
return this.type === TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC;
}
/**
* True if credential is a vault ssh cert type.
* @type {boolean}
*/
get isVaultSSHCertificate() {
return this.type === TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE;
}
}