Skip to content

Policy Endpoints #57

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

Draft
wants to merge 57 commits into
base: feat/policy-endpoint
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ecd6839
Basic POST /policies created
lennertdr Jul 4, 2025
846fcac
Practical addRule implementation to test the POST endpoint
lennertdr Jul 4, 2025
1c377a7
added Get One Policy endpoint, need a way to fix the ID (encoding?)
lennertdr Jul 4, 2025
e60eb75
getOnePolicy works if a good encoding of ID's is implemented
lennertdr Jul 4, 2025
6f0916f
follow implementation from Main
lennertdr Jul 4, 2025
a183107
test content type
lennertdr Jul 7, 2025
89eb900
feat: Allow APIs with raw input
joachimvh Jul 7, 2025
f2de8ad
Format checks removed, they are already in N3 Parser
lennertdr Jul 7, 2025
56727e8
Merge remote-tracking branch 'upstream/main' into policyEndpoints
lennertdr Jul 7, 2025
f6dc977
fix: Correctly handle multiple routing classes
joachimvh Jul 7, 2025
8295dbf
Change to Memory structure for better testing on this branch
lennertdr Jul 7, 2025
3d110ce
Merge remote-tracking branch 'upstream/main' into policyEndpoints
lennertdr Jul 7, 2025
3ee80a6
POST with proper content types
lennertdr Jul 7, 2025
90ff950
Memory based tests
lennertdr Jul 7, 2025
64ae909
Merge remote-tracking branch 'origin/policyEndpoints'
lennertdr Jul 8, 2025
b5dab70
import fix
lennertdr Jul 8, 2025
2dad0f7
GET /uma/policies/<id> first finished implementation
lennertdr Jul 8, 2025
2f43a30
Add extra checks to POST
lennertdr Jul 8, 2025
73d32d8
More generic url handling and POST with sanitize function (to be comp…
lennertdr Jul 8, 2025
9e1102b
excessive documentation
lennertdr Jul 8, 2025
e11cc43
test doc and very primitive way to detect fails
lennertdr Jul 8, 2025
9f78328
DELETE endpoint implemented, still needs tests
lennertdr Jul 8, 2025
944b52e
fix: Export OperationLogger
joachimvh Jul 1, 2025
4c05231
fix: Prevent contract creation errors from stopping the request
joachimvh Jul 1, 2025
1b08acb
fix: Request subject resource permissions for auxiliaries
joachimvh Jul 1, 2025
0f0e025
feat: Allow relative URIs when using DirectoryUCRulesStorage
joachimvh Jul 1, 2025
0d91822
refactor: Remove unused seeding fields
joachimvh Jul 1, 2025
1e3c9e1
feat: Make containerURL of ContainerUCRulesStorage configurable
joachimvh Jul 1, 2025
3e7d7b6
feat: Make App the root configured component
joachimvh Jul 1, 2025
b7588c7
chore: Remove unused dependencies
joachimvh Jul 1, 2025
a746efe
chore: Replace ts-node completely with tsx
joachimvh Jul 1, 2025
3f8c388
test: Add integration tests with vitest
joachimvh Jul 1, 2025
4cde160
test: Add testing to CI
joachimvh Jul 2, 2025
de2fab0
chore: Build startup scripts instead of using tsx
joachimvh Jul 8, 2025
3be468a
Tests for DELETE endpoint
lennertdr Jul 9, 2025
de05066
edit policy setup
lennertdr Jul 9, 2025
778ca15
Basic edit implementation
lennertdr Jul 9, 2025
f06de50
added simple tests for PATCH
lennertdr Jul 9, 2025
aecd278
patch + tests
lennertdr Jul 9, 2025
f0ea4c7
extra check for PATCH
lennertdr Jul 10, 2025
c807bb7
remove console.logs
lennertdr Jul 10, 2025
308e6c1
Seperate rule definitions for a policy based on the client
lennertdr Jul 10, 2025
f98fbc9
PATCH safety fix, GET duplicate fix
lennertdr Jul 10, 2025
15d4619
cleanup, fix PUT, less redundant GET
lennertdr Jul 10, 2025
d16071b
extra PUT checks, extra documentation
lennertdr Jul 10, 2025
a67b3d4
doc layout fix
lennertdr Jul 10, 2025
615a9a9
detailed documentation
lennertdr Jul 11, 2025
d66d1f4
Stronger POST checks
lennertdr Jul 11, 2025
bb08a83
DELETE idea, need to adjust tests
lennertdr Jul 11, 2025
29b8eaa
fixed small bug
lennertdr Jul 14, 2025
4c1cc6f
Merge remote-tracking branch 'upstream/main', kept memory storage in …
lennertdr Jul 14, 2025
9c189ec
doc update
lennertdr Jul 14, 2025
7cbbedc
doc update
lennertdr Jul 14, 2025
0ba8846
typos
lennertdr Jul 14, 2025
36934e8
temporary header against CORS, not the right solution
lennertdr Jul 16, 2025
ed76ee6
script to seed for specific id
lennertdr Jul 16, 2025
155169e
options for other requests
lennertdr Jul 17, 2025
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
34 changes: 0 additions & 34 deletions .github/workflows/push.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

name: Test

on:
push:

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

build:

runs-on: ${{ matrix.operating-system }}

strategy:
fail-fast: false
matrix:
operating-system:
- ubuntu-latest
# logtalk-actions/setup-swi-prolog@master does not work with windows, so a different solution would be required
# - windows-latest
node-version:
- 20.x
- 22.x
- 24.x

steps:

- name: Install prolog
uses: logtalk-actions/setup-swi-prolog@master

- name: Clone EYE repo
uses: actions/checkout@v4
with:
repository: eyereasoner/eye

- name: Build EYE
run: bash install.sh --prefix=$HOME/.local # This folder is available on $PATH already

- name: Checkout main branch
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Enable Node.js Corepack
run: corepack enable

- name: Yarn install
run: yarn install

- name: Test
run: yarn test
11 changes: 0 additions & 11 deletions demo/flow-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,6 @@ import { Parser, Writer, Store } from 'n3';
import { randomUUID } from 'crypto';
import chalk from 'chalk'

// import * as jsonld from 'jsonld';

// import vc from '@digitalcredentials/vc';

// // Required to set up a suite instance with private key
// import {Ed25519VerificationKey2020} from
// '@digitalcredentials/ed25519-verification-key-2020';
// import {Ed25519Signature2020} from '@digitalcredentials/ed25519-signature-2020';



const parser = new Parser();
const writer = new Writer();

Expand Down
9 changes: 0 additions & 9 deletions demo/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import { Parser, Writer, Store } from 'n3';
import { randomUUID } from 'crypto';
import chalk from 'chalk'

import * as jsonld from 'jsonld';

import vc from '@digitalcredentials/vc';

// Required to set up a suite instance with private key
import {Ed25519VerificationKey2020} from
'@digitalcredentials/ed25519-verification-key-2020';
import {Ed25519Signature2020} from '@digitalcredentials/ed25519-signature-2020';



const parser = new Parser();
Expand Down
18 changes: 18 additions & 0 deletions demo/seed.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"email": "[email protected]",
"password": "abc123",
"pods": [{
"name": "ruben"
}]
},
{
"email": "[email protected]",
"password": "abc123",
"pods": [
{
"name": "demo"
}
]
}
]
213 changes: 213 additions & 0 deletions docs/policy-management.md

