Skip to content

REST API, part 2: read-only API, personal access tokens and OpenAPI (Phase 1) #489

Open

Description

@caseysoftware

Intent: third parties can read everything a user can see in the UI, and nothing more.

Depends on: #488. Decide first: #480, #481, #482.

Steps

  • api/index.php front controller on Slim 4 with no PHP session; Apache rewrite with Authorization passthrough and an nginx example.
  • Middleware: Problem Details errors (RFC 9457), CORS allow-list (off by default), bearer authentication, request context, rate limiting (identity layer's RateLimiter).
  • Personal access tokens: api_tokens table (hashed, prefix, scopes, expiry, last used, revoked); "API tokens" tab on the user's profile; admin list and revoke. Tokens stop working for disabled users (Identity layer, part 1: foundations and session hardening (Phase 0) #458).
  • Transformers (field allow-lists, HTML entities decoded, UTC RFC 3339 dates) and cursor pagination.
  • GET endpoints: /me (+ preferences, permissions), companies, departments, contacts, users (directory fields), projects and their sub-resources, tasks and their sub-resources, task logs, events, files (metadata and content download), forums and messages, links, resources, history, lookups (sysvals, custom field definitions, public config, locales, active modules), search. updated_since where *_updated exists.
  • OpenAPI 3.1 generated from zircote/swagger-php attributes and committed; /api/docs; CI gates (Spectral, Schemathesis, schema contract tests).
  • ACL contract suite: admin, project member and outsider fixtures with item-level denies, covering every endpoint.
  • Optional: read-only stdio MCP preview (bin/w2p-mcp) using a personal token.

Goal: the ACL contract suite passes for every endpoint, and the published spec validates every response.

Spec: REST API and MCP server proposal (#471), sections 5–9.

Activity

  1. added
    api
    on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions