Skip to content

Commit

Permalink
bumped bascule, webpa-common, and wrp-go (#116)
Browse files Browse the repository at this point in the history
* bumped bascule, webpa-common, and wrp-go

updated related code

* increase go version
  • Loading branch information
kristinapathak authored Oct 8, 2020
1 parent 5f6c19f commit 7dfc136
Show file tree
Hide file tree
Showing 9 changed files with 287 additions and 61 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Updated references to the main branch [#114](https://github.com/xmidt-org/svalinn/pull/114)

## [v0.14.2]
- Updated references to the main branch [#114](https://github.com/xmidt-org/gungnir/pull/114)
- Bumped bascule and webpa-common versions to have case sensitivity for jwt claims [#115](https://github.com/xmidt-org/gungnir/pull/115)

## [v0.14.1]
- add fix for empty sessionID [#112](https://github.com/xmidt-org/gungnir/pull/112)
Expand Down Expand Up @@ -159,7 +162,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Initial creation
- Bumped codex version, modified code to match changes

[Unreleased]: https://github.com/xmidt-org/gungnir/compare/v0.14.1...HEAD
[Unreleased]: https://github.com/xmidt-org/gungnir/compare/v0.14.2...HEAD
[v0.14.2]: https://github.com/xmidt-org/gungnir/compare/v0.14.1...v0.14.2
[v0.14.1]: https://github.com/xmidt-org/gungnir/compare/v0.14.0...v0.14.1
[v0.14.0]: https://github.com/xmidt-org/gungnir/compare/v0.13.1...v0.14.0
[v0.13.1]: https://github.com/xmidt-org/gungnir/compare/v0.13.0...v0.13.1
Expand Down
4 changes: 2 additions & 2 deletions deviceStatus.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (
kithttp "github.com/go-kit/kit/transport/http"
"github.com/goph/emperror"
"github.com/gorilla/mux"
"github.com/xmidt-org/codex-db"
db "github.com/xmidt-org/codex-db"
"github.com/xmidt-org/webpa-common/logging"
"github.com/xmidt-org/wrp-go/v2"
"github.com/xmidt-org/wrp-go/v3"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions deviceStatus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import (
"github.com/xmidt-org/voynicrypto"
"github.com/xmidt-org/webpa-common/logging"
"github.com/xmidt-org/webpa-common/xmetrics/xmetricstest"
"github.com/xmidt-org/wrp-go/v2"
"github.com/xmidt-org/wrp-go/v3"

"github.com/xmidt-org/codex-db"
db "github.com/xmidt-org/codex-db"
)

func TestGetStatusInfo(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
module github.com/xmidt-org/gungnir

go 1.12
go 1.15

require (
github.com/InVisionApp/go-health/v2 v2.1.2
github.com/c9s/goprocinfo v0.0.0-20190309065803-0b2ad9ac246b // indirect
github.com/go-kit/kit v0.9.0
github.com/goph/emperror v0.17.3-0.20190703203600-60a8d9faa17b
github.com/gorilla/mux v1.7.3
github.com/gorilla/mux v1.7.4
github.com/justinas/alice v1.2.0
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.6.1
github.com/spf13/viper v1.7.0
github.com/stretchr/testify v1.4.0
github.com/ugorji/go/codec v1.1.7
github.com/xmidt-org/bascule v0.8.0
github.com/xmidt-org/bascule v0.9.0
github.com/xmidt-org/codex-db v0.7.0
github.com/xmidt-org/voynicrypto v0.1.1
github.com/xmidt-org/webpa-common v1.9.0
github.com/xmidt-org/wrp-go/v2 v2.0.1
github.com/xmidt-org/webpa-common v1.11.1
github.com/xmidt-org/wrp-go/v3 v3.0.1
)
228 changes: 222 additions & 6 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion model/event.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package model

import (
"github.com/xmidt-org/wrp-go/v2"
"github.com/xmidt-org/wrp-go/v3"
)

//go:generate codecgen -st "json" -o event_codec.go event.go
Expand Down
68 changes: 34 additions & 34 deletions model/event_codec.go

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

15 changes: 10 additions & 5 deletions primaryHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

"github.com/ugorji/go/codec"
"github.com/xmidt-org/gungnir/model"
"github.com/xmidt-org/wrp-go/v2"
"github.com/xmidt-org/wrp-go/v3"

"github.com/justinas/alice"
"github.com/xmidt-org/bascule"
Expand Down Expand Up @@ -356,6 +356,10 @@ func authChain(basicAuth []string, jwtVal JWTValidator, capabilityCheck Capabili
// only add capability check if the configuration is set
if capabilityCheck.Type == "enforce" || capabilityCheck.Type == "monitor" {
var endpoints []*regexp.Regexp
c, err := basculechecks.NewEndpointRegexCheck(capabilityCheck.Prefix, capabilityCheck.AcceptAllMethod)
if err != nil {
return alice.Chain{}, emperror.With(err, "failed to create capability check")
}
for _, e := range capabilityCheck.EndpointBuckets {
r, err := regexp.Compile(e)
if err != nil {
Expand All @@ -364,11 +368,12 @@ func authChain(basicAuth []string, jwtVal JWTValidator, capabilityCheck Capabili
}
endpoints = append(endpoints, r)
}
checker, err := basculechecks.NewCapabilityChecker(capabilityCheckMeasures, capabilityCheck.Prefix, capabilityCheck.AcceptAllMethod, endpoints)
if err != nil {
return alice.Chain{}, emperror.With(err, "failed to create capability check")
m := basculechecks.MetricValidator{
C: basculechecks.CapabilitiesValidator{Checker: c},
Measures: capabilityCheckMeasures,
Endpoints: endpoints,
}
bearerRules = append(bearerRules, checker.CreateBasculeCheck(capabilityCheck.Type == "enforce"))
bearerRules = append(bearerRules, m.CreateValidator(capabilityCheck.Type == "enforce"))
}

authEnforcer := basculehttp.NewEnforcer(
Expand Down
7 changes: 4 additions & 3 deletions primaryHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/xmidt-org/gungnir/model"
"github.com/xmidt-org/wrp-go/v2"
"net/http"
"net/http/httptest"
"testing"
"time"

db "github.com/xmidt-org/codex-db"
"github.com/xmidt-org/gungnir/model"
"github.com/xmidt-org/wrp-go/v3"

"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/xmidt-org/voynicrypto"

kithttp "github.com/go-kit/kit/transport/http"
"github.com/gorilla/mux"
"github.com/stretchr/testify/assert"
"github.com/xmidt-org/codex-db"
"github.com/xmidt-org/webpa-common/logging"
"github.com/xmidt-org/webpa-common/xmetrics/xmetricstest"
)
Expand Down

0 comments on commit 7dfc136

Please sign in to comment.