Skip to content

Instantly share code, notes, and snippets.

@samber
Created July 4, 2023 09:05
Show Gist options
  • Save samber/80869a9c1eb83d0993ff73c8fc29a456 to your computer and use it in GitHub Desktop.
Save samber/80869a9c1eb83d0993ff73c8fc29a456 to your computer and use it in GitHub Desktop.
hmac cloudflare
# timestamp is ignored, since we use a very large token validity: 1000000000.
(
lower(http.request.headers["x-screeb-hmac-digest"][0]) eq “hmac-sha256-base64”
)
and
(
is_timed_hmac_valid_v0(
"secret",
http.request.headers["x-screeb-hmac-signature"][0],
1000000000,
http.request.timestamp.sec,
0
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment