Add policy support #271

Merged
cmo merged 14 commits from policies into master 2026-10-02 06:54:55 +00:00

2026-10-02

Christian Monch
refactor: rename authorized_for to authorized_by
Some checks failed
Codespell / Check for spelling errors (push) Failing after 42s
Codespell / Check for spelling errors (pull_request) Failing after 42s
Ruff / Code linting (push) Successful in 51s
Ruff / Code linting (pull_request) Successful in 53s
Type annotation (PR) / check (pull_request) Failing after 1m20s
Test execution / Test-all (push) Successful in 1m27s
The configuration property that maps policies to
users is now called `authorized_by` to reflect
that a policy is matching and granting the
user access,
2026-10-02 08:46:39 +02:00

2026-10-01

Christian Monch
docs: describe policy configuration in docs
Some checks failed
Codespell / Check for spelling errors (pull_request) Failing after 42s
Codespell / Check for spelling errors (push) Failing after 45s
Ruff / Code linting (push) Successful in 52s
Ruff / Code linting (pull_request) Successful in 1m2s
Type annotation (PR) / check (pull_request) Failing after 1m23s
Test execution / Test-all (push) Successful in 1m32s
2026-10-01 23:23:59 +02:00
Christian Monch
feat: make instance_id optional again
To keep backwards compatibility, the `instance_id`
property of forgejo authentication sources is
made optional again.

It is strongly advised to use an `instance_id`
if a user from the forgejo authentication source
should be present in the policy mapping.
2026-10-01 22:56:37 +02:00
Christian Monch
chore: format code according to standard
Some checks failed
Codespell / Check for spelling errors (push) Successful in 43s
Codespell / Check for spelling errors (pull_request) Successful in 44s
Ruff / Code linting (pull_request) Successful in 54s
Ruff / Code linting (push) Successful in 57s
Type annotation (PR) / check (pull_request) Failing after 1m22s
Test execution / Test-all (push) Successful in 1m30s
2026-10-01 22:32:45 +02:00
Christian Monch
chore: update linkml dependency
Some checks failed
Codespell / Check for spelling errors (push) Successful in 28s
Ruff / Code linting (push) Failing after 33s
Test execution / Test-all (push) Successful in 1m14s
Codespell / Check for spelling errors (pull_request) Successful in 28s
Ruff / Code linting (pull_request) Failing after 34s
Type annotation (PR) / check (pull_request) Failing after 1m5s
For test reasons, linkml had been installed from the
current top of the `main`-branch of `linkml`. This
commit reverts the dependency to the latest release.
2026-10-01 22:26:44 +02:00
Christian Monch
test: update policy mappings in test collections
This commit updates the policy mapping in the test
collections to ensure that the expected sets of
records are retrieved in the respective tests.
2026-10-01 22:22:07 +02:00
Christian Monch
feat: add policy handling
To support exact specification of user-IDs,
`AuthenticationInfo` now contains a
`source_identifier`. This will identify the
authentication source that was used. All
`AuthenticationSource`s are instantiated with
a `source_identifier`, chosen by the caller.

Add user-id -> policy mapping to collection
configuration

Adapt code to extended user ID information, i.e. to
(authentication_instance_id, user_id),

feat: add policy handling to SQLite backend

This commit implements policy handling in the
SQLite backend. That means, result records
are filtered by an optional default policy, a
set of active policies, and the policies that
are set in the annotations of a record.
2026-10-01 22:19:10 +02:00