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

Verify v2 client requesting directory hosted with intermediate path elements sets subdirectory ID correctly #416

Open
nothingmuch opened this issue Nov 28, 2024 · 2 comments · Fixed by #448
Assignees
Milestone

Comments

@nothingmuch
Copy link
Collaborator

If the directory is deployed behind e.g. a reverse proxy and requests are rewritten exposing the public URI with a path, the current behavior of the pj_url derivation is to replace the path in its entirety.

In some places in the code .join is used, appending the subdirectory ID but the sender uses set_path as well.

@nothingmuch nothingmuch self-assigned this Nov 28, 2024
DanGould added a commit to DanGould/rust-payjoin that referenced this issue Dec 29, 2024
Fix payjoin#416

Without this change a base URL subpath e.g. https://payjo.in/dir-path/
would be overwritten when V2Context.extract_req was called and
incorrectly produce a request to https://payjo.in/subdir instead of
https://payjo.in/dir-path/subdir.
DanGould added a commit to DanGould/rust-payjoin that referenced this issue Dec 29, 2024
Fix payjoin#416

Without this change a base URL subpath e.g. https://payjo.in/dir-path/
would be overwritten when V2GetContext.extract_req was called and
incorrectly produce a request to https://payjo.in/subdir instead of
https://payjo.in/dir-path/subdir.
DanGould added a commit to DanGould/rust-payjoin that referenced this issue Dec 29, 2024
Fix payjoin#416

Without this change a base URL subpath e.g. https://payjo.in/dir-path/
would be overwritten when V2GetContext.extract_req was called and
incorrectly produce a request to https://payjo.in/subdir instead of
https://payjo.in/dir-path/subdir.
DanGould added a commit to DanGould/rust-payjoin that referenced this issue Dec 29, 2024
Fix payjoin#416

Without this change a base URL subpath e.g. https://payjo.in/dir-path/
would be overwritten when V2GetContext.extract_req was called and
incorrectly produce a request to https://payjo.in/subdir instead of
https://payjo.in/dir-path/subdir.
DanGould added a commit to DanGould/rust-payjoin that referenced this issue Dec 29, 2024
Fix payjoin#416

Without this change a base URL subpath e.g. https://payjo.in/dir-path/
would be overwritten when V2GetContext.extract_req was called and
incorrectly produce a request to https://payjo.in/subdir instead of
https://payjo.in/dir-path/subdir.
@DanGould
Copy link
Contributor

Fixed by #448

@DanGould
Copy link
Contributor

Because of our tangled arch this was difficult to verify even though it was probably resolved. Leaving this open until we have a proper test that a directory hosted with additional path elements beyond the host is verified as functional in the v2 flow.

@DanGould DanGould reopened this Dec 29, 2024
@DanGould DanGould changed the title Don't use set_path to set subdirectory ID Verify v2 client requesting directory hosted with intermediate path elements sets subdirectory ID correctly Dec 29, 2024
@DanGould DanGould added this to the payjoin-1.0 milestone Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants