header_rewrite: inherit default hook support - #13486
Merged
Merged
Conversation
Operators intended for every hook maintained private copies of the default allowlist. New hooks added to Statement could therefore remain unavailable for plugin controls and transaction or session state, causing otherwise valid configurations to be rejected. This patch lets those operators inherit Statement's default allowlist and extends the POST_REMAP AuTest to exercise a state operator. Future default hooks will now be available without updating duplicate lists.
Contributor
There was a problem hiding this comment.
Pull request overview
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR removes duplicated per-operator hook allowlists in header_rewrite so operators inherit Statement’s default hook allowlist, preventing new hooks from being rejected by otherwise valid configurations.
Changes:
- Removed custom
initialize_hooks()overrides from several operators to inherit the default hook allowlist. - Extended the POST_REMAP AuTest config to exercise a state operator at
POST_REMAP_HOOK. - Updated test comments/conditions to validate state persistence into
SEND_RESPONSE_HDR_HOOK.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/gold_tests/pluginTest/header_rewrite/post_remap.conf | Extends the gold test to set a state flag at POST_REMAP and assert it when sending the response header. |
| plugins/header_rewrite/operators.h | Removes initialize_hooks() overrides so operators inherit the base/default hook allowlist. |
| plugins/header_rewrite/operators.cc | Deletes the duplicated explicit allowlist implementations for the affected operators. |
Suppressed comments (1)
plugins/header_rewrite/operators.h:1
- This PR changes hook validation behavior for multiple operators by removing their explicit allowlists (e.g.,
OperatorSetPluginCntl,OperatorSetStateInt8,OperatorSetStateInt16) so they inherit the default hook allowlist. The updated gold test only exercisesset-state-flagatPOST_REMAP_HOOK; consider extending the same AuTest (or adding another small gold test) to also execute at least one of the other updated operators atPOST_REMAP_HOOK(or another relevant hook) so regressions in inherited allowlist behavior are caught for those operators as well.
/*
maskit
approved these changes
Aug 4, 2026
cmcfarlen
pushed a commit
to cmcfarlen/trafficserver
that referenced
this pull request
Aug 5, 2026
Operators intended for every hook maintained private copies of the default allowlist. New hooks added to Statement could therefore remain unavailable for plugin controls and transaction or session state, causing otherwise valid configurations to be rejected. This patch lets those operators inherit Statement's default allowlist and extends the POST_REMAP AuTest to exercise a state operator. Future default hooks will now be available without updating duplicate lists. (cherry picked from commit e013fde)
Contributor
|
Cherry-picked to the 10.2.x branch as 108d9f6 for the 10.2.0 release. |
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.
Operators intended for every hook maintained private copies of the
default allowlist. New hooks added to Statement could therefore remain
unavailable for plugin controls and transaction or session state,
causing otherwise valid configurations to be rejected.
This patch lets those operators inherit Statement's default allowlist
and extends the POST_REMAP AuTest to exercise a state operator. Future
default hooks will now be available without updating duplicate lists.