Skip to content

Commit

Permalink
Need to define metrics setter for validator
Browse files Browse the repository at this point in the history
  • Loading branch information
joe94 committed Jan 25, 2018
1 parent 8d56143 commit 6f985ec
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
36 changes: 19 additions & 17 deletions src/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package: .
homepage: https://github.com/Comcast/tr1d1um
import:
- package: github.com/Comcast/webpa-common
version: ff81f093033bfdf7c8d71b36697f9895026dc78b
version: f61a77521d8fbad863a4700fab405d688f979e3b
- package: github.com/go-ozzo/ozzo-validation
version: v3.3
18 changes: 9 additions & 9 deletions src/tr1d1um/tr1d1um.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,23 +275,23 @@ func GetValidator(v *viper.Viper, m *secure.JWTValidationMeasures) (validator se
validators := make(secure.Validators, 0, len(jwtVals))

for _, validatorDescriptor := range jwtVals {
validatorDescriptor.Custom.DefineMeasures(m)

var keyResolver key.Resolver
keyResolver, err = validatorDescriptor.Keys.NewResolver()
if err != nil {
validator = validators
return
}

validatorDescriptor.Custom.DefineMeasures(m)
validator := secure.JWSValidator{
DefaultKeyId: DefaultKeyID,
Resolver: keyResolver,
JWTValidators: []*jwt.Validator{validatorDescriptor.Custom.New()},
}

validators = append(
validators,
secure.JWSValidator{
DefaultKeyId: DefaultKeyID,
Resolver: keyResolver,
JWTValidators: []*jwt.Validator{validatorDescriptor.Custom.New()},
},
)
validator.DefineMeasures(m)
validators = append(validators, validator)
}

basicAuth := v.GetStringSlice("authHeader")
Expand Down

0 comments on commit 6f985ec

Please sign in to comment.