Skip to content

feat: add fastify support #2212

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

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from

Conversation

sloops77
Copy link

@sloops77 sloops77 commented Mar 5, 2025

Second Attempt at implementing #2147
Replaces #2150

TODO

Must Have

  • Add HTTP response headers handling
  • Add back default router if none specified
  • Convert rest of configure methods
  • Tests for fastify

Nice to have

  • Add all HTTP methods to CredoRouter
  • Add example errors to tests (express & fastify)
  • Specify correct Generic types for all routes
  • Permit org to utilize different versions of the spec via configuration only

Future work suggestions

  • Could RequestContext loggers be supported instead of dependency injected/Agent Config
  • Use Zod schemas in fastify endpoint specifications
  • Rationalize error throwing and standardize the properties on errors

@sloops77 sloops77 requested a review from a team as a code owner March 5, 2025 02:29
Copy link

changeset-bot bot commented Mar 5, 2025

🦋 Changeset detected

Latest commit: 57c981f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 14 packages
Name Type
@credo-ts/openid4vc Minor
@credo-ts/action-menu Minor
@credo-ts/anoncreds Minor
@credo-ts/askar Minor
@credo-ts/cheqd Minor
@credo-ts/core Minor
@credo-ts/didcomm Minor
@credo-ts/drpc Minor
@credo-ts/indy-sdk-to-askar-migration Minor
@credo-ts/indy-vdr Minor
@credo-ts/node Minor
@credo-ts/question-answer Minor
@credo-ts/react-native Minor
@credo-ts/tenants Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sloops77 sloops77 marked this pull request as draft March 5, 2025 02:33
@sloops77 sloops77 force-pushed the refactor/2147-add-fastify-support branch from 1e3c8b9 to 7d69189 Compare March 5, 2025 02:52
@sloops77 sloops77 changed the title Refactor/2147 add fastify support feat: add fastify support Mar 5, 2025
@sloops77 sloops77 force-pushed the refactor/2147-add-fastify-support branch from 8a868cd to 74bfb77 Compare March 5, 2025 06:51
sloops77 added 6 commits March 6, 2025 06:37
Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
…oduleConfig

Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
…Config

Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
…Config

Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
@sloops77 sloops77 force-pushed the refactor/2147-add-fastify-support branch from fd49190 to c897c45 Compare March 5, 2025 19:38
@sloops77
Copy link
Author

sloops77 commented Mar 7, 2025

@TimoGlastra pls review

sloops77 and others added 13 commits March 8, 2025 09:21
refactor: extract Credo adapters to Http framworks
refactor: share issuer modules logic for fastify & express

Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
…ptions

Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
Signed-off-by: sloops77 <andres.olave@thinkingbytes.net>
Signed-off-by: Andres Olave <arolave@gmail.com>
Signed-off-by: Andres Olave <arolave@gmail.com>
Signed-off-by: Andres Olave <arolave@gmail.com>
Signed-off-by: Andres Olave <arolave@gmail.com>
Signed-off-by: Andres Olave <arolave@gmail.com>
Signed-off-by: Andres Olave <arolave@gmail.com>
Signed-off-by: Andres Olave <arolave@gmail.com>
Signed-off-by: Andres Olave <arolave@gmail.com>
@sloops77
Copy link
Author

sloops77 commented May 2, 2025

@TimoGlastra Reminder to please give us feedback when you can

Signed-off-by: nassan <nassanpaul@gmail.com>
@nassan nassan force-pushed the refactor/2147-add-fastify-support branch from 9dffec6 to 299a4c4 Compare May 15, 2025 12:33
@nassan
Copy link
Contributor

nassan commented May 15, 2025

@sloops77 wdyt of 299a4c4 for injection of different modules?

Signed-off-by: nassan <nassanpaul@gmail.com>
@sloops77
Copy link
Author

sloops77 commented May 16, 2025

@sloops77 wdyt of 299a4c4 for injection of different modules?

@nassan you'll want to use https://jestjs.io/docs/api#describeeachtablename-fn-timeout with one table entry using express module for issuer and holder and the other fastify

@sloops77
Copy link
Author

sloops77 commented May 19, 2025

@TimoGlastra
Our thinking has evolved to using https://github.com/openwallet-foundation-labs/oid4vc-ts directly. That means we will pause working on this PR. But will be giving that library and it's sister repositories a good workout

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.

2 participants