Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #85 +/- ##
==========================================
- Coverage 99.40% 98.95% -0.46%
==========================================
Files 9 9
Lines 336 382 +46
Branches 38 51 +13
==========================================
+ Hits 334 378 +44
Misses 1 1
- Partials 1 3 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Verifying without an Auth Secret is a configuration error, so raise Transloadit::Exception::MissingSecret instead of InvalidSignature. Callers such as Rails integrations can then answer forged callbacks with 401 and surface misconfiguration as a server error. Move the JSON < 3 constraint from the gemspec to the Ruby 3.1 test bundle, matching #90, so applications on newer Rubies can still use JSON 3. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Applications receiving Assembly notifications currently have to implement signature verification themselves.
Add
Transloadit#verify_notification!(fields), which validates an SHA-1 HMAC over the exact receivedtransloaditfield before parsing it. Accept legacy andsha1:-prefixed signatures and string/symbol field keys. Validate signature format and length before using OpenSSL’s constant-time comparison, and raiseTransloadit::Exception::InvalidSignaturewith a generic message on authentication failure. Document that authenticated invalid JSON still raises the parser exception and that applications must handle notification retries/replays idempotently.Validation: full Ruby 3.3 suite passes (132 tests, 260 assertions; optional live-upload and signature-parity tests skipped), plus
bundle exec standardrbandgit diff --check. Tests cover valid signatures, exact-byte verification, wrong secrets, malformed/missing fields, unsupported prefixes, and authentication before parsing.Compatibility: the Ruby 3.1 test bundle pins JSON below 3, because Ruby 3.1 resolves MultiJson 1.19, whose positional parsing options are incompatible with JSON 3 (#89). The pin lives in the Gemfile, with the same lines as #90, so the runtime gemspec is unchanged and applications on newer Rubies can still use JSON 3.
Configuration errors: verifying without an Auth Secret raises
Transloadit::Exception::MissingSecretinstead ofInvalidSignature. Integrations such as the Rails SDK can then answer forged callbacks with 401 and surface misconfiguration as a server error.The four fixes also merge together cleanly. Their combined Ruby 3.3 suite passes with Node signature parity enabled: 147 tests, 321 assertions, with only the optional live upload skipped.
Closes #83.