Large diffs are not rendered by default.

52 changes: 16 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
],
"private": true,
"packageManager": "yarn@4.1.0",
"packageManager": "yarn@4.9.2",
"engines": {
"node": ">=20.0",
"yarn": ">=4.0"
Expand All @@ -54,53 +54,47 @@
"postinstall": "yarn run sync:list && yarn build",
"clean": "shx rm -rf ./**/node_modules",
"build": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited -t run build",
"test": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run test",
"test": "vitest run",
"start": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run start",
"start:odrl": "yarn workspace @solidlab/uma run start:odrl & yarn workspace @solidlab/uma-css run start",
"start:demo": "yarn workspaces foreach --include 'packages/*' -A -pi -j unlimited run demo",
"script:demo": "yarn exec tsx ./demo/flow.ts",
"script:demo-test": "yarn exec tsx ./demo/flow-test.ts",
"script:public": "yarn exec ts-node ./scripts/test-public.ts",
"script:private": "yarn exec ts-node ./scripts/test-private.ts",
"script:registration": "yarn exec ts-node ./scripts/test-registration.ts",
"script:uma-ucp": "yarn exec ts-node ./scripts/test-uma-ucp.ts",
"script:uma-odrl": "yarn exec ts-node ./scripts/test-uma-ODRL.ts",
"script:uma-odrl-policy": "yarn exec ts-node ./scripts/test-uma-ODRL-policy.ts",
"script:public": "yarn exec tsx ./scripts/test-public.ts",
"script:private": "yarn exec tsx ./scripts/test-private.ts",
"script:registration": "yarn exec tsx ./scripts/test-registration.ts",
"script:seed": "yarn exec tsx ./scripts/seed-uma-ODRL-policy.ts",
"script:uma-ucp": "yarn exec tsx ./scripts/test-uma-ucp.ts",
"script:uma-odrl": "yarn exec tsx ./scripts/test-uma-ODRL.ts",
"script:uma-odrl-policy": "yarn exec tsx ./scripts/test-uma-ODRL-policy.ts",
"script:flow": "yarn run script:public && yarn run script:private && yarn run script:uma-ucp && yarn run script:registration",
"sync:list": "syncpack list-mismatches",
"sync:fix": "syncpack fix-mismatches"
},
"devDependencies": {
"@commitlint/cli": "^16.1.0",
"@commitlint/config-conventional": "^16.0.0",
"@solidlab/ucp": "workspace:^",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.25",
"@types/node": "^20.19.1",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"chalk": "^5.4.1",
"componentsjs-generator": "^3.1.2",
"concurrently": "^8.2.2",
"eslint": "^8.10.0",
"jest": "^29.7.0",
"jest-rdf": "^1.8.1",
"koreografeye": "^0.4.8",
"shx": "^0.3.4",
"syncpack": "^13.0.2",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.3.3"
"tsx": "^4.19.2",
"typescript": "^5.8.3",
"vite": "^6.3.5",
"vitest": "^3.2.3"
},
"resolutions": {
"@types/node": "^20.11.25"
"@types/node": "^20.19.1"
},
"workspaces": [
"packages/*"
],
"jest": {
"projects": [
"./packages/*/package.json"
]
},
"eslintConfig": {
"env": {
"browser": true,
Expand Down Expand Up @@ -155,19 +149,5 @@
]
]
}
},
"dependencies": {
"@digitalbazaar/ed25519-signature-2020": "^5.4.0",
"@digitalbazaar/ed25519-verification-key-2020": "^4.2.0",
"@digitalbazaar/vc": "^7.1.0",
"@digitalcredentials/ed25519-signature-2020": "^6.0.0",
"@digitalcredentials/ed25519-verification-key-2020": "^4.0.0",
"@digitalcredentials/vc": "^9.0.1",
"@digitalcredentials/vc-data-model": "^2.0.0",
"@inrupt/solid-client": "^2.0.1",
"@inrupt/solid-client-authn-core": "^2.1.0",
"chalk": "^5.4.1",
"jsonld": "^8.3.3",
"tsx": "^4.19.2"
}
}
2 changes: 1 addition & 1 deletion packages/css/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"css:config/storage/key-value/resource-store.json",
"css:config/storage/location/pod.json",
"css:config/storage/middleware/default.json",
"css:config/util/auxiliary/acl.json",
"css:config/util/auxiliary/empty.json",
"css:config/util/identifiers/suffix.json",
"css:config/util/index/default.json",
"css:config/util/logging/winston.json",
Expand Down
1 change: 0 additions & 1 deletion packages/css/config/demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
],
"import": [
"uma-css:config/default.json",
"uma-css:config/derived.json",
"css:config/storage/backend/data-accessors/file.json"
],
"@graph": [
Expand Down
72 changes: 0 additions & 72 deletions packages/css/config/derived.json

This file was deleted.

40 changes: 17 additions & 23 deletions packages/css/config/ldp/authorization/readers/uma.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,24 @@
"requestedModes"
],
"source": {
"comment": "Requests permissions on subject resources for auxiliary resources.",
"@type": "AuxiliaryReader",
"auxiliaryStrategy": {
"@id": "urn:solid-server:default:AuxiliaryStrategy"
},
"reader": {
"@type": "UnionPermissionReader",
"readers": [
{
"comment": "This PermissionReader will be used to prevent external access to containers used for internal storage.",
"@id": "urn:solid-server:default:PathBasedReader",
"@type": "PathBasedReader",
"baseUrl": {
"@id": "urn:solid-server:default:variable:baseUrl"
}
},
{
"comment": "The main reader, checks permissions from UMA token.",
"@id": "urn:solid-server:default:UmaPermissionReader",
"@type": "UmaPermissionReader"
"@id": "urn:uma:default:UnionPermissionReader",
"@type": "UnionPermissionReader",
"readers": [
{
"comment": "This PermissionReader will be used to prevent external access to containers used for internal storage.",
"@id": "urn:solid-server:default:PathBasedReader",
"@type": "PathBasedReader",
"baseUrl": {
"@id": "urn:solid-server:default:variable:baseUrl"
}
]
}
},
{
"comment": "The main reader, checks permissions from UMA token.",
"@id": "urn:solid-server:default:UmaPermissionReader",
"@type": "UmaPermissionReader"
}
]
}
}
]
}
}
Loading