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

feat: anoncreds w3c migration #1744

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
6f7193d
feat: w3c migration + data integrity issuance protocol alpha
auer-martin Jan 18, 2024
da663d6
merge branch main
auer-martin Jan 18, 2024
3de7105
fix: mainly issue regarding credential not being processed after rece…
auer-martin Jan 23, 2024
879b9dd
fix: lint issues
auer-martin Jan 23, 2024
91da079
feat: add cryptosuite tag to the credential record
auer-martin Jan 23, 2024
32432a8
fix: TODOS in credential format service
auer-martin Jan 24, 2024
9fb93f5
feat: presentation support
auer-martin Jan 30, 2024
c547754
fix: allow random presentation definition id string
auer-martin Jan 30, 2024
ded0462
feat: implement autorespond
auer-martin Jan 31, 2024
fd6fe4f
fix: todos
auer-martin Jan 31, 2024
86f8e6a
fix: remove presentation submission cryptosuite
auer-martin Jan 31, 2024
1303a23
Merge branch 'main' into w3c-migration
auer-martin Jan 31, 2024
d5c3866
complete merge, and fix part's of the legacy identifier issues
auer-martin Feb 1, 2024
866105a
fix: anoncreds-rs cryptosuite naming
auer-martin Feb 2, 2024
0c9c032
Merge branch 'main' into w3c-migration
auer-martin Feb 2, 2024
76dc962
fix: rename anoncredsvc to anoncreds
auer-martin Feb 2, 2024
79d8eaf
review changes
auer-martin Feb 5, 2024
cde35f8
fix: todos
auer-martin Feb 5, 2024
06ee6be
fix: stuff
auer-martin Feb 5, 2024
9856e2f
feat: also query legacy
auer-martin Feb 5, 2024
378e4aa
fix: packed pex
auer-martin Feb 5, 2024
1584dd8
update readme
auer-martin Feb 5, 2024
9acc6fa
feat: roll back demo
auer-martin Feb 5, 2024
fb470e3
fix: warn when using legacy
auer-martin Feb 5, 2024
29a1715
fix: add additional checks
auer-martin Feb 5, 2024
443fe6a
feat: update anoncreds-rs to 0.2.0-dev.11
auer-martin Feb 6, 2024
8a278d0
feat: update pex to official release
auer-martin Feb 6, 2024
218cf19
fix: missing offerattachment format
auer-martin Feb 6, 2024
1ea69de
fix: offerattachment issues
auer-martin Feb 6, 2024
046b633
fix: simplify linksecret handling for the anoncreds2023 cryptosuite
auer-martin Feb 6, 2024
27c4671
Merge branch 'main' into w3c-migration
auer-martin Feb 6, 2024
9c2d574
fix: tests
auer-martin Feb 6, 2024
cacc3c0
fix: migration
auer-martin Feb 6, 2024
f456e1b
fix: credential validation issues
auer-martin Feb 6, 2024
1c36fa2
fix: incoroporate feedback
auer-martin Feb 13, 2024
9cefe8a
fix: add cheqd test
auer-martin Feb 13, 2024
7b7b94c
Merge branch 'main' into pr/2mau/1744
auer-martin Feb 14, 2024
88417f4
Merge branch 'main' into pr/2mau/1744
auer-martin Feb 14, 2024
26739a5
fix: incorporate feedback
auer-martin Feb 18, 2024
57adb0b
Merge branch 'main' into pr/2mau/1744
auer-martin Feb 18, 2024
a74ffcb
fix: merge issue
auer-martin Feb 18, 2024
e4a26b6
fix: change import path
auer-martin Feb 18, 2024
519e863
fix: update anoncreds to stable release
auer-martin Feb 22, 2024
7d24ab0
fix: AnonCredsClaimRecord value should only be string | number for now
auer-martin Feb 22, 2024
45c4223
Merge branch 'main' into w3c-migration
auer-martin Feb 22, 2024
8d6e534
refactor: find and replace npm scope (#1712)
auer-martin Feb 23, 2024
ea1b036
Merge branch 'main' into w3c-migration
karimStekelenburg Feb 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/anoncreds/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"test": "jest"
},
"dependencies": {
"@astronautlabs/jsonpath": "^1.1.2",
"@credo-ts/core": "0.4.2",
"big-integer": "^1.6.51",
"bn.js": "^5.2.1",
"class-transformer": "0.5.1",
"class-validator": "0.14.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/anoncreds/src/AnonCredsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,8 @@ export class AnonCredsApi {
}
}

