[PR #5067] [MERGED] feat(common): enhance HAWK authentication with payload hash calculation #5044

Closed
opened 2026-03-17 02:31:38 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5067
Author: @anwarulislam
Created: 5/12/2025
Status: Merged
Merged: 5/20/2025
Merged by: @jamesgeorge007

Base: nextHead: feat/hawk-payload-hash


📝 Commits (2)

  • 8b1d54f feat(hawk): enhance HAWK authentication with payload hash calculation and content type handling
  • bae07fe chore: cleanup

📊 Changes

3 files changed (+112 additions, -23 deletions)

View changed files

📝 packages/hoppscotch-common/src/components/http/authorization/HAWK.vue (+2 -3)
📝 packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts (+14 -2)
📝 packages/hoppscotch-data/src/utils/hawk.ts (+96 -18)

📄 Description

Closes HFE-834

This pull request enhances the HAWK authentication mechanism by implementing payload hash calculation, improving payload handling, and ensuring compliance with the HAWK specification. Key updates include enabling the "Include Payload Hash" option in the UI, extending utility functions to support complex payload types, and refining the hashing logic for better consistency and error handling.

Backend Integration:

  • Modified getComputedAuthHeaders in EffectiveURL.ts to include body in the request object and calculate the payload hash using the final body content. [1] [2]
  • Addressed a type error in getFinalBodyFromRequest by adding a @ts-expect-error comment for a known issue.
  • Not Completed
  • Completed

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5067 **Author:** [@anwarulislam](https://github.com/anwarulislam) **Created:** 5/12/2025 **Status:** ✅ Merged **Merged:** 5/20/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `feat/hawk-payload-hash` --- ### 📝 Commits (2) - [`8b1d54f`](https://github.com/hoppscotch/hoppscotch/commit/8b1d54fe7964d711e2fe03a01574d8e512b8478f) feat(hawk): enhance HAWK authentication with payload hash calculation and content type handling - [`bae07fe`](https://github.com/hoppscotch/hoppscotch/commit/bae07fe604242753fa5ee4ecc45ca63b8a4aa733) chore: cleanup ### 📊 Changes **3 files changed** (+112 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components/http/authorization/HAWK.vue` (+2 -3) 📝 `packages/hoppscotch-common/src/helpers/utils/EffectiveURL.ts` (+14 -2) 📝 `packages/hoppscotch-data/src/utils/hawk.ts` (+96 -18) </details> ### 📄 Description Closes HFE-834 This pull request enhances the HAWK authentication mechanism by implementing payload hash calculation, improving payload handling, and ensuring compliance with the HAWK specification. Key updates include enabling the "Include Payload Hash" option in the UI, extending utility functions to support complex payload types, and refining the hashing logic for better consistency and error handling. ### Backend Integration: * Modified `getComputedAuthHeaders` in `EffectiveURL.ts` to include `body` in the request object and calculate the payload hash using the final body content. [[1]](diffhunk://#diff-6893f8df61876a50ecd103e5f3b6d9b0165067dcd6fa69742b364e9424884c9cL251-R258) [[2]](diffhunk://#diff-6893f8df61876a50ecd103e5f3b6d9b0165067dcd6fa69742b364e9424884c9cR267-R270) * Addressed a type error in `getFinalBodyFromRequest` by adding a `@ts-expect-error` comment for a known issue. - [ ] Not Completed - [x] Completed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:31:38 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5044
No description provided.