Skip to content

feat(basic-auth): publish authenticated identity - #1108

Open
nerdalert wants to merge 1 commit into
praxis-proxy:mainfrom
nerdalert:feat/basic-auth-identity
Open

feat(basic-auth): publish authenticated identity#1108
nerdalert wants to merge 1 commit into
praxis-proxy:mainfrom
nerdalert:feat/basic-auth-identity

Conversation

@nerdalert

@nerdalert nerdalert commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

Basic Auth currently verifies credentials but discards the verified username before later filters run. This change publishes that username through Praxis's existing private, request-local AuthenticatedIdentity extension after successful authentication.

That gives downstream filters a trusted subject without forwarding a password, retaining the Authorization header, or accepting a caller-controlled identity header.

Why this matters

The immediate use case is subject-keyed distributed token quota in Praxis AI. Multiple gateway replicas can enforce one shared quota for the same authenticated application, while different applications receive independent quotas.

The contract is intentionally authentication-method-neutral. Policy/JWT authentication already uses AuthenticatedIdentity, so downstream consumers can use one identity interface for Basic Auth now and JWT/OIDC/OAuth-backed authentication as those integrations evolve.

Behavior

  • Publishes identity only after credential verification succeeds.
  • Uses the verified Basic Auth username as the subject ID.
  • Never stores the password or Authorization value in identity metadata.
  • Leaves rejected and malformed requests without an authenticated identity.
  • Preserves existing strip_authorization behavior.
  • Makes the existing internal identity constructor available when the Basic Auth feature is enabled.

Tests

Adds focused coverage proving:

  • a successful request publishes the expected subject;
  • rejected credentials publish no identity;
  • stripped Authorization behavior remains intact;
  • no password is exposed through the identity object.

Static and focused validation was completed before the commit.

Closes #1107.
Related to praxis-proxy/ai#121 and praxis-proxy/grid#101.

Related implementation

Comment thread crates/filter/src/builtins/http/security/basic_auth/tests.rs Fixed
Comment thread crates/filter/src/builtins/http/security/basic_auth/tests.rs Fixed
Publish the verified Basic Auth username through the existing private request-local AuthenticatedIdentity extension. This lets downstream filters consume a trusted, authentication-neutral subject without forwarding credentials or trusting caller-controlled identity headers.

Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
@nerdalert
nerdalert force-pushed the feat/basic-auth-identity branch from 3f3b7bf to 5e23ca9 Compare September 7, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Basic Auth should publish verified request identity

2 participants