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

Signal keyconfig problem #153

Merged
merged 5 commits into from
Dec 28, 2023
Merged

Conversation

DanGould
Copy link
Contributor

Fix #152

Signal OHTTP Key Configuration problem

Respond with application/problem+json when OHTTP decapsulation fails
according to draft-ietf-ohai-ohttp section 5.3. See:
https://ietf-wg-ohai.github.io/oblivious-http/draft-ietf-ohai-ohttp.html#section-5.3

Ensure the error response is clearly understood in payjoin-cli

Show response details including the body so that rejected key errors are
clear.
@@ -218,6 +221,15 @@ impl HandlerError {
error!("Internal server error: {}", e);
*res.status_mut() = StatusCode::INTERNAL_SERVER_ERROR
}
HandlerError::OhttpKeyRejection(e) => {
const OHTTP_KEY_REJECTION_RES_JSON: &str = r#"{"type":"https://iana.org/assignments/http-problem-types#ohttp-key", "title": "key identifier unknown"}"#;
Copy link
Contributor

@jbesraa jbesraa Dec 28, 2023

Choose a reason for hiding this comment

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

i think the title is a bit opaque, maybe its worth mentioning the specific problematic param ie ohttp_config

edit:
I see this is following the spec, but still we might want to add a message or something

Copy link
Contributor Author

@DanGould DanGould Dec 28, 2023

Choose a reason for hiding this comment

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

I agree, it would be instructive to show something like "Key identifier unknown. Refresh your payjoin directory configuration at $OHTTP_GATEWAY/ohttp-config" or similar.

I think this is a separate task for payjoin-cli, and eventually an implementation library doing I/O. Fortunately the client should be able to automate this problem away with automatic ip protected fetch as described here

@DanGould DanGould merged commit f3c5ea0 into payjoin:master Dec 28, 2023
5 checks passed
@DanGould DanGould mentioned this pull request Jan 2, 2024
25 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Payjoin-cli V2 returns uninstructive 400 from OHTTP relay when client ohttp_config mismatches gateway
2 participants