Skip to content

Commit 67f2c16

Browse files
authored
Merge branch 'main' into add-joins-for-searches
2 parents 45b567e + d8744e8 commit 67f2c16

File tree

5 files changed

+35
-93
lines changed

5 files changed

+35
-93
lines changed

ui/admin/app/components/form/credential-library/radio/index.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import Component from '@glimmer/component';
77
import {
88
TYPES_CREDENTIAL_LIBRARY,
99
TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE,
10-
TYPE_CREDENTIAL_LIBRARY_VAULT_LDAP,
1110
} from 'api/models/credential-library';
1211
import { service } from '@ember/service';
1312

@@ -22,18 +21,10 @@ export default class FormCredentialLibraryRadioComponent extends Component {
2221
get credentialTypes() {
2322
let types = [...TYPES_CREDENTIAL_LIBRARY];
2423

25-
if (!this.features.isEnabled('ssh-target')) {
26-
types = types.filter(
27-
(type) => type !== TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE,
28-
);
29-
}
30-
31-
if (!this.features.isEnabled('vault-ldap-credential')) {
32-
types = types.filter(
33-
(type) => type !== TYPE_CREDENTIAL_LIBRARY_VAULT_LDAP,
34-
);
35-
}
36-
37-
return types;
24+
return this.features.isEnabled('ssh-target')
25+
? types
26+
: types.filter(
27+
(type) => type !== TYPE_CREDENTIAL_LIBRARY_VAULT_SSH_CERTIFICATE,
28+
);
3829
}
3930
}

ui/admin/app/templates/scopes/scope/credential-stores/credential-store/credential-libraries/index.hbs

