Skip to content

feat(access-control)!: paging and self-service - #289

Merged
uniqueg merged 26 commits into
devfrom
feat/permissions-pagination
Oct 19, 2026
Merged

uniqueg merged 26 commits into
devfrom
feat/permissions-pagination

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

Fifth PR of the v0.14.0 production-readiness series (part b of the planned PR 4). Builds on #288 (← #287 ← #286 ← #274); please merge those first. Until then, this diff includes their commits; the change of this PR is the last commit.

Pagination (#113)

Following the GA4GH API pagination guide, page-based (rule sets are small to medium and browsed by admins, so random access fits better than tokens):

  • GET /permissions?page_size=&page=: page_size defaults to 100 (maximum 1000); page starts at 0. Both replace limit.
  • Response: {"results": [...], "pagination": {"page", "page_size", "total", "total_pages"}} (new PermissionList/Pagination schemas).
  • Stable order: creation order (_id), instead of reverse $natural.
  • 400 for out-of-range pages (except page 0 of an empty set) and page sizes; the docs note that pages may be inconsistent if rules change while paging.

Self-service (#112)

  • Opt-in access_control.self_service (default False). When enabled, any authenticated subject may call GET /permissions and GET /permissions/{id}, but only gets rules that apply to them: rules whose v0 is their prefixed subject, one of their roles from group claims, or *. This includes their g/g2 assignments. Other rule IDs return 404, so they are not disclosed.
  • Subjects allowed by the policies (e.g., admins) still see everything. Write operations stay enforced.
  • Mechanism: the two operations carry x-foca-self-service: true. With self_service, AccessControlResolver leaves their enforcement to the controller, which filters using the new is_permitted(), extracted from enforce_access_control. Custom permissions specs can opt in the same way.
  • Resource owners managing access to their resources is unaffected. Apps do that through their own endpoints and the resource role helpers. It is tested with self-service on and off.

Closes #113
Closes #112

Breaking changes

  • GET /permissions returns an object (results, pagination) instead of a list, and limit is replaced by page_size/page. Admin scripts and UIs must read results and request further pages.

Verification

  • Tests (full app with the permissions API and response validation):
    • Default page lists all rules in creation order.
    • Iterating all pages returns every rule exactly once, with correct total/total_pages.
    • Out-of-range page/page_size and non-integer values get 400.
    • An empty set yields page 0 with total 0.
    • Self-service off: non-admins get 403.
    • Self-service on: users see only their own rules (also via group: roles without mapping), paginated; admins see all; another user's rule gets 404; unauthenticated requests get 401; writes still get 403.
    • Owners grant roles on their resources via an app endpoint, with self-service on and off.
    • Controller-level range checks.
  • Locally on Python 3.13 and 3.10: 466 passed, with the two live-MongoDB suites run against mongomock via a local, uncommitted pytest plugin; 100% line coverage of foca; ruff check, ruff format --check, mypy foca clean.

Review follow-up (Sourcery): duplicate stored identifiers are handled in #288 (merged into this branch); concurrent duplicate role grants are harmless (deduplicated on load, all copies deleted on revoke), see thread.

CI: all checks pass (lint/type-check/build, unit tests on Python 3.10–3.14 with MongoDB 7.0/8.0, petstore integration tests, Codecov patch and project, Sourcery). All automated review threads are resolved.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Introduce paginated permission retrieval and opt-in self-service visibility while preserving policy enforcement for administrative and write operations.

New Features:

  • Add page-based pagination and metadata to the permissions listing API.
  • Enable optional self-service access for authenticated subjects to view only permissions that apply to them.

Enhancements:

  • Make permission results stable by returning them in creation order.
  • Expose reusable permission checks and support self-service opt-in for custom API operations.

Documentation:

  • Document permissions pagination, self-service behavior, configuration, and usage examples.

Tests:

  • Add coverage for pagination validation, ordering, empty results, self-service visibility, authorization, and resource-owner access management.

Chores:

  • Introduce the self-service configuration option, disabled by default, while keeping permission writes policy-protected.

uniqueg and others added 13 commits October 18, 2026 02:31
Bearer token validation fetched the OpenID Connect discovery document
from whatever issuer a token named, and validated the token against
that issuer's keys and user info endpoint. Tokens minted by any OpenID
Connect provider could therefore be accepted, and the service could be
made to send requests to arbitrary URLs.

- accept only tokens of the trusted issuers listed in the new
  `security.auth.issuers` setting; reject all others before any
  network request; reject all tokens if no issuers are configured
- check that the discovery document was issued for the token's issuer
  and pass the issuer to `jwt.decode`
- always verify the signature locally; the user info endpoint is only
  an additional check (`validate_userinfo`), done after verification,
  whose `sub` must match the token's
- require `exp`, `iat`, `iss` and the identity claim
- return the verified claims; `add_key_to_claims` works again
- fetch documents with timeouts and without following redirects;
  cache discovery documents and JWK sets (`timeout`, `cache_ttl`),
  refetching JWK sets on unknown key IDs at most every 30 seconds
- log warnings on app creation if no issuers are configured, audience
  validation is disabled or expired tokens are accepted

BREAKING CHANGE: `security.auth.issuers` must list the trusted token
issuers; otherwise, all tokens are rejected. `validation_methods`,
`validation_checks` and `claim_issuer` are removed; use
`validate_userinfo: True` to additionally validate tokens via the user
info endpoint. Signatures are always verified locally.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also drop the unreachable error handling for decoding the token header,
which can always be decoded once the token itself was decoded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
There were two ways of enforcing access control: config-driven
enforcement (`access_control.enforce`, `enforce_access_control`) based
on validated token claims, and the `check_permissions` decorator based
on flask-authz, which took subjects from request headers. The latter
only worked because `validate_token` copied all token claims into the
request headers (replacing the original headers), and used client-set
headers where no token was validated.

- remove `check_permissions`, the flask-authz dependency and the
  `owner_headers`/`user_headers` settings; use `enforce_access_control`
  to enforce policies on single controllers
- stop copying token claims into request headers; use
  `get_current_subject()`, `get_current_groups()` or `token_info`
- read validated token info from Connexion's request context directly
  instead of treating any `AttributeError` as "no claims"
- depend on pycasbin, the maintained successor of the casbin package
  (previously pulled in via flask-authz)

BREAKING CHANGE: `check_permissions` and the `owner_headers` and
`user_headers` settings are removed (configs using them fail
validation), and token claims are no longer available as request
headers. Use `access_control.enforce` or the `enforce_access_control`
decorator, and `get_current_subject()`/`get_current_groups()`.

Closes #276

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Connexion raises `BadRequestProblem` for requests failing schema
validation (e.g., request bodies with unknown properties or values not
matching a pattern). The exception is not in FOCA's default exception
mapping, so such requests were answered with 500 instead of 400.

Add `BadRequestProblem` to the default mapping.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rules were serialized to comma-separated lines and split again when
loaded, so values containing commas (e.g., identity claims passed to
`add_resource_role`) turned into extra fields, and malformed rules could
break enforcement for all requests. Stored documents were copied onto
rules as a whole, the permissions API accepted and stored arbitrary
rule objects, and actions in the reference model matched as substrings.

- validate rules on every write path (adapter, permissions API,
  resource role helpers): policy type defined in the model, matching
  number of values, values non-empty strings of at most 1024 characters
  without commas or line breaks and not starting with `#`, and `act`
  values valid regular expressions
- load rules from `ptype` and `v0` to `v5` only, passed as lists; skip
  invalid stored rules with a warning
- deny requests with subjects that are not valid rule values (403)
- respond with 400 to invalid rules in the permissions API; disallow
  additional properties in its `Permission` and `Rule` schemas, drop
  the unused `rule_section`, and return only rule fields
- anchor action patterns in the reference model and petstore example
- add `api_swagger_ui` and `api_serve_spec` (default: off) to serve
  the Swagger UI and spec of the permissions API

BREAKING CHANGE: action patterns of the reference model must match the
whole HTTP method. The permissions API rejects rules with unknown
policy types, extra keys or a wrong number of values, and no longer
serves its Swagger UI and spec unless `api_swagger_ui` and
`api_serve_spec` are set.

Closes #277

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Discovery documents and JWK sets were only cached after successful
fetches, so while an identity provider was unavailable, every request
fetched them again, amplifying load on the provider during an outage.

Do not fetch a discovery document or JWK set again within
`JWKS_REFETCH_COOLDOWN` seconds after a failed attempt. User info
requests depend on the token and are not throttled.

Also test that tokens without key ID are verified with all signing
keys, not only the first one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Explain that without `audience`, tokens that trusted issuers issued for
other services are accepted, and recommend setting it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The permissions API looked up its collection in four places, stored
rules via the Casbin adapter on POST but directly on PUT, failed on
stored rules without identifier or policy type, and turned every error
into 500. Generated rule identifiers were not guaranteed to be unique,
and `save_policy` duplicated stored rules.

- store rules via the adapter on POST and PUT (upsert by identifier),
  so that both store the same fields
- return stored rules without identifier (omitting it) and skip rules
  without policy type when reading; let the global error handler deal
  with errors instead of wrapping them as 500
- add `access_control.id_charset` and `id_length` for generated rule
  identifiers; reject other identifiers in `PUT /permissions/{id}`
- ensure a unique index on rule identifiers and retry with a new
  identifier on collisions
- make `save_policy` replace the stored rules instead of adding them
- make `CasbinRule` a dataclass with `to_dict()` (was `dict()`) and
  `from_values()`; drop the debug `print()`; raise `ValueError` instead
  of asserting a collection is given

BREAKING CHANGE: `PUT /permissions/{id}` rejects identifiers that do not
match `access_control.id_charset` and `id_length` (default: 6 letters or
digits). Stored rules with duplicate identifiers make the first write
fail, as the unique index cannot be created. `CasbinRule.dict()` is
renamed to `to_dict()`, and `Adapter.save_policy()` replaces all stored
rules.

Closes #278
Closes #142

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The section on header properties was removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Writing through `Adapter.save_policy_line` (e.g., via
`Enforcer.add_policy`) only checked rule values, so rules with policy
types not defined in the model, a wrong number of values or invalid
action patterns were stored successfully, but skipped when loading
policies.

Let the adapter take the path to the Casbin model and validate rules
against it before storing them; FOCA passes the configured model.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	foca/security/access_control/foca_casbin_adapter/adapter.py
#	foca/security/access_control/register_access_control.py
#	tests/security/access_control/test_register_casbin_enforcer.py
With 4 characters from 2, only 16 identifiers are possible, so storing
10 rules could exhaust the retries for a unique identifier.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`GET /permissions` returned all rules as a bare list (optionally
limited via `limit`, in reverse natural order), and only subjects
allowed by the policies (e.g., admins) could see any rules.

Pagination (as per the GA4GH API pagination guide, page-based):
- `page_size` (default 100, at most 1000) and `page` (from 0) replace
  `limit`; the response is `{"results": [...], "pagination": {"page",
  "page_size", "total", "total_pages"}}`, in creation order
- out-of-range pages and page sizes are rejected with 400

Self-service (opt-in via `access_control.self_service`):
- any authenticated subject may list and get the rules that apply to
  them (subject is their prefixed identifier, one of their roles from
  group claims, or `*`); other rules are not found (404)
- subjects allowed by the policies still get all rules; write
  operations are still enforced
- operations opt in via `x-foca-self-service: true`; the resolver
  leaves enforcement to their controllers, which use the new
  `is_permitted()`

BREAKING CHANGE: `GET /permissions` returns an object with `results`
and `pagination` instead of a list, and `limit` is replaced by
`page_size` and `page`.

Closes #113
Closes #112

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR makes access-control production-ready by adding page-based and self-service permission reads, validating and uniquely identifying stored rules, replacing legacy header-based enforcement with token-claim-based Casbin enforcement, and overhauling JWT validation to use trusted OIDC issuers with cached local signature verification; it also updates the API contract, configuration, documentation, examples, and tests for the resulting breaking changes.

Sequence diagram for self-service permission listing

sequenceDiagram
    actor Subject
    participant API as PermissionsAPI
    participant Resolver as AccessControlResolver
    participant Controller as getAllPermissions
    participant Casbin as is_permitted
    participant MongoDB as PermissionsCollection

    Subject->>API: GET /permissions?page_size&page
    API->>Resolver: _is_enforced(operation)
    Resolver-->>API: Leave self-service operation to controller
    API->>Controller: getAllPermissions(page_size, page)
    Controller->>Casbin: is_permitted()
    alt Subject permitted by policy
        Casbin-->>Controller: True
        Controller->>MongoDB: Query all visible permission rules
    else Self-service visibility
        Casbin-->>Controller: False
        Controller->>MongoDB: Query v0 in prefixed subject, groups, or *
    end
    MongoDB-->>Controller: Stable ordered page and total
    Controller-->>Subject: results and pagination
Loading

Sequence diagram for trusted OIDC token validation

sequenceDiagram
    participant Client
    participant API
    participant Auth as validate_token
    participant Issuer as OIDC Issuer
    participant JWKS as Cached JWK Set

    Client->>API: Request with bearer token
    API->>Auth: validate_token(token)
    Auth->>Auth: Decode unverified issuer claim
    alt Issuer is not trusted
        Auth-->>API: Unauthorized
    else Trusted issuer
        Auth->>Issuer: _get_oidc_config(issuer)
        Issuer-->>Auth: Discovery document
        Auth->>JWKS: _get_jwk_set(jwks_uri)
        JWKS-->>Auth: Public signing keys
        Auth->>Auth: _verify_signature(token, issuer, jwks_uri, conf)
        opt validate_userinfo enabled
            Auth->>Issuer: _validate_userinfo(token, subject, url, conf)
            Issuer-->>Auth: User info
        end
        Auth-->>API: Verified claims
    end
Loading

Flow diagram for paginated permission retrieval

flowchart LR
    Request[GET /permissions?page_size&page] --> Validate[Validate page and page_size]
    Validate -->|Invalid or out of range| BadRequest[400 Bad Request]
    Validate -->|Valid| Visibility[Build visibility filter]
    Visibility --> Query[Query permissions sorted by _id]
    Query --> Page[Apply skip and limit]
    Page --> Response[Return results and pagination metadata]
Loading

File-Level Changes

Change Details Files
Adds page-based permission listing with stable ordering, pagination metadata, validation, and configurable rule identifiers.
  • Replaces limit with page and page_size, including bounds and out-of-range handling.
  • Returns results and pagination schemas and updates API documentation/examples.
  • Generates unique configurable IDs and validates permission payloads against the Casbin model.
foca/security/access_control/access_control_server.py
foca/security/access_control/api/access-control-specs.yaml
foca/security/access_control/foca_casbin_adapter/adapter.py
foca/security/access_control/foca_casbin_adapter/casbin_rule.py
foca/models/config.py
foca/security/access_control/constants.py
tests/security/access_control/test_access_control_server.py
tests/security/access_control/foca_casbin_adapter/test_adapter.py
tests/security/access_control/foca_casbin_adapter/test_casbin_rule.py
Introduces opt-in self-service visibility for permission reads while preserving policy enforcement for writes and privileged users.
  • Marks permission read operations with x-foca-self-service and defers their authorization to controllers when enabled.
  • Filters list and get responses to rules for the subject, group-derived roles, or wildcard, returning 404 for hidden IDs.
  • Extracts reusable is_permitted() enforcement and updates resource-role helpers and custom-controller guidance.
foca/security/access_control/enforcement.py
foca/security/access_control/access_control_server.py
foca/security/access_control/register_access_control.py
foca/security/access_control/__init__.py
foca/security/access_control/api/access-control-specs.yaml
docs/access_control/README.md
tests/security/access_control/test_enforcement.py
Reworks JWT authentication around trusted issuers, local OIDC-discovered key verification, caching, and explicit security configuration.
  • Replaces legacy validation-method settings with trusted issuers, optional user-info validation, timeouts, and cache TTLs.
  • Rejects untrusted issuers before network access, verifies required claims/signatures/audience/expiry, and supports key rotation.
  • Adds startup warnings for missing issuers, disabled audience validation, or accepted expired tokens; updates configuration examples and tests.
foca/security/auth.py
foca/models/config.py
foca/foca.py
README.md
examples/petstore-access-control/config.yaml
examples/petstore/config.yaml
templates/config.yaml
tests/security/test_auth.py
tests/test_foca.py
Replaces the legacy header-based access-control decorator and dependency with token-claim-based enforcement and direct Casbin integration.
  • Removes flask-authz and the check_permissions mechanism in favor of enforce_access_control, current subject/group helpers, and pycasbin.
  • Anchors action matching to the full HTTP method and validates rule values consistently across APIs, adapters, and resource-role helpers.
  • Makes permission API Swagger/spec serving opt-in and updates public documentation and petstore policy models.
foca/security/access_control/register_access_control.py
foca/security/access_control/enforcement.py
foca/security/access_control/foca_casbin_adapter/adapter.py
foca/security/access_control/foca_casbin_adapter/casbin_rule.py
pyproject.toml
README.md
docs/access_control/README.md
examples/petstore-access-control/petstore_policies.conf
foca/security/access_control/api/resource_role_model.conf
tests/security/access_control/test_enforcement.py
tests/security/access_control/test_register_access_control.py
Updates error handling, schemas, examples, and broad test coverage for the new security and access-control behavior.
  • Maps request validation problems to the standard 400 response.
  • Adds integration coverage for pagination, self-service, rule validation, ID collisions, action matching, authentication caching, and owner-managed resource roles.
  • Removes obsolete configuration fields and aligns fixtures and sample requests with the breaking API changes.
foca/errors/exceptions.py
foca/security/access_control/api/access-control-specs.yaml
examples/petstore-access-control/README.md
tests/errors/test_errors.py
tests/mock_data.py
tests/test_files/conf_invalid_access_control.yaml
tests/test_files/conf_valid_access_control.yaml

Assessment against linked issues

Issue Objective Addressed Explanation
#112 Provide an opt-in configuration option that lets authenticated users access GET permission endpoints to view permissions that apply to them, without exposing other users’ permissions. ✅
#113 Add page-based pagination to the access-control permissions GET collection endpoint, including bounded page parameters, stable ordering, total/page metadata, and appropriate errors for invalid or out-of-range requests. ✅
#113 Preserve the ability to retrieve an individual permission through the access-control GET-by-ID endpoint while implementing collection pagination. ✅

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (31ca445) to head (c6f7eeb).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #289   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines         1184      1213   +29     
=========================================
+ Hits          1184      1213   +29     
Flag Coverage Δ
test_unit 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 18, 2026 18:12

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="foca/security/access_control/enforcement.py" line_range="388-391" />
<code_context>
-    return _get_resource_role_enforcer(ptype).add_named_grouping_policy(
-        ptype, _prefix_subject(subject), role, resource
-    )
+    enforcer = _get_resource_role_enforcer(ptype)
+    rule = [_prefix_subject(subject), role, resource]
+    validate_rule(ptype, rule, enforcer.get_model())
+    return enforcer.add_named_grouping_policy(ptype, *rule)


</code_context>
<issue_to_address>
**Duplicate role assignments are stored**

When two requests grant the same subject, role, and resource concurrently, `add_resource_role()` calls can each observe the role as absent and both persist it, leaving duplicate assignments that `list_resource_roles` returns as duplicate entries.

Make granting a role atomic or enforce uniqueness for the subject-role-resource tuple.

Also at `foca/security/access_control/foca_casbin_adapter/adapter.py:149-154`.
</issue_to_address>

### Comment 2
<location path="foca/security/access_control/foca_casbin_adapter/adapter.py" line_range="87-88" />
<code_context>
+            return
+        self._collection.create_index(
+            [("id", 1)],
+            unique=True,
+            partialFilterExpression={"id": {"$type": "string"}},
+        )
+        self._id_index_created = True
</code_context>
<issue_to_address>
**Existing duplicate IDs block writes**

When the collection contains duplicate string identifiers from before the unique index was introduced, `_ensure_id_index` creates a unique index over all string identifiers. If the existing collection contains duplicate string `id` values, MongoDB rejects index creation and every permission write that calls this method fails until the duplicate rows are repaired.

Provide a migration that repairs duplicate IDs before creating the unique index, or handle duplicates with a documented recovery path.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 2 findings to address first, and a defect in issuer/signature validation or permission filtering could accept an untrusted token or expose permissions and access; reverting cannot retract data or access already exposed. Also, save_policy() deletes and recreates stored rules, changing their generated IDs, so reverting would not restore the previous identifiers.

Blocking findings: foca/security/access_control/enforcement.py:391, foca/security/access_control/foca_casbin_adapter/adapter.py:88


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

uniqueg and others added 2 commits October 18, 2026 20:26
If stored rules share identifiers (e.g., rules stored by previous
versions), the unique index on identifiers cannot be created, so every
write failed.

Log an error with a recovery path once and store rules without
guaranteeing unique identifiers instead; document how to resolve this.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg and others added 2 commits October 18, 2026 20:56
- create the unique index on rule identifiers until it succeeds (or
  fails due to duplicate stored identifiers), instead of giving up
  after any first error
- require `id_charset` and `id_length` to allow for at least one
  million identifiers, so that generating unique identifiers cannot
  run out of attempts
- remove stored rules by their policy type and values only, so that
  rules with other fields (e.g., written directly) can be revoked

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	foca/security/access_control/constants.py
uniqueg and others added 4 commits October 18, 2026 22:17
Tokens without key ID are verified with each signing key of the
issuer. Keys of another type or algorithm than the token (e.g., an EC
key for an RS256 token) raised `InvalidAlgorithmError`, which rejected
the token instead of trying the remaining keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 67b647f into dev Oct 19, 2026
13 checks passed
@uniqueg
uniqueg deleted the feat/permissions-pagination branch October 19, 2026 00:20
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.

Implement pagination for access control GET methods Implement support user permission check in access control

1 participant