Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't copy URI path & query to gateway request #46

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nothingmuch
Copy link

When requests to the relay include a path & query, previously this would be copied to the request sent to the gateway.

This behavior did not match the specified behavior in RFC 9458, where the relay and gateway resource are related by a fixed 1:1 mapping, whereas copying the path is a family of 1:1 mappings between relay resources and gateway resources.

Less pedantic behavior could arguably simply ignore any extraneous path or query elements in the request URI, but based on the logic that any deployment relying on the existing behavior would be incompatible with the existing directory implementation, this more conservative path was chosen.

This was only tested manually by temporarily modifying the ohttp_req test helper to ensure it fails (for both the request matching and the explicit treatment of req.uri().path_and_query()), in order to avoid modifying it with additional long lived complexity to allow overriding the path. The rationale is that in the near term protocol opt-in by directories will give meaning to path components of directory requests, and the modified behavior fails closed.

When requests to the relay include a path & query, previously this would
be copied to the request sent to the gateway.

This behavior did not match the specified behavior in RFC 9458, where
the relay and gateway resource are related by a fixed 1:1 mapping,
whereas copying the path is a family of 1:1 mappings between relay
resources and gateway resources.

Less pedantic behavior could arguably simply ignore any extraneous path
or query elements in the request URI, but based on the logic that any
deployment relying on the existing behavior would be incompatible with
the existing directory implementation, this more conservative path was
chosen.

This was only tested manually by temporarily modifying the ohttp_req
test helper to ensure it fails (for both the request matching and the
explicit treatment of req.uri().path_and_query()), in order to avoid
modifying it with additional long lived complexity to allow overriding
the path. The rationale is that in the near term protocol opt-in by
directories will give meaning to path components of directory requests,
and the modified behavior fails closed.
@nothingmuch nothingmuch mentioned this pull request Feb 5, 2025
Copy link
Collaborator

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

This appears to be correct expression of 1:1 Relay:Gateway Resource mapping.

The target resource information is encoded in each OHTTP Encapsulated request, not in the OHTTP request's path and query information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants