chore: 🤖 vault ldap feature flag

This commit is contained in:
Dharini committed 2025-09-03 17:02:25 -07:00
1 parent ff087738fc
commit df8bfc42bb
5 files changed
+77 -34

No files matched your search

@@ -7,6 +7,7 @@ import Component from '@glimmer/component';
import {
TYPES_CREDENTIAL_LIBRARY,
TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE,
TYPE_CREDENTIAL_LIBRARY_VAULT_LDAP,
} from 'api/models/credential-library';
import { service } from '@ember/service';
@@ -19,11 +20,20 @@ export default class FormCredentialLibraryRadioComponent extends Component {
* @returns {Array.<string>}
*/
get credentialTypes() {
let types = TYPES_CREDENTIAL_LIBRARY;
return this.features.isEnabled('ssh-target')
? types
: types.filter(
let types = [...TYPES_CREDENTIAL_LIBRARY];
if (!this.features.isEnabled('ssh-target')) {
types = types.filter(
(type) => type !== TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE,
);
}
if (!this.features.isEnabled('vault-ldap-credential')) {
types = types.filter(
(type) => type !== TYPE_CREDENTIAL_LIBRARY_VAULT_LDAP,
);
}
return types;
}
}