public async getCredential(credentialId: string) {
return this.anonCredsHolderService.getCredential(this.agentContext, { credentialId })
public async getCredential(id: string) {
return this.anonCredsHolderService.getCredential(this.agentContext, { id })
}

public async getCredentials(options: GetCredentialsOptions) {
Expand Down
11 changes: 11 additions & 0 deletions packages/anoncreds/src/AnonCredsModule.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import type { AnonCredsModuleConfigOptions } from './AnonCredsModuleConfig'
import type { DependencyManager, Module, Update } from '@credo-ts/core'

import { AnonCredsDataIntegrityServiceSymbol } from '@credo-ts/core'

import { AnonCredsApi } from './AnonCredsApi'
import { AnonCredsModuleConfig } from './AnonCredsModuleConfig'
import { AnonCredsRsHolderService, AnonCredsRsIssuerService, AnonCredsRsVerifierService } from './anoncreds-rs'
import { AnonCredsDataIntegrityService } from './anoncreds-rs/AnonCredsDataIntegrityService'
import {
AnonCredsCredentialDefinitionPrivateRepository,
AnonCredsKeyCorrectnessProofRepository,
Expand All @@ -16,6 +19,7 @@ import { AnonCredsSchemaRepository } from './repository/AnonCredsSchemaRepositor
import { AnonCredsHolderServiceSymbol, AnonCredsIssuerServiceSymbol, AnonCredsVerifierServiceSymbol } from './services'
import { AnonCredsRegistryService } from './services/registry/AnonCredsRegistryService'
import { updateAnonCredsModuleV0_3_1ToV0_4 } from './updates/0.3.1-0.4'
import { updateAnonCredsModuleV0_4ToV0_5 } from './updates/0.4-0.5'

/**
* @public
Expand Down Expand Up @@ -47,6 +51,8 @@ export class AnonCredsModule implements Module {
dependencyManager.registerSingleton(AnonCredsHolderServiceSymbol, AnonCredsRsHolderService)
dependencyManager.registerSingleton(AnonCredsIssuerServiceSymbol, AnonCredsRsIssuerService)
dependencyManager.registerSingleton(AnonCredsVerifierServiceSymbol, AnonCredsRsVerifierService)

dependencyManager.registerSingleton(AnonCredsDataIntegrityServiceSymbol, AnonCredsDataIntegrityService)
}

public updates = [
Expand All @@ -55,5 +61,10 @@ export class AnonCredsModule implements Module {
toVersion: '0.4',
doUpdate: updateAnonCredsModuleV0_3_1ToV0_4,
},
{
fromVersion: '0.4',
toVersion: '0.5',
doUpdate: updateAnonCredsModuleV0_4ToV0_5,
},
] satisfies Update[]
}
10 changes: 9 additions & 1 deletion packages/anoncreds/src/__tests__/AnonCredsModule.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import type { AnonCredsRegistry } from '../services'
import type { DependencyManager } from '@credo-ts/core'

import { AnonCredsDataIntegrityServiceSymbol } from '@credo-ts/core'

import { anoncreds } from '../../tests/helpers'
import { AnonCredsModule } from '../AnonCredsModule'
import { AnonCredsModuleConfig } from '../AnonCredsModuleConfig'
import { AnonCredsRsHolderService, AnonCredsRsIssuerService, AnonCredsRsVerifierService } from '../anoncreds-rs'
import { AnonCredsDataIntegrityService } from '../anoncreds-rs/AnonCredsDataIntegrityService'
import {
AnonCredsSchemaRepository,
AnonCredsCredentialDefinitionRepository,
Expand Down Expand Up @@ -32,7 +35,7 @@ describe('AnonCredsModule', () => {
})
anonCredsModule.register(dependencyManager)

expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(11)
expect(dependencyManager.registerSingleton).toHaveBeenCalledTimes(12)
expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(AnonCredsRegistryService)
expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(AnonCredsSchemaRepository)
expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(AnonCredsCredentialDefinitionRepository)
Expand All @@ -57,6 +60,11 @@ describe('AnonCredsModule', () => {
AnonCredsRsVerifierService
)

expect(dependencyManager.registerSingleton).toHaveBeenCalledWith(
AnonCredsDataIntegrityServiceSymbol,
AnonCredsDataIntegrityService
)

expect(dependencyManager.registerInstance).toHaveBeenCalledTimes(1)
expect(dependencyManager.registerInstance).toHaveBeenCalledWith(AnonCredsModuleConfig, anonCredsModule.config)
})
Expand Down
Loading
Loading