motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.78k stars 318 forks source link

Add/Fix Plugin Configuration Validation #368

Closed s4nji closed 5 years ago

s4nji commented 5 years ago

Applies struct validation (using asaskevich/govalidator) to plugin configurations.
This was not properly validated, as it assumed config to be interface{} during the validation.

Ticket

https://hellofresh.atlassian.net/browse/PT-1755

codecov[bot] commented 5 years ago

Codecov Report

Merging #368 into master will decrease coverage by 0.6%. The diff coverage is 30.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #368      +/-   ##
==========================================
- Coverage   40.34%   39.73%   -0.61%     
==========================================
  Files          74       75       +1     
  Lines        2553     2660     +107     
==========================================
+ Hits         1030     1057      +27     
- Misses       1464     1541      +77     
- Partials       59       62       +3
Impacted Files Coverage Δ
pkg/web/api_handler.go 0% <0%> (ø) :arrow_up:
pkg/plugin/rate/setup.go 51.92% <25%> (-5.86%) :arrow_down:
pkg/plugin/cb/setup.go 80.64% <25%> (-8.45%) :arrow_down:
pkg/plugin/cors/setup.go 69.23% <25%> (-20.25%) :arrow_down:
pkg/plugin/retry/setup.go 29.41% <25%> (-3.93%) :arrow_down:
pkg/plugin/bodylmt/setup.go 55.55% <25%> (-26.27%) :arrow_down:
pkg/plugin/oauth2/setup.go 8.33% <25%> (+0.46%) :arrow_up:
pkg/plugin/plugin.go 38.18% <71.42%> (ø)

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 cb02e45...93393e0. Read the comment docs.