Skip to content

Improve cache invalidation in IdP SP cache#129025

Merged
elasticsearchmachine merged 1 commit intoelastic:8.18from
tvernum:backport/8.18/128890-Improve-cache-invalidation-in
Jun 6, 2025
Merged

Improve cache invalidation in IdP SP cache#129025
elasticsearchmachine merged 1 commit intoelastic:8.18from
tvernum:backport/8.18/128890-Improve-cache-invalidation-in

Conversation

@tvernum
Copy link
Copy Markdown
Contributor

@tvernum tvernum commented Jun 6, 2025

The Identity Provider's Service Provider cache had two issues:

  1. It checked for identity based on sequence numbers, but didn't include the seq_no_primary_term parameter on searches, which means the sequence would always by -2
  2. It didn't track whether the index was deleted, which means it could be caching values from an old version of the index

This commit fixes both of these issues.

In practice neither issue was a problem because there are no deployments that use index-based service providers, however the 2nd issue did cause some challenges for testing.

Backport of: #128890

The Identity Provider's Service Provider cache had two issues:

1. It checked for identity based on sequence numbers, but didn't
   include the `seq_no_primary_term` parameter on searches, which
   means the sequence would always by `-2`
2. It didn't track whether the index was deleted, which means it
   could be caching values from an old version of the index

This commit fixes both of these issues.

In practice neither issue was a problem because there are no
deployments that use index-based service providers, however the 2nd
issue did cause some challenges for testing.

Backport of: elastic#128890
@tvernum tvernum added >bug backport :Security/IdentityProvider Identity Provider (SSO) project in X-Pack auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) labels Jun 6, 2025
@elasticsearchmachine elasticsearchmachine merged commit c234912 into elastic:8.18 Jun 6, 2025
15 checks passed
@tvernum tvernum deleted the backport/8.18/128890-Improve-cache-invalidation-in branch June 6, 2025 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Security/IdentityProvider Identity Provider (SSO) project in X-Pack v8.18.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants