Add password type to models and mirage (#3039)
* feat: 🎸 add new password type to cred models + mirage * test: 💍 fix * refactor: 💡 update target mirage trait * chore: 🤖 add missing attr type
This commit is contained in:
1 parent
2bf09011fb
commit
f39961bbf5
8 files changed
+39
-14
No files matched your search
@@ -59,9 +59,9 @@ export default class GeneratedCredentialModel extends BaseModel {
|
||||
})
|
||||
username;
|
||||
|
||||
// =attributes (username_password, username_password_domain)
|
||||
// =attributes (username_password, username_password_domain, password)
|
||||
@attr('string', {
|
||||
for: ['username_password', 'username_password_domain'],
|
||||
for: ['username_password', 'username_password_domain', 'password'],
|
||||
isNestedAttribute: true,
|
||||
isSecret: true,
|
||||
description: 'The password for credential.',
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
TYPE_CREDENTIAL_SSH_PRIVATE_KEY,
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN,
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD,
|
||||
TYPE_CREDENTIAL_PASSWORD,
|
||||
} from 'api/models/credential';
|
||||
/**
|
||||
* Enum options for credential library.
|
||||
@@ -19,6 +20,7 @@ export const options = {
|
||||
TYPE_CREDENTIAL_SSH_PRIVATE_KEY,
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD,
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN,
|
||||
TYPE_CREDENTIAL_PASSWORD,
|
||||
],
|
||||
mapping_overrides: {
|
||||
username_password: ['username_attribute', 'password_attribute'],
|
||||
@@ -32,6 +34,7 @@ export const options = {
|
||||
'password_attribute',
|
||||
'domain_attribute',
|
||||
],
|
||||
password: ['password_attribute'],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -12,13 +12,16 @@ import GeneratedCredentialModel from '../generated/models/credential';
|
||||
export const TYPE_CREDENTIAL_USERNAME_PASSWORD = 'username_password';
|
||||
export const TYPE_CREDENTIAL_SSH_PRIVATE_KEY = 'ssh_private_key';
|
||||
export const TYPE_CREDENTIAL_JSON = 'json';
|
||||
export const TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN = 'username_password_domain';
|
||||
export const TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN =
|
||||
'username_password_domain';
|
||||
export const TYPE_CREDENTIAL_PASSWORD = 'password';
|
||||
|
||||
export const TYPES_CREDENTIAL = Object.freeze([
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD,
|
||||
TYPE_CREDENTIAL_SSH_PRIVATE_KEY,
|
||||
TYPE_CREDENTIAL_USERNAME_PASSWORD_DOMAIN,
|
||||
TYPE_CREDENTIAL_JSON,
|
||||
TYPE_CREDENTIAL_PASSWORD,
|
||||
]);
|
||||
|
||||
export default class CredentialModel extends GeneratedCredentialModel {
|
||||
|
||||
Reference in new issue
Block a user