Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
4715f05
primitive policy endpoint with small test
lennertdr Jul 2, 2025
3ca0de8
delete todo
lennertdr Jul 2, 2025
c84a364
script to run policy test file
lennertdr Jul 2, 2025
06dc7dc
Using authorisation headers, awaiting addition of /policies route
lennertdr Jul 2, 2025
6fa50a8
use ODRL variable and Authorization headers
lennertdr Jul 2, 2025
b8969c7
edit vocab
lennertdr Jul 2, 2025
2160ad8
route configuration start
lennertdr Jul 2, 2025
ade4168
Return all policy information instead of just the id
lennertdr Jul 2, 2025
3bdcf13
Implemented suggested changes, endpoint works with depth 1
lennertdr Jul 3, 2025
0e1c440
updated tests
lennertdr Jul 3, 2025
6259418
updated tests (2)
lennertdr Jul 3, 2025
aa33f01
implemented suggestions
lennertdr Jul 3, 2025
b9a618e
refactor for future endpoints
lennertdr Jul 3, 2025
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
49b17dd
cleaner get all policies implementation
lennertdr Jul 4, 2025
6f0916f
follow implementation from Main
lennertdr Jul 4, 2025
b4509db
Change index imports and test new endpoint case
lennertdr Jul 7, 2025
b5390cf
change name
lennertdr Jul 7, 2025
0ec41f8
change name (2)
lennertdr Jul 7, 2025
abc7f38
Rename policyUtil.ts to PolicyUtil.ts
lennertdr Jul 7, 2025
a183107
test content type
lennertdr Jul 7, 2025
f5772a9
feat: Introduce get All policies endpoint
woutslabbinck 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
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
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
6eaf6f2
some requested changes
lennertdr Jul 25, 2025
b8de385
undo wrong import
lennertdr Jul 28, 2025
10c7247
quick workaround
lennertdr Jul 28, 2025
dc950da
demo script
lennertdr Jul 30, 2025
80bf03b
script shortcut
lennertdr Jul 30, 2025
e6044f7
added test again
lennertdr Jul 31, 2025
eb605dc
Removed logs and finetuned docs
lennertdr Jul 31, 2025
46c177f
docfix
lennertdr Jul 31, 2025
9a5f4e8
TODO's
lennertdr Jul 31, 2025
abac429
Merge pull request #57 from lennertdr/main
woutslabbinck Aug 4, 2025
a958a08
fix: rename file such that build works on unix-based systems + update…
woutslabbinck Aug 4, 2025
5e9f766
fix: update yarn.lock such that github actions succeed
woutslabbinck Aug 4, 2025
283c4ac
docs: added PUT example in policy management documentation
bramcomyn Aug 18, 2025
4abbfd5
docs: added DELETE example in policy management documentation
bramcomyn Aug 18, 2025
4f596d8
docs: added PATCH example in policy management documentation
bramcomyn Aug 18, 2025
46c2577
docs: changed PATCH request content type specification to match code
bramcomyn Aug 18, 2025
0ab7dac
fix: error message included when query engine throws
bramcomyn Aug 18, 2025
cd2da3b
refactor: changed docs to documentation to align with main branch
bramcomyn Aug 18, 2025
e5d9f6f
docs: adding requested changes
bramcomyn Aug 18, 2025
0ebe091
docs: added requested change removing mentions of PR#50
bramcomyn Aug 18, 2025
8f0a74f
Merge pull request #60 from bramcomyn/feat/policy-endpoint
woutslabbinck Aug 18, 2025
8e3c044
feat: initial (empty) implementation of the AccessRequestHandler
bramcomyn Aug 21, 2025
65a6424
feat: access requests endpoints set up, but not fully implemented
bramcomyn Aug 22, 2025
edf2cdf
Merge branch 'SolidLabResearch:feat/access-request-endpoint' into fea…
bramcomyn Aug 22, 2025
718259a
feat: implemented simple access request management
bramcomyn Aug 28, 2025
f5b72f1
feat: access request endpoint implemented and described
bramcomyn Aug 29, 2025
4952344
feat: implemented access endpoint (PATCH included) (version 1)
bramcomyn Sep 1, 2025
84ef50c
feat: implemented BaseController
bramcomyn Sep 4, 2025
04994b5
feat: implemented sanitization functions
bramcomyn Sep 4, 2025
63931a1
feat: implemented AccessRequest- and PolicyController, made BaseContr…
bramcomyn Sep 4, 2025
0013a72
feat: implemented first BaseHandler and setup configuration
bramcomyn Sep 4, 2025
0ea3933
remove: old access request/grants and policies routing code
bramcomyn Sep 4, 2025
fa7ea61
feat: implemented BaseHandler
bramcomyn Sep 4, 2025
78e5628
feat: implemented BaseHandler
bramcomyn Sep 4, 2025
a2f0394
Merge branch 'refactor/access-requests-policies-endpoints' of github.…
bramcomyn Sep 4, 2025
dd29001
fix: minor error in CORS handling and body of POST
bramcomyn Sep 4, 2025
5be37a9
refactor: removed my own CORS handling in favour of already configure…
bramcomyn Sep 4, 2025
50c3ebb
feat: automatic policy creation upon access grant
bramcomyn Sep 5, 2025
db12a75
changes: renamed getAuthorizationHeader ==> verifyHttpCredentials and…
bramcomyn Sep 5, 2025
e99efdd
docs: added documentation for BaseHandler and BaseController and its …
bramcomyn Sep 5, 2025
d0aedc8
refactor: naming conventions for sanitization files
bramcomyn Sep 5, 2025
6dc58e1
docs: added documentation to the sanitization functions
bramcomyn Sep 5, 2025
4219845
changes: being implicit in what is imported in the sanitization funct…
bramcomyn Sep 5, 2025
5bc9382
docs: updating access request management documentation
bramcomyn Sep 5, 2025
12147e7
Update documentation/access-request-management.md
bramcomyn Sep 5, 2025
3e030a6
Update documentation/access-request-management.md
bramcomyn Sep 5, 2025
eee5168
Update documentation/access-request-management.md
bramcomyn Sep 5, 2025
0d6fd0e
Update documentation/access-request-management.md
bramcomyn Sep 5, 2025
0ba4403
Update documentation/access-request-management.md
bramcomyn Sep 5, 2025
cd09c9f
Merge branch 'refactor/access-requests-policies-endpoints' of github.…
bramcomyn Sep 5, 2025
0eec690
docs: updated policy-management.md
bramcomyn Sep 5, 2025
dd450d7
docs: updating acces-request-management with requested changes
bramcomyn Sep 5, 2025
ec5b8f2
feat: readded PUT for policies and checked documentation for policy m…
bramcomyn Sep 9, 2025
2b967a5
docs: documented undefined behavior for PATCH/DELETE on access reques…
bramcomyn Sep 9, 2025
b384dc2
refactor: renaming policy and access request functions to move away f…
bramcomyn Sep 9, 2025
6819b99
refactor: renaming clientID to more semantic variable
bramcomyn Sep 9, 2025
665fa95
docs: added detail in important notes
bramcomyn Sep 11, 2025
f319bca
test: end2end test for access request endpoint is done
bramcomyn Sep 15, 2025
51ee1ab
fix: parameter name in postAccessRequest
bramcomyn Sep 16, 2025
5846016
fix: removing uid from access requests
bramcomyn Sep 16, 2025
07ad6a0
feat: removing logging and fixing broken end2end test
bramcomyn Sep 17, 2025
be139a6
fix: broken policy examples without uid
bramcomyn Sep 18, 2025
106606b
fix: sanitization and policy endpoint test script
bramcomyn Sep 18, 2025
feb4d2f
chore: remove debug logging in BaseController
bramcomyn Sep 18, 2025
6c1961b
feat: added read and write testing script
bramcomyn Sep 19, 2025
3e30fd8
Merge pull request #61 from bramcomyn/refactor/access-requests-polici…
woutslabbinck Sep 23, 2025
160c119
refactor: iterate over access request endpoint API
woutslabbinck Sep 25, 2025
2878794
Merge branch 'feat/access-request-endpoint'
joachimvh Nov 5, 2025
907e9d1
test: Expand policy test script
joachimvh Oct 28, 2025
03d5e88
fix: Use storage interface to change policy data
joachimvh Oct 29, 2025
1ab1190
test: Fix integration tests
joachimvh Oct 29, 2025
4b4cfaf
test: Fix test scripts
joachimvh Oct 29, 2025
370dfad
test: Create utility function for test server ports
joachimvh Oct 30, 2025
f6ec28c
test: Add policy integration tests
joachimvh Oct 30, 2025
5dbb557
docs: Update policy management documentation with known issues
joachimvh Nov 3, 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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ You can then execute the following flows:
- `yarn script:collection`: `POST`, `GET` and `DELETE` some text to/from `/alice/public/resource.txt` to test the correct creation and deletion of resource registrations on the UMA server.
An AssetCollection policy is used to create `/alice/public/`.
More information on the collection implementation can be found in [documentation/collections.md](documentation/collections.md).
- `yarn script:uma-odrl-policy`: Tests all policy management APIs.
- `yarn script:uma-odrl-end2end`: Tests the access request management APIs

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

