Skip to content

An undeclared method on an auth: true extension mount answers 401/403 instead of 405 #915

Closed

Description

@jimhoyd

Found by the #841 trial (#909).

Observed:

  • /api/review/* declares methods: [POST], but GET answers 401.
  • /api/pending/* declares [GET, HEAD], but DELETE without Origin answers 403.
  • A signed-in same-origin PATCH answers 405.

Expected: a method the route doesn't declare is refused with 405 and Allow before the auth policy runs, consistent with core routes and with what the OpenAPI export describes.

Unverified: whether core auth: true routes that aren't extension mounts behave the same way.

Activity

  1. jimhoyd commented on Sep 29, 2026

    @jimhoyd
    CollaboratorAuthor

    Fixed in #919. On any route an extension protects, method admission now runs before every authorize(): agents/throttle, then 405 with Allow in the route's error format, then authorize. Tested on a protected mount, a core auth route and a JSON-format route, with zero authorize() calls for an undeclared method.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions