-
Notifications
You must be signed in to change notification settings - Fork 3
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
fix: improve validation of Git credentials request #25
Conversation
WalkthroughThe recent changes in the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- handlers.go (3 hunks)
- internal/credentialhandler/marshal.go (2 hunks)
- internal/credentialhandler/marshal_test.go (1 hunks)
Additional comments not posted (2)
handlers.go (1)
61-65
: Refactoring to useConstructRepositoryURL
enhances clarity and validation.internal/credentialhandler/marshal_test.go (1)
215-318
: Comprehensive test coverage forConstructRepositoryURL
.
866c471
to
7d5213c
Compare
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
Out of diff range and nitpick comments (1)
handlers_test.go (1)
Line range hint
138-160
: Consider adding assertions to verify the constructed URL inTestHandlePostGitCredentials_ReturnsTokenOnSuccess
.This would ensure that the URL construction logic is correctly integrated and functioning as expected within the handler.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- handlers.go (4 hunks)
- handlers_test.go (3 hunks)
- internal/credentialhandler/marshal.go (2 hunks)
- internal/credentialhandler/marshal_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- handlers.go
- internal/credentialhandler/marshal.go
- internal/credentialhandler/marshal_test.go
7d5213c
to
3f9b572
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #25 +/- ##
==========================================
+ Coverage 84.98% 88.73% +3.74%
==========================================
Files 12 12
Lines 413 426 +13
==========================================
+ Hits 351 378 +27
+ Misses 42 33 -9
+ Partials 20 15 -5 ☔ View full report in Codecov by Sentry. |
3f9b572
to
476fbcc
Compare
Reject obviously malformed requests, and don't try to add details if they're missing. Git credentials helpers are invoked by Git with a defined and stable protocol. Anything outside this shouldn't be handled, instead rejecting as cheaply as possible.
476fbcc
to
11a072f
Compare
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
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (4)
- handlers.go (4 hunks)
- handlers_test.go (6 hunks)
- internal/credentialhandler/marshal.go (2 hunks)
- internal/credentialhandler/marshal_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (4)
- handlers.go
- handlers_test.go
- internal/credentialhandler/marshal.go
- internal/credentialhandler/marshal_test.go
Reject obviously malformed requests, and don't try to add details if they're missing.
Git credentials helpers are invoked by Git with a defined and stable protocol. Anything outside this shouldn't be handled, instead rejecting as cheaply as possible.
Summary by CodeRabbit