Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@charley-geoffroy
Copy link
Contributor

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.tsx to ensure that only keys matching the selected status appear in the list. Specifically, it uses useMemo to 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)

  1. Set up the latest stable version of Keycloak (26.0.4).
  2. Open a terminal and generate a new key with the following command:
keytool -genkeypair -alias <alias> -keyalg RSA -keysize 2048 -validity 365 -keystore <key-name>.jks
  1. In the Keycloak Admin Console, go to Realms settings -> Keys -> Add Provider and add the generated key.

  2. Set the key's Active status to "off".

  3. 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)

  1. Repeat steps 3-4 above to add a new key with the "Active" status set to "off."

  2. Verify that the key does not appear in the Active keys list under Keys list.

Closes #34675

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 <[email protected]>
@charley-geoffroy charley-geoffroy requested a review from a team as a code owner November 6, 2024 21:40
@edewit edewit enabled auto-merge (squash) November 7, 2024 11:05
@edewit edewit merged commit 46f7fb5 into keycloak:main Nov 7, 2024
edewit pushed a commit to edewit/keycloak that referenced this pull request Nov 7, 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 <[email protected]>
Signed-off-by: Erik Jan de Wit <[email protected]>
edewit pushed a commit to edewit/keycloak that referenced this pull request Nov 15, 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 <[email protected]>
edewit pushed a commit to edewit/keycloak that referenced this pull request Nov 20, 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 <[email protected]>
(cherry picked from commit 46f7fb5)
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 <[email protected]>
(cherry picked from commit 46f7fb5)
Signed-off-by: Erik Jan de Wit <[email protected]>
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 <[email protected]>
Signed-off-by: Erik Jan de Wit <[email protected]>
Co-authored-by: Charley <[email protected]>
@edewit edewit mentioned this pull request Dec 11, 2024
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 <[email protected]>
Signed-off-by: Erik Jan de Wit <[email protected]>
Co-authored-by: Charley <[email protected]>
Signed-off-by: Erik Jan de Wit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keys tab showing disabled and inactive keys as active

2 participants