Skip to content

Various repository cleanups #52

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

Merged
merged 6 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
**/.classpath
**/.dockerignore
**/.env
**/.idea
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.yarn
**/*.*proj.user
**/*.dbmdl
**/*.jfm
Expand Down
34 changes: 15 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
FROM node:20.0.0
FROM node:22
ENV NODE_ENV=production
WORKDIR /usr/src/app
# COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
# RUN npm install -g yarn

COPY . .

ENV YARN_VERSION 4.0.0
RUN yarn policies set-version $YARN_VERSION
# Install EYE reasoner
RUN apt-get update \
&& apt-get install swi-prolog -y \
&& git clone https://github.com/eyereasoner/eye.git \
&& /eye/install.sh --prefix=/usr/local \
&& rm -r /eye

RUN corepack enable yarn
RUN yarn install
# COPY . .
WORKDIR /usr/src/app
COPY . .

RUN yarn build
# Install packages and build server
RUN corepack enable yarn \
&& yarn install \
&& yarn build \
&& chown -R node /usr/src/app

EXPOSE 3000
EXPOSE 4000
EXPOSE 4444
EXPOSE 5123
EXPOSE 8201
EXPOSE 8202
EXPOSE 8203

RUN chown -R node /usr/src/app
USER node
CMD ["yarn", "start:demo"]
CMD ["yarn", "start"]
28 changes: 8 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This repository contains SolidLab research artefacts on use of UMA in the Solid

- [`@solidlab/uma-css`](packages/css): UMA modules for the [Community Solid Server](https://github.com/CommunitySolidServer/CommunitySolidServer/).

- [`@solidlab/ucp`](packages/ucp): Usage Control Policy decision/enforcement component.
- [`@solidlab/ucp`](packages/ucp): Usage Control Policy utility component.

## Getting started

Expand All @@ -28,7 +28,6 @@ You can then execute the following flows:
- `yarn script:private`: `PUT` some text to the private `/alice/private/resource.txt`, protected by a simple WebID check;
- `yarn script:uma-ucp`: `PUT` some text to the private `/alice/other/resource.txt`, protected by a UCP enforcer checking WebIDs according to policies in `packages/uma/config/rules/policy/`.
- `yarn script:registration`: `POST`, `GET` and `DELETE` some text to/from `/alice/public/resource.txt` to test the correct creation and deletion of resource registrations on the UNA server.
- `yarn script:ucp-enforcement`: Run the UCP enforcer in a script (`scripts/test-ucp-enforcement.ts`). This does not need the servers to be started.

`yarn script:flow` runs all flows in sequence.

Expand All @@ -46,24 +45,13 @@ which runs with experimental contracts.
The packages in this project currently only support a fixed UMA AS per CSS RS.
Authorization can be done with a simple, unverified, WebID embedded in the ticket
using the [WebIdAuthorizer](packages/uma/src/policies/authorizers/WebIdAuthorizer.ts)
or the [PolicyBasedAuthorizer](packages/uma/src/policies/authorizers/PolicyBasedAuthorizer.ts)
or the [OdrlAuthorizer](packages/uma/src/policies/authorizers/OdrlAuthorizer.ts)
which supports simple ODRL policies.
A [NamespacedAuthorizer](packages/uma/src/policies/authorizers/NamespacedAuthorizer.ts)
is used to apply different authorizers to different containers.

### Usage control policy enforcement
## ODRL

Used for creating a modular engine that calculates which access modes are granted based on:

- Usage Control Rules
- Interpretation of those rules
- The request of the Requested Party together with all its claims

For more information, you can check out its [own repository](https://github.com/woutslabbinck/ucp-enforcement) which has three engines that use [ODRL rules](https://www.w3.org/TR/odrl-model/).

A test script is provided for a CRUD ODRL engine: `yarn script:ucp-enforcement`.
In the [script](./scripts/test-ucp-enforcement.ts) a read Usage Control Rule (in ODRL) is present together with N3 interpretation rules.
Then a read request is performed using the engine, which results in a list of grants. This list is then printed to the console.


## Next steps

More advanced ODRL evaluation can be found in the `feat/ODRL-evaluator` branch.
A variant of the server that only uses ODRL for authorization can be started with `yarn start:odrl`.
A corresponding script can then be executed with `yarn script:uma-odrl`.
The test policies can be found in [packages/uma/config/rules/odrl](packages/uma/config/rules/odrl).
20 changes: 0 additions & 20 deletions docker-compose.debug.yml

This file was deleted.

15 changes: 7 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
version: '3.4'
# The server is currently configured to use localhost as its base URL.
# When using multiple docker containers that want to interact with each other, 0.0.0.0 should be used.
# Because of this, and also because of potential external interactions with the server,
# it might be necessary in the future to add changes to support this.
# Newer versions of CSS can be configured to allow multiple base URLs which will be necessary then.

services:
pacsoi-poc-1:
image: pacsoi-poc1
solidtrustflows:
image: solidtrustflows
build:
context: .
dockerfile: ./Dockerfile
Expand All @@ -11,8 +15,3 @@ services:
ports:
- 3000:3000
- 4000:4000
- 4444:4444
- 5123:5123
- 8201:8201
- 8202:8202
- 8203:8203
2 changes: 1 addition & 1 deletion dockerize.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
docker image build --pull --file './Dockerfile' --tag 'solidlab-trust-flows-demo:latest' --label 'com.microsoft.created-by=visual-studio-code' --network=host ./
docker image build --pull --file './Dockerfile' --tag 'solidlab-trust-flows-demo:latest' --network=host .
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@
"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:ucp-enforcement": "yarn exec ts-node ./scripts/test-ucp-enforcement.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:flow": "yarn run script:public && yarn run script:private && yarn run script:uma-ucp && yarn run script:registration && yarn run script:ucp-enforcement",
"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"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/css/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ export * from './identity/interaction/account/util/UmaAccountStore';

export * from './init/UmaSeededAccountInitializer';

export * from './server/description/AccountSettingsStorageDescriber';

export * from './server/middleware/JwksHandler';

export * from './uma/ResourceRegistrar';
Expand Down

This file was deleted.

76 changes: 0 additions & 76 deletions packages/ucp/docs/crud_full.n3

This file was deleted.

Loading