Skip to content

Add supported versions to /health response#1348

Merged
arminsabouri merged 1 commit intopayjoin:masterfrom
spacebear21:directory-capabilities-endpoint
Feb 21, 2026
Merged

Add supported versions to /health response#1348
arminsabouri merged 1 commit intopayjoin:masterfrom
spacebear21:directory-capabilities-endpoint

Conversation

@spacebear21
Copy link
Copy Markdown
Collaborator

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:

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.
@coveralls
Copy link
Copy Markdown
Collaborator

Pull Request Test Coverage Report for Build 22244259109

Details

  • 34 of 34 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.04%) to 82.484%

Totals Coverage Status
Change from base Build 22242311720: 0.04%
Covered Lines: 10624
Relevant Lines: 12880

💛 - Coveralls

Copy link
Copy Markdown
Collaborator

@arminsabouri arminsabouri left a comment

Choose a reason for hiding this comment

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

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]" };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Suggested change
let versions = if self.v1.is_some() { "[1,2]" } else { "[2]" };
let versions = if self.v1.is_some() { "[bip78,bip77]" } else { "[bip77]" };

Copy link
Copy Markdown
Collaborator Author

@spacebear21 spacebear21 Feb 21, 2026

Choose a reason for hiding this comment

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

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...)

@arminsabouri arminsabouri merged commit 0a2d316 into payjoin:master Feb 21, 2026
14 checks passed
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.

3 participants