-
Notifications
You must be signed in to change notification settings - Fork 4
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
added method label, improved unit tests #96
Conversation
Codecov Report
@@ Coverage Diff @@
## main #96 +/- ##
==========================================
- Coverage 67.12% 67.12% -0.01%
==========================================
Files 34 34
Lines 943 949 +6
==========================================
+ Hits 633 637 +4
- Misses 291 292 +1
- Partials 19 20 +1
Continue to review full report at Codecov.
|
SonarCloud Quality Gate failed. |
@@ -93,6 +94,9 @@ func (c CapabilitiesValidator) CheckAuthentication(auth bascule.Authentication, | |||
if auth.Token == nil { | |||
return MissingValues, ErrNoToken | |||
} | |||
if len(auth.Request.Method) == 0 { |
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.
Can server-side requests ever have empty methods?
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.
If the Authentication
is built incorrectly, it can. We build it in the constructor middleware (where this case isn't possible), but it's not technically required. Anyone can build their own Authentication
and put it into a context:
https://github.com/xmidt-org/bascule/blob/main/context.go
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.
😎
fixes #86