-
Notifications
You must be signed in to change notification settings - Fork 49
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
Conversation
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
Show response details including the body so that rejected key errors are clear.
47c0482
to
9e43b90
Compare
@@ -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"}"#; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
Fix #152
Signal OHTTP Key Configuration problem
Respond with
application/problem+json
when OHTTP decapsulation failsaccording 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