Repository navigation
Add supported versions to /health response - #1348
Conversation
Now that directory operators have the ability to opt out of v1 support, this addresses the requirement from payjoin#1198 that "The directory needs a way to declare its compatability with bip78." Instead of a new endpoint, it adds a "versions" array to the existing /health response. This is non-breaking.
Pull Request Test Coverage Report for Build 22244259109Details
💛 - Coveralls |
arminsabouri
left a comment
There was a problem hiding this comment.
cAck & Approach Ack d1f1fb9
Clean. One comment but no reason to hold up the merge
| Ok(Response::new(empty())) | ||
| impl<D: Db> Service<D> { | ||
| async fn health_check(&self) -> Result<Response<BoxBody<Bytes, hyper::Error>>, HandlerError> { | ||
| let versions = if self.v1.is_some() { "[1,2]" } else { "[2]" }; |
There was a problem hiding this comment.
Would it be more descriptive if we had the bip numbers? if 1 and 2 are mentioned elsewhere in the docs and devs know what they means lets role with that.
| let versions = if self.v1.is_some() { "[1,2]" } else { "[2]" }; | |
| let versions = if self.v1.is_some() { "[bip78,bip77]" } else { "[bip77]" }; |
There was a problem hiding this comment.
I followed the convention from the BIP78 error message for unsupported versions https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki#optional-parameters
I think using bip numbers everywhere would be more descriptive but we may have too much lock in with version numbers already (pj uri parameter, error responses, payjoin-cli and mailroom config...)
Now that directory operators have the ability to opt out of v1 support, this addresses the requirement from #1198 that "The directory needs a way to declare its compatability with bip78."
Instead of a new endpoint, it adds a "versions" array to the existing /health response. This is non-breaking.
Written by Opus 4.6 and reviewed by me
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.