* feat: 🎸 Add support for unknown credential types ✅ Closes: ICU-6153 * fix: 🐛 add unknown cred type * refactor: 💡 move credential type logic to a component * chore: 🤖 fix component name * fix: 🐛 update component name, remove unused translated string * fix: 🐛 file name Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
34 lines
653 B
JavaScript
34 lines
653 B
JavaScript
import GeneratedCredentialLibraryModel from '../generated/models/credential-library';
|
|
|
|
/**
|
|
* Enum options for credential library.
|
|
*/
|
|
export const options = {
|
|
http_method: ['GET', 'POST'],
|
|
};
|
|
|
|
/**
|
|
* Supported Credential Library types.
|
|
*/
|
|
export const types = ['vault'];
|
|
|
|
export default class CredentialLibraryModel extends GeneratedCredentialLibraryModel {
|
|
// =attributes
|
|
|
|
/**
|
|
* True if credential is an unknown type.
|
|
* @type {boolean}
|
|
*/
|
|
get isUnknown() {
|
|
return !types.includes(this.type);
|
|
}
|
|
|
|
/**
|
|
* True if credential is a vault type.
|
|
* @type {boolean}
|
|
*/
|
|
get isVault() {
|
|
return this.type === 'vault';
|
|
}
|
|
}
|