Skip to content

refactor: use scopes to limit access to annotation review data#83

Merged
mirdono merged 3 commits into
feat/odrl-policy-for-authz-sparql-parserfrom
refactor/odrl-scope-for-annotation-review-service
Apr 10, 2026
Merged

refactor: use scopes to limit access to annotation review data#83
mirdono merged 3 commits into
feat/odrl-policy-for-authz-sparql-parserfrom
refactor/odrl-scope-for-annotation-review-service

Conversation

@mirdono
Copy link
Copy Markdown
Member

@mirdono mirdono commented Apr 10, 2026

Initially sparql-parser's ODRL configuration lacked support for scopes. Consequently, in #74 we had to provide public read and write access to the human-validation graph1.

We have introduced support for scopes in sparql-parser's ODRL feature build. This allows us to update the ODRL (and Lisp) configuration with scopes as to limit write access to the human-validation graph to only the annotation-review-service.

How to test

  1. Check out the branch for this PR.
  2. Make sure to pull the latest feature-build for sparql-parser, only this one supports scopes: docker compose pull database
  3. Pull the latest version of the annotation-review-service: docker compose pull annotation-review
  4. (Re-)up the database and annotation-review services: docker compose up -d database annotation-review.
  5. You will need the latest version of the frontend-decide-human-validator for the following steps. So either
    a. Add the following entry to your docker-compose.override.yml. Afterwards, pull and re-up this frontend service.
     frontend-human-validator:
       image: lblod/frontend-decide-human-validator:latest
    b. Run a local development version of that frontend.
  6. Browse to http://human-validator.localhost/expressions
  7. Choose one of the shown decisions and click on its title (it does not matter which one)
  8. Validate some entries by clicking on the thumbs up and down icons. Make sure the appropriate icon gets highlighted and the numbers change.
  9. Browse to http://human-validator.localhost/validate-expression-labels
  10. Validate some entries by clicking on the thumbs up and down icons. Make sure the appropriate icon gets highlighted and the numbers change.
  11. Repeat steps 5-9 in another session (e.g. using a private browsing window) and check whether the numbers shown in for both sessions match.

If you opted for option 4.b for the frontend, browse to http://localhost:4200/expressions and http://localhost:4200/validate-expression-labels in steps 5 and 8 respectively.

Notes

Support for scopes was added directly to sparql-parser's ODRL feature branch, see #12. The relevant diff for that branch can be found here.

Related tickets

  • LBRON-1320

Footnotes

  1. Using sudo queries would have been another option. But with the introduction of scopes in sparql-parser this option is somewhat deprecated.

mirdono added 3 commits April 10, 2026 14:29
Replace the public read+write permission to the human-validation graph by a
scoped permission for the `annotation-review-service`. This way only this
service can write `ext:ReviewAnnotation` resources to that graph.

Furthermore, additional scoped permissions are added such that the service can
read data from the appropriate graphs.
During development it can be useful to easily switch between the Lisp and ODRL
config. The added commented lines allow to do this by simply uncommenting them
if you want the Lisp config.
Replace the public read+write grant to the human-validation graph by a scoped
grant for the `annotation-review-service`. This way only this service can write
`ext:ReviewAnnotation` resources to that graph.

Furthermore, additional scoped grant are added such that the service can
read data from the appropriate graphs.
@mirdono mirdono self-assigned this Apr 10, 2026
@mirdono mirdono requested a review from Rahien April 10, 2026 13:32
Copy link
Copy Markdown
Contributor

@Rahien Rahien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works as advertised! pretty cool to see a mu-auth config in ttl!!

@mirdono mirdono merged commit af5c2e9 into feat/odrl-policy-for-authz-sparql-parser Apr 10, 2026
@mirdono mirdono deleted the refactor/odrl-scope-for-annotation-review-service branch April 10, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants