Skip to content

header_rewrite: inherit default hook support - #13486

Merged
bneradt merged 1 commit into
apache:masterfrom
bneradt:header-rewrite-inherit-hooks
Aug 4, 2026
Merged

header_rewrite: inherit default hook support#13486
bneradt merged 1 commit into
apache:masterfrom
bneradt:header-rewrite-inherit-hooks

Conversation

@bneradt

@bneradt bneradt commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@bneradt bneradt added this to the 11.0.0 milestone Aug 4, 2026
Copilot AI lite review requested due to automatic review settings August 4, 2026 15:37
@bneradt bneradt self-assigned this Aug 4, 2026
@bneradt bneradt added header_rewrite header_rewrite plugin Bug AuTest labels Aug 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 exercises set-state-flag at POST_REMAP_HOOK; consider extending the same AuTest (or adding another small gold test) to also execute at least one of the other updated operators at POST_REMAP_HOOK (or another relevant hook) so regressions in inherited allowlist behavior are caught for those operators as well.
/*

Comment thread tests/gold_tests/pluginTest/header_rewrite/post_remap.conf
@bneradt bneradt removed the Bug label Aug 4, 2026
@bneradt
bneradt merged commit e013fde into apache:master Aug 4, 2026
15 checks passed
@bneradt
bneradt deleted the header-rewrite-inherit-hooks branch August 4, 2026 16:42
@github-project-automation github-project-automation Bot moved this to For v10.2.0 in ATS v10.2.x 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)
@cmcfarlen cmcfarlen moved this from For v10.2.0 to Picked v10.2.0 in ATS v10.2.x Aug 5, 2026
@cmcfarlen cmcfarlen modified the milestones: 11.0.0, 10.2.0 Aug 5, 2026
@cmcfarlen

Copy link
Copy Markdown
Contributor

Cherry-picked to the 10.2.x branch as 108d9f6 for the 10.2.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AuTest header_rewrite header_rewrite plugin

Projects

Status: Picked v10.2.0

Development

Successfully merging this pull request may close these issues.

4 participants