Skip to content

Improve cache invalidation in IdP SP cache #129024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

tvernum
Copy link
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 >enhancement 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!) >bug and removed >enhancement labels Jun 6, 2025
@elasticsearchmachine elasticsearchmachine merged commit 79eff38 into elastic:9.0 Jun 6, 2025
16 checks passed
@tvernum tvernum deleted the backport/9.0/128890-Improve-cache-invalidation-in branch June 6, 2025 05:53
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 v9.0.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants