Skip to content
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

Merged
merged 2 commits into from
Apr 30, 2021
Merged

Conversation

kristinapathak
Copy link
Contributor

fixes #86

@kristinapathak kristinapathak added enhancement New feature or request validator labels Apr 30, 2021
@kristinapathak kristinapathak added this to the Unreleased milestone Apr 30, 2021
@kristinapathak kristinapathak requested a review from joe94 April 30, 2021 01:00
@codecov
Copy link

codecov bot commented Apr 30, 2021

Codecov Report

Merging #96 (11fb2fa) into main (0515628) will decrease coverage by 0.00%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
basculechecks/metrics.go 0.00% <0.00%> (ø)
basculechecks/metricvalidator.go 85.86% <50.00%> (-1.64%) ⬇️
basculechecks/capabilitiesvalidator.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0515628...11fb2fa. Read the comment docs.

@sonarqubecloud
Copy link

@@ -93,6 +94,9 @@ func (c CapabilitiesValidator) CheckAuthentication(auth bascule.Authentication,
if auth.Token == nil {
return MissingValues, ErrNoToken
}
if len(auth.Request.Method) == 0 {
Copy link
Member

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?

Copy link
Contributor Author

@kristinapathak kristinapathak Apr 30, 2021

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

Copy link
Member

@joe94 joe94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😎

@kristinapathak kristinapathak merged commit 0d6add6 into main Apr 30, 2021
@kristinapathak kristinapathak deleted the method-label branch April 30, 2021 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request validator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add method label to basculechecks metric
2 participants