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

fix(deps): update module github.com/pivotal-cf/brokerapi/v9 to v10 #1814

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/golangapiserver/spec
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ files:
- autoscaler/vendor/code.cloudfoundry.org/tlsconfig/* # gosub
- autoscaler/vendor/github.com/beorn7/perks/quantile/* # gosub
- autoscaler/vendor/github.com/cespare/xxhash/v2/* # gosub
- autoscaler/vendor/github.com/go-chi/chi/v5/* # gosub
- autoscaler/vendor/github.com/go-sql-driver/mysql/* # gosub
- autoscaler/vendor/github.com/golang/protobuf/proto/* # gosub
- autoscaler/vendor/github.com/golang/protobuf/ptypes/timestamp/* # gosub
Expand Down Expand Up @@ -69,13 +70,13 @@ files:
- autoscaler/vendor/github.com/openzipkin/zipkin-go/model/* # gosub
- autoscaler/vendor/github.com/patrickmn/go-cache/* # gosub
- autoscaler/vendor/github.com/pborman/uuid/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v9/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v9/auth/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v9/domain/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v9/domain/apiresponses/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v9/handlers/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v9/middlewares/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v9/utils/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v10/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v10/auth/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v10/domain/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v10/domain/apiresponses/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v10/handlers/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v10/middlewares/* # gosub
- autoscaler/vendor/github.com/pivotal-cf/brokerapi/v10/utils/* # gosub
- autoscaler/vendor/github.com/pkg/errors/* # gosub
- autoscaler/vendor/github.com/prometheus/client_golang/prometheus/* # gosub
- autoscaler/vendor/github.com/prometheus/client_golang/prometheus/collectors/* # gosub
Expand Down
4 changes: 2 additions & 2 deletions src/autoscaler/api/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/models"
"code.cloudfoundry.org/lager/v3"
uuid "github.com/nu7hatch/gouuid"
"github.com/pivotal-cf/brokerapi/v9/domain"
"github.com/pivotal-cf/brokerapi/v9/domain/apiresponses"
"github.com/pivotal-cf/brokerapi/v10/domain"
"github.com/pivotal-cf/brokerapi/v10/domain/apiresponses"
"golang.org/x/exp/slices"
)

Expand Down
2 changes: 1 addition & 1 deletion src/autoscaler/api/broker/broker_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/models"
"github.com/pivotal-cf/brokerapi/v9/domain"
"github.com/pivotal-cf/brokerapi/v10/domain"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/api/config"
. "github.com/onsi/ginkgo/v2"
Expand Down
4 changes: 2 additions & 2 deletions src/autoscaler/api/broker/broker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"code.cloudfoundry.org/lager/v3/lagertest"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/pivotal-cf/brokerapi/v9/domain"
"github.com/pivotal-cf/brokerapi/v9/domain/apiresponses"
"github.com/pivotal-cf/brokerapi/v10/domain"
"github.com/pivotal-cf/brokerapi/v10/domain/apiresponses"
)

var _ = Describe("Broker", func() {
Expand Down
12 changes: 6 additions & 6 deletions src/autoscaler/api/brokerserver/broker_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"net/url"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/api/broker"
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/testhelpers"

"github.com/gorilla/mux"
"github.com/pivotal-cf/brokerapi/v9/handlers"
"github.com/pivotal-cf/brokerapi/v10/handlers"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/db"
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/fakes"
Expand Down Expand Up @@ -76,7 +76,7 @@ var _ = Describe("BrokerHandler", func() {
var body []byte
JustBeforeEach(func() {
req, err = http.NewRequest(http.MethodPut, "", bytes.NewReader(body))
req = mux.SetURLVars(req, map[string]string{"instance_id": testInstanceId})
req = testhelpers.SetURLParams(req, "instance_id", testInstanceId)
handler.Provision(resp, req)
})
BeforeEach(func() {
Expand Down Expand Up @@ -300,7 +300,7 @@ var _ = Describe("BrokerHandler", func() {
callUpdateServiceInstance := func() {
req, err = http.NewRequest(http.MethodPut, "", bytes.NewReader(body))
Expect(err).NotTo(HaveOccurred())
req = mux.SetURLVars(req, map[string]string{"instance_id": testInstanceId})
req = testhelpers.SetURLParams(req, "instance_id", testInstanceId)
handler.Update(resp, req)
}
updatePlanAndDefaultPolicy := func(fromPlan string, targetPlan string, defaultPolicy json.RawMessage) {
Expand Down Expand Up @@ -693,7 +693,7 @@ var _ = Describe("BrokerHandler", func() {
Describe("DeleteServiceInstance", func() {
JustBeforeEach(func() {
req, _ = http.NewRequest(http.MethodDelete, "", nil)
req = mux.SetURLVars(req, map[string]string{"instance_id": testInstanceId})
req = testhelpers.SetURLParams(req, "instance_id", testInstanceId)
values := url.Values{}
values.Set("service_id", "autoscaler-guid")
values.Set("plan_id", "autoscaler-free-plan-id")
Expand Down Expand Up @@ -1100,7 +1100,7 @@ var _ = Describe("BrokerHandler", func() {
Describe("UnBindServiceInstance", func() {
BeforeEach(func() {
req, _ = http.NewRequest(http.MethodDelete, "", nil)
req = mux.SetURLVars(req, map[string]string{"instance_id": testInstanceId, "binding_id": testBindingId})
req = testhelpers.SetURLParams(req, "instance_id", testInstanceId, "binding_id", testBindingId)
values := url.Values{}
values.Set("service_id", "autoscaler-guid")
values.Set("plan_id", "autoscaler-free-plan-id")
Expand Down
15 changes: 4 additions & 11 deletions src/autoscaler/api/brokerserver/broker_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,16 @@ import (
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/api/config"
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/db"
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/healthendpoint"
"github.com/pivotal-cf/brokerapi/v9"
"github.com/pivotal-cf/brokerapi/v9/domain"
"github.com/pivotal-cf/brokerapi/v10"
"github.com/pivotal-cf/brokerapi/v10/domain"

"code.cloudfoundry.org/lager/v3"
"github.com/gorilla/mux"
"github.com/go-chi/chi/v5"
"github.com/tedsuo/ifrit"
"github.com/tedsuo/ifrit/http_server"
"golang.org/x/crypto/bcrypt"
)

type VarsFunc func(w http.ResponseWriter, r *http.Request, vars map[string]string)

func (vh VarsFunc) ServeHTTP(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
vh(w, r, vars)
}

type MiddleWareBrokerCredentials struct {
BrokerUsername string
BrokerUsernameHash []byte
Expand Down Expand Up @@ -123,7 +116,7 @@ func NewBrokerServer(logger lager.Logger, conf *config.Config, bindingdb db.Bind
httpStatusCollectMiddleware := healthendpoint.NewHTTPStatusCollectMiddleware(httpStatusCollector)
autoscalerBroker := broker.New(logger.Session("broker"), conf, bindingdb, policydb, catalog.Services, credentials)

r := mux.NewRouter()
r := chi.NewRouter()

r.Use(basicAuthentication.Middleware)
r.Use(httpStatusCollectMiddleware.Collect)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"strconv"

"github.com/pivotal-cf/brokerapi/v9/domain"
"github.com/pivotal-cf/brokerapi/v10/domain"

"code.cloudfoundry.org/app-autoscaler/src/autoscaler/api/brokerserver"
"code.cloudfoundry.org/app-autoscaler/src/autoscaler/api/config"
Expand Down
3 changes: 2 additions & 1 deletion src/autoscaler/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
code.cloudfoundry.org/tlsconfig v0.0.0-20220621140725-0e6fbd869921
dario.cat/mergo v1.0.0
github.com/cenkalti/backoff/v4 v4.2.1
github.com/go-chi/chi/v5 v5.0.8
github.com/go-sql-driver/mysql v1.7.1
github.com/golang/protobuf v1.5.3
github.com/golangci/golangci-lint v1.53.3
Expand All @@ -24,7 +25,7 @@ require (
github.com/onsi/ginkgo/v2 v2.11.0
github.com/onsi/gomega v1.27.8
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pivotal-cf/brokerapi/v9 v9.0.1
github.com/pivotal-cf/brokerapi/v10 v10.0.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.16.0
github.com/rubyist/circuitbreaker v2.2.1+incompatible
Expand Down
6 changes: 4 additions & 2 deletions src/autoscaler/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,8 @@ github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmV
github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo=
github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0=
github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-critic/go-critic v0.8.1 h1:16omCF1gN3gTzt4j4J6fKI/HnRojhEp+Eks6EuKw3vw=
github.com/go-critic/go-critic v0.8.1/go.mod h1:kpzXl09SIJX1cr9TB/g/sAG+eFEl7ZS9f9cqvZtyNl0=
github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g=
Expand Down Expand Up @@ -1204,8 +1206,8 @@ github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2
github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI=
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pivotal-cf/brokerapi/v9 v9.0.1 h1:RCFVI88hL7OoeAmpqH3a/oh+QWVSDV9vjXxT+cJQkFo=
github.com/pivotal-cf/brokerapi/v9 v9.0.1/go.mod h1:8tU05vMehQWHfkmjiLdo9QoQ+K5FWinN07f8O3MZ7Vw=
github.com/pivotal-cf/brokerapi/v10 v10.0.0 h1:cC2zdIF1jh1twD196xWpHjiX2JEbU+RMLH2jpmLDRT8=
github.com/pivotal-cf/brokerapi/v10 v10.0.0/go.mod h1:LVexXnzj0Zj7lxIJXnDqc794/XHwEzkOPzAZdEaKM5M=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
18 changes: 18 additions & 0 deletions src/autoscaler/testhelpers/chi.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package testhelpers

import (
"context"
"net/http"

"github.com/go-chi/chi/v5"
)

func SetURLParams(req *http.Request, params ...string) *http.Request {
rc := chi.NewRouteContext()
for i := 0; i+1 < len(params); i += 2 {
rc.URLParams.Add(params[i], params[i+1])
}
ctx := context.WithValue(req.Context(), chi.RouteCtxKey, rc)
req = req.WithContext(ctx)
return req
}
Loading