Skip to content

hrw4u: disallow inbound.url.{} as an operator#13121

Open
mlibbey wants to merge 1 commit intoapache:masterfrom
mlibbey:hrw4u-inbound-url-operator-removal
Open

hrw4u: disallow inbound.url.{} as an operator#13121
mlibbey wants to merge 1 commit intoapache:masterfrom
mlibbey:hrw4u-inbound-url-operator-removal

Conversation

@mlibbey
Copy link
Copy Markdown
Contributor

@mlibbey mlibbey commented Apr 27, 2026

When one uses inbound.url.{} as an operator, for instance: REMAP {
inbound.url.host = "example.com";
}
hrw4u turns this into set-destination which modifies the outbound URL, making the naming actively misleading.

inbound.url reads from the pristine client URL (CLIENT-URL) which is immutable — ATS provides no mechanism to set it. So, removing this as an operator, but keeping it as a valid condition.

@mlibbey mlibbey requested review from bneradt and zwoop April 27, 2026 23:26
@mlibbey mlibbey added the header_rewrite header_rewrite plugin label Apr 27, 2026
When one uses inbound.url.{} as an operator, for instance:
REMAP {
  inbound.url.host = "example.com";
}
hrw4u turns this into set-destination which modifies the outbound URL,
making the naming actively misleading.

inbound.url reads from the pristine client URL (CLIENT-URL) which
is immutable — ATS provides no mechanism to set it. So, removing this
as an operator, but keeping it as a valid condition.
@mlibbey mlibbey force-pushed the hrw4u-inbound-url-operator-removal branch from 7e4119a to 35d44a2 Compare April 28, 2026 18:20
@zwoop zwoop added this to the 11.0.0 milestone May 1, 2026
@bryancall bryancall requested a review from Copilot May 4, 2026 22:19
@bryancall bryancall removed the request for review from bneradt May 4, 2026 22:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates hrw4u so URL mutations are expressed through outbound.url.* instead of inbound.url.*, aligning the DSL with ATS semantics where inbound.url is read-only client URL state. It mainly adjusts operator/reverse-mapping behavior plus the corresponding fixtures and user docs.

Changes:

  • Removed inbound.url.* from the assignment/operator map and kept destination mutations on outbound.url.*.
  • Updated reverse-resolution logic so set-destination/rm-destination QUERY decompile back to outbound.url.*.
  • Refreshed tests and admin-guide examples to use the new spelling.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/hrw4u/tests/data/ops/set-destination.input.txt Updates operator fixture to use outbound.url.*.
tools/hrw4u/tests/data/ops/set-destination.ast.txt Updates expected AST for the new operator spelling.
tools/hrw4u/tests/data/ops/bad_path.fail.input.txt Adjusts invalid-suffix failure fixture to target outbound.url.*.
tools/hrw4u/tests/data/ops/bad_path.fail.error.txt Updates expected error text for the renamed fixture input.
tools/hrw4u/tests/data/examples/rm-query.input.txt Switches example query removal to outbound.url.query.
tools/hrw4u/tests/data/examples/rm-query.ast.txt Updates AST expectation for the query-removal example.
tools/hrw4u/tests/data/examples/all-nonsense.input.txt Rewrites example destination mutations to outbound.url.*.
tools/hrw4u/tests/data/examples/all-nonsense.ast.txt Updates the large example AST to match the new semantics.
tools/hrw4u/src/tables.py Removes inbound.url.* as an operator target and changes reverse context defaults to outbound.url.*.
tools/hrw4u/src/hrw_symbols.py Makes reverse conversion of rm-destination QUERY emit outbound.url.query = "".
tools/hrw4u/src/generators.py Adjusts URL reverse-context mapping so REMAP also resolves to outbound.url.*.
doc/admin-guide/configuration/hrw4u.en.rst Documents inbound.url as immutable and updates operator mapping/examples to outbound.url.*.

Comment thread tools/hrw4u/src/tables.py
@@ -47,7 +47,6 @@
"inbound.resp.": MapParams(target=HeaderOperations.OPERATIONS, add=True, validate=Validator.http_header_name(), sections={SectionType.READ_RESPONSE, SectionType.SEND_RESPONSE}),
"inbound.status.reason": MapParams(target="set-status-reason", validate=Validator.quoted_or_simple(), sections=HTTP_SECTIONS),
"inbound.status": MapParams(target="set-status", validate=Validator.range(0, 999), sections=HTTP_SECTIONS),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah -- I didn't add a negative test because I'm somewhat expecting that we end up adding something that can modify the inbound url in some manner; which would then have us undo the test.

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

Labels

header_rewrite header_rewrite plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants