Skip to content

Commit

Permalink
fix: Upgrade SDK to latest version which contains a fix to deserializ…
Browse files Browse the repository at this point in the history
…e the JWT Credential from JTI String.
  • Loading branch information
elribonazo committed Feb 8, 2024
1 parent c1971f7 commit e9aa761
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"author": "elribonazo@gmail.com",
"license": "Apache-2.0",
"peerDependencies": {
"@atala/prism-wallet-sdk": "^4.0.0"
"@atala/prism-wallet-sdk": "^4.0.2"
},
"optionalDependencies": {
"@pluto-encrypted/indexdb": "1.12.1",
Expand All @@ -51,7 +51,7 @@
"level": "^6.0.1"
},
"dependencies": {
"@atala/prism-wallet-sdk": "^4.0.0",
"@atala/prism-wallet-sdk": "^4.0.2",
"@pluto-encrypted/encryption": "1.11.0",
"@pluto-encrypted/shared": "1.11.3",
"@pluto-encrypted/schemas": "^1.0.0",
Expand All @@ -63,4 +63,4 @@
"build/*"
],
"gitHead": "6aa4ce8bbb9938fc4c4e790efffa5b902631362c"
}
}
6 changes: 3 additions & 3 deletions packages/schemas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"author": "elribonazo@gmail.com",
"license": "Apache-2.0",
"peerDependencies": {
"@atala/prism-wallet-sdk": "^4.0.0-rc.1"
"@atala/prism-wallet-sdk": "^4.0.2"
},
"devDependencies": {
"@pluto-encrypted/encryption": "1.11.0",
"@pluto-encrypted/shared": "1.11.3",
"@vitest/coverage-v8": "^1.0.4"
},
"dependencies": {
"@atala/prism-wallet-sdk": "^4.0.0-rc.1",
"@atala/prism-wallet-sdk": "^4.0.2",
"@pluto-encrypted/encryption": "1.11.0",
"@pluto-encrypted/shared": "1.11.3",
"rxdb": "^14.17.0",
Expand All @@ -46,4 +46,4 @@
"build/*"
],
"gitHead": "6aa4ce8bbb9938fc4c4e790efffa5b902631362c"
}
}
3 changes: 2 additions & 1 deletion packages/schemas/src/schemas/credential/orm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export const CredentialMethods: CredentialMethodTypes = {
if (this.recoveryId === SDK.JWTVerifiableCredentialRecoveryId) {
const jwtString = Buffer.from(this.credentialData).toString()
const jwtObj = JSON.parse(jwtString)
return SDK.JWTCredential.fromJWT(jwtObj, jwtString)
const fromJWT = SDK.JWTCredential.fromJWT(jwtObj, jwtObj.jti)
return fromJWT
} else if (this.recoveryId === SDK.AnonCredsRecoveryId) {
const credentialData = Buffer.from(this.credentialData).toString()
const credentialJson = JSON.parse(credentialData)
Expand Down
18 changes: 9 additions & 9 deletions packages/test-suite/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void
}
})
}
debugger;

const deleteResponse = await storageInstance.bulkWrite(
[toDelete],
testContext
)
debugger;

expect(deleteResponse.error).toStrictEqual({})
debugger;

const foundDoc = await storageInstance.findDocumentsById([pkey], false)

expect(foundDoc).toStrictEqual({})
Expand Down Expand Up @@ -913,7 +913,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void

describe('.query()', () => {
it('should find all documents', async ({ expect }) => {
debugger;

storageInstance = await storage.createStorageInstance<{ key: string, value: string }>({
databaseInstanceToken: randomCouchString(10),
databaseName: randomCouchString(12),
Expand All @@ -923,7 +923,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void
multiInstance: false,
devMode: true
})
debugger;

const writeData = {
key: 'foobar',
value: 'barfoo',
Expand All @@ -934,14 +934,14 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void
lwt: now()
}
}
debugger;

await storageInstance.bulkWrite(
[{
document: writeData
}],
testContext
)
debugger;

const writeData2 = {
key: 'foobar2',
value: 'barfoo2',
Expand All @@ -958,7 +958,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void
}],
testContext
)
debugger;

const preparedQuery = prepareQuery(
storageInstance.schema,
{
Expand All @@ -971,7 +971,7 @@ export function runTestSuite(suite: TestSuite, testStorage: RxTestStorage): void
)
const allDocs = await storageInstance.query(preparedQuery)
const first = allDocs.documents[0]
debugger;

expect(first).not.toBe(undefined)
expect(first.value).toBe('barfoo')

Expand Down

0 comments on commit e9aa761

Please sign in to comment.