-
Notifications
You must be signed in to change notification settings - Fork 18
Backmerge Commcare 2.61.1 #1512
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
Adds argument validations for auth classes
WalkthroughThe PR adds input validation to the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/org/commcare/core/network/AuthInfo.java (1)
27-32: NewProvidedAuthvalidation changes constructor behavior; confirm call sites and consider reuseEnforcing non-empty username/password via
IllegalArgumentExceptionis reasonable, but it is an observable behavior change: any existing caller that passednull/""(even as a sentinel) will now fail at construction time. Please:
- Double-check call sites to ensure they never intentionally pass empty/nullable credentials.
- Add/extend tests to cover these exceptional paths so regressions are caught early.
If this style of validation expands, consider a small shared helper to avoid repeating the sameisEmpty/exception pattern in multiple auth constructors.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/main/java/org/commcare/core/network/AuthInfo.java(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/java/org/commcare/core/network/AuthInfo.java (1)
src/main/java/org/commcare/cases/util/StringUtils.java (1)
StringUtils(13-166)
⏰ 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). (2)
- GitHub Check: task-list-completed
- GitHub Check: task-list-completed
🔇 Additional comments (2)
src/main/java/org/commcare/core/network/AuthInfo.java (2)
3-4: Using sharedStringUtilshelper is a good choiceCentralizing null/empty checks on
StringUtils.isEmptykeeps the constructors concise and avoids re-implementing the same logic.
46-47: TokenAuth null/empty guarding is sound but also a behavior changeRejecting null/empty tokens up front is a good invariant for
TokenAuth, but likeProvidedAuth, this will now throw where existing code may previously have constructed a “blank token” instance. Please verify:
- No current callers use
null/""to represent “no token yet” (they should useNoAuth/CurrentAuthinstead).- Tests cover the invalid-token case and any upstream validation paths.
Product Description
Technical Summary
Safety Assurance
Safety story
Automated test coverage
QA Plan
Special deploy instructions
Rollback instructions
Review
Duplicate PR
Automatically duplicate this PR as defined in contributing.md.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.