⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

feat: implement ohttp gateway middleware#1306

Open
Harshdev098 wants to merge 3 commits intopayjoin:masterfrom
Harshdev098:ohttpGateway-middleware
Open

feat: implement ohttp gateway middleware#1306
Harshdev098 wants to merge 3 commits intopayjoin:masterfrom
Harshdev098:ohttpGateway-middleware

Conversation

@Harshdev098
Copy link
Contributor

@Harshdev098 Harshdev098 commented Feb 1, 2026

part of #941

added ohttp gateway middleware in payjoin-services.

have used claude to fix errors in the development works

Pull Request Checklist

Please confirm the following before requesting review:

@zealsham
Copy link
Collaborator

zealsham commented Feb 3, 2026

ThankS for working on this @Harshdev098. Ideally we would want this middleware to be written with axum so it would fit in with the rest of the middlwares we plan to add, @spacebear21 this is correct right ?

@spacebear21
Copy link
Collaborator

we would want this middleware to be written with axum so it would fit in with the rest of the middlwares we plan to add

Yes exactly. The gateway should be an axum middleware written mostly from scratch similar to @zealsham's ongoing work in #1296. Duplication could also be reduced by first making the helper utils (encapsulate_xxx, decapsulate_xxx, constants...) pub in the ohttp-relay crate and reusing them in payjoin-service.

@Harshdev098
Copy link
Contributor Author

okay will use axum in the middleware and update you!

@Harshdev098 Harshdev098 force-pushed the ohttpGateway-middleware branch from e454ea4 to f8fcdfe Compare February 6, 2026 09:25
@Harshdev098
Copy link
Contributor Author

@spacebear21 Can you please review it, have updated the PR to use axum, also should I refactor the payjoin-directory becuase in the middleware I have done encapsulation and decapsulation, and the payjoin-directory is duplicating it which causes the failures of integration tests.

@zealsham
Copy link
Collaborator

zealsham commented Feb 6, 2026

@Harshdev098 I still see so many traces of hyper in the recent commit. can you take a look at #1101, should help with re-writting the ohttp middleware in axum.

@spacebear21
Copy link
Collaborator

spacebear21 commented Feb 6, 2026

There are also many comments deleted with no explanation, which seems like unreviewed (and undisclosed) LLM work.

@Harshdev098 Harshdev098 force-pushed the ohttpGateway-middleware branch 4 times, most recently from 156c799 to 45ac88d Compare February 7, 2026 09:33
@Harshdev098 Harshdev098 force-pushed the ohttpGateway-middleware branch from 45ac88d to 43b12a9 Compare February 7, 2026 09:36
@Harshdev098
Copy link
Contributor Author

@zealsham @spacebear21 Have updated the code as you referenced and disclosed my claude usage too in the description!

@zealsham
Copy link
Collaborator

zealsham commented Feb 7, 2026

Haven’t taken good look since I’m away from keyboard , However you need the test cases passing, it’s the only way we can tell everything works well.

I see your prior question about removing directory code because decapsulation is done twice. The answer to that is you have to do what you think we make the test cases pass. If you think doing something will complete the Pr, then do it. Reviewers are here to catch something totally off.

Remember a complete Pr ready for review is the Pr with all green checks in CI

cheers!

@coveralls
Copy link
Collaborator

coveralls commented Feb 8, 2026

Pull Request Test Coverage Report for Build 21802660858

Details

  • 181 of 246 (73.58%) changed or added relevant lines in 4 files are covered.
  • 16 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 82.962%

Changes Missing Coverage Covered Lines Changed/Added Lines %
payjoin-directory/src/lib.rs 27 37 72.97%
payjoin-service/src/lib.rs 30 41 73.17%
payjoin-service/src/ohttp/middleware.rs 79 99 79.8%
ohttp-relay/src/gateway_helpers.rs 45 69 65.22%
Files with Coverage Reduction New Missed Lines %
payjoin-directory/src/lib.rs 16 42.55%
Totals Coverage Status
Change from base Build 21757410623: -0.3%
Covered Lines: 10289
Relevant Lines: 12402

💛 - Coveralls

@Harshdev098 Harshdev098 force-pushed the ohttpGateway-middleware branch from 89d951a to 2a0def2 Compare February 8, 2026 13:43
@Harshdev098
Copy link
Contributor Author

Hey @zealsham @spacebear21 Can you please review it! have removed the ohttp handling from the directory in order to pass the test and prevent double encapsulation and decapsulation

@Harshdev098 Harshdev098 force-pushed the ohttpGateway-middleware branch from 2a0def2 to a928973 Compare February 8, 2026 13:55
@zealsham
Copy link
Collaborator

zealsham commented Feb 8, 2026

Hey @zealsham @spacebear21 Can you please review it! have removed the ohttp handling from the directory in order to pass the test and prevent double encapsulation and decapsulation

The tests does not pass ? , can you see the CI result for your pull request ?.

@Harshdev098
Copy link
Contributor Author

Actually I think I have removed/added some dependencies earlier in the commits and forgot to run update lock file script

@Harshdev098 Harshdev098 force-pushed the ohttpGateway-middleware branch from a928973 to 5957c0a Compare February 8, 2026 17:54
@Harshdev098
Copy link
Contributor Author

@zealsham the tests are passing now!

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.

4 participants