Skip to content

Commit

Permalink
Merge pull request #488 from docknetwork/feat/audit-fixes
Browse files Browse the repository at this point in the history
Audit fixes, RDF library upgrade
  • Loading branch information
cykoder authored Dec 2, 2024
2 parents 6077491 + c174967 commit 2283917
Show file tree
Hide file tree
Showing 17 changed files with 3,400 additions and 2,495 deletions.
10 changes: 10 additions & 0 deletions examples/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @docknetwork/sdk-examples

## 0.5.2

### Patch Changes

- Audit fixes and RDF lib upgrade
- Updated dependencies
- @docknetwork/credential-sdk@0.13.0
- @docknetwork/dock-blockchain-modules@0.8.1
- @docknetwork/dock-blockchain-api@0.6.2

## 0.5.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.5.1",
"version": "0.5.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.12.0",
"@docknetwork/dock-blockchain-api": "0.6.1",
"@docknetwork/dock-blockchain-modules": "0.8.0"
"@docknetwork/credential-sdk": "0.13.0",
"@docknetwork/dock-blockchain-api": "0.6.2",
"@docknetwork/dock-blockchain-modules": "0.8.1"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
],
"dependencies": {},
"devDependencies": {
"turbo": "2.0.5",
"@changesets/cli": "^2.x.x",
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.3",
"@babel/node": "^7.23.9",
"@babel/plugin-transform-modules-commonjs": "^7.24.1",
"@babel/preset-env": "^7.24.3"
"@babel/preset-env": "^7.24.3",
"@changesets/cli": "^2.x.x",
"turbo": "2.0.5"
},
"packageManager": "[email protected]",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions packages/cheqd-blockchain-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @docknetwork/cheqd-blockchain-api

## 0.11.1

### Patch Changes

- Audit fixes and RDF lib upgrade
- Updated dependencies
- @docknetwork/credential-sdk@0.13.0

## 0.11.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.11.0",
"version": "0.11.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.12.0"
"@docknetwork/credential-sdk": "0.13.0"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
Expand Down
8 changes: 8 additions & 0 deletions packages/cheqd-blockchain-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @docknetwork/cheqd-blockchain-modules

## 0.10.1

### Patch Changes

- Audit fixes and RDF lib upgrade
- Updated dependencies
- @docknetwork/credential-sdk@0.13.0

## 0.10.0

### Minor 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.10.0",
"version": "0.10.1",
"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.12.0"
"@docknetwork/credential-sdk": "0.13.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.11.0",
"@docknetwork/cheqd-blockchain-api": "0.11.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.13.0

### Minor Changes

- Audit fixes and RDF lib upgrade

## 0.12.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions 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.12.0",
"version": "0.13.0",
"license": "MIT",
"type": "module",
"files": [
Expand Down Expand Up @@ -31,11 +31,11 @@
"node": ">=18.0.0"
},
"dependencies": {
"@comunica/actor-init-sparql-rdfjs": "^1.22.3",
"@comunica/query-sparql-rdfjs": "^4.0.2",
"@digitalcredentials/vc-status-list": "^8.0.0",
"@docknetwork/crypto-wasm-ts": "^0.63.0",
"@juanelas/base64": "^1.1.5",
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "^0.25.0",
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "^0.26.0",
"@stablelib/ed25519": "^1.0.0",
"@subsquid/ss58-codec": "latest",
"@transmute/json-web-signature": "^0.7.0-unstable.82",
Expand Down
10 changes: 5 additions & 5 deletions packages/credential-sdk/src/rdf-and-cd/rdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ export async function queryNextLookup(claimgraph, query, engine) {

// Query the engine, if querying multiple times user should
// pass engine parameter for optimal performance
const result = await engine.query(query, { sources: [store] });
const bindingsStream = await engine.queryBindings(query, { sources: [store] });

// Get bindings from query
const bindings = await result.bindings();
const bindings = await bindingsStream.toArray();

// Convert bindings to claimgraph format using lookupNext variable
bindings.forEach((b) => assert(
b.get('?lookupNext') !== undefined,
"Query for next lookup must always bind '?lookupNext'",
b.get('lookupNext') !== undefined,
"Query for next lookup must always bind 'lookupNext'",
));
return bindings.map((binding) => fromJsonldjsNode(binding.get('?lookupNext')));
return bindings.map((binding) => fromJsonldjsNode(binding.get('lookupNext')));
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/credential-sdk/tests/crawl.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { newEngine } from "@comunica/actor-init-sparql-rdfjs";
import { QueryEngine } from "@comunica/query-sparql-rdfjs";

import { crawl } from "../src/rdf-and-cd";
import { ANYCLAIM, MAYCLAIM, MAYCLAIM_DEF_1 } from "../src/rdf-and-cd";
Expand Down Expand Up @@ -72,7 +72,7 @@ describe("Crawler unit tests", () => {
RULES,
CURIOSITY,
resolveGraph,
newEngine()
new QueryEngine()
);
expect(allFacts).toEqual([
[
Expand Down
6 changes: 3 additions & 3 deletions packages/credential-sdk/tests/rdf-turtle.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { newEngine } from "@comunica/actor-init-sparql-rdfjs";
import { QueryEngine } from "@comunica/query-sparql-rdfjs";
import { parseRDFDocument, queryNextLookup } from "../src/rdf-and-cd";

const rdfInputs = [
Expand Down Expand Up @@ -48,15 +48,15 @@ const claimgraph = [

describe("RDF SPARQL", () => {
test("Can query an RDF source (dbpedia)", async () => {
const engine = newEngine();
const engine = new QueryEngine();
const query =
"SELECT * { ?s ?p <http://dbpedia.org/resource/Belgium>. ?s ?p ?lookupNext } LIMIT 2";
const newGraph = await queryNextLookup(dbpediaSource, query, engine);
expect(newGraph).toEqual([{ Iri: "http://dbpedia.org/resource/Belgium" }]);
});

test("Can query a claimgraph", async () => {
const engine = newEngine();
const engine = new QueryEngine();
const query = `prefix dockalpha: <http://rdf.dock.io/alpha/2021#>
select * {
?root dockalpha:mayClaim dockalpha:ANYCLAIM .
Expand Down
8 changes: 8 additions & 0 deletions packages/dock-blockchain-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @docknetwork/dock-blockchain-api

## 0.6.2

### Patch Changes

- Audit fixes and RDF lib upgrade
- Updated dependencies
- @docknetwork/credential-sdk@0.13.0

## 0.6.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.6.1",
"version": "0.6.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.12.0",
"@docknetwork/credential-sdk": "0.13.0",
"@docknetwork/node-types": "^0.17.0",
"@juanelas/base64": "^1.0.5",
"@polkadot/api": "10.12.4",
Expand Down
8 changes: 8 additions & 0 deletions packages/dock-blockchain-modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @docknetwork/dock-blockchain-modules

## 0.8.1

### Patch Changes

- Audit fixes and RDF lib upgrade
- Updated dependencies
- @docknetwork/credential-sdk@0.13.0

## 0.8.0

### Minor 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.8.0",
"version": "0.8.1",
"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.12.0"
"@docknetwork/credential-sdk": "0.13.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.6.1",
"@docknetwork/dock-blockchain-api": "0.6.2",
"@rollup/plugin-alias": "^4.0.2",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^24.0.0",
Expand Down
Loading

0 comments on commit 2283917

Please sign in to comment.