-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for SHA256 and SHA512 algorithms in One Time Password generation #620
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughAdds conditional logic in OneTimePassword URI generation to include an algorithm query parameter when the algorithm is not SHA1. Expands unit tests to cover TOTP/HOTP variations, defaults suppression, custom parameters, and default counter behavior, asserting the resulting otpauth URIs. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Caller
participant OTP as OneTimePassword
participant PCF as ProcessCommonFields
C->>OTP: Generate otpauth URI
OTP->>PCF: Build base URI and common fields
alt Algorithm != SHA1
PCF-->>PCF: Append "&algorithm=<ALG>"
else Algorithm == SHA1
PCF-->>PCF: Skip algorithm parameter
end
PCF-->>OTP: Return common fields
OTP-->>C: Return final otpauth URI
note over OTP: Digits/period/counter appended per type and defaults
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (2)QRCoder/PayloadGenerator/OneTimePassword.cs (3)
QRCoderTests/PayloadGeneratorTests/OneTimePasswordTests.cs (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (7)
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 |
Summary by CodeRabbit
New Features
Tests