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

fix: issuance with unqualified identifiers #1431

Merged

Conversation

TimoGlastra
Copy link
Contributor

Bigger PR than anticipated, but this fixes the issuance of credentials with unqualified identifiers. You can now issue with both unqulaiifed and did indy identifiers interchangeably, but only for the issuance side. the other sides don't work interchangeably yet.

I hope this is one of the last big tasks before releasing 0.4.0?

Lot of code is moving around stuff and removing some of the duplicated code. We now have indy specific identifier code in the anoncreds package, but it's needed for the unqualified handling. As it's part of the spec, and it can provide the easiest migration path, that is okay by me. (it's not much, just some identifier parsing etc..)

Hope this doesn't clash too much with your Revocation pr @genaris

Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra TimoGlastra requested a review from a team as a code owner April 13, 2023 18:57
}

export function isUnqualifiedRevocationRegistryId(revocationRegistryId: string) {
return unqualifiedRevocationRegistryIdRegex.test(revocationRegistryId)

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'.
}
}

const legacyMatch = revocationRegistryId.match(unqualifiedRevocationRegistryIdRegex)

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'. This [regular expression](1) that depends on [library input](3) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'. This [regular expression](1) that depends on [library input](4) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'. This [regular expression](1) that depends on [library input](5) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'. This [regular expression](1) that depends on [library input](6) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'.
* Assert that a revocation registry id is unqualified.
*/
export function assertUnqualifiedRevocationRegistryId(revocationRegistryId: string) {
if (!unqualifiedRevocationRegistryIdRegex.test(revocationRegistryId)) {

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data

This [regular expression](1) that depends on [library input](2) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'. This [regular expression](1) that depends on [library input](3) may run slow on strings with many repetitions of 'a:CL_ACCUM:a'.
@codecov-commenter
Copy link

codecov-commenter commented Apr 13, 2023

Codecov Report

Merging #1431 (9208678) into main (b38525f) will increase coverage by 4.39%.
The diff coverage is 85.71%.

@@            Coverage Diff             @@
##             main    #1431      +/-   ##
==========================================
+ Coverage   80.07%   84.47%   +4.39%     
==========================================
  Files         849      885      +36     
  Lines       20406    21057     +651     
  Branches     3462     3558      +96     
==========================================
+ Hits        16341    17788    +1447     
+ Misses       3785     3065     -720     
+ Partials      280      204      -76     
Impacted Files Coverage Δ
...dentials/v1/messages/V1ProposeCredentialMessage.ts 100.00% <ø> (ø)
...ository/AnonCredsCredentialDefinitionRepository.ts 60.00% <0.00%> (ø)
...ncreds/src/repository/AnonCredsSchemaRepository.ts 60.00% <0.00%> (ø)
packages/askar/src/storage/AskarStorageService.ts 82.43% <0.00%> (ø)
packages/core/tests/jsonld.ts 91.66% <ø> (ø)
packages/indy-sdk/src/dids/didIndyUtil.ts 93.33% <ø> (-2.32%) ⬇️
packages/indy-sdk/src/utils/did.ts 100.00% <ø> (ø)
packages/indy-vdr/src/utils/did.ts 93.33% <ø> (+18.33%) ⬆️
...sdk/src/anoncreds/services/IndySdkHolderService.ts 7.57% <20.00%> (-0.43%) ⬇️
...sdk/src/anoncreds/services/IndySdkIssuerService.ts 19.23% <25.00%> (-3.69%) ⬇️
... and 28 more

... and 130 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@genaris genaris left a comment

Choose a reason for hiding this comment

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

I don't think it clashes so much with the revocation PR so LGTM 😆

Just a few comments to double check a few things.

Signed-off-by: Timo Glastra <timo@animo.id>
@TimoGlastra TimoGlastra enabled auto-merge (squash) April 14, 2023 12:08
@TimoGlastra TimoGlastra merged commit de90caf into openwallet-foundation:main Apr 14, 2023
TimoGlastra added a commit that referenced this pull request May 16, 2023
Co-authored-by: Karim Stekelenburg <karim@animo.id>
Co-authored-by: Ariel Gentile <gentilester@gmail.com>
Co-authored-by: Timo Glastra <timo@animo.id>
Co-authored-by: Jim Ezesinachi <ezesinachijim@gmail.com>
Co-authored-by: Ry Jones <ry@linux.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kim Ebert <kim@developmint.work>
Co-authored-by: Grammatopoulos Athanasios Vasileios <GramThanos@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Victor Anene <62852943+Vickysomtee@users.noreply.github.com>
Co-authored-by: Jim Ezesinachi <jim@animo.id>
Co-authored-by: KolbyRKunz <KolbyKunz@yahoo.com>
Co-authored-by: Berend Sliedrecht <61358536+blu3beri@users.noreply.github.com>
Co-authored-by: Jason C. Leach <jason.leach@fullboar.ca>
Co-authored-by: Martin Auer <martin.auer97@gmail.com>
Co-authored-by: Niall Shaw <100220424+niall-shaw@users.noreply.github.com>
Co-authored-by: Pritam Singh <43764373+Zzocker@users.noreply.github.com>
Co-authored-by: Mo <10432473+morrieinmaas@users.noreply.github.com>
Co-authored-by: NB-MikeRichardson <93971245+NB-MikeRichardson@users.noreply.github.com>
Co-authored-by: Amit-Padmani <106090107+Amit-Padmani@users.noreply.github.com>
Co-authored-by: DaevMithran <61043607+DaevMithran@users.noreply.github.com>
Co-authored-by: Alexander Shenshin <93187809+AlexanderShenshin@users.noreply.github.com>
fix(openid4vc-client): set package to private (#1210)
fix: fix typing issues with typescript 4.9 (#1214)
Fixes #1205
resolver (#1247)
fix: set updateAt on records when updating a record (#1272)
fix(transport)!: added docs moved connection to connectionId (#1222)
fix(indy-vdr): export relevant packages from root (#1291)
fix(askar): generate nonce suitable for anoncreds (#1295)
resolver and registrar for did:indy (#1253)
fix: imports from core (#1303)
fix: thread id improvements (#1311)
fix: loosen base64 validation (#1312)
fix(samples): dummy module response message type (#1321)
fix: seed and private key validation and return type in registrars (#1324)
fix!: don't emit legacy did:sov prefix for new protocols (#1245)
fix(askar): anoncrypt messages unpacking (#1332)
fix: expose indy pool configs and action menu messages (#1333)
fix: create new socket if socket state is 'closing' (#1337)
fix(anoncreds): include prover_did for legacy indy (#1342)
fix(indy-sdk): import from core (#1346)
fix(anoncreds-rs): save revocation registry index (#1351)
fix: isNewSocket logic (#1355)
fix(tenant): Correctly configure storage for multi tenant agents (#1359)
Fixes hyperledger#1353
fix(anoncreds): Buffer not imported from core (#1367)
fix(core): repository event when calling deleteById (#1356)
fix(askar): custom error handling (#1372)
fix: return HTTP 415 if unsupported content type (#1313)
fix: remove named capture groups (#1378)
fix example usage of indy-sdk-react-native package (#1382)
fix: connection id in sessions for new connections (#1383)
fix: did cache key not being set correctly (#1394)
fix: incorrect type for anoncreds registration (#1396)
fix: reference to indyLedgers in IndyXXXNotConfiguredError (#1397)
fix: add reflect-metadata (#1409)
fix: various anoncreds revocation fixes (#1416)
fix: jsonld credential format identifier version (#1412)
fix: remove `deleteOnFinish` and added documentation (#1418)
fix(askar): default key derivation method (#1420)
fix(anoncreds): make revocation status list inline with the spec (#1421)
fix(anoncreds-rs): revocation status list as JSON (#1422)
fix: issuance with unqualified identifiers (#1431)
fix(connections): store imageUrl when using DIDExchange (#1433)
fix(indy-vdr): do not force indy-vdr version (#1434)
fix: small issues with migration and WAL files (#1443)
fix: migration of link secret (#1444)
fix: Emit RoutingCreated event for mediator routing record (#1445)
fix: small updates to cheqd module and demo (#1439)
fix: remove scope check from response (#1450)
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