Add policy support #271

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

Add support for policies that limit access at the record level.

Add support for policies that limit access at the record level.
cmo added 10 commits 2026-10-01 20:31:09 +00:00
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.
This commit updates the policy mapping in the test
collections to ensure that the expected sets of
records are retrieved in the respective tests.
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
97e0203f5a
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.
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
375737a9af
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.
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
3dc220e03e
cmo self-assigned this 2026-10-02 06:43:26 +00:00
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
48697365d9
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,
cmo merged commit ca1c083a89 into master 2026-10-02 06:54:55 +00:00
Sign in to join this conversation.
No description provided.