Repository navigation
mod_authn_socache: keep cache entries separate per AuthType, AuthName, provider and server port - #1049
Open
notroj wants to merge 2 commits into
Open
mod_authn_socache: keep cache entries separate per AuthType, AuthName, provider and server port#1049notroj wants to merge 2 commits into
notroj wants to merge 2 commits into
Conversation
authn provider and server port: * modules/aaa/mod_authn_socache.c (construct_key): Take the provider name. Add it, the AuthName for Basic auth, and for the "directory" and "server" contexts the port configured for the server, to the key. (ap_authn_cache_store): Pass the provider name. (check_password, get_realm_hash): Try the key for each provider cached for. * docs/manual/mod/mod_authn_socache.xml: Update AuthnCacheContext to match. * test/modules/aaa/test_016_authn_socache.py (_SocacheBase.url, _SocacheBase.basic): Take a port. (TestAuthnSocache._class_scope): Add locations and a second server for the tests below. (TestAuthnSocache.test_authn_socache_175_files_authname, TestAuthnSocache.test_authn_socache_176_second_provider, TestAuthnSocache.test_authn_socache_177_host_port, TestAuthnSocache.test_authn_socache_178_server_port): New tests. * changes-entries/authn_socache_key.txt: New file. Submitted by: Hafiar <289389248+0xABCD01 users.noreply.github.com> Reviewed by: jorton (committed with changes) Github: closes apache#930 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
* modules/aaa/mod_authn_socache.c (construct_key): Add the lower-cased AuthType to the key. * docs/manual/mod/mod_authn_socache.xml: Document it. * test/modules/aaa/test_016_authn_socache.py (TestAuthnSocache._class_scope): Add Basic and Digest locations sharing a context and AuthName. (TestAuthnSocache.test_authn_socache_179_auth_type): New test. * changes-entries/authn_socache_key.txt: Update. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
notroj
force-pushed
the
authn-socache-key-binding
branch
from
November 17, 2026 11:33
dc9e8e8 to
9ed68fe
Compare
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.
This is #930 rebased onto trunk and squashed into one commit, plus follow-up changes from review; the
AuthTypechange is a second commit.The cache key now includes the
AuthNamefor Basic as well as Digest, the name of the authn provider which stored the entry, and theAuthType. With thedirectoryandservervalues ofAuthnCacheContextit also includes the server's port. Locations which differ in any of these no longer share cache entries.Changes from #930:
ap_get_server_port(). The latter takes the port from theHostheader by default, which let a client miss the cache at will and store an entry per port.AuthTypeis added to the key, since a Basic entry and a Digest entry for the same user and realm are of no use to each other.test_016_authn_socache.py, which trunk has gained since, and extended to cover the provider, port andAuthTypeparts of the key.CHANGESentry is moved tochanges-entries/.This changes behaviour for a custom
AuthnCacheContexttoo: locations sharing one now share entries only where theirAuthType,AuthNameand provider also match.🤖 Generated with Claude Code