phramecms / user
Identity, RBAC/ABAC authorization, first-class AI Agent credentials, and persistent immutable audit logging module for PhrameCMS.
Requires
- php: ^8.5
- phramecms/core: ^0.1
- phramecms/database: ^0.1
- psr/http-factory: ^1.0
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.95
- infection/infection: ^0.35.12
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^13.0
- phramecms/routing: ^0.1
- spaze/phpstan-disallowed-calls: ^4.15
Suggests
- phramecms/routing: Enables HTTP BearerAuthMiddleware integration
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-12-04 21:38:18 UTC
README
Identity, RBAC/ABAC authorization, first-class AI Agent credentials, and persistent audit logging module for PhrameCMS.
Responsibilities
- Human Users & Roles: Manage user accounts, password hashing (
password_hash/ Argon2id), roles, and granular permission grants (e.g.,entity.content.article.create,entity.content.article.publish,config.write,schema.modify). - First-Class AI Agent Principals:
- Dedicated Agent Tokens distinct from human user accounts (
actor_type = 'agent'), stored hashed at rest with optional expiration (expires_at) and revocation. - Explicit capability scope allowlists (e.g., allow
entity.content.article.create_draftandconfig.readwhile forbiddingpublishordelete). - Optional
on_behalf_ofhuman attribution andagent_session_idtracking.
- Dedicated Agent Tokens distinct from human user accounts (
- Core Policy Enforcement: Implements
PolicyEnforcerInterfacefromphramecms/core, automatically authorizing every Operation invoked via REST API, MCP, or CLI. - HTTP & MCP Auth Guards: Bearer token middleware for
phramecms/routingand principal resolution forphramecms/mcp. - Immutable Audit Trail: Implements
AuditLoggerInterfacepersisted viaphramecms/database, capturing actor ID, actor type (human/agent), operation name, target resource, before/after state hashes, dry-run flag, correlation ID, and timestamp.
AI-First Design Role
Security for autonomous AI agents cannot rely on shared admin passwords or UI-only checks. By distinguishing agent principals, scoping capabilities per token, enforcing policies inside the Core Operation Pipeline, and persisting immutable audit logs, PhrameCMS lets teams grant AI agents precise, revocable, observable authority.
Dependencies
- PHP
^8.5 phramecms/corephramecms/databasephramecms/routing(optional — enables HTTP auth middleware when installed)
Ecosystem
Part of the PhrameCMS multi-repo suite. See PhrameCMS/cms for the starter distribution and architecture docs.