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

[proposal] Make headers call for AgentRestClient dynamic #1314

Merged
merged 35 commits into from
Jan 16, 2024

Conversation

cre8
Copy link
Contributor

@cre8 cre8 commented Jan 16, 2024

What issue is this PR fixing

Fixes #1313

What is being changed

The AgentRestClient constructor is able to handle functions calls for the headers. This allows to pass dynamic values like an access token that needs to be updated frequently.

Quality

Check all that apply:

  • I want these changes to be integrated
  • I successfully ran pnpm i, pnpm build, pnpm test, pnpm test:browser locally.
 FAIL  packages/data-store/src/__tests__/data-store-orm.test.ts (25.45 s)

                                                                                                                                           
  ● Test suite failed to run                                                                                                               
                                                                                                                                           
    EBUSY: resource busy or locked, unlink './tmp/test-db2.sqlite'                                                                         
                                                                                                                                           
      143 |   afterAll(async () => {                                                                                                       
      144 |     ;(await dbConnection).close()                                                                                              
    > 145 |     fs.unlinkSync(databaseFile)                                                                                                
          |        ^                                                                                                                       
      146 |   })                                                                                                                           
      147 |                                                                                                                                
      148 |   test('search presentations by verifier', async () => {                                                                       
                                                                                                                                           
      at Object.<anonymous> (packages/data-store/src/__tests__/data-store-orm.test.ts:145:8)  

This error has nothing to do with the changes, but resulted in a incomplete test run (OS: Windows 11)

  • I allow my PR to be updated by the reviewers (to speed up the review process).
  • I added unit tests.
  • I added integration tests.
  • I did not add automated tests because the package has no test implemented, and I am aware that a PR without tests will likely get rejected.

uport-automation-bot and others added 30 commits September 21, 2023 16:29
…ntial IDs (decentralized-identity#1239)

BREAKING CHANGE: going forward credentials and presentations will have a new ID format in the database. If you are relying on the IDs assigned internally by `@veramo/data-store` to work with your credentials, you will have to recompute them using the `@veramo/utils#computeEntryHash` method.
BREAKING CHANGE: now using ethers v6 as a dependency which may need extra attention when merging. The output of `eth_signTransaction` algorithms may be slightly different as transactions are by default infered as type 1 (EIP1559)
…ovider (decentralized-identity#1218)

fixes decentralized-identity#1215

BREAKING CHANGE: The behavior of `DIDManager` has changed when working with `alias`. It is mostly ignoring `provider` unless it is used to create new identifiers. `AbstractDIDStore` APIs have been adapted and implementations have changed.
# Conflicts:
#	__tests__/localJsonStoreAgent.test.ts
…zed-identity#1258)

* test(credential-eip712): fix test vector containing 22 byte null address instead of 20
decentralized-identity#1283)

* feat(did-comm): returnMessage from sendDIDCommMessage() when available

BREAKING CHANGE: the return type of `IDIDComm.sendDIDCommMessage()` has changed from a string representing the transport ID to an object that may include a `returnMessage` property along with a `transportId` property.
…3.0 (decentralized-identity#1282)

Implement coordinate mediation from v3 (https://didcomm.org/coordinate-mediation/3.0/)
 - add recipient update
 - add recipient update response
 - add recipient query
 - add recipient
add grant or deny control mechanism
 - add default logic
 - add TODO for injection of grant/deny mechanism logic
add datastore for:
 - mediation
 - recipient did
 - mediation policy
define types:
 - IDataStore
 - IMediation
 - IMediationPolicy
 - IRecipientDid
add tests for new functionality
 - modify mediate test suite
 - add recipient update test suite
 - add recipient query test suite
documentation:
 - add documentation on introduced methods
cli:
 - add mediate allow-from command
 - add mediate deny-from command
 - add mediate list
 - add mediate remove

---------

Co-authored-by: Paul Parker
…d-identity#1297)

* refactor: ensure v3 mediation protocol is correctly exported
* refactor: cli mediate feedback on no mediation manager plugin configured
* docs: add additional help text to the mediate cli help page
…ableCredentialsByClaims` (decentralized-identity#1299)

fixes decentralized-identity#1285

Co-authored-by: Mirko Mollik <mirko.mollik@fit.fraunhofer.de>
@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ac1b620) 85.47% compared to head (3b43ea3) 85.47%.

Additional details and impacted files
@@           Coverage Diff           @@
##             next    #1314   +/-   ##
=======================================
  Coverage   85.47%   85.47%           
=======================================
  Files         170      170           
  Lines       18950    18952    +2     
  Branches     2115     2116    +1     
=======================================
+ Hits        16197    16199    +2     
  Misses       2753     2753           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

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

Thanks for posting this and for leading with an issue explaining the changes!

Just one nit to fix, otherwise looks great!

packages/remote-client/src/client.ts Outdated Show resolved Hide resolved
@mirceanis mirceanis changed the base branch from next to main January 16, 2024 17:00
@mirceanis mirceanis merged commit 1b8a0a2 into decentralized-identity:main Jan 16, 2024
9 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.

[proposal] Make headers call for AgentRestClient dynamic