Expand All @@ -39,6 +41,9 @@ the above scripts are the best way to learn about how everything works.
A more extensive getting started guide can be found
in [documentation/getting-started.md](documentation/getting-started.md).

More information on policy management can be found in
[documentation/policy-management](documentation/policy-management.md).

## Demonstration

Instead of running `yarn start`, you can run `yarn start:demo` to start the server with an alternative configuration.
Expand Down
134 changes: 134 additions & 0 deletions documentation/access-request-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# Access Request Management

This document describes the *access request administration endpoint*.
It contains the methods to describe how to create, read, update and delete access requests.
Example cURL-requests are provided for ease of use.

The general flow of access requests and grants looks like this:

![Access requests and grants flow](./figures/access_grants_requests_fsm.png)

The document makes use of these parties and identifiers:

- **Resource Owner**: `https://pod.example.com/profile/card#me`
- **Authorization Server**: `http://localhost:4000`
- **Resource Server**: `http://localhost:3000/resources`
- **Requesting Party**: `https://example.pod.knows.idlab.ugent.be/profile/card#me`

The examples provided below make use of `text/turtle` and `application/sparql-update` messages.
The access request used in the examples below looks like this:

```turtle
@prefix sotw: <https://w3id.org/force/sotw#> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix ex: <http://example.org/> .

ex:request a sotw:EvaluationRequest ;
sotw:requestedTarget <http://localhost:3000/resources/resource.txt> ;
sotw:requestedAction odrl:read ;
sotw:requestingParty <https://example.pod.knows.idlab.ugent.be/profile/card#me> ;
ex:requestStatus ex:requested .
```

