You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plugin Principal differs from access control identity #519
Found in the pre-release review of v0.18.0 (finding 4, medium).
Problem
Principal.groups (foca/plugins/adapter.py, current_principal) comes only from get_current_groups(). It leaves out roles that is_permitted() and is_admin() use: the role a service client gets through access_control.client_mapping, and roles from global g rules.
Principal.subject is the bare client subject for service tokens (not client:<id>), and it ignores the user named in on_behalf_of_header, although the ownership helpers attribute resources to that user.
The docs say plugin roles "are access control roles" and that subject is the identity "as stored with resources".
Scenario
client_mapping: {portal: admin} and a plugin or preset with roles: [admin]: access control treats portal as admin, but the engine refuses its choice with a generic 400 (fails closed).
A plugin keying quotas or provenance on Principal.subject sees portal for every user the portal acts for; with a single issuer that value shares a namespace with user subjects.
Fix
Derive Principal.groups from the same source as access control (client_mapping, g rules).
Add a subject type (or use client:<id>) for service tokens.
Expose the on-behalf-of user.
Add an unmocked test; keep docs/plugins.md and docs/configuration/plugins.md consistent (proTES relies on these semantics).
Activity