Skip to content

basic-auth v3 - Proposal #70

Closed
Closed

Description

@Phillip9587

Activity

  1. blakeembrey commented on Jan 27, 2026

    @blakeembrey
    Member

    A few notes on what we could do:

    1. Use TypeScript instead of separate types, publish them together.
    2. I don't think we should add fetch support but instead just decouple from the HTTP interface entirely.
    3. Remove buffer entirely so it can be used in any environment

    Related but not a major is doing performance optimization. Both the base64 conversion (str -> buffer -> str) and removing regex checks could provide some speed improvements when also considering the proper RFC compliance.

  2. Phillip9587 commented on Feb 26, 2026

    @Phillip9587
    ContributorAuthor

    Hey @blakeembrey , I just cycled back to this.

    After reviewing your feedback, I decided to start with a TypeScript rewrite of the current codebase in #93 as you suggested, and then apply the other changes incrementally.

    Planned follow-ups after the TS rewrite is merged:

    1. Remove the default method accepting Node.js IncomingMessage. I think we should only expose a parse and a format method.
    2. Add benchmarks for parse.
    3. Remove Node.js Buffer and use Uint8Array.fromBase64() (with fallback if not available).
    4. Add a format method (similar to feat: add auth.format for formatting credentials #65) with proper input validation, using Uint8Array.toBase64() where available (with fallback).
    5. Add benchmarks for format.
    6. Replace regexes if it improves performance.
    7. Disallow control characters in user-id and password to be RFC-compliant. #55
    8. ESM dual bundle.
  3. blakeembrey commented on Feb 27, 2026

    @blakeembrey
    Member

    Just a quick heads up that I'll be unavailable for the next two weeks but I took a quick look at the PRs and it seems like it's great work, thanks!

  4. Phillip9587 commented on Mar 28, 2026

    @Phillip9587
    ContributorAuthor

    Hey @blakeembrey, hope you had a great time off! When you’re ready, it would be great to get #93 reviewed and merged so I can start applying the follow-up changes.

  5. blakeembrey commented on Apr 23, 2026

    @blakeembrey
    Member

    @Phillip9587 Would you want to switch this package to ESM only? I don't think there's an immediate need to land our changes in upstream packages so it might be a simple opportunity to switch over with the release.

  6. Phillip9587 commented on Apr 23, 2026

    @Phillip9587
    ContributorAuthor

    @blakeembrey Yes I think it is an opportunity. I'm not sure it aligns with the expressjs standards which currently define that commonjs is needed. If you prefer we can also make it a dual-package but i don't think it is needed as require(ESM) is stable now.

  7. blakeembrey commented on Apr 23, 2026

    @blakeembrey
    Member

    I confirmed in a call with a subset of the members on my intent to ship ESM only if they target Express.js 6 and it seemed like they were onboard. If it's intended for 5 I won't, but these changes don't seem needed immediately in any express dependency.

  8. XinGOfCloude18 commented on Aug 12, 2026

    @XinGOfCloude18

    A few notes on what we could do:

    1. Use TypeScript instead of separate types, publish them together.
    2. I don't think we should add fetch support but instead just decouple from the HTTP interface entirely.
    3. Remove buffer entirely so it can be used in any environment

    Related but not a major is doing performance optimization. Both the base64 conversion (str -> buffer -> str) and removing regex checks could provide some speed improvements when also considering the proper RFC compliance.

  9. Phillip9587 commented on Aug 12, 2026

    @Phillip9587
    ContributorAuthor

    @XinGOfCloude18 Already done in https://github.com/jshttp/basic-auth/releases/tag/v3.0.0. We just forgot to close the issue

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