Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for Digest authorization #4339

Merged
merged 21 commits into from
Oct 29, 2024

Conversation

anwarulislam
Copy link
Member

@anwarulislam anwarulislam commented Sep 11, 2024

Closes HFE-570

What's changed

This PR introduces Digest authentication as new request auth types.

Note for reviewers

Digest auth works in two stages.

First, it requests for an initial response, where we get necessary information like realm, nonce, algorithm, etc., from the server in the header WWW-Authenticate.

Then, we have to parse information from that header. Finally, we have to generate an authorization header and request with that auth header in the Authorization header property.

To test digest auth in CLI

hopp test src/__tests__/e2e/fixtures/collections/digest-auth-coll.json -e src/__tests__/e2e/fixtures/environments/digest-auth-envs.json

// HA1 = MD5(username:realm:password)
const ha1 = crypto
.createHash("md5")
.update(`${username}:${realm}:${password}`)

Check failure

Code scanning / CodeQL

Use of password hash with insufficient computational effort

Password from [an access to password](1) is hashed insecurely. Password from [an access to password](2) is hashed insecurely.
// HA1 = MD5(username:realm:password)
const ha1 = crypto
.createHash("md5")
.update(`${username}:${realm}:${password}`)

Check failure

Code scanning / CodeQL

Use of a broken or weak cryptographic algorithm

[A broken or weak cryptographic algorithm](1) depends on [sensitive data from an access to username](2). [A broken or weak cryptographic algorithm](1) depends on [sensitive data from an access to username](3).
@jamesgeorge007 jamesgeorge007 merged commit 4b2f04d into hoppscotch:next Oct 29, 2024
1 check passed
@jamesgeorge007 jamesgeorge007 changed the title feat: digest authentication added to the request auth types feat: add support for Digest Authorization Oct 29, 2024
@jamesgeorge007 jamesgeorge007 changed the title feat: add support for Digest Authorization feat: add support for Digest authorization Oct 29, 2024
amk-dev pushed a commit to amk-dev/hoppscotch that referenced this pull request Nov 26, 2024
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.

3 participants