Skip to content

Commit

Permalink
Allow to verify credentials with no revealed subject
Browse files Browse the repository at this point in the history
  • Loading branch information
cykoder committed Dec 5, 2024
1 parent 75d555e commit 98b16b7
Show file tree
Hide file tree
Showing 13 changed files with 63 additions and 20 deletions.
9 changes: 9 additions & 0 deletions examples/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @docknetwork/sdk-examples

## 0.6.2

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.16.0
- @docknetwork/dock-blockchain-api@0.8.2
- @docknetwork/dock-blockchain-modules@0.9.2

## 0.6.1

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@docknetwork/sdk-examples",
"private": true,
"type": "module",
"version": "0.6.1",
"version": "0.6.2",
"scripts": {
"bbs-dock-example": "babel-node ./bbs-dock.js",
"claim-deduction-example": "babel-node ./claim-deduction.js",
Expand All @@ -19,9 +19,9 @@
"lint": "eslint \"*.js\""
},
"dependencies": {
"@docknetwork/credential-sdk": "0.15.0",
"@docknetwork/dock-blockchain-api": "0.8.1",
"@docknetwork/dock-blockchain-modules": "0.9.1"
"@docknetwork/credential-sdk": "0.16.0",
"@docknetwork/dock-blockchain-api": "0.8.2",
"@docknetwork/dock-blockchain-modules": "0.9.2"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/cheqd-blockchain-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @docknetwork/cheqd-blockchain-api

## 0.14.1

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.16.0

## 0.14.0

### Minor Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/cheqd-blockchain-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/cheqd-blockchain-api",
"version": "0.14.0",
"version": "0.14.1",
"license": "MIT",
"main": "./dist/esm/index.js",
"type": "module",
Expand Down Expand Up @@ -34,7 +34,7 @@
},
"dependencies": {
"@cheqd/sdk": "cjs",
"@docknetwork/credential-sdk": "0.15.0"
"@docknetwork/credential-sdk": "0.16.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
Expand Down
7 changes: 7 additions & 0 deletions packages/cheqd-blockchain-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @docknetwork/cheqd-blockchain-modules

## 0.11.2

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.16.0

## 0.11.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/cheqd-blockchain-modules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/cheqd-blockchain-modules",
"version": "0.11.1",
"version": "0.11.2",
"type": "module",
"license": "MIT",
"main": "./dist/esm/index.js",
Expand Down Expand Up @@ -33,7 +33,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"@docknetwork/credential-sdk": "0.15.0"
"@docknetwork/credential-sdk": "0.16.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
Expand All @@ -42,7 +42,7 @@
"@babel/plugin-syntax-import-attributes": "^7.25.6",
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
"@babel/preset-env": "^7.24.3",
"@docknetwork/cheqd-blockchain-api": "0.14.0",
"@docknetwork/cheqd-blockchain-api": "0.14.1",
"@rollup/plugin-alias": "^4.0.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/credential-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @docknetwork/credential-sdk

## 0.16.0

### Minor Changes

- Dont require credential subject property

## 0.15.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/credential-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/credential-sdk",
"version": "0.15.0",
"version": "0.16.0",
"license": "MIT",
"type": "module",
"files": [
Expand Down
10 changes: 5 additions & 5 deletions packages/credential-sdk/src/vc/credentials.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ export function checkCredentialRequired(credential, isJWT) {
throw new Error('"type" property is required.');
}

// Ensure credential has subject
if (!credential.credentialSubject) {
throw new Error('"credentialSubject" property is required.');
}

// Ensure issuer and issue date is valid, only for non-jwt as that is defined in the header
if (!isJWT) {
const issuer = getId(credential.issuer);
Expand Down Expand Up @@ -518,6 +513,11 @@ export async function issueCredential(
// Ensure credential is valid
checkCredential(cred);

// Ensure credential has subject
if (!cred.credentialSubject) {
throw new Error('"credentialSubject" property is required.');
}

// Should use JWT format?
if (useJWT) {
// Format to VC JWT spec
Expand Down
7 changes: 7 additions & 0 deletions packages/dock-blockchain-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @docknetwork/dock-blockchain-api

## 0.8.2

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.16.0

## 0.8.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/dock-blockchain-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/dock-blockchain-api",
"version": "0.8.1",
"version": "0.8.2",
"license": "MIT",
"main": "./dist/esm/index.js",
"type": "module",
Expand Down Expand Up @@ -89,7 +89,7 @@
"@polkadot/api": "10.12.4"
},
"dependencies": {
"@docknetwork/credential-sdk": "0.15.0",
"@docknetwork/credential-sdk": "0.16.0",
"@docknetwork/node-types": "^0.17.0",
"@juanelas/base64": "^1.0.5",
"@polkadot/api": "10.12.4",
Expand Down
7 changes: 7 additions & 0 deletions packages/dock-blockchain-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @docknetwork/dock-blockchain-modules

## 0.9.2

### Patch Changes

- Updated dependencies
- @docknetwork/credential-sdk@0.16.0

## 0.9.1

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/dock-blockchain-modules/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@docknetwork/dock-blockchain-modules",
"version": "0.9.1",
"version": "0.9.2",
"license": "MIT",
"type": "module",
"main": "./dist/esm/index.js",
Expand Down Expand Up @@ -33,7 +33,7 @@
"node": ">=18.0.0"
},
"dependencies": {
"@docknetwork/credential-sdk": "0.15.0"
"@docknetwork/credential-sdk": "0.16.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
Expand All @@ -42,7 +42,7 @@
"@babel/plugin-syntax-import-attributes": "^7.25.6",
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
"@babel/preset-env": "^7.24.3",
"@docknetwork/dock-blockchain-api": "0.8.1",
"@docknetwork/dock-blockchain-api": "0.8.2",
"@rollup/plugin-alias": "^4.0.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down

0 comments on commit 98b16b7

Please sign in to comment.