Update HashExpressionProcessors.java#6170
Update HashExpressionProcessors.java#6170JoanJaraBosch wants to merge 4 commits intovividus-framework:masterfrom
Conversation
WalkthroughAdds HMAC support to hash expression processors by introducing a 3-argument calculateHash(key, algorithm, input) that computes HMAC when requested and standard hashing otherwise. The 2-argument calculateHash now rejects HMAC algorithms. A helper for HMAC computation and related imports are added. Non-HMAC and file-hash behavior remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as Caller
participant H as HashExpressionProcessors
participant C as Java Crypto (Mac)
Note over U,H: calculateHash(key, algorithm, input)
U->>H: calculateHash(key, algorithm, input)
alt algorithm is HMAC-*
H->>H: calculateHmac(key, algorithm, input)
H->>C: init Mac("Hmac<Alg>"), doFinal(input)
C-->>H: raw bytes
H->>H: hex-encode
H-->>U: hmacHex
else non-HMAC algorithm
H->>H: standard hash(input)
H-->>U: hashHex
end
sequenceDiagram
autonumber
participant U as Caller
participant H as HashExpressionProcessors
Note over U,H: calculateHash(algorithm, input)
U->>H: calculateHash(algorithm, input)
alt algorithm is HMAC-*
H-->>U: throw IllegalArgumentException (use 3-arg)
else non-HMAC algorithm
H->>H: standard hash(input)
H-->>U: hashHex
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code graph analysis (1)vividus/src/main/java/org/vividus/expression/HashExpressionProcessors.java (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
vividus/src/main/java/org/vividus/expression/HashExpressionProcessors.java(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
vividus/src/main/java/org/vividus/expression/HashExpressionProcessors.java (1)
vividus-util/src/main/java/org/vividus/util/ResourceUtils.java (1)
ResourceUtils(35-229)
…cessors.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
@JoanJaraBosch the build is failed |
Summary by CodeRabbit