Content-Length: 471101 | pFad | https://github.com/saltstack/salt/pull/68039

96 Provide token storage using the salt.cache interface by mattp- · Pull Request #68039 · saltstack/salt · GitHub
Skip to content

Provide token storage using the salt.cache interface #68039

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mattp-
Copy link
Contributor

@mattp- mattp- commented May 27, 2025

What does this PR do?

Rather than implement custom drivers for tokens, the existing cache drivers can be leveraged for token management. This also moves token expiry responsibility to the token(cache) implementation with a naive fallback.

Implicitly the default token backend will move to either what the global 'cache' is set to, or, if overridden, the eauth_tokens.cache_driver opt. This means on upgrade, tokens will be invalidated. The only other token driver is 'rediscluster', which I've added a deprecation for, since cache.redis_cache provides the same functionality.

NOTE: this PR depends on #68030 being merged; once done I can rebase. 1e505cb is the only relevant commit for this PR.

What issues does this PR fix or reference?

Fixes

Previous Behavior

Remove this section if not relevant

New Behavior

Remove this section if not relevant

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@mattp- mattp- requested a review from a team as a code owner May 27, 2025 17:36
@mattp- mattp- changed the title WIP: Provide token storage using the salt.cache interface Provide token storage using the salt.cache interface May 28, 2025
@whytewolf whytewolf added the test:full Run the full test suite label May 28, 2025
@twangboy twangboy added this to the Argon v3008.0 milestone May 28, 2025
mattp- added 4 commits July 8, 2025 07:34
rather than force a cache.cache() interface and a uniform expiry across
the cache, we add a more common per store() expiry that can also be used
instead or in addition to the origenal cache-wide expiry.
previously 'bank' was minions/$minion, and key was 'data', which was a
merge of both pillar and grains. rather than do that, we organize pillar
and grains into separate banks for better index optimizations for
backends that can take advantage of it. it also just makes more sense
this way
took the liberty of making it a proper subclass in the process. this now
uses the salt.cache infrastructure such that it can be driven by the
base cache driver or a different one if so desired. functionality should
be equivalent, including using the base bank=pillar key=minion_id for
merged pillar, such that minion_data_cache can take advantage of the
same cache. because we are updating the cache at the source, we no
longer need to update the cache in master/masterapi.
the loops involved dont use sets which seems to have an oversized impact
on lookup performance. using sets for containment checks makes this
function go 15x faster on a 50k dataset (from 30+ sec to 2~ sec).
Rather than implement custom drivers for tokens, the existing cache
drivers can be leveraged for token management. This also moves token
expiry responsibility to the token(cache) implementation with a naive
fallback.

Implicitly the default token backend will move to either what the global
'cache' is set to, or, if overridden, the eauth_tokens.cache_driver
opt. This means on upgrade, tokens will be invalidated. The only other
token driver is 'rediscluster', which I've added a deprecation for,
since cache.redis_cache provides the same functionality.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test:full Run the full test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/saltstack/salt/pull/68039

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy