Skip to content

Key principal-provider behavior on providesPrincipal, not the extension name 'auth' #888

Closed

Description

@jimhoyd

Found while proving a second, independent auth provider (#886, Auth.js as @example/urlcode-authjs). No core import or type depends on the first-party auth package, but several behaviors are keyed on the extension name auth, not on the contract (providesPrincipal):

  • auth: true short form. It expands only to policies.extensions.auth and requires extensions.auth (packages/core/src/config.ts:456, :464). Policy-error locations follow the same rule (extensions.ts:684).
  • Catalog name reservation. An independent package can't be named auth, because that is a first-party catalog name (addon-install.ts:524). So an independent provider can never use the short form, and must write policies: {extensions: {authjs: {}}}.
  • OpenAPI export. The 401/403 answers and the session security scheme are emitted only for auth (openapi.ts:167, :174, :208, :236). A route gated by authjs gets neither.
  • Review hint. The session-cookie finding suggests only auth (review.ts:185).

Proposed change: the short form, OpenAPI security and review should follow the one installed extension that declares providesPrincipal (refusing ambiguity when more than one is installed), or an explicit operator choice. It must not follow the name. Provider-specific capability names (context.capabilities.<name>.identity) can stay provider-specific.

Related: #841, #886.

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