feat/read truvera api configs from data store - #565
Merged
maycon-mello merged 3 commits intoJul 28, 2026
Conversation
maycon-mello
force-pushed
the
feat/read-truvera-api-configs-from-data-store
branch
from
July 27, 2026 16:35
ad596ac to
87d0a70
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors delegatable revocation configuration to be provided as a single truveraApi config object (and to be read from the wallet data store in the delegation offer flow), rather than passing separate sponsor key + API URL fields around.
Changes:
- Added
truveraApitoDataStoreConfigsfor centralized Truvera API config storage. - Introduced
TruveraApiConfigsand updatedRevocationContextto use it, updating call sites and tests accordingly. - Wired delegation offer issuance to pass revocation context sourced from
wallet.dataStore.configs.truveraApi.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/data-store/src/types.ts | Adds truveraApi to persisted/constructed data store configs. |
| packages/core/src/delegation/delegation-revocation.ts | Refactors revocation context shape to use a truveraApiConfigs object. |
| packages/core/src/delegation/delegation-offer.ts | Passes revocation context from wallet.dataStore.configs.truveraApi into delegated issuance flow. |
| packages/core/src/delegation/delegation-issuance.ts | Makes delegated issuance optionally allocate status entries based on presence of Truvera API configs. |
| integration-tests/delegatable-revocation.test.ts | Updates integration test setup to the new truveraApiConfigs shape. |
Comments suppressed due to low confidence (2)
packages/core/src/delegation/delegation-revocation.ts:105
- The assertion message and validation in
postRevocationare outdated after the config refactor: it checkstruveraApiConfigsbut the error message still mentionstruveraApiSponsorKey, and it doesn't validate required fields (authKey,apiUrl). This can lead to confusing errors later (e.g., building a URL withundefined).
assert(!!ctx.truveraApiConfigs, 'truveraApiSponsorKey is required');
const jwt = await signRevocationJWT(ctx, {registryId, ...body});
packages/core/src/delegation/delegation-offer.ts:380
- New behavior is introduced here (building revocationContext from wallet.dataStore.configs.truveraApi and passing it into delegated issuance), but there’s no test coverage asserting that the handler includes revocation context when configs are present (and omits it when absent). Adding a unit test around DELEGATION_REQUEST_HANDLER (or an integration test for the offer->issue flow) would prevent regressions in the config plumbing.
revocationContext: {
wallet,
truveraApiConfigs: wallet.dataStore.configs.truveraApi,
issuerDID: delegationOffer.issuerDID || issuerDID,
},
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mike-parkhill
previously approved these changes
Jul 27, 2026
mike-parkhill
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.