Add cache key hash logging field and public API#13134
Open
zwoop wants to merge 1 commit intoapache:masterfrom
Open
Add cache key hash logging field and public API#13134zwoop wants to merge 1 commit intoapache:masterfrom
zwoop wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
Author
|
The use of this new log tag is primarily when the cachekey (or other plugins) modifies the cache key beyond what's in the URL. This allows for data analysis using the unique / identifiable value of the cache key, without spilling any secrets or details into the logs. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds visibility into the cache key digest by introducing a new access log field (ckh) and a new public plugin API to retrieve the raw cache key hash bytes for a transaction, along with accompanying documentation and a gold test update.
Changes:
- Add
ckhlog field that base64-encodes the effective cache key digest. - Add
TSHttpTxnCacheKeyDigestGet()public API for plugins to retrieve the raw digest bytes. - Update admin/API docs and extend the existing milestone logging gold test to validate
ckh.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/gold_tests/logging/verify_milestone_fields.py |
Extends validation to require a base64 ckh field and ensure it’s stable across miss/hit. |
tests/gold_tests/logging/log-milestone-fields.test.py |
Adds ckh to the custom log format used by the gold test. |
src/proxy/logging/TransactionLogData.cc |
Exposes the transaction cache key hash to the logging layer via a new accessor. |
src/proxy/logging/LogAccess.cc |
Implements marshalling for ckh by base64-encoding the cache key digest. |
src/proxy/logging/Log.cc |
Registers the new ckh log field. |
src/api/InkAPI.cc |
Implements the new plugin API TSHttpTxnCacheKeyDigestGet(). |
include/ts/ts.h |
Declares and documents TSHttpTxnCacheKeyDigestGet(). |
include/proxy/logging/TransactionLogData.h |
Declares the new get_cache_lookup_hash() accessor. |
include/proxy/logging/LogAccess.h |
Declares marshal_cache_key_hash(). |
include/proxy/http/HttpCacheSM.h |
Adds HttpCacheSM::get_cache_key() accessor needed by logging/API. |
doc/developer-guide/api/functions/TSHttpTxnCacheKeyDigestGet.en.rst |
Adds developer documentation for the new API function. |
doc/admin-guide/logging/formatting.en.rst |
Documents the new ckh access log field. |
Add 'ckh' log field that emits the base64-encoded cache key digest, and TSHttpTxnCacheKeyDigestGet() for plugin access to the raw hash bytes. Includes admin and API documentation. Co-Author: Craig Taylor
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.
Add 'ckh' log field that emits the base64-encoded cache key digest, and TSHttpTxnCacheKeyDigestGet() for plugin access to the raw hash bytes. Includes admin and API documentation.
Co-Author: Craig Taylor