Repository navigation
mod_authn_socache: add test coverage, fix a crash with AuthnCacheProvideFor in htaccess - #1046
Merged
Merged
Conversation
(TestAuthnSocache.test_authn_socache_173_files_share_directory_context, TestAuthnSocache.test_authn_socache_174_files_context): Based on tests by Hafiar <289389248+0xABCD01 users.noreply.github.com> in GitHub PR apache#930. * test/modules/aaa/env.py (AAATestSetup.__init__): Load mod_authn_socache. (AAATestEnv.__init__): Log mod_authn_socache. (AAATestEnv.write_basic_pwfile, AAATestEnv.write_digest_pwfile, AAATestEnv.preserved_test_conf): New. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
and its use in place of a link to r957072. [skip ci] Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
without AuthnCacheEnable: * modules/aaa/mod_authn_socache.c (authn_cache_setprovider): Don't set configured from an htaccess file. * test/modules/aaa/test_016_authn_socache.py (TestAuthnSocacheHtaccess): Test without AuthnCacheEnable. * changes-entries/authn_socache_htaccess.txt: New file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
APR_NOTFOUND for a missing key. * changes-entries/socache_dbm_notfound.txt: New file. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
compiled: * modules/cache/mod_socache_dbm.c: Include apu_version.h. (socache_dbm_init, socache_dbm_store, socache_dbm_retrieve, socache_dbm_remove, socache_dbm_expire, socache_dbm_status, socache_dbm_iterate): Fix parentheses in the apr_dbm_get_driver() test. (socache_dbm_retrieve): Use rc, not rv. (socache_dbm_expire): Don't return a value. Fixes: 95592b5 (SVN r1891019) Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
notroj
force-pushed
the
test-authn-socache
branch
from
November 16, 2026 18:12
05bad09 to
3dadb40
Compare
Collaborator
Author
|
mod_socache_dbm testing was tripping ASAN at shutdown/restart, will come back to that. |
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.
Adds pytest coverage for
mod_authn_socache, which had none, and fixes bugs found along the way.AuthnCacheProvideForin an htaccess file crashed the child process if caching was not enabled anywhere in the main configuration. It is now ignored there, which is what theAuthnCacheEnabledocumentation already describes.mod_socache_dbmreported a missing key as a generic failure rather thanAPR_NOTFOUND, so withAuthnCacheSOCache dbmevery cache miss logged "Error accessing authentication cache" at error level.mod_socache_dbmfor APR-util 1.7 was never compiled, because the file testedAPU_MAJOR_VERSIONwithout includingapu_version.h, and it did not compile once enabled.The tests cannot see from a response whether the cache answered, so they make the cache and the password file disagree: log in, rewrite the file with a different password, and check which of the two passwords is then accepted. They run against the default provider and
shmcb, notdbm.The two tests using different password files within one directory are based on those in #930. They cover only what is unchanged by that PR; its test that a different
AuthNameseparates entries is not included, since that is not the behaviour on trunk.Also replaces the dead link to r957072 in the
mod_authn_socachemanual page with a description ofap_authn_cache_storeand an example of its use.🤖 Generated with Claude Code