Skip to content

Add IsValidWebhookHmac to ShopifyOAuthClient - #25

Closed
matnun-br wants to merge 5 commits into
mainfrom
feat/add-isvalidwebhookhmac
Closed

matnun-br wants to merge 5 commits into
mainfrom
feat/add-isvalidwebhookhmac

Conversation

@matnun-br

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The Shopify webhook signature verification change has no active review issues.

No open issues 🎉

What changed in this PR

Adds Shopify webhook signature verification to the existing OAuth utilities and prepares package version 3.2.0.

Changes:

  • Adds HMAC-SHA256 verification for raw byte and string bodies using constant-time hash comparison.
  • Exposes the Shopify webhook HMAC header name and documents raw-body requirements.
  • Adds tests for valid signatures, tampered bodies, malformed headers, encoding, and null inputs.
File Description
ShopifyNet/​ShopifyNet.csproj Bumps the package version from 3.1.0 to 3.2.0.
ShopifyNet/​OAuth/​ShopifyOAuthClient.cs Adds webhook HMAC verification overloads and the header-name constant.
ShopifyNet.Tests/​ShopifyWebhookHmacTests.cs Adds webhook signature validation and edge-case tests.

Review effort: Balanced

@matnun-br matnun-br changed the title Main Add IsValidWebhookHmac to ShopifyOAuthClient Nov 17, 2026
@matnun-br matnun-br assigned clement911 and unassigned Copilot Nov 23, 2026
@matnun-br
matnun-br marked this pull request as ready for review November 23, 2026 01:50
- BuildAuthorizationUrl takes IEnumerable<string> scopeList instead of a
  comma-separated string. It validates the list in parameter order, rejects
  an empty list or null/blank entries, and enumerates the list only once.
- Add an IsValidHmac overload for IEnumerable<KeyValuePair<string, StringValues>>,
  so ASP.NET Core's Request.Query can be passed directly. It delegates to the
  string overload, which handles null checks.
- Add GetScopes() to the offline, online and client assertion access tokens.
- Bump to 3.2.0
@matnun-br matnun-br closed this Nov 23, 2026
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.

4 participants