* feat: 🎸 create form for json credentials ✅ Closes: ICU-6682 * refactor: 💡 add new info field * refactor: 💡 add feature flag * refactor: 💡 add hds radio cards to json cred * Update ui/admin/tests/acceptance/credential-store/credentials/create-test.js * test: 💍 add test for json cred * chore: 🤖 Remove ember-data-model-fragments package * fix: 🐛 Update how json is added as a known credential type * refactor: 💡 update credentialTypes if statement to ternary * chore: 🤖 add ember-data back to addon/api project * chore: 🤖 remove ember-feature-flag from addon/api * refactor: 💡 remove if statement in cred form * refactor: 💡 update selectors for json cred. tests * refactor: 💡 Update Credential Form to use form.disabled * test: 💍 Fix test selectors for radio card credential tests * refactor: 💡 update credential types declaration to const * style: 💄 Fix style issue with SecretEditor in edit mode * refactor: 💡 remove disabled and readonly attributes in form * refactor: 💡 Create credential ability canRead override * test: 💍 add credential ability override tests * test: 💍 Fix brokered credential test with json support added * refactor: 💡 add attributes comment back to credential model Co-authored-by: Cameron Perera <cameron.perera@hashicorp.com>
29 lines
700 B
JavaScript
29 lines
700 B
JavaScript
import GeneratedCredentialModel from '../generated/models/credential';
|
|
|
|
/**
|
|
* Supported Credential types.
|
|
*/
|
|
export const types = ['username_password', 'ssh_private_key', 'json'];
|
|
|
|
export default class CredentialModel extends GeneratedCredentialModel {
|
|
// =attributes
|
|
/**
|
|
* All Credentials are prefixed with "cred" and are considered
|
|
* static due to their relation with Static Credential Stores.
|
|
*
|
|
* True if credential starts with the "cred" prefix.
|
|
* @type {boolean}
|
|
*/
|
|
get isStatic() {
|
|
return this.id.startsWith('cred');
|
|
}
|
|
|
|
/**
|
|
* True if credential is an unknown type.
|
|
* @type {boolean}
|
|
*/
|
|
get isUnknown() {
|
|
return !types.includes(this.type);
|
|
}
|
|
}
|