hrw4u: disallow inbound.url.{} as an operator#13121
Open
mlibbey wants to merge 1 commit intoapache:masterfrom
Open
hrw4u: disallow inbound.url.{} as an operator#13121mlibbey wants to merge 1 commit intoapache:masterfrom
mlibbey wants to merge 1 commit intoapache:masterfrom
Conversation
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.
7e4119a to
35d44a2
Compare
Contributor
There was a problem hiding this comment.
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 onoutbound.url.*. - Updated reverse-resolution logic so
set-destination/rm-destination QUERYdecompile back tooutbound.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.*. |
| @@ -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), | |||
Contributor
Author
There was a problem hiding this comment.
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.
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.
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.