* 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>
24 lines
546 B
JavaScript
24 lines
546 B
JavaScript
import GeneratedCredentialModel from '../generated/models/credential';
|
|
import { equal } from '@ember/object/computed';
|
|
|
|
/**
|
|
* Supported Credential types.
|
|
*/
|
|
export const types = ['username_password', 'ssh_private_key'];
|
|
|
|
export default class CredentialModel extends GeneratedCredentialModel {
|
|
// =attributes
|
|
/**
|
|
* @type {boolean}
|
|
*/
|
|
@equal('type', 'username_password') isUsernamePassword;
|
|
|
|
/**
|
|
* True if credential is an unknown type.
|
|
* @type {boolean}
|
|
*/
|
|
get isUnknown() {
|
|
return !types.includes(this.type);
|
|
}
|
|
}
|