Skip to content

Commit abac429

Browse files
Merge pull request #57 from lennertdr/main
This merge contains a first working version of the policy management API. I've tested it locally and (with some minor fixes), the API runs on the default setup (`yarn start`). In a later commit, I will address these. Finally, some issues that are required for merging with the main branch will be created by me. This includes creating proper tests, fine-tuning the documentation, sanitization of policies, and more.
2 parents f5772a9 + 9a5f4e8 commit abac429

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+3628
-2955
lines changed

.github/workflows/push.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
name: Test
3+
4+
on:
5+
push:
6+
7+
concurrency:
8+
group: ${{ github.head_ref || github.run_id }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
13+
build:
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
operating-system:
21+
- ubuntu-latest
22+
# logtalk-actions/setup-swi-prolog@master does not work with windows, so a different solution would be required
23+
# - windows-latest
24+
node-version:
25+
- 20.x
26+
- 22.x
27+
- 24.x
28+
29+
steps:
30+
31+
- name: Install prolog
32+
uses: logtalk-actions/setup-swi-prolog@master
33+
34+
- name: Clone EYE repo
35+
uses: actions/checkout@v4
36+
with:
37+
repository: eyereasoner/eye
38+
39+
- name: Build EYE
40+
run: bash install.sh --prefix=$HOME/.local # This folder is available on $PATH already
41+
42+
- name: Checkout main branch
43+
uses: actions/checkout@v4
44+
45+
- name: Use Node.js ${{ matrix.node-version }}
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: ${{ matrix.node-version }}
49+
50+
- name: Enable Node.js Corepack
51+
run: corepack enable
52+
53+
- name: Yarn install
54+
run: yarn install
55+
56+
- name: Test
57+
run: yarn test

demo/flow-test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@ import { Parser, Writer, Store } from 'n3';
55
import { randomUUID } from 'crypto';
66
import chalk from 'chalk'
77

8-
// import * as jsonld from 'jsonld';
9-
10-
// import vc from '@digitalcredentials/vc';
11-
12-
// // Required to set up a suite instance with private key
13-
// import {Ed25519VerificationKey2020} from
14-
// '@digitalcredentials/ed25519-verification-key-2020';
15-
// import {Ed25519Signature2020} from '@digitalcredentials/ed25519-signature-2020';
16-
17-
18-
198
const parser = new Parser();
209
const writer = new Writer();
2110

demo/flow.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ import { Parser, Writer, Store } from 'n3';
55
import { randomUUID } from 'crypto';
66
import chalk from 'chalk'
77

8-
import * as jsonld from 'jsonld';
9-
10-
import vc from '@digitalcredentials/vc';
11-
12-
// Required to set up a suite instance with private key
13-
import {Ed25519VerificationKey2020} from
14-
'@digitalcredentials/ed25519-verification-key-2020';
15-
import {Ed25519Signature2020} from '@digitalcredentials/ed25519-signature-2020';
16-
178

189

1910
const parser = new Parser();

demo/seed.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[
2+
{
3+
"email": "[email protected]",
4+
"password": "abc123",
5+
"pods": [{
6+
"name": "ruben"
7+
}]
8+
},
9+
{
10+
"email": "[email protected]",
11+
"password": "abc123",
12+
"pods": [
13+
{
14+
"name": "demo"
15+
}
16+
]
17+
}
18+
]

docs/policy-management.md

Lines changed: 216 additions & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
}
4343
],
4444
"private": true,
45-
"packageManager": "yarn@4.1.0",
45+
"packageManager": "yarn@4.9.2",
4646
"engines": {
4747
"node": ">=20.0",
4848
"yarn": ">=4.0"
@@ -54,53 +54,48 @@
5454
"postinstall": "yarn run sync:list && yarn build",
5555
"clean": "shx rm -rf ./**/node_modules",
5656
"build": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited -t run build",
57-
"test": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run test",
57+
"test": "vitest run",
5858
"start": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run start",
5959
"start:odrl": "yarn workspace @solidlab/uma run start:odrl & yarn workspace @solidlab/uma-css run start",
6060
"start:demo": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run demo",
6161
"script:demo": "yarn exec tsx ./demo/flow.ts",
6262
"script:demo-test": "yarn exec tsx ./demo/flow-test.ts",
63-
"script:public": "yarn exec ts-node ./scripts/test-public.ts",
64-
"script:private": "yarn exec ts-node ./scripts/test-private.ts",
65-
"script:registration": "yarn exec ts-node ./scripts/test-registration.ts",
66-
"script:uma-ucp": "yarn exec ts-node ./scripts/test-uma-ucp.ts",
67-
"script:uma-odrl": "yarn exec ts-node ./scripts/test-uma-ODRL.ts",
68-
"script:uma-odrl-policy": "yarn exec ts-node ./scripts/test-uma-ODRL-policy.ts",
63+
"script:demo-uma-policy": "yarn exec tsx ./scripts/demo-uma-policy.ts",
64+
"script:public": "yarn exec tsx ./scripts/test-public.ts",
65+
"script:private": "yarn exec tsx ./scripts/test-private.ts",
66+
"script:registration": "yarn exec tsx ./scripts/test-registration.ts",
67+
"script:seed": "yarn exec tsx ./scripts/seed-uma-ODRL-policy.ts",
68+
"script:uma-ucp": "yarn exec tsx ./scripts/test-uma-ucp.ts",
69+
"script:uma-odrl": "yarn exec tsx ./scripts/test-uma-ODRL.ts",
70+
"script:uma-odrl-policy": "yarn exec tsx ./scripts/test-uma-ODRL-policy.ts",
6971
"script:flow": "yarn run script:public && yarn run script:private && yarn run script:uma-ucp && yarn run script:registration",
7072
"sync:list": "syncpack list-mismatches",
7173
"sync:fix": "syncpack fix-mismatches"
7274
},
7375
"devDependencies": {
7476
"@commitlint/cli": "^16.1.0",
7577
"@commitlint/config-conventional": "^16.0.0",
76-
"@solidlab/ucp": "workspace:^",
7778
"@types/jest": "^29.5.12",
78-
"@types/node": "^20.11.25",
79+
"@types/node": "^20.19.1",
7980
"@typescript-eslint/eslint-plugin": "^5.12.1",
8081
"@typescript-eslint/parser": "^5.12.1",
82+
"chalk": "^5.4.1",
8183
"componentsjs-generator": "^3.1.2",
82-
"concurrently": "^8.2.2",
8384
"eslint": "^8.10.0",
84-
"jest": "^29.7.0",
8585
"jest-rdf": "^1.8.1",
86-
"koreografeye": "^0.4.8",
8786
"shx": "^0.3.4",
8887
"syncpack": "^13.0.2",
89-
"ts-jest": "^29.1.2",
90-
"ts-node": "^10.9.2",
91-
"typescript": "^5.3.3"
88+
"tsx": "^4.19.2",
89+
"typescript": "^5.8.3",
90+
"vite": "^6.3.5",
91+
"vitest": "^3.2.3"
9292
},
9393
"resolutions": {
94-
"@types/node": "^20.11.25"
94+
"@types/node": "^20.19.1"
9595
},
9696
"workspaces": [
9797
"packages/*"
9898
],
99-
"jest": {
100-
"projects": [
101-
"./packages/*/package.json"
102-
]
103-
},
10499
"eslintConfig": {
105100
"env": {
106101
"browser": true,
@@ -155,19 +150,5 @@
155150
]
156151
]
157152
}
158-
},
159-
"dependencies": {
160-
"@digitalbazaar/ed25519-signature-2020": "^5.4.0",
161-
"@digitalbazaar/ed25519-verification-key-2020": "^4.2.0",
162-
"@digitalbazaar/vc": "^7.1.0",
163-
"@digitalcredentials/ed25519-signature-2020": "^6.0.0",
164-
"@digitalcredentials/ed25519-verification-key-2020": "^4.0.0",
165-
"@digitalcredentials/vc": "^9.0.1",
166-
"@digitalcredentials/vc-data-model": "^2.0.0",
167-
"@inrupt/solid-client": "^2.0.1",
168-
"@inrupt/solid-client-authn-core": "^2.1.0",
169-
"chalk": "^5.4.1",
170-
"jsonld": "^8.3.3",
171-
"tsx": "^4.19.2"
172153
}
173154
}

packages/css/config/default.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"css:config/storage/key-value/resource-store.json",
2929
"css:config/storage/location/pod.json",
3030
"css:config/storage/middleware/default.json",
31-
"css:config/util/auxiliary/acl.json",
31+
"css:config/util/auxiliary/empty.json",
3232
"css:config/util/identifiers/suffix.json",
3333
"css:config/util/index/default.json",
3434
"css:config/util/logging/winston.json",

packages/css/config/demo.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
],
66
"import": [
77
"uma-css:config/default.json",
8-
"uma-css:config/derived.json",
98
"css:config/storage/backend/data-accessors/file.json"
109
],
1110
"@graph": [

packages/css/config/derived.json

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)