2022-07-19 13:02:04 -07:00
|
|
|
import GeneratedCredentialModel from '../generated/models/credential';
|
2022-09-02 12:29:39 -07:00
|
|
|
import { equal } from '@ember/object/computed';
|
2022-07-19 13:02:04 -07:00
|
|
|
|
2022-09-20 17:31:16 -07:00
|
|
|
/**
|
|
|
|
|
* Supported Credential types.
|
|
|
|
|
*/
|
|
|
|
|
export const types = ['username_password', 'ssh_private_key'];
|
|
|
|
|
|
2022-09-02 12:29:39 -07:00
|
|
|
export default class CredentialModel extends GeneratedCredentialModel {
|
|
|
|
|
// =attributes
|
|
|
|
|
/**
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
@equal('type', 'username_password') isUsernamePassword;
|
2022-09-20 17:31:16 -07:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* True if credential is an unknown type.
|
|
|
|
|
* @type {boolean}
|
|
|
|
|
*/
|
|
|
|
|
get isUnknown() {
|
|
|
|
|
return !types.includes(this.type);
|
|
|
|
|
}
|
2022-09-02 12:29:39 -07:00
|
|
|
}
|