Skip to content

Authentication guide shows obsolete PHP APIs #41

@nficano

Description

@nficano

docs/guides/auth.md:30 constructs new BearerAuth('secret', principal: 'alice'), but src/Auth/BearerAuth.php:17 expects one array argument mapping tokens to principals. The custom verifier example in docs/guides/auth.md:33 implements scheme() even though src/Auth/AuthScheme.php:20 requires name(), and it calls AuthResult::accepted() and AuthResult::rejected() even though the actual factories are AuthResult::accept() and AuthResult::reject().

This guide is likely to be copied by users configuring authentication, and the examples fail before they demonstrate the intended extension point. It also conflicts with the public auth interfaces and with the current unit tests.

Fix prompt: Rewrite the auth guide examples against the current API. Show new BearerAuth(['secret' => 'alice']), implement AuthScheme::name() in the custom verifier, use AuthResult::accept() and AuthResult::reject(), and add a docs snippet smoke test or embed the example in a small sample so future interface renames are caught automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationseverity:mediumMedium severity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions