[IDEV-2586]: feat: add HMAC-SHA256 signing support for RTTF feed endpoints - #207
Merged
Conversation
cpanares
approved these changes
Aug 20, 2026
cpanares
left a comment
Contributor
There was a problem hiding this comment.
Everything looks good! 💯
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enhancement: RTTF feeds now support HMAC-signed authentication.
nod,nad,noh,domainrdap,domaindiscovery,realtime_domain_risk,domainhotlist,iphotlist,iprisk) previously raisedValueErrorwhenalways_sign_api_key=Truewas set. They now sign the request using the same HMAC-SHA256 algorithm as standard API endpoints:HMAC-SHA256(key, username + timestamp + path).Fix:
header_authenticationauto-disables when HMAC signing is requested for RTTF. Previously, explicitly passingalways_sign_api_key=Truefor an RTTF endpoint would leaveheader_authenticationdefaulting toTrue, causing both theX-Api-Keyheader and the HMAC query params to be applied simultaneously. The default is now resolved asis_rttf AND NOT always_sign_api_key, so requesting HMAC signing automatically disables header auth.Fix: RTTF path normalized before signing. RTTF paths are constructed without a leading slash (e.g.
v1/feed/nod/), but the HMAC signing spec requires the version-prefixed path (e.g./v1/feed/nod/). The path is now normalized with a leading/before the HMAC digest is computed, matching the behaviour of standard API paths.No change to defaults. Standard API endpoints continue to use HMAC signing by default (
always_sign_api_key=True). RTTF endpoints continue to default to header authentication (X-Api-Key). HMAC for RTTF is opt-in viaalways_sign_api_key=True.Updated README.md
Added
examples/rttf_feeds.py. New example file demonstrating the four common RTTF patterns: basic stream, HMAC-signed stream, session-based stream, and download endpoint.