Skip to content
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

Make pfiDid required property in TbdexHttpServer #166

Merged
merged 3 commits into from
Feb 9, 2024

Conversation

kirahsapong
Copy link
Contributor

closes #161

Copy link

changeset-bot bot commented Feb 8, 2024

🦋 Changeset detected

Latest commit: 1d13ed2

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

This PR includes changesets to release 3 packages
Name Type
@tbdex/http-server Minor
@tbdex/protocol Minor
@tbdex/http-client 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

Copy link
Contributor

github-actions bot commented Feb 8, 2024

TBDocs Report

🛑 Errors: 0
⚠️ Warnings: 12

@tbdex/protocol

  • Project entry file: packages/protocol/src/main.ts

@tbdex/http-client

  • Project entry file: packages/http-client/src/main.ts
📄 File: packages/http-client/src/errors/request-error.ts
⚠️ extractor:ae-missing-release-tag: "RequestErrorParams" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) #L1
⚠️ extractor:ae-undocumented: Missing documentation for "RequestErrorParams". #L1
⚠️ extractor:ae-undocumented: Missing documentation for "recipientDid". #L13
⚠️ extractor:ae-undocumented: Missing documentation for "url". #L14
📄 File: packages/http-client/src/errors/request-token-error.ts
⚠️ extractor:ae-missing-release-tag: "RequestTokenErrorParams" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) #L3
⚠️ extractor:ae-undocumented: Missing documentation for "RequestTokenErrorParams". #L3
📄 File: packages/http-client/src/errors/response-error.ts
⚠️ extractor:ae-missing-release-tag: "ResponseErrorParams" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal) #L3
⚠️ extractor:ae-undocumented: Missing documentation for "ResponseErrorParams". #L3
⚠️ extractor:ae-undocumented: Missing documentation for "statusCode". #L15
⚠️ extractor:ae-undocumented: Missing documentation for "details". #L16
⚠️ extractor:ae-undocumented: Missing documentation for "recipientDid". #L17
⚠️ extractor:ae-undocumented: Missing documentation for "url". #L18

@tbdex/http-server

  • Project entry file: packages/http-server/src/main.ts

TBDocs Report Updated at 2024-02-08T22:51:48Z 1d13ed2

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Merging #166 (1d13ed2) into main (c2a6916) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
- Coverage   85.55%   85.50%   -0.05%     
==========================================
  Files          35       35              
  Lines        2803     2795       -8     
  Branches      234      237       +3     
==========================================
- Hits         2398     2390       -8     
  Misses        405      405              
Components Coverage Δ
protocol 90.01% <ø> (ø)
http-client 86.78% <ø> (ø)
http-server 71.15% <100.00%> (-0.41%) ⬇️

@kirahsapong
Copy link
Contributor Author

cc: @angiejones

Copy link
Contributor

@jiyoontbd jiyoontbd left a comment

Choose a reason for hiding this comment

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

thank you for saving future us hours of debugging

@kirahsapong
Copy link
Contributor Author

kirahsapong commented Feb 8, 2024

just FYI - falling back to did:ex:pfi for the pfiDid since if they choose to instantiate without passing opts, they're using the fakeExchangesApi and fakeOfferingsApi anyway, which use did:ex:pfi where a pfi's DID should go. if they do instantiate with an obj, they'll have to pass a pfiDid so it will never fallback to this string. thoughts on this approach tho? we can require that one always passes a pfiDid even if using the fakeApis

@diehuxx
Copy link
Contributor

diehuxx commented Feb 8, 2024

@kirahsapong Making sure I understand. As of 1d13ed2, this PR does not change any behavior or address #161?

@kirahsapong
Copy link
Contributor Author

Making sure I understand. As of 1d13ed2, this PR does not change any behavior or address #161?

@diehuxx it does. it makes sure the pfiDid is a required property if options are passed in. That is, if you instantiate with an opts containing exchangesApi or offeringsApi (both are optional) or even neither, you must pass pfiDid. This is required for verifying a request token where one of the steps of making sure you're the intended audience for the token at all. If you're instantiating with the default (fake) apis instead, it falls back to the pfiDid being used throughout those fake apis. in either case, it ensures you cannot instantiate with a custom api but not your custom pfiDid. both or neither!

@kirahsapong kirahsapong merged commit ca1b235 into main Feb 9, 2024
17 checks passed
@kirahsapong kirahsapong deleted the feat/require-pfi-did branch February 9, 2024 00:33
phoebe-lew added a commit that referenced this pull request Feb 20, 2024
* main:
  Stricten, test, and bugfix http-server (#170)
  Version Packages (#167)
  Update web5/dids, web5/credentials, web5/crypto, web5/common to latest  (#177)
  Add exchange state machine (#168)
  Stricten http-client (#169)
  Make `pfiDid` required property in `TbdexHttpServer` (#166)
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.

Require pfiDid when exchangesApi option is passed to TbdexHttpServer constructor
4 participants