Repository navigation
Fix(admin-ui): key status filtering issue in KeysListTab - #34721
Merged
edewit merged 1 commit intoNov 7, 2024
Merged
Conversation
8000
Support customer reports that keys with 'Active' set to 'off' still appear in the Active keys list in the Admin console under Realms settings -> Keys -> Keys list. The root cause was identified as the filtering logic, which does not apply status-based filtering for the first item in FILTER_OPTIONS ('ACTIVE'). This commit corrects the filtering logic to properly exclude keys based on the 'Active' status selection.
Closes #34675
Signed-off-by: Charley <charley.geoffroy@protonmail.com>
edewit
approved these changes
Nov 7, 2024
edewit
enabled auto-merge (squash)
November 7, 2024 11:05
This was referenced Nov 20, 2024
Merged
edewit
pushed a commit
to edewit/keycloak
that referenced
this pull request
Dec 2, 2024
) Support customer reports that keys with 'Active' set to 'off' still appear in the Active keys list in the Admin console under Realms settings -> Keys -> Keys list. The root cause was identified as the filtering logic, which does not apply status-based filtering for the first item in FILTER_OPTIONS ('ACTIVE'). This commit corrects the filtering logic to properly exclude keys based on the 'Active' status selection. Closes keycloak#34675 Signed-off-by: Charley <charley.geoffroy@protonmail.com> (cherry picked from commit 46f7fb5) Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
ssilvert
pushed a commit
that referenced
this pull request
Dec 9, 2024
…5133) Support customer reports that keys with 'Active' set to 'off' still appear in the Active keys list in the Admin console under Realms settings -> Keys -> Keys list. The root cause was identified as the filtering logic, which does not apply status-based filtering for the first item in FILTER_OPTIONS ('ACTIVE'). This commit corrects the filtering logic to properly exclude keys based on the 'Active' status selection. Closes #34675 (cherry picked from commit 46f7fb5) Signed-off-by: Charley <charley.geoffroy@protonmail.com> Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com> Co-authored-by: Charley <71822392+charley04310@users.noreply.github.com>
Closed
edewit
added a commit
to edewit/keycloak
that referenced
this pull request
Dec 11, 2024
) (keycloak#35133) Support customer reports that keys with 'Active' set to 'off' still appear in the Active keys list in the Admin console under Realms settings -> Keys -> Keys list. The root cause was identified as the filtering logic, which does not apply status-based filtering for the first item in FILTER_OPTIONS ('ACTIVE'). This commit corrects the filtering logic to properly exclude keys based on the 'Active' status selection. Closes keycloak#34675 (cherry picked from commit 46f7fb5) Signed-off-by: Charley <charley.geoffroy@protonmail.com> Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com> Co-authored-by: Charley <71822392+charley04310@users.noreply.github.com> Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Overview:
Support customer reports that keys with 'Active' set to 'off' still appear in the Active keys list in the Admin console under Realms settings -> Keys -> Keys list. The root cause was identified as the filtering logic, which does not apply status-based filtering for the first item in FILTER_OPTIONS ('ACTIVE'). This commit corrects the filtering logic to properly exclude keys based on the 'Active' status selection.
Solution
This PR refactors the filtering logic in
KeysListTab.tsxto ensure that only keys matching the selected status appear in the list. Specifically, it usesuseMemoto cache and apply the correct filter based on the current selection, so that keys with an "Inactive" status are no longer shown in the Active keys list.How to Test It
Steps to Reproduce the Bug (without the PR)
In the Keycloak Admin Console, go to Realms settings -> Keys -> Add Provider and add the generated key.
Set the key's Active status to "off".
Observe the bug: The key still appears in Realms settings -> Keys -> keys list, even though its status is set to inactive.
Steps to Verify the Fix (with the PR applied)
Repeat steps 3-4 above to add a new key with the "Active" status set to "off."
Verify that the key does not appear in the Active keys list under Keys list.
Closes #34675