## Supported endpoints

The current implementation supports the following requests to the `uma/requests` and `/uma/requests/:id` endpoints

- [**GET**](#reading-access-requests)
- [**POST**](#creating-access-requests)
- [**PATCH**](#managing-access-requests)
- [**DELETE**](#deleting-access-requests)

## Creating access requests

Create an access request/multiple access requests by sending a **POST** request to `uma/requests`.
Apart from its `Authorization` header, the `Content-Type` header must be set to the RDF serialization format in which the body is written.
The accepted formats are those accepted by the [N3 Parser](https://github.com/rdfjs/N3.js/?tab=readme-ov-file#parsing), represented by the following content types:

- `text/turtle`
- `application/trig`
- `application/n-triples`
- `application/n-quads`
- `text/n3`

The body is expected to represent a valid ODRL access request.
No sanitization is currently applied.
Upon success, the server responds with **status code 201**.
Bad requests, possibly due to improper access request definition, will respond with **status code 400** (to be implemented) <!-- TODO: implement -->
When the access requested has been validated (to be implemented), but the storage fails, the response will have **status code 500**.

### Example POST request

This example creates an access request `ex:request` for the RP `https://example.pod.knows.idlab.ugent.be/profile/card#me`:

```shell-session
curl --location 'http://localhost:4000/uma/requests' \
--header 'Authorization: https://example.pod.knows.idlab.ugent.be/profile/card#me' \
--header 'Content-Type: text/turtle' \
--data-raw '
@prefix sotw: <https://w3id.org/force/sotw#> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ex: <http://example.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:request a sotw:EvaluationRequest ;
sotw:requestedTarget <http://localhost:3000/resources/resource.txt> ;
sotw:requestedAction odrl:write ;
sotw:requestingParty <https://example.pod.knows.idlab.ugent.be/profile/card#me> ;
ex:requestStatus ex:requested .'
```

## Reading access requests

To read policies, a single endpoint is currently implemented.
This endpoint currently returns the list of access requests where the WebID provided in the `Authorization` header is marked as the requesting party.
An example request to this endpoint is:

```shell-session
curl -X GET --location 'http://localhost:4000/uma/requests' \
--header 'Authorization: https://example.pod.knows.idlab.ugent.be/profile/card#me'
```

## Managing access requests

The RO can accept or deny the access requests, which is done by updating the status triple.

Updating policies can be done through a **PATCH** request.
The body must hold the content type `application/json`.
The example below shows how to update the access request's status from `requested` to `accepted`:

```shell-session
curl -X PATCH --location 'http://localhost:4000/uma/requests/http%3A%2F%2Fexample.org%2Frequest' \
--header 'Authorization: https://pod.example.com/profile/card#me' \
--header 'Content-Type: application/json' \
--data-raw '{ "status": "accepted" }' # can be changed to `denied` too.
```

Once an access request's status has been changed from `requested` to `accepted`, the backend will automatically create a new policy including the correct rules to allow the RP access to the resource.
After this, the RP will be able to use the resource following the UMA protocol.

## Deleting access requests

Currently, access requests cannot be deleted. The reason being that it from a governance decision a decision need to be made who is allowed to delete it.

Is it the requesting party? Or is it the resource owner?
From the start. It makes more sense for the RP. However, if the RO made a decision, it does not make sense that the RP can remove this.


## Important Notes

### Undefined behavior for **PATCH/DELETE** request

Upon the first **PATCH** request which changes an access request's status from `requested` to `accepted` a new policy and permission are created.
When a new **PATCH** request would change the status to denied, nothing is currently done with the policy.
Even when the access request would be deleted, the backend currently doesn't do anything to the policy.
This is undefined behavior and should be treated as such.
This works in both directions: if the policy is changed in some way, nothing is changed to the access request either.

## Future work

### Discrepancies between [earlier descriptions](https://github.com/bramcomyn/loama/blob/feat/odrl/documentation/access_grants_vs_dsnp.md) and this implementation

This file counts as authorative resource for the access request management.
Other documentation should point to this file as the latest and correct documentation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading