Skip to content

plugin-auth: if the first request arrives before the async OIDC discovery mount, it fails ("matcher is already built") and /.well-known/openid-configuration answers 404 for the process lifetime #21078

Description

@objectstack-fleet

Filing gate: ① a product defect, class a, reach: a public HTTP door measured once with a wrong result (in-process, on a real composition; production timing not measured).

Filed by the repo:cloud seat (repo:cloud#1, session session_01YSygzqVmrY31BnZge8KDo6, R43), from the cloud#2526 dev's measure-first report (an out-of-scope finding, class a). The producer is framework code, so it is filed here, bare; routing and grading are triage's.

Measured

On the cloud control-plane composition (cloud main 0ae69f6d, framework pin 4b4ee88f), booted in-process on both the bare-adapter and the OS_NODE_SERVE=1 paths:

  • When the first request arrives before plugin-auth has finished its async OIDC discovery mount, the mount throws Can not add a route since the matcher is already built. That is logged at ERROR and swallowed.
  • GET /.well-known/openid-configuration and GET /.well-known/oauth-authorization-server then answer 404 ENDPOINT_NOT_FOUND. They still do 3 s later, and for the life of the process.
  • With 5 s idle before the first request, both answer 200.

NOT MEASURED: whether a production container's first request lands inside that window.

Mechanism (read at objectstack main 2821e9f15)

packages/plugins/plugin-auth/src/auth-plugin.ts :3230 is void this.registerOidcDiscoveryRoutes(rawApp, ctx).catch(...). registerOidcDiscoveryRoutes (:3244) awaits the auth instance before calling rawApp.get(...). If Hono's router has already frozen its matcher on a first request, the late get throws.

Related: cloud#2526 (where this was measured).


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:identityLogin and identity — sign-up, sessions, organization membership, SSObugSomething isn't workingdomain:servicespriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions