Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Comments

feat: add auth.format for formatting credentials#65

Open
Phillip9587 wants to merge 1 commit intojshttp:master from
Phillip9587:format
Open

feat: add auth.format for formatting credentials #65
Phillip9587 wants to merge 1 commit intojshttp:master from
Phillip9587:format

Conversation

@Phillip9587
Copy link

@Phillip9587 Phillip9587 commented Feb 12, 2025

This pull request introduces a new feature to the basic-auth library, adding a method to format credentials into a basic auth header string.

throw new TypeError('argument credentials is required to have name and pass properties')
}

return 'Basic ' + Buffer.from(credentials.name + ':' + credentials.pass).toString('base64')
Copy link
Member

@blakeembrey blakeembrey Jan 27, 2026
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should validate name doesn't contain :. From the spec:

Furthermore, a user-id containing a colon character is invalid, [...]

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

Reviewers

@blakeembrey blakeembrey blakeembrey left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /