-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(anoncreds): use legacy prover did (#1374)
Signed-off-by: Ariel Gentile <[email protected]>
- Loading branch information
Showing
12 changed files
with
103 additions
and
43 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,6 +62,8 @@ import { | |
checkValidCredentialValueEncoding, | ||
encodeCredentialValue, | ||
assertNoDuplicateGroupsNamesInProofRequest, | ||
legacyIndyCredentialDefinitionIdRegex, | ||
legacyIndySchemaIdRegex, | ||
} from '../utils' | ||
|
||
const V2_INDY_PRESENTATION_PROPOSAL = 'hlindy/[email protected]' | ||
|
@@ -471,6 +473,10 @@ export class LegacyIndyProofFormatService implements ProofFormatService<LegacyIn | |
const schemas: { [key: string]: AnonCredsSchema } = {} | ||
|
||
for (const schemaId of schemaIds) { | ||
if (!schemaId.match(legacyIndySchemaIdRegex)) { | ||
throw new AriesFrameworkError(`${schemaId} is not a valid legacy indy schema id`) | ||
} | ||
|
||
const schemaRegistry = registryService.getRegistryForIdentifier(agentContext, schemaId) | ||
const schemaResult = await schemaRegistry.getSchema(agentContext, schemaId) | ||
|
||
|
@@ -499,6 +505,10 @@ export class LegacyIndyProofFormatService implements ProofFormatService<LegacyIn | |
const credentialDefinitions: { [key: string]: AnonCredsCredentialDefinition } = {} | ||
|
||
for (const credentialDefinitionId of credentialDefinitionIds) { | ||
if (!credentialDefinitionId.match(legacyIndyCredentialDefinitionIdRegex)) { | ||
throw new AriesFrameworkError(`${credentialDefinitionId} is not a valid legacy indy credential definition id`) | ||
} | ||
|
||
const credentialDefinitionRegistry = registryService.getRegistryForIdentifier( | ||
agentContext, | ||
credentialDefinitionId | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -864,23 +864,23 @@ | |
resolved "https://registry.yarnpkg.com/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340" | ||
integrity sha512-H9XAx3hc0BQHY6l+IFSWHDySypcXsvsuLhgYLUGywmJ5pswRVQJUHpOsobnLYp2ZUaUlKiKDrgWWhosOwAEM8Q== | ||
|
||
"@hyperledger/anoncreds-nodejs@^0.1.0-dev.9": | ||
version "0.1.0-dev.9" | ||
resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.1.0-dev.9.tgz#5f09d5f147ce204abd9b3cea486c23e556cc8fdc" | ||
integrity sha512-Ht5Gt1DfnFiRIY+AlTpe8Hcdryb+jKl79hGQ3kszdct/1JFZ70A81ssfwX0VKYTdCHt5jK5cJzVaOjOVmBKZiw== | ||
"@hyperledger/anoncreds-nodejs@^0.1.0-dev.10": | ||
version "0.1.0-dev.10" | ||
resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-nodejs/-/anoncreds-nodejs-0.1.0-dev.10.tgz#80c093ecb08a277fb494399b64aad1b900c3103f" | ||
integrity sha512-ju5mJPwuyebAPziuf+eUOwxEws02G2FHEp/qG3GV3kxtlx7THW7HVB7dMSNqhRVKCsbcNnZtWJB1UiPvWqboUg== | ||
dependencies: | ||
"@hyperledger/anoncreds-shared" "0.1.0-dev.9" | ||
"@hyperledger/anoncreds-shared" "0.1.0-dev.10" | ||
"@mapbox/node-pre-gyp" "^1.0.10" | ||
ffi-napi "4.0.3" | ||
node-cache "5.1.2" | ||
ref-array-di "1.2.2" | ||
ref-napi "3.0.3" | ||
ref-struct-di "1.1.1" | ||
|
||
"@hyperledger/[email protected].9", "@hyperledger/anoncreds-shared@^0.1.0-dev.9": | ||
version "0.1.0-dev.9" | ||
resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.1.0-dev.9.tgz#7f6a033997e2641432a51ff2b609d603b3f9ab50" | ||
integrity sha512-xbWEB9Z9PwkxC2awx74xt1OULMxihbK2v7818Dtrrmun75gNBXF8Jdorn9+t+TEd62QLrJpVUJ1ZCKhXPx81zw== | ||
"@hyperledger/[email protected].10", "@hyperledger/anoncreds-shared@^0.1.0-dev.10": | ||
version "0.1.0-dev.10" | ||
resolved "https://registry.yarnpkg.com/@hyperledger/anoncreds-shared/-/anoncreds-shared-0.1.0-dev.10.tgz#9d67f64e98ff41971644c95b03dabafd741df4df" | ||
integrity sha512-POvcwQrUcPrwoZehQa38pN1dnjyeUlrQ6VlksbBRS8SUHJuyixZsD+d3XoumqaNfl9Z1DCjfuOgEiPlec01gXQ== | ||
|
||
"@hyperledger/aries-askar-nodejs@^0.1.0-dev.4": | ||
version "0.1.0-dev.4" | ||
|