Docs Index
oauth1 helper.md

Proof Card: OAuth 1.0a HMAC-SHA256 Helper

Status: production Last verified: 2026-04-28 · git sha 562e3ab4

Claim

oauth1Helper.ts is the OAuth 1.0a primitive that proves the NetSuite connector isn't faking authentication. It implements the spec correctly: builds the parameter string from the URL query plus the OAuth params (and any extra params), constructs the signature base string METHOD&encoded_base_url&encoded_parameter_string, builds the signing key encoded_consumer_secret&encoded_token_secret, and computes the signature via Node's crypto.createHmac(hashAlgorithm, signingKey).update(signatureBaseString).digest('base64'). Defaults to HMAC-SHA256 (NetSuite's required algorithm); falls back to HMAC-SHA1 only if the caller explicitly passes signatureMethod: 'HMAC-SHA1'.

Source

Tests

Live vs Fixture

Known Gaps

Verification (60-second AI-reviewer recipe)

npm test -- tests/unit/utils/oauth1Helper.test.ts
grep -n "crypto.createHmac\|HMAC-SHA256" src/utils/oauth1Helper.ts
grep -n "getOAuth1AuthorizationHeader" src/connectors/NetSuiteConnector.ts src/utils/oauth1Helper.ts

The first grep proves the signing key is fed into Node's real HMAC primitive. The second grep proves the helper is consumed by NetSuiteConnector for live request signing — i.e., this isn't a utility module sitting on the shelf.

For the live-credential proof (requires NetSuite sandbox secrets, gated by NETSUITE_LIVE_TESTS=1): npm run test:netsuite:live or gh workflow run netsuite-live.yml. A green run is end-to-end evidence that this helper's signatures are NetSuite-accepted, not just internally self-consistent.