From 5e8b5671743f0a3e2b93ef18ebfce1a656d51f6c Mon Sep 17 00:00:00 2001 From: Services Enablement CI Date: Fri, 12 Apr 2024 21:24:25 +0000 Subject: [PATCH] Bump ODB SDK to latest. --- go.mod | 5 +- go.sum | 10 +- vendor/github.com/go-chi/chi/v5/CHANGELOG.md | 5 + vendor/github.com/go-chi/chi/v5/README.md | 2 + vendor/github.com/go-chi/chi/v5/mux.go | 16 ++ vendor/github.com/go-chi/chi/v5/path_value.go | 20 ++ .../go-chi/chi/v5/path_value_fallback.go | 19 ++ .../pivotal-cf/brokerapi/v11/LICENSE | 201 ++++++++++++++ .../pivotal-cf/brokerapi/v11/NOTICE | 10 + .../v11/domain/experimental_volume_mount.go | 13 + .../brokerapi/v11/domain/maintenance_info.go | 16 ++ .../brokerapi/v11/domain/service_broker.go | 245 ++++++++++++++++++ .../brokerapi/v11/domain/service_catalog.go | 76 ++++++ .../brokerapi/v11/domain/service_metadata.go | 62 +++++ .../v11/domain/service_plan_metadata.go | 83 ++++++ .../serviceadapter/domain.go | 2 +- vendor/modules.txt | 9 +- 17 files changed, 784 insertions(+), 10 deletions(-) create mode 100644 vendor/github.com/go-chi/chi/v5/path_value.go create mode 100644 vendor/github.com/go-chi/chi/v5/path_value_fallback.go create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/LICENSE create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/NOTICE create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/domain/experimental_volume_mount.go create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/domain/maintenance_info.go create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_broker.go create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_catalog.go create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_metadata.go create mode 100644 vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_plan_metadata.go diff --git a/go.mod b/go.mod index 15e530cf1..489101688 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/onsi/gomega v1.32.0 github.com/pborman/uuid v1.2.1 github.com/pivotal-cf/brokerapi/v10 v10.2.0 - github.com/pivotal-cf/on-demand-services-sdk v0.45.4 + github.com/pivotal-cf/on-demand-services-sdk v0.45.5-0.20240412212149-512df882a3a1 github.com/pkg/errors v0.9.1 github.com/urfave/negroni v1.0.0 github.com/xeipuuv/gojsonschema v1.2.0 @@ -33,7 +33,7 @@ require ( github.com/cloudfoundry/socks5-proxy v0.2.116 // indirect github.com/cppforlife/go-semi-semantic v0.0.0-20160921010311-576b6af77ae4 // indirect github.com/gabriel-vasile/mimetype v1.4.3 // indirect - github.com/go-chi/chi/v5 v5.0.11 // indirect + github.com/go-chi/chi/v5 v5.0.12 // indirect github.com/go-logr/logr v1.4.1 // indirect github.com/go-playground/locales v0.14.1 // indirect github.com/go-playground/universal-translator v0.18.1 // indirect @@ -47,6 +47,7 @@ require ( github.com/leodido/go-urn v1.4.0 // indirect github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d // indirect github.com/openzipkin/zipkin-go v0.4.2 // indirect + github.com/pivotal-cf/brokerapi/v11 v11.0.0 // indirect github.com/pivotal-cf/paraphernalia v0.0.0-20180203224945-a64ae2051c20 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect diff --git a/go.sum b/go.sum index 1564f77ae..df4928005 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= -github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA= -github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= +github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= @@ -119,8 +119,10 @@ github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw= github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pivotal-cf/brokerapi/v10 v10.2.0 h1:cdXk5FMkxuBONiaPS+H9aIu0v5aSYv4qvo5keBcUTGA= github.com/pivotal-cf/brokerapi/v10 v10.2.0/go.mod h1:UEwbfVgaY8FpQ3NOfjoVRPLW/Ar0c7uYQP5TJj3r3OE= -github.com/pivotal-cf/on-demand-services-sdk v0.45.4 h1:OezpDWzqC4jr2wyE21X63G4TDwTrhcGN7oeEDPL0mp8= -github.com/pivotal-cf/on-demand-services-sdk v0.45.4/go.mod h1:KsXyH6jtYQdPusKh2881KQRoqHE4Ichtx0phGKHt8ow= +github.com/pivotal-cf/brokerapi/v11 v11.0.0 h1:FxIrKdrFNAUyX8NAgPpdkJjwQ0vHmjbaPoxTPcAvcmY= +github.com/pivotal-cf/brokerapi/v11 v11.0.0/go.mod h1:MY40lQBKIChtmOpTVluTOyKQ9bW9p5fDszvXOEViIBQ= +github.com/pivotal-cf/on-demand-services-sdk v0.45.5-0.20240412212149-512df882a3a1 h1:0Q4gqoRKnvLTwsYfesVYdfgHzg+HrsfAyKLE3MQrC4g= +github.com/pivotal-cf/on-demand-services-sdk v0.45.5-0.20240412212149-512df882a3a1/go.mod h1:0tQWl0fkErnAK6GPy42MlSju5kMq4AYyIstAelJ6Ru0= github.com/pivotal-cf/paraphernalia v0.0.0-20180203224945-a64ae2051c20 h1:DR5eMfe2+6GzLkVyWytdtgUxgbPiOfvKDuqityTV3y8= github.com/pivotal-cf/paraphernalia v0.0.0-20180203224945-a64ae2051c20/go.mod h1:Y3IqE20LKprEpLkXb7gXinJf4vvDdQe/BS8E4kL/dgE= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/vendor/github.com/go-chi/chi/v5/CHANGELOG.md b/vendor/github.com/go-chi/chi/v5/CHANGELOG.md index 83d5aa28f..25b45b974 100644 --- a/vendor/github.com/go-chi/chi/v5/CHANGELOG.md +++ b/vendor/github.com/go-chi/chi/v5/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v5.0.12 (2024-02-16) + +- History of changes: see https://github.com/go-chi/chi/compare/v5.0.11...v5.0.12 + + ## v5.0.11 (2023-12-19) - History of changes: see https://github.com/go-chi/chi/compare/v5.0.10...v5.0.11 diff --git a/vendor/github.com/go-chi/chi/v5/README.md b/vendor/github.com/go-chi/chi/v5/README.md index 4b1c99d12..21cbb0fc0 100644 --- a/vendor/github.com/go-chi/chi/v5/README.md +++ b/vendor/github.com/go-chi/chi/v5/README.md @@ -354,6 +354,7 @@ with `net/http` can be used with chi's mux. | [RouteHeaders] | Route handling for request headers | | [SetHeader] | Short-hand middleware to set a response header key/value | | [StripSlashes] | Strip slashes on routing paths | +| [Sunset] | Sunset set Deprecation/Sunset header to response | | [Throttle] | Puts a ceiling on the number of concurrent requests | | [Timeout] | Signals to the request context when the timeout deadline is reached | | [URLFormat] | Parse extension from url and put it on request context | @@ -380,6 +381,7 @@ with `net/http` can be used with chi's mux. [RouteHeaders]: https://pkg.go.dev/github.com/go-chi/chi/middleware#RouteHeaders [SetHeader]: https://pkg.go.dev/github.com/go-chi/chi/middleware#SetHeader [StripSlashes]: https://pkg.go.dev/github.com/go-chi/chi/middleware#StripSlashes +[Sunset]: https://pkg.go.dev/github.com/go-chi/chi/v5/middleware#Sunset [Throttle]: https://pkg.go.dev/github.com/go-chi/chi/middleware#Throttle [ThrottleBacklog]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ThrottleBacklog [ThrottleWithOpts]: https://pkg.go.dev/github.com/go-chi/chi/middleware#ThrottleWithOpts diff --git a/vendor/github.com/go-chi/chi/v5/mux.go b/vendor/github.com/go-chi/chi/v5/mux.go index 735ab2323..6dc1904d9 100644 --- a/vendor/github.com/go-chi/chi/v5/mux.go +++ b/vendor/github.com/go-chi/chi/v5/mux.go @@ -107,12 +107,24 @@ func (mx *Mux) Use(middlewares ...func(http.Handler) http.Handler) { // Handle adds the route `pattern` that matches any http method to // execute the `handler` http.Handler. func (mx *Mux) Handle(pattern string, handler http.Handler) { + parts := strings.SplitN(pattern, " ", 2) + if len(parts) == 2 { + mx.Method(parts[0], parts[1], handler) + return + } + mx.handle(mALL, pattern, handler) } // HandleFunc adds the route `pattern` that matches any http method to // execute the `handlerFn` http.HandlerFunc. func (mx *Mux) HandleFunc(pattern string, handlerFn http.HandlerFunc) { + parts := strings.SplitN(pattern, " ", 2) + if len(parts) == 2 { + mx.Method(parts[0], parts[1], handlerFn) + return + } + mx.handle(mALL, pattern, handlerFn) } @@ -440,6 +452,10 @@ func (mx *Mux) routeHTTP(w http.ResponseWriter, r *http.Request) { // Find the route if _, _, h := mx.tree.FindRoute(rctx, method, routePath); h != nil { + if supportsPathValue { + setPathValue(rctx, r) + } + h.ServeHTTP(w, r) return } diff --git a/vendor/github.com/go-chi/chi/v5/path_value.go b/vendor/github.com/go-chi/chi/v5/path_value.go new file mode 100644 index 000000000..7e78171e5 --- /dev/null +++ b/vendor/github.com/go-chi/chi/v5/path_value.go @@ -0,0 +1,20 @@ +//go:build go1.22 +// +build go1.22 + +package chi + +import "net/http" + +// supportsPathValue is true if the Go version is 1.22 and above. +// +// If this is true, `net/http.Request` has methods `SetPathValue` and `PathValue`. +const supportsPathValue = true + +// setPathValue sets the path values in the Request value +// based on the provided request context. +func setPathValue(rctx *Context, r *http.Request) { + for i, key := range rctx.URLParams.Keys { + value := rctx.URLParams.Values[i] + r.SetPathValue(key, value) + } +} diff --git a/vendor/github.com/go-chi/chi/v5/path_value_fallback.go b/vendor/github.com/go-chi/chi/v5/path_value_fallback.go new file mode 100644 index 000000000..f551781a4 --- /dev/null +++ b/vendor/github.com/go-chi/chi/v5/path_value_fallback.go @@ -0,0 +1,19 @@ +//go:build !go1.22 +// +build !go1.22 + +package chi + +import "net/http" + +// supportsPathValue is true if the Go version is 1.22 and above. +// +// If this is true, `net/http.Request` has methods `SetPathValue` and `PathValue`. +const supportsPathValue = false + +// setPathValue sets the path values in the Request value +// based on the provided request context. +// +// setPathValue is only supported in Go 1.22 and above so +// this is just a blank function so that it compiles. +func setPathValue(rctx *Context, r *http.Request) { +} diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/LICENSE b/vendor/github.com/pivotal-cf/brokerapi/v11/LICENSE new file mode 100644 index 000000000..5c304d1a4 --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/LICENSE @@ -0,0 +1,201 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/NOTICE b/vendor/github.com/pivotal-cf/brokerapi/v11/NOTICE new file mode 100644 index 000000000..d5013b58c --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/NOTICE @@ -0,0 +1,10 @@ +brokerapi + +Copyright (c) 2014-2018 Pivotal Software, Inc. All Rights Reserved. + +This product is licensed to you under the Apache License, Version 2.0 (the "License"). +You may not use this product except in compliance with the License. + +This product may include a number of subcomponents with separate copyright notices +and license terms. Your use of these subcomponents is subject to the terms and +conditions of the subcomponent's license, as noted in the LICENSE file. diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/domain/experimental_volume_mount.go b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/experimental_volume_mount.go new file mode 100644 index 000000000..66993a4f0 --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/experimental_volume_mount.go @@ -0,0 +1,13 @@ +package domain + +type ExperimentalVolumeMount struct { + ContainerPath string `json:"container_path"` + Mode string `json:"mode"` + Private ExperimentalVolumeMountPrivate `json:"private"` +} + +type ExperimentalVolumeMountPrivate struct { + Driver string `json:"driver"` + GroupID string `json:"group_id"` + Config string `json:"config"` +} diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/domain/maintenance_info.go b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/maintenance_info.go new file mode 100644 index 000000000..8399b51c9 --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/maintenance_info.go @@ -0,0 +1,16 @@ +package domain + +import "reflect" + +type MaintenanceInfo struct { + Public map[string]string `json:"public,omitempty"` + Private string `json:"private,omitempty"` + Version string `json:"version,omitempty"` + Description string `json:"description,omitempty"` +} + +func (m *MaintenanceInfo) Equals(input MaintenanceInfo) bool { + return m.Version == input.Version && + m.Private == input.Private && + reflect.DeepEqual(m.Public, input.Public) +} diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_broker.go b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_broker.go new file mode 100644 index 000000000..3a9f34902 --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_broker.go @@ -0,0 +1,245 @@ +package domain + +import ( + "context" + "encoding/json" +) + +//go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -generate +//counterfeiter:generate -o ../fakes/auto_fake_service_broker.go -fake-name AutoFakeServiceBroker . ServiceBroker + +// Each method of the ServiceBroker interface maps to an individual endpoint of the Open Service Broker API. +// The specification is available here: https://github.com/openservicebrokerapi/servicebroker/blob/v2.14/spec.md +// The OpenAPI documentation is available here: http://petstore.swagger.io/?url=https://raw.githubusercontent.com/openservicebrokerapi/servicebroker/v2.14/openapi.yaml +type ServiceBroker interface { + + // Services gets the catalog of services offered by the service broker + // GET /v2/catalog + Services(ctx context.Context) ([]Service, error) + + // Provision creates a new service instance + // PUT /v2/service_instances/{instance_id} + Provision(ctx context.Context, instanceID string, details ProvisionDetails, asyncAllowed bool) (ProvisionedServiceSpec, error) + + // Deprovision deletes an existing service instance + // DELETE /v2/service_instances/{instance_id} + Deprovision(ctx context.Context, instanceID string, details DeprovisionDetails, asyncAllowed bool) (DeprovisionServiceSpec, error) + + // GetInstance fetches information about a service instance + // GET /v2/service_instances/{instance_id} + GetInstance(ctx context.Context, instanceID string, details FetchInstanceDetails) (GetInstanceDetailsSpec, error) + + // Update modifies an existing service instance + // PATCH /v2/service_instances/{instance_id} + Update(ctx context.Context, instanceID string, details UpdateDetails, asyncAllowed bool) (UpdateServiceSpec, error) + + // LastOperation fetches last operation state for a service instance + // GET /v2/service_instances/{instance_id}/last_operation + LastOperation(ctx context.Context, instanceID string, details PollDetails) (LastOperation, error) + + // Bind creates a new service binding + // PUT /v2/service_instances/{instance_id}/service_bindings/{binding_id} + Bind(ctx context.Context, instanceID, bindingID string, details BindDetails, asyncAllowed bool) (Binding, error) + + // Unbind deletes an existing service binding + // DELETE /v2/service_instances/{instance_id}/service_bindings/{binding_id} + Unbind(ctx context.Context, instanceID, bindingID string, details UnbindDetails, asyncAllowed bool) (UnbindSpec, error) + + // GetBinding fetches an existing service binding + // GET /v2/service_instances/{instance_id}/service_bindings/{binding_id} + GetBinding(ctx context.Context, instanceID, bindingID string, details FetchBindingDetails) (GetBindingSpec, error) + + // LastBindingOperation fetches last operation state for a service binding + // GET /v2/service_instances/{instance_id}/service_bindings/{binding_id}/last_operation + LastBindingOperation(ctx context.Context, instanceID, bindingID string, details PollDetails) (LastOperation, error) +} + +type LastOperation struct { + State LastOperationState `json:"state"` + Description string `json:"description"` +} + +type LastOperationState string + +const ( + InProgress LastOperationState = "in progress" + Succeeded LastOperationState = "succeeded" + Failed LastOperationState = "failed" +) + +type VolumeMount struct { + Driver string `json:"driver"` + ContainerDir string `json:"container_dir"` + Mode string `json:"mode"` + DeviceType string `json:"device_type"` + Device SharedDevice `json:"device"` +} + +type SharedDevice struct { + VolumeId string `json:"volume_id"` + MountConfig map[string]interface{} `json:"mount_config"` +} + +type ProvisionDetails struct { + ServiceID string `json:"service_id"` + PlanID string `json:"plan_id"` + OrganizationGUID string `json:"organization_guid"` + SpaceGUID string `json:"space_guid"` + RawContext json.RawMessage `json:"context,omitempty"` + RawParameters json.RawMessage `json:"parameters,omitempty"` + MaintenanceInfo *MaintenanceInfo `json:"maintenance_info,omitempty"` +} + +type ProvisionedServiceSpec struct { + IsAsync bool + AlreadyExists bool + DashboardURL string + OperationData string + Metadata InstanceMetadata +} + +type InstanceMetadata struct { + Labels map[string]string `json:"labels,omitempty"` + Attributes map[string]string `json:"attributes,omitempty"` +} + +type DeprovisionDetails struct { + PlanID string `json:"plan_id"` + ServiceID string `json:"service_id"` + Force bool `json:"force"` +} + +type DeprovisionServiceSpec struct { + IsAsync bool + OperationData string +} + +type GetInstanceDetailsSpec struct { + ServiceID string `json:"service_id"` + PlanID string `json:"plan_id"` + DashboardURL string `json:"dashboard_url"` + Parameters interface{} `json:"parameters"` + Metadata InstanceMetadata +} + +type UpdateDetails struct { + ServiceID string `json:"service_id"` + PlanID string `json:"plan_id"` + RawParameters json.RawMessage `json:"parameters,omitempty"` + PreviousValues PreviousValues `json:"previous_values"` + RawContext json.RawMessage `json:"context,omitempty"` + MaintenanceInfo *MaintenanceInfo `json:"maintenance_info,omitempty"` +} + +type PreviousValues struct { + PlanID string `json:"plan_id"` + ServiceID string `json:"service_id"` + OrgID string `json:"organization_id"` + SpaceID string `json:"space_id"` + MaintenanceInfo *MaintenanceInfo `json:"maintenance_info,omitempty"` +} + +type UpdateServiceSpec struct { + IsAsync bool + DashboardURL string + OperationData string + Metadata InstanceMetadata +} + +type FetchInstanceDetails struct { + ServiceID string `json:"service_id"` + PlanID string `json:"plan_id"` +} + +type FetchBindingDetails struct { + ServiceID string `json:"service_id"` + PlanID string `json:"plan_id"` +} + +type PollDetails struct { + ServiceID string `json:"service_id"` + PlanID string `json:"plan_id"` + OperationData string `json:"operation"` +} + +type BindDetails struct { + AppGUID string `json:"app_guid"` + PlanID string `json:"plan_id"` + ServiceID string `json:"service_id"` + BindResource *BindResource `json:"bind_resource,omitempty"` + RawContext json.RawMessage `json:"context,omitempty"` + RawParameters json.RawMessage `json:"parameters,omitempty"` +} + +type BindResource struct { + AppGuid string `json:"app_guid,omitempty"` + SpaceGuid string `json:"space_guid,omitempty"` + Route string `json:"route,omitempty"` + CredentialClientID string `json:"credential_client_id,omitempty"` + BackupAgent bool `json:"backup_agent,omitempty"` +} + +type UnbindDetails struct { + PlanID string `json:"plan_id"` + ServiceID string `json:"service_id"` +} + +type UnbindSpec struct { + IsAsync bool + OperationData string +} + +type Binding struct { + IsAsync bool `json:"is_async"` + AlreadyExists bool `json:"already_exists"` + OperationData string `json:"operation_data"` + Credentials interface{} `json:"credentials"` + SyslogDrainURL string `json:"syslog_drain_url"` + RouteServiceURL string `json:"route_service_url"` + BackupAgentURL string `json:"backup_agent_url,omitempty"` + VolumeMounts []VolumeMount `json:"volume_mounts"` +} + +type GetBindingSpec struct { + Credentials interface{} + SyslogDrainURL string + RouteServiceURL string + VolumeMounts []VolumeMount + Parameters interface{} +} + +func (d ProvisionDetails) GetRawContext() json.RawMessage { + return d.RawContext +} + +func (d ProvisionDetails) GetRawParameters() json.RawMessage { + return d.RawParameters +} + +func (d BindDetails) GetRawContext() json.RawMessage { + return d.RawContext +} + +func (d BindDetails) GetRawParameters() json.RawMessage { + return d.RawParameters +} + +func (m InstanceMetadata) IsEmpty() bool { + return len(m.Attributes) == 0 && len(m.Labels) == 0 +} + +func (d UpdateDetails) GetRawContext() json.RawMessage { + return d.RawContext +} + +func (d UpdateDetails) GetRawParameters() json.RawMessage { + return d.RawParameters +} + +type DetailsWithRawParameters interface { + GetRawParameters() json.RawMessage +} + +type DetailsWithRawContext interface { + GetRawContext() json.RawMessage +} diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_catalog.go b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_catalog.go new file mode 100644 index 000000000..fc02cb223 --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_catalog.go @@ -0,0 +1,76 @@ +package domain + +const ( + PermissionRouteForwarding = RequiredPermission("route_forwarding") + PermissionSyslogDrain = RequiredPermission("syslog_drain") + PermissionVolumeMount = RequiredPermission("volume_mount") + + additionalMetadataName = "AdditionalMetadata" +) + +type Service struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + Bindable bool `json:"bindable"` + InstancesRetrievable bool `json:"instances_retrievable,omitempty"` + BindingsRetrievable bool `json:"bindings_retrievable,omitempty"` + Tags []string `json:"tags,omitempty"` + PlanUpdatable bool `json:"plan_updateable"` + Plans []ServicePlan `json:"plans"` + Requires []RequiredPermission `json:"requires,omitempty"` + Metadata *ServiceMetadata `json:"metadata,omitempty"` + DashboardClient *ServiceDashboardClient `json:"dashboard_client,omitempty"` + AllowContextUpdates bool `json:"allow_context_updates,omitempty"` +} + +type ServicePlan struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + Free *bool `json:"free,omitempty"` + Bindable *bool `json:"bindable,omitempty"` + Metadata *ServicePlanMetadata `json:"metadata,omitempty"` + Schemas *ServiceSchemas `json:"schemas,omitempty"` + PlanUpdatable *bool `json:"plan_updateable,omitempty"` + MaximumPollingDuration *int `json:"maximum_polling_duration,omitempty"` + MaintenanceInfo *MaintenanceInfo `json:"maintenance_info,omitempty"` +} + +type ServiceSchemas struct { + Instance ServiceInstanceSchema `json:"service_instance,omitempty"` + Binding ServiceBindingSchema `json:"service_binding,omitempty"` +} + +type ServiceInstanceSchema struct { + Create Schema `json:"create,omitempty"` + Update Schema `json:"update,omitempty"` +} + +type ServiceBindingSchema struct { + Create Schema `json:"create,omitempty"` +} + +type Schema struct { + Parameters map[string]interface{} `json:"parameters"` +} + +type RequiredPermission string + +func FreeValue(v bool) *bool { + return &v +} + +func BindableValue(v bool) *bool { + return &v +} + +func PlanUpdatableValue(v bool) *bool { + return &v +} + +type ServiceDashboardClient struct { + ID string `json:"id"` + Secret string `json:"secret"` + RedirectURI string `json:"redirect_uri"` +} diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_metadata.go b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_metadata.go new file mode 100644 index 000000000..926aae23d --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_metadata.go @@ -0,0 +1,62 @@ +package domain + +import ( + "encoding/json" + "reflect" + + "github.com/pkg/errors" +) + +type ServiceMetadata struct { + DisplayName string `json:"displayName,omitempty"` + ImageUrl string `json:"imageUrl,omitempty"` + LongDescription string `json:"longDescription,omitempty"` + ProviderDisplayName string `json:"providerDisplayName,omitempty"` + DocumentationUrl string `json:"documentationUrl,omitempty"` + SupportUrl string `json:"supportUrl,omitempty"` + Shareable *bool `json:"shareable,omitempty"` + AdditionalMetadata map[string]interface{} +} + +func (sm ServiceMetadata) MarshalJSON() ([]byte, error) { + type Alias ServiceMetadata + + b, err := json.Marshal(Alias(sm)) + if err != nil { + return []byte{}, errors.Wrap(err, "unmarshallable content in AdditionalMetadata") + } + + var m map[string]interface{} + json.Unmarshal(b, &m) + delete(m, additionalMetadataName) + + for k, v := range sm.AdditionalMetadata { + m[k] = v + } + return json.Marshal(m) +} + +func (sm *ServiceMetadata) UnmarshalJSON(data []byte) error { + type Alias ServiceMetadata + + if err := json.Unmarshal(data, (*Alias)(sm)); err != nil { + return err + } + + additionalMetadata := map[string]interface{}{} + if err := json.Unmarshal(data, &additionalMetadata); err != nil { + return err + } + + for _, jsonName := range GetJsonNames(reflect.ValueOf(sm).Elem()) { + if jsonName == additionalMetadataName { + continue + } + delete(additionalMetadata, jsonName) + } + + if len(additionalMetadata) > 0 { + sm.AdditionalMetadata = additionalMetadata + } + return nil +} diff --git a/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_plan_metadata.go b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_plan_metadata.go new file mode 100644 index 000000000..fbb329d82 --- /dev/null +++ b/vendor/github.com/pivotal-cf/brokerapi/v11/domain/service_plan_metadata.go @@ -0,0 +1,83 @@ +package domain + +import ( + "encoding/json" + "reflect" + "strings" + + "github.com/pkg/errors" +) + +type ServicePlanMetadata struct { + DisplayName string `json:"displayName,omitempty"` + Bullets []string `json:"bullets,omitempty"` + Costs []ServicePlanCost `json:"costs,omitempty"` + AdditionalMetadata map[string]interface{} +} + +type ServicePlanCost struct { + Amount map[string]float64 `json:"amount"` + Unit string `json:"unit"` +} + +func (spm *ServicePlanMetadata) UnmarshalJSON(data []byte) error { + type Alias ServicePlanMetadata + + if err := json.Unmarshal(data, (*Alias)(spm)); err != nil { + return err + } + + additionalMetadata := map[string]interface{}{} + if err := json.Unmarshal(data, &additionalMetadata); err != nil { + return err + } + + s := reflect.ValueOf(spm).Elem() + for _, jsonName := range GetJsonNames(s) { + if jsonName == additionalMetadataName { + continue + } + delete(additionalMetadata, jsonName) + } + + if len(additionalMetadata) > 0 { + spm.AdditionalMetadata = additionalMetadata + } + return nil +} + +func (spm ServicePlanMetadata) MarshalJSON() ([]byte, error) { + type Alias ServicePlanMetadata + + b, err := json.Marshal(Alias(spm)) + if err != nil { + return []byte{}, errors.Wrap(err, "unmarshallable content in AdditionalMetadata") + } + + var m map[string]interface{} + json.Unmarshal(b, &m) + delete(m, additionalMetadataName) + + for k, v := range spm.AdditionalMetadata { + m[k] = v + } + + return json.Marshal(m) +} + +func GetJsonNames(s reflect.Value) (res []string) { + valType := s.Type() + for i := 0; i < s.NumField(); i++ { + field := valType.Field(i) + tag := field.Tag + jsonVal := tag.Get("json") + if jsonVal != "" { + components := strings.Split(jsonVal, ",") + jsonName := components[0] + res = append(res, jsonName) + } else { + res = append(res, field.Name) + } + } + return res +} diff --git a/vendor/github.com/pivotal-cf/on-demand-services-sdk/serviceadapter/domain.go b/vendor/github.com/pivotal-cf/on-demand-services-sdk/serviceadapter/domain.go index b1808f59f..1657f5552 100644 --- a/vendor/github.com/pivotal-cf/on-demand-services-sdk/serviceadapter/domain.go +++ b/vendor/github.com/pivotal-cf/on-demand-services-sdk/serviceadapter/domain.go @@ -23,7 +23,7 @@ import ( "io" "github.com/go-playground/validator/v10" - "github.com/pivotal-cf/brokerapi/v10/domain" + "github.com/pivotal-cf/brokerapi/v11/domain" "github.com/pivotal-cf/on-demand-services-sdk/bosh" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index d28dd392a..6c05041f0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -62,7 +62,7 @@ github.com/gabriel-vasile/mimetype github.com/gabriel-vasile/mimetype/internal/charset github.com/gabriel-vasile/mimetype/internal/json github.com/gabriel-vasile/mimetype/internal/magic -# github.com/go-chi/chi/v5 v5.0.11 +# github.com/go-chi/chi/v5 v5.0.12 ## explicit; go 1.14 github.com/go-chi/chi/v5 # github.com/go-logr/logr v1.4.1 @@ -170,8 +170,11 @@ github.com/pivotal-cf/brokerapi/v10/domain/apiresponses github.com/pivotal-cf/brokerapi/v10/handlers github.com/pivotal-cf/brokerapi/v10/middlewares github.com/pivotal-cf/brokerapi/v10/utils -# github.com/pivotal-cf/on-demand-services-sdk v0.45.4 -## explicit; go 1.20 +# github.com/pivotal-cf/brokerapi/v11 v11.0.0 +## explicit; go 1.21 +github.com/pivotal-cf/brokerapi/v11/domain +# github.com/pivotal-cf/on-demand-services-sdk v0.45.5-0.20240412212149-512df882a3a1 +## explicit; go 1.21 github.com/pivotal-cf/on-demand-services-sdk/bosh github.com/pivotal-cf/on-demand-services-sdk/serviceadapter # github.com/pivotal-cf/paraphernalia v0.0.0-20180203224945-a64ae2051c20