Lines changed: 30 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,38 @@
4040
@valign='middle'
4141
>
4242
<:body as |B|>
43-
{{#if
44-
(or
45-
(not-eq B.data.type 'vault-ldap')
46-
(feature-flag 'vault-ldap-credential')
47-
)
48-
}}
49-
<B.Tr>
50-
<B.Td>
51-
{{#if (can 'read credential-library' B.data)}}
52-
<LinkTo
53-
@route='scopes.scope.credential-stores.credential-store.credential-libraries.credential-library'
54-
@model={{B.data.id}}
55-
>
56-
{{B.data.displayName}}
57-
</LinkTo>
58-
{{else}}
59-
<Hds::Text::Body @tag='p'>
60-
{{B.data.displayName}}
61-
</Hds::Text::Body>
62-
{{/if}}
43+
<B.Tr>
44+
<B.Td>
45+
{{#if (can 'read credential-library' B.data)}}
46+
<LinkTo
47+
@route='scopes.scope.credential-stores.credential-store.credential-libraries.credential-library'
48+
@model={{B.data.id}}
49+
>
50+
{{B.data.displayName}}
51+
</LinkTo>
52+
{{else}}
6353
<Hds::Text::Body @tag='p'>
64-
{{B.data.description}}
54+
{{B.data.displayName}}
6555
</Hds::Text::Body>
66-
</B.Td>
67-
<B.Td>
68-
<Hds::Badge
69-
@text={{t
70-
(concat 'resources.credential-library.types.' B.data.type)
71-
}}
72-
/>
73-
</B.Td>
74-
<B.Td>
75-
<Hds::Copy::Snippet
76-
@textToCopy={{B.data.id}}
77-
@color='secondary'
78-
/>
79-
</B.Td>
80-
</B.Tr>
81-
{{/if}}
56+
{{/if}}
57+
<Hds::Text::Body @tag='p'>
58+
{{B.data.description}}
59+
</Hds::Text::Body>
60+
</B.Td>
61+
<B.Td>
62+
<Hds::Badge
63+
@text={{t
64+
(concat 'resources.credential-library.types.' B.data.type)
65+
}}
66+
/>
67+
</B.Td>
68+
<B.Td>
69+
<Hds::Copy::Snippet
70+
@textToCopy={{B.data.id}}
71+
@color='secondary'
72+
/>
73+
</B.Td>
74+
</B.Tr>
8275
</:body>
8376
</Hds::Table>
8477
{{else}}

ui/admin/config/features.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ const baseEdition = {
2828
'ldap-auth-methods': false,
2929
'worker-filter': false,
3030
'worker-filter-hcp': false,
31-
// TODO: Remove this flag when Vault-ldap credential library is supported
32-
'vault-ldap-credential': false,
3331
};
3432
// Editions maps edition keys to their associated featuresets.
3533
const featureEditions = {};

ui/admin/tests/acceptance/credential-library/create-test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,6 @@ module('Acceptance | credential-libraries | create', function (hooks) {
444444
},
445445
});
446446

447-
featuresService.enable('vault-ldap-credential');
448-
449447
await visit(urls.newCredentialLibrary);
450448

451449
await click(selectors.TYPE_VAULT_LDAP);
@@ -475,22 +473,6 @@ module('Acceptance | credential-libraries | create', function (hooks) {
475473
);
476474
});
477475

478-
test('cannot select vault ldap when feature is disabled', async function (assert) {
479-
setRunOptions({
480-
rules: {
481-
'color-contrast': {
482-
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-09-04
483-
enabled: false,
484-
},
485-
},
486-
});
487-
488-
await visit(urls.newCredentialLibrary);
489-
490-
assert.false(featuresService.isEnabled('vault-ldap-credential'));
491-
assert.dom(selectors.TYPE_VAULT_LDAP).doesNotExist();
492-
});
493-
494476
test('default `vault-generic` credential library is selected when `ssh-target` feature is not enabled and user manually sets `type` in the query params', async function (assert) {
495477
setRunOptions({
496478
rules: {
@@ -501,8 +483,6 @@ module('Acceptance | credential-libraries | create', function (hooks) {
501483
},
502484
});
503485

504-
featuresService.enable('vault-ldap-credential');
505-
506486
await visit(`${urls.newCredentialLibrary}?type=vault-ssh-certificate`);
507487

508488
assert.dom(selectors.TYPE_VAULT_SSH_CERT).isNotVisible();

ui/admin/tests/acceptance/credential-library/list-test.js

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module('Acceptance | credential-libraries | list', function (hooks) {
1515
setupApplicationTest(hooks);
1616
setupSqlite(hooks);
1717

18-
let featuresService;
1918
const instances = {
2019
scopes: {
2120
org: null,
@@ -59,7 +58,6 @@ module('Acceptance | credential-libraries | list', function (hooks) {
5958
urls.credentialStore = `${urls.credentialStores}/${instances.credentialStore.id}`;
6059
urls.credentialLibraries = `${urls.credentialStore}/credential-libraries`;
6160
urls.vaultLDAPCredentialLibrary = `${urls.credentialLibraries}/${instances.vaultLDAPCredentialLibrary.id}`;
62-
featuresService = this.owner.lookup('service:features');
6361
});
6462

6563
test('Users can navigate to credential libraries with proper authorization', async function (assert) {
@@ -108,28 +106,10 @@ module('Acceptance | credential-libraries | list', function (hooks) {
108106
},
109107
});
110108

111-
featuresService.enable('vault-ldap-credential');
112109
await visit(urls.credentialLibraries);
113110

114111
assert
115112
.dom(commonSelectors.TABLE_RESOURCE_LINK(urls.vaultLDAPCredentialLibrary))
116113
.isVisible();
117114
});
118-
119-
test('User cannot navigate to vault ldap credential library details when feature is not enabled', async function (assert) {
120-
setRunOptions({
121-
rules: {
122-
'color-contrast': {
123-
// [ember-a11y-ignore]: axe rule "color-contrast" automatically ignored on 2025-09-04
124-
enabled: false,
125-
},
126-
},
127-
});
128-
129-
await visit(urls.credentialLibraries);
130-
131-
assert
132-
.dom(commonSelectors.TABLE_RESOURCE_LINK(urls.vaultLDAPCredentialLibrary))
133-
.doesNotExist();
134-
});
135115
});

0 commit comments

Comments
 (0)