Skip to content

Make route policy shorthand extension-defined rather than auth-specific core schema #710

Closed

Description

@jimhoyd

Observed gap

Core's configuration model and type definitions contain a built-in auth route field and hard-code its expansion to policies.extensions.auth. normalizeRouteAuth() also requires extensions.auth, and its TypeScript shape duplicates the auth extension's policy keys, including bearer quota.

That makes a first-party extension's vocabulary part of generic core parsing, typing, revision behavior and documentation. Other extensions cannot define an equivalent ergonomic short form through their RuntimeExtension definition, schema or authoring contract.

Desired direction

Preserve compatibility for auth:, but move shorthand registration/normalization to an extension-declared capability or a generic core shorthand registry supplied by the trusted host. The generic contract should validate and canonicalize a declared mapping without knowing the extension name or policy-key shape. Add a focused fixture for a non-auth extension-defined shorthand and ensure no core type refers to auth policy fields.

Evidence

  • packages/core/src/config.ts: normalizeRouteAuth() directly checks and writes auth.
  • packages/core/src/types.ts: RouteAuthConfig repeats auth extension policy vocabulary.
  • docs/EXTENSIONS.md: the documented general composition seam is extension registration, schema, hooks and authoring contracts.

Activity

  1. added
    enhancement
    needs-decision
    extension
    on Sep 25, 2026
  2. jimhoyd commented on Sep 25, 2026

    @jimhoyd
    CollaboratorAuthor

    Decision (owner, 2026-09-25): keep auth: exactly as authors write it today, and move ownership of its contents to the auth extension. Core keeps only the mapping auth: X → policies.extensions.auth (with true meaning {}), and validates the value through the auth registration's own policySchema. That means:

    A general shorthand system that any extension can claim is not being built now: only auth needs one, and it would open route-key name clashes. Revisit if a second extension needs a shorthand.

    Keep the #702 behaviour: an invalid auth: object must still name the failing field (now reported from auth's policy schema, via extensionPolicyError from #720). Removing needs-decision.


    Generated by Claude Code

  3. removed
    needs-decision
    on Sep 25, 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

    enhancementextension

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions