diff --git a/.licenses/go/github.com/antihax/optional.dep.yml b/.licenses/go/github.com/antihax/optional.dep.yml deleted file mode 100644 index fd41710c..00000000 --- a/.licenses/go/github.com/antihax/optional.dep.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -name: github.com/antihax/optional -version: v1.0.0 -type: go -summary: -homepage: https://pkg.go.dev/github.com/antihax/optional -license: mit -licenses: -- sources: LICENSE - text: | - The MIT License (MIT) - Copyright (c) 2016 Adam Hintz - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -notices: [] diff --git a/.licenses/go/github.com/arduino/iot-client-go.dep.yml b/.licenses/go/github.com/arduino/iot-client-go/v2.dep.yml similarity index 85% rename from .licenses/go/github.com/arduino/iot-client-go.dep.yml rename to .licenses/go/github.com/arduino/iot-client-go/v2.dep.yml index ae869df4..ed76f3c6 100644 --- a/.licenses/go/github.com/arduino/iot-client-go.dep.yml +++ b/.licenses/go/github.com/arduino/iot-client-go/v2.dep.yml @@ -1,9 +1,9 @@ --- -name: github.com/arduino/iot-client-go -version: v1.4.4 +name: github.com/arduino/iot-client-go/v2 +version: v2.0.2 type: go summary: -homepage: https://pkg.go.dev/github.com/arduino/iot-client-go +homepage: https://pkg.go.dev/github.com/arduino/iot-client-go/v2 license: apache-2.0 licenses: - sources: LICENSE diff --git a/.licenses/go/github.com/golang/protobuf/jsonpb.dep.yml b/.licenses/go/github.com/golang/protobuf/jsonpb.dep.yml index f31bd044..9bbd6dcb 100644 --- a/.licenses/go/github.com/golang/protobuf/jsonpb.dep.yml +++ b/.licenses/go/github.com/golang/protobuf/jsonpb.dep.yml @@ -1,13 +1,13 @@ --- name: github.com/golang/protobuf/jsonpb -version: v1.5.3 +version: v1.5.4 type: go summary: Package jsonpb provides functionality to marshal and unmarshal between a protocol buffer message and JSON. homepage: https://pkg.go.dev/github.com/golang/protobuf/jsonpb license: bsd-3-clause licenses: -- sources: protobuf@v1.5.3/LICENSE +- sources: protobuf@v1.5.4/LICENSE text: |+ Copyright 2010 The Go Authors. All rights reserved. @@ -38,4 +38,3 @@ licenses: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. notices: [] -... diff --git a/.licenses/go/github.com/golang/protobuf/proto.dep.yml b/.licenses/go/github.com/golang/protobuf/proto.dep.yml index cec24b9a..e8fc9149 100644 --- a/.licenses/go/github.com/golang/protobuf/proto.dep.yml +++ b/.licenses/go/github.com/golang/protobuf/proto.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/golang/protobuf/proto -version: v1.5.3 +version: v1.5.4 type: go summary: Package proto provides functionality for handling protocol buffer messages. homepage: https://pkg.go.dev/github.com/golang/protobuf/proto license: bsd-3-clause licenses: -- sources: protobuf@v1.5.3/LICENSE +- sources: protobuf@v1.5.4/LICENSE text: |+ Copyright 2010 The Go Authors. All rights reserved. @@ -37,4 +37,3 @@ licenses: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. notices: [] -... diff --git a/.licenses/go/github.com/golang/protobuf/ptypes.dep.yml b/.licenses/go/github.com/golang/protobuf/ptypes.dep.yml index 61048e01..774b077c 100644 --- a/.licenses/go/github.com/golang/protobuf/ptypes.dep.yml +++ b/.licenses/go/github.com/golang/protobuf/ptypes.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/golang/protobuf/ptypes -version: v1.5.3 +version: v1.5.4 type: go summary: Package ptypes provides functionality for interacting with well-known types. homepage: https://pkg.go.dev/github.com/golang/protobuf/ptypes license: bsd-3-clause licenses: -- sources: protobuf@v1.5.3/LICENSE +- sources: protobuf@v1.5.4/LICENSE text: |+ Copyright 2010 The Go Authors. All rights reserved. @@ -37,4 +37,3 @@ licenses: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. notices: [] -... diff --git a/.licenses/go/github.com/golang/protobuf/ptypes/any.dep.yml b/.licenses/go/github.com/golang/protobuf/ptypes/any.dep.yml index e964341f..9bb63a9b 100644 --- a/.licenses/go/github.com/golang/protobuf/ptypes/any.dep.yml +++ b/.licenses/go/github.com/golang/protobuf/ptypes/any.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/golang/protobuf/ptypes/any -version: v1.5.3 +version: v1.5.4 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/golang/protobuf/ptypes/any license: bsd-3-clause licenses: -- sources: protobuf@v1.5.3/LICENSE +- sources: protobuf@v1.5.4/LICENSE text: |+ Copyright 2010 The Go Authors. All rights reserved. @@ -37,4 +37,3 @@ licenses: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. notices: [] -... diff --git a/.licenses/go/github.com/golang/protobuf/ptypes/duration.dep.yml b/.licenses/go/github.com/golang/protobuf/ptypes/duration.dep.yml index a2afe63a..b443330f 100644 --- a/.licenses/go/github.com/golang/protobuf/ptypes/duration.dep.yml +++ b/.licenses/go/github.com/golang/protobuf/ptypes/duration.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/golang/protobuf/ptypes/duration -version: v1.5.3 +version: v1.5.4 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/golang/protobuf/ptypes/duration license: bsd-3-clause licenses: -- sources: protobuf@v1.5.3/LICENSE +- sources: protobuf@v1.5.4/LICENSE text: |+ Copyright 2010 The Go Authors. All rights reserved. @@ -37,4 +37,3 @@ licenses: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. notices: [] -... diff --git a/.licenses/go/github.com/golang/protobuf/ptypes/timestamp.dep.yml b/.licenses/go/github.com/golang/protobuf/ptypes/timestamp.dep.yml index 0eaf03df..f7c119e7 100644 --- a/.licenses/go/github.com/golang/protobuf/ptypes/timestamp.dep.yml +++ b/.licenses/go/github.com/golang/protobuf/ptypes/timestamp.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/golang/protobuf/ptypes/timestamp -version: v1.5.3 +version: v1.5.4 type: go -summary: +summary: homepage: https://pkg.go.dev/github.com/golang/protobuf/ptypes/timestamp license: bsd-3-clause licenses: -- sources: protobuf@v1.5.3/LICENSE +- sources: protobuf@v1.5.4/LICENSE text: |+ Copyright 2010 The Go Authors. All rights reserved. @@ -37,4 +37,3 @@ licenses: OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. notices: [] -... diff --git a/.licenses/go/golang.org/x/oauth2.dep.yml b/.licenses/go/golang.org/x/oauth2.dep.yml index fb3a4ba5..7be49c5b 100644 --- a/.licenses/go/golang.org/x/oauth2.dep.yml +++ b/.licenses/go/golang.org/x/oauth2.dep.yml @@ -1,6 +1,6 @@ --- name: golang.org/x/oauth2 -version: v0.14.0 +version: v0.21.0 type: go summary: Package oauth2 provides support for making OAuth2 authorized and authenticated HTTP requests, as specified in RFC 6749. diff --git a/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml b/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml index 15c89b78..f5cc2b56 100644 --- a/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml +++ b/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/oauth2/clientcredentials -version: v0.14.0 +version: v0.21.0 type: go summary: Package clientcredentials implements the OAuth2.0 "client credentials" token flow, also known as the "two-legged OAuth 2.0". homepage: https://pkg.go.dev/golang.org/x/oauth2/clientcredentials license: bsd-3-clause licenses: -- sources: oauth2@v0.14.0/LICENSE +- sources: oauth2@v0.21.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. diff --git a/.licenses/go/golang.org/x/oauth2/internal.dep.yml b/.licenses/go/golang.org/x/oauth2/internal.dep.yml index 06346c35..4d1daff8 100644 --- a/.licenses/go/golang.org/x/oauth2/internal.dep.yml +++ b/.licenses/go/golang.org/x/oauth2/internal.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/oauth2/internal -version: v0.14.0 +version: v0.21.0 type: go summary: Package internal contains support packages for oauth2 package. homepage: https://pkg.go.dev/golang.org/x/oauth2/internal license: bsd-3-clause licenses: -- sources: oauth2@v0.14.0/LICENSE +- sources: oauth2@v0.21.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. diff --git a/.licenses/go/google.golang.org/protobuf/encoding/protojson.dep.yml b/.licenses/go/google.golang.org/protobuf/encoding/protojson.dep.yml index 86cc6294..a4a3cd8a 100644 --- a/.licenses/go/google.golang.org/protobuf/encoding/protojson.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/encoding/protojson.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/encoding/protojson -version: v1.32.0 +version: v1.34.2 type: go summary: Package protojson marshals and unmarshals protocol buffer messages as JSON format. homepage: https://pkg.go.dev/google.golang.org/protobuf/encoding/protojson license: other licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/encoding/prototext.dep.yml b/.licenses/go/google.golang.org/protobuf/encoding/prototext.dep.yml index b291d739..3f009bc9 100644 --- a/.licenses/go/google.golang.org/protobuf/encoding/prototext.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/encoding/prototext.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/encoding/prototext -version: v1.32.0 +version: v1.34.2 type: go summary: Package prototext marshals and unmarshals protocol buffer messages as the textproto format. homepage: https://pkg.go.dev/google.golang.org/protobuf/encoding/prototext license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/encoding/protowire.dep.yml b/.licenses/go/google.golang.org/protobuf/encoding/protowire.dep.yml index 893bb78d..efd306fa 100644 --- a/.licenses/go/google.golang.org/protobuf/encoding/protowire.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/encoding/protowire.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/encoding/protowire -version: v1.32.0 +version: v1.34.2 type: go summary: Package protowire parses and formats the raw wire encoding. homepage: https://pkg.go.dev/google.golang.org/protobuf/encoding/protowire license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/descfmt.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/descfmt.dep.yml index b50a32e1..d062bbc7 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/descfmt.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/descfmt.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/descfmt -version: v1.32.0 +version: v1.34.2 type: go summary: Package descfmt provides functionality to format descriptors. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/descfmt license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/descopts.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/descopts.dep.yml index d05b2994..0cfeb15b 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/descopts.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/descopts.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/descopts -version: v1.32.0 +version: v1.34.2 type: go summary: Package descopts contains the nil pointers to concrete descriptor options. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/descopts license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/detrand.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/detrand.dep.yml index 8a8e4027..eb5cf0f4 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/detrand.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/detrand.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/detrand -version: v1.32.0 +version: v1.34.2 type: go summary: Package detrand provides deterministically random functionality. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/detrand license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/editiondefaults.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/editiondefaults.dep.yml new file mode 100644 index 00000000..d7fe6050 --- /dev/null +++ b/.licenses/go/google.golang.org/protobuf/internal/editiondefaults.dep.yml @@ -0,0 +1,63 @@ +--- +name: google.golang.org/protobuf/internal/editiondefaults +version: v1.34.2 +type: go +summary: Package editiondefaults contains the binary representation of the editions + defaults. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/editiondefaults +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.2/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.2/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google 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, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/go/google.golang.org/protobuf/internal/editionssupport.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/editionssupport.dep.yml new file mode 100644 index 00000000..dcd28b8d --- /dev/null +++ b/.licenses/go/google.golang.org/protobuf/internal/editionssupport.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/internal/editionssupport +version: v1.34.2 +type: go +summary: Package editionssupport defines constants for editions that are supported. +homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/editionssupport +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.2/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.2/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google 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, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/go/google.golang.org/protobuf/internal/encoding/defval.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/encoding/defval.dep.yml index 3f5fa0aa..f8c57aec 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/encoding/defval.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/encoding/defval.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/encoding/defval -version: v1.32.0 +version: v1.34.2 type: go summary: Package defval marshals and unmarshals textual forms of default values. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/encoding/defval license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/encoding/json.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/encoding/json.dep.yml index 9b24c44a..aebd0e4d 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/encoding/json.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/encoding/json.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/encoding/json -version: v1.32.0 +version: v1.34.2 type: go -summary: +summary: homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/encoding/json license: other licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml index 8a167b8a..de1ead0f 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/encoding/messageset.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/encoding/messageset -version: v1.32.0 +version: v1.34.2 type: go summary: Package messageset encodes and decodes the obsolete MessageSet wire format. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/encoding/messageset license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/encoding/tag.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/encoding/tag.dep.yml index 4285175c..cec632cd 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/encoding/tag.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/encoding/tag.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/internal/encoding/tag -version: v1.32.0 +version: v1.34.2 type: go summary: Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/encoding/tag license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/encoding/text.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/encoding/text.dep.yml index 1f1e6102..a5a5fe70 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/encoding/text.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/encoding/text.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/encoding/text -version: v1.32.0 +version: v1.34.2 type: go summary: Package text implements the text format for protocol buffers. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/encoding/text license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/errors.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/errors.dep.yml index 6aa38301..f8fac1a1 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/errors.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/errors.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/errors -version: v1.32.0 +version: v1.34.2 type: go summary: Package errors implements functions to manipulate errors. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/errors license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/filedesc.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/filedesc.dep.yml index d5a13a20..7bd85fc8 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/filedesc.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/filedesc.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/filedesc -version: v1.32.0 +version: v1.34.2 type: go summary: Package filedesc provides functionality for constructing descriptors. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/filedesc license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/filetype.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/filetype.dep.yml index 5ff68c1f..121eef33 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/filetype.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/filetype.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/internal/filetype -version: v1.32.0 +version: v1.34.2 type: go summary: Package filetype provides functionality for wrapping descriptors with Go type information. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/filetype license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/flags.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/flags.dep.yml index 4b9ed00f..07486178 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/flags.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/flags.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/flags -version: v1.32.0 +version: v1.34.2 type: go summary: Package flags provides a set of flags controlled by build tags. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/flags license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/genid.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/genid.dep.yml index 6c5e5e9b..41bc8146 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/genid.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/genid.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/internal/genid -version: v1.32.0 +version: v1.34.2 type: go summary: Package genid contains constants for declarations in descriptor.proto and the well-known types. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/genid license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/impl.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/impl.dep.yml index f6134647..b00e8269 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/impl.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/impl.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/impl -version: v1.32.0 +version: v1.34.2 type: go -summary: +summary: homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/impl license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/order.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/order.dep.yml index 82fc654d..f3a12858 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/order.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/order.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/order -version: v1.32.0 +version: v1.34.2 type: go summary: Package order provides ordered access to messages and maps. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/order license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/pragma.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/pragma.dep.yml index a433d6da..258bb73b 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/pragma.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/pragma.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/internal/pragma -version: v1.32.0 +version: v1.34.2 type: go summary: Package pragma provides types that can be embedded into a struct to statically enforce or prevent certain language properties. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/pragma license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/set.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/set.dep.yml index d6e02e54..795d843b 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/set.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/set.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/set -version: v1.32.0 +version: v1.34.2 type: go summary: Package set provides simple set data structures for uint64s. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/set license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/strs.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/strs.dep.yml index d8737a57..aa357fc0 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/strs.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/strs.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/strs -version: v1.32.0 +version: v1.34.2 type: go summary: Package strs provides string manipulation functionality specific to protobuf. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/strs license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/internal/version.dep.yml b/.licenses/go/google.golang.org/protobuf/internal/version.dep.yml index af54a63a..664f1909 100644 --- a/.licenses/go/google.golang.org/protobuf/internal/version.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/internal/version.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/internal/version -version: v1.32.0 +version: v1.34.2 type: go summary: Package version records versioning information about this module. homepage: https://pkg.go.dev/google.golang.org/protobuf/internal/version license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/proto.dep.yml b/.licenses/go/google.golang.org/protobuf/proto.dep.yml index b62bb6ab..4b37df11 100644 --- a/.licenses/go/google.golang.org/protobuf/proto.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/proto.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/proto -version: v1.32.0 +version: v1.34.2 type: go summary: Package proto provides functions operating on protocol buffer messages. homepage: https://pkg.go.dev/google.golang.org/protobuf/proto license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/reflect/protodesc.dep.yml b/.licenses/go/google.golang.org/protobuf/reflect/protodesc.dep.yml index 254023d3..eb89fd65 100644 --- a/.licenses/go/google.golang.org/protobuf/reflect/protodesc.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/reflect/protodesc.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/reflect/protodesc -version: v1.32.0 +version: v1.34.2 type: go summary: Package protodesc provides functionality for converting FileDescriptorProto messages to/from [protoreflect.FileDescriptor] values. homepage: https://pkg.go.dev/google.golang.org/protobuf/reflect/protodesc license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml b/.licenses/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml index 0f835606..104d1f33 100644 --- a/.licenses/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/reflect/protoreflect.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/reflect/protoreflect -version: v1.32.0 +version: v1.34.2 type: go summary: Package protoreflect provides interfaces to dynamically manipulate messages. homepage: https://pkg.go.dev/google.golang.org/protobuf/reflect/protoreflect license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml b/.licenses/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml index d65478d4..861ea2a3 100644 --- a/.licenses/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/reflect/protoregistry.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/reflect/protoregistry -version: v1.32.0 +version: v1.34.2 type: go summary: Package protoregistry provides data structures to register and lookup protobuf descriptor types. homepage: https://pkg.go.dev/google.golang.org/protobuf/reflect/protoregistry license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/runtime/protoiface.dep.yml b/.licenses/go/google.golang.org/protobuf/runtime/protoiface.dep.yml index 1d019473..0d2f7a83 100644 --- a/.licenses/go/google.golang.org/protobuf/runtime/protoiface.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/runtime/protoiface.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/runtime/protoiface -version: v1.32.0 +version: v1.34.2 type: go summary: Package protoiface contains types referenced or implemented by messages. homepage: https://pkg.go.dev/google.golang.org/protobuf/runtime/protoiface license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/runtime/protoimpl.dep.yml b/.licenses/go/google.golang.org/protobuf/runtime/protoimpl.dep.yml index ab4d7329..9574d512 100644 --- a/.licenses/go/google.golang.org/protobuf/runtime/protoimpl.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/runtime/protoimpl.dep.yml @@ -1,13 +1,13 @@ --- name: google.golang.org/protobuf/runtime/protoimpl -version: v1.32.0 +version: v1.34.2 type: go summary: Package protoimpl contains the default implementation for messages generated by protoc-gen-go. homepage: https://pkg.go.dev/google.golang.org/protobuf/runtime/protoimpl license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -36,7 +36,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/types/descriptorpb.dep.yml b/.licenses/go/google.golang.org/protobuf/types/descriptorpb.dep.yml index e28d7d6e..56d8aeb4 100644 --- a/.licenses/go/google.golang.org/protobuf/types/descriptorpb.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/types/descriptorpb.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/types/descriptorpb -version: v1.32.0 +version: v1.34.2 type: go -summary: +summary: homepage: https://pkg.go.dev/google.golang.org/protobuf/types/descriptorpb license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/types/gofeaturespb.dep.yml b/.licenses/go/google.golang.org/protobuf/types/gofeaturespb.dep.yml new file mode 100644 index 00000000..e4dceaf4 --- /dev/null +++ b/.licenses/go/google.golang.org/protobuf/types/gofeaturespb.dep.yml @@ -0,0 +1,62 @@ +--- +name: google.golang.org/protobuf/types/gofeaturespb +version: v1.34.2 +type: go +summary: +homepage: https://pkg.go.dev/google.golang.org/protobuf/types/gofeaturespb +license: bsd-3-clause +licenses: +- sources: protobuf@v1.34.2/LICENSE + text: | + Copyright (c) 2018 The Go Authors. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +- sources: protobuf@v1.34.2/PATENTS + text: | + Additional IP Rights Grant (Patents) + + "This implementation" means the copyrightable works distributed by + Google as part of the Go project. + + Google 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, + transfer and otherwise run, modify and propagate the contents of this + implementation of Go, where such license applies only to those patent + claims, both currently owned or controlled by Google and acquired in + the future, licensable by Google that are necessarily infringed by this + implementation of Go. This grant does not include claims that would be + infringed only as a consequence of further modification of this + implementation. If you or your agent or exclusive licensee institute or + order or agree to the institution of patent litigation against any + entity (including a cross-claim or counterclaim in a lawsuit) alleging + that this implementation of Go or any code incorporated within this + implementation of Go constitutes direct or contributory patent + infringement, or inducement of patent infringement, then any patent + rights granted to you under this License for this implementation of Go + shall terminate as of the date such litigation is filed. +notices: [] diff --git a/.licenses/go/google.golang.org/protobuf/types/known/anypb.dep.yml b/.licenses/go/google.golang.org/protobuf/types/known/anypb.dep.yml index 96a2e4d6..b9c5ae4b 100644 --- a/.licenses/go/google.golang.org/protobuf/types/known/anypb.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/types/known/anypb.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/types/known/anypb -version: v1.32.0 +version: v1.34.2 type: go summary: Package anypb contains generated types for google/protobuf/any.proto. homepage: https://pkg.go.dev/google.golang.org/protobuf/types/known/anypb license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/types/known/durationpb.dep.yml b/.licenses/go/google.golang.org/protobuf/types/known/durationpb.dep.yml index 94ba0200..03140396 100644 --- a/.licenses/go/google.golang.org/protobuf/types/known/durationpb.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/types/known/durationpb.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/types/known/durationpb -version: v1.32.0 +version: v1.34.2 type: go summary: Package durationpb contains generated types for google/protobuf/duration.proto. homepage: https://pkg.go.dev/google.golang.org/protobuf/types/known/durationpb license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/types/known/timestamppb.dep.yml b/.licenses/go/google.golang.org/protobuf/types/known/timestamppb.dep.yml index d006164a..c896d5ec 100644 --- a/.licenses/go/google.golang.org/protobuf/types/known/timestamppb.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/types/known/timestamppb.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/types/known/timestamppb -version: v1.32.0 +version: v1.34.2 type: go summary: Package timestamppb contains generated types for google/protobuf/timestamp.proto. homepage: https://pkg.go.dev/google.golang.org/protobuf/types/known/timestamppb license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/google.golang.org/protobuf/types/known/wrapperspb.dep.yml b/.licenses/go/google.golang.org/protobuf/types/known/wrapperspb.dep.yml index 8709d6b6..8177dc8d 100644 --- a/.licenses/go/google.golang.org/protobuf/types/known/wrapperspb.dep.yml +++ b/.licenses/go/google.golang.org/protobuf/types/known/wrapperspb.dep.yml @@ -1,12 +1,12 @@ --- name: google.golang.org/protobuf/types/known/wrapperspb -version: v1.32.0 +version: v1.34.2 type: go -summary: +summary: homepage: https://pkg.go.dev/google.golang.org/protobuf/types/known/wrapperspb license: bsd-3-clause licenses: -- sources: protobuf@v1.32.0/LICENSE +- sources: protobuf@v1.34.2/LICENSE text: | Copyright (c) 2018 The Go Authors. All rights reserved. @@ -35,7 +35,7 @@ licenses: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: protobuf@v1.32.0/PATENTS +- sources: protobuf@v1.34.2/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/cli/device/list.go b/cli/device/list.go index a853dfc7..d7799a0d 100644 --- a/cli/device/list.go +++ b/cli/device/list.go @@ -92,7 +92,7 @@ func (r listResult) String() string { return "No devices found." } t := table.New() - t.SetHeader("Name", "ID", "Board", "FQBN", "SerialNumber", "Tags") + t.SetHeader("Name", "ID", "Board", "FQBN", "SerialNumber", "Status", "Tags") for _, device := range r.devices { t.AddRow( device.Name, @@ -100,8 +100,16 @@ func (r listResult) String() string { device.Board, device.FQBN, device.Serial, + dereferenceString(device.Status), strings.Join(device.Tags, ","), ) } return t.Render() } + +func dereferenceString(s *string) string { + if s == nil { + return "" + } + return *s +} diff --git a/command/dashboard/create.go b/command/dashboard/create.go index 0aab64cb..2fc78620 100644 --- a/command/dashboard/create.go +++ b/command/dashboard/create.go @@ -47,10 +47,10 @@ func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) // Name passed as parameter has priority over name from template if params.Name != nil { - dashboard.Name = *params.Name + dashboard.Name = params.Name } // If name is not specified in the template, it should be passed as parameter - if dashboard.Name == "" { + if dashboard.Name == nil || *dashboard.Name == "" { return nil, errors.New("dashboard name not specified") } diff --git a/command/dashboard/dashboard.go b/command/dashboard/dashboard.go index b1da267b..431fb6b4 100644 --- a/command/dashboard/dashboard.go +++ b/command/dashboard/dashboard.go @@ -18,7 +18,7 @@ package dashboard import ( - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" ) // DashboardInfo contains the most interesting @@ -33,7 +33,9 @@ type DashboardInfo struct { func getDashboardInfo(dashboard *iotclient.ArduinoDashboardv2) *DashboardInfo { var widgets []string for _, w := range dashboard.Widgets { - widgets = append(widgets, w.Name) + if w.Name != nil { + widgets = append(widgets, *w.Name) + } } info := &DashboardInfo{ Name: dashboard.Name, diff --git a/command/device/create.go b/command/device/create.go index 33d5cd30..cabc9996 100644 --- a/command/device/create.go +++ b/command/device/create.go @@ -100,7 +100,14 @@ func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) ID: dev.Id, Board: dev.Type, Serial: dev.Serial, - FQBN: dev.Fqbn, + FQBN: dereferenceString(dev.Fqbn), } return devInfo, nil } + +func dereferenceString(s *string) string { + if s == nil { + return "" + } + return *s +} diff --git a/command/device/creategeneric.go b/command/device/creategeneric.go index f0ebbe0b..fa34dcea 100644 --- a/command/device/creategeneric.go +++ b/command/device/creategeneric.go @@ -75,9 +75,9 @@ func CreateGeneric(ctx context.Context, params *CreateGenericParams, cred *confi ID: dev.Id, Board: dev.Type, Serial: dev.Serial, - FQBN: dev.Fqbn, + FQBN: dereferenceString(dev.Fqbn), }, - Password: pass.SuggestedPassword, + Password: dereferenceString(pass.SuggestedPassword), } return devInfo, nil } diff --git a/command/device/createlora.go b/command/device/createlora.go index 821d5018..06542bad 100644 --- a/command/device/createlora.go +++ b/command/device/createlora.go @@ -26,7 +26,7 @@ import ( "github.com/arduino/arduino-cloud-cli/arduino/cli" "github.com/arduino/arduino-cloud-cli/config" "github.com/arduino/arduino-cloud-cli/internal/iot" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "github.com/sirupsen/logrus" "go.bug.st/serial" ) @@ -181,7 +181,7 @@ func getDeviceLoraInfo(ctx context.Context, iotClient *iot.Client, loraDev *iotc ID: dev.Id, Board: dev.Type, Serial: dev.Serial, - FQBN: dev.Fqbn, + FQBN: dereferenceString(dev.Fqbn), }, AppEUI: loraDev.AppEui, AppKey: loraDev.AppKey, diff --git a/command/device/device.go b/command/device/device.go index f965e016..832f1116 100644 --- a/command/device/device.go +++ b/command/device/device.go @@ -19,7 +19,7 @@ package device import ( "github.com/arduino/arduino-cloud-cli/command/tag" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" ) // DeviceInfo contains the most interesting @@ -31,6 +31,7 @@ type DeviceInfo struct { Serial string `json:"serial_number"` FQBN string `json:"fqbn"` Tags []string `json:"tags,omitempty"` + Status *string `json:"status,omitempty"` } func getDeviceInfo(device *iotclient.ArduinoDevicev2) (*DeviceInfo, error) { @@ -45,8 +46,9 @@ func getDeviceInfo(device *iotclient.ArduinoDevicev2) (*DeviceInfo, error) { ID: device.Id, Board: device.Type, Serial: device.Serial, - FQBN: device.Fqbn, + FQBN: dereferenceString(device.Fqbn), Tags: tags, + Status: device.DeviceStatus, } return dev, nil } diff --git a/command/device/provision.go b/command/device/provision.go index 58781a33..2515cb3a 100644 --- a/command/device/provision.go +++ b/command/device/provision.go @@ -29,7 +29,7 @@ import ( "github.com/arduino/arduino-cloud-cli/internal/binary" "github.com/arduino/arduino-cloud-cli/internal/serial" "github.com/arduino/go-paths-helper" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "github.com/sirupsen/logrus" ) @@ -185,7 +185,7 @@ func (p provision) configBoard(ctx context.Context) error { } logrus.Info("Sending certificate authority key") - b, err = hex.DecodeString(cert.AuthorityKeyIdentifier) + b, err = hex.DecodeString(dereferenceString(cert.AuthorityKeyIdentifier)) if err != nil { return fmt.Errorf("decoding certificate authority key id: %w", err) } diff --git a/command/ota/generate.go b/command/ota/generate.go index 2c01051c..50663222 100644 --- a/command/ota/generate.go +++ b/command/ota/generate.go @@ -68,3 +68,10 @@ func Generate(binFile string, outFile string, fqbn string) error { return nil } + +func dereferenceString(s *string) string { + if s == nil { + return "" + } + return *s +} diff --git a/command/ota/massupload.go b/command/ota/massupload.go index 150fe596..1fbffa38 100644 --- a/command/ota/massupload.go +++ b/command/ota/massupload.go @@ -21,16 +21,17 @@ import ( "context" "errors" "fmt" - "github.com/sirupsen/logrus" "os" "path/filepath" + "github.com/sirupsen/logrus" + "github.com/arduino/arduino-cloud-cli/config" "github.com/arduino/arduino-cloud-cli/internal/iot" "github.com/arduino/arduino-cloud-cli/internal/ota" otaapi "github.com/arduino/arduino-cloud-cli/internal/ota-api" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" ) const ( @@ -179,8 +180,8 @@ func validateDevices(ctx context.Context, lister deviceLister, ids []string, fqb continue } // Device FQBN doesn't match the passed one - if found.Fqbn != fqbn { - inv := Result{ID: id, Err: fmt.Errorf("has FQBN '%s' instead of '%s'", found.Fqbn, fqbn)} + if dereferenceString(found.Fqbn) != fqbn { + inv := Result{ID: id, Err: fmt.Errorf("has FQBN '%s' instead of '%s'", dereferenceString(found.Fqbn), fqbn)} invalid = append(invalid, inv) continue } diff --git a/command/ota/massupload_test.go b/command/ota/massupload_test.go index 476fa7c6..981b18e6 100644 --- a/command/ota/massupload_test.go +++ b/command/ota/massupload_test.go @@ -8,7 +8,7 @@ import ( "testing" otaapi "github.com/arduino/arduino-cloud-cli/internal/ota-api" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "github.com/gofrs/uuid" "github.com/stretchr/testify/assert" ) @@ -96,9 +96,9 @@ func TestValidateDevices(t *testing.T) { mockDeviceList := deviceListerTest{ list: []iotclient.ArduinoDevicev2{ - {Id: idCorrect1, Fqbn: correctFQBN}, - {Id: idCorrect2, Fqbn: correctFQBN}, - {Id: idNotValid, Fqbn: wrongFQBN}, + {Id: idCorrect1, Fqbn: &correctFQBN}, + {Id: idCorrect2, Fqbn: &correctFQBN}, + {Id: idNotValid, Fqbn: &wrongFQBN}, }, } diff --git a/command/ota/upload.go b/command/ota/upload.go index a41cf462..f9e7424f 100644 --- a/command/ota/upload.go +++ b/command/ota/upload.go @@ -85,7 +85,7 @@ func Upload(ctx context.Context, params *UploadParams, cred *config.Credentials) otaFile = filepath.Join(otaDir, "temp.ota") defer os.RemoveAll(otaDir) - err = Generate(params.File, otaFile, dev.Fqbn) + err = Generate(params.File, otaFile, dereferenceString(dev.Fqbn)) if err != nil { return fmt.Errorf("%s: %w", "cannot generate .ota file", err) } diff --git a/command/thing/bind.go b/command/thing/bind.go index c21f0961..c6ee8983 100644 --- a/command/thing/bind.go +++ b/command/thing/bind.go @@ -23,7 +23,7 @@ import ( "github.com/arduino/arduino-cloud-cli/config" "github.com/arduino/arduino-cloud-cli/internal/iot" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" ) // BindParams contains the parameters needed to @@ -42,7 +42,7 @@ func Bind(ctx context.Context, params *BindParams, cred *config.Credentials) err } thing := &iotclient.ThingUpdate{ - DeviceId: params.DeviceID, + DeviceId: ¶ms.DeviceID, } err = iotClient.ThingUpdate(ctx, params.ID, thing, true) @@ -52,3 +52,10 @@ func Bind(ctx context.Context, params *BindParams, cred *config.Credentials) err return nil } + +func dereferenceString(s *string) string { + if s == nil { + return "" + } + return *s +} diff --git a/command/thing/clone.go b/command/thing/clone.go index b22e6ae9..e1fec588 100644 --- a/command/thing/clone.go +++ b/command/thing/clone.go @@ -23,7 +23,6 @@ import ( "github.com/arduino/arduino-cloud-cli/config" "github.com/arduino/arduino-cloud-cli/internal/iot" - iotclient "github.com/arduino/iot-client-go" ) // CloneParams contains the parameters needed to clone a thing. @@ -39,16 +38,9 @@ func Clone(ctx context.Context, params *CloneParams, cred *config.Credentials) ( return nil, err } - thing, err := retrieve(ctx, iotClient, params.CloneID) + newThing, err := iotClient.ThingClone(ctx, params.CloneID, params.Name) if err != nil { - return nil, err - } - - thing.Name = params.Name - force := true - newThing, err := iotClient.ThingCreate(ctx, thing, force) - if err != nil { - return nil, err + return nil, fmt.Errorf("cloning thing %s: %w", params.CloneID, err) } t, err := getThingInfo(newThing) @@ -57,30 +49,3 @@ func Clone(ctx context.Context, params *CloneParams, cred *config.Credentials) ( } return t, nil } - -type thingFetcher interface { - ThingShow(ctx context.Context, id string) (*iotclient.ArduinoThing, error) -} - -func retrieve(ctx context.Context, fetcher thingFetcher, thingID string) (*iotclient.ThingCreate, error) { - clone, err := fetcher.ThingShow(ctx, thingID) - if err != nil { - return nil, fmt.Errorf("%s: %w", "retrieving the thing to be cloned", err) - } - - thing := &iotclient.ThingCreate{} - - // Copy variables - for _, p := range clone.Properties { - thing.Properties = append(thing.Properties, iotclient.Property{ - Name: p.Name, - Permission: p.Permission, - UpdateParameter: p.UpdateParameter, - UpdateStrategy: p.UpdateStrategy, - Type: p.Type, - VariableName: p.VariableName, - }) - } - - return thing, nil -} diff --git a/command/thing/create.go b/command/thing/create.go index a0e447be..849d34ef 100644 --- a/command/thing/create.go +++ b/command/thing/create.go @@ -47,10 +47,10 @@ func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) // Name passed as parameter has priority over name from template if params.Name != nil { - thing.Name = *params.Name + thing.Name = params.Name } // If name is not specified in the template, it should be passed as parameter - if thing.Name == "" { + if dereferenceString(thing.Name) == "" { return nil, errors.New("thing name not specified") } diff --git a/command/thing/thing.go b/command/thing/thing.go index 16bc7817..8b10defb 100644 --- a/command/thing/thing.go +++ b/command/thing/thing.go @@ -19,7 +19,7 @@ package thing import ( "github.com/arduino/arduino-cloud-cli/command/tag" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" ) // ThingInfo contains the main parameters of @@ -47,7 +47,7 @@ func getThingInfo(thing *iotclient.ArduinoThing) (*ThingInfo, error) { info := &ThingInfo{ Name: thing.Name, ID: thing.Id, - DeviceID: thing.DeviceId, + DeviceID: dereferenceString(thing.DeviceId), Variables: vars, Tags: tags, } diff --git a/go.mod b/go.mod index 6718765a..f4e84138 100644 --- a/go.mod +++ b/go.mod @@ -3,23 +3,23 @@ module github.com/arduino/arduino-cloud-cli go 1.19 require ( - github.com/antihax/optional v1.0.0 github.com/arduino/arduino-cli v0.0.0-20221116144942-76251df9241a github.com/arduino/go-paths-helper v1.7.0 github.com/arduino/go-win32-utils v1.0.0 - github.com/arduino/iot-client-go v1.4.4 + github.com/arduino/iot-client-go/v2 v2.0.2 github.com/gofrs/uuid v4.2.0+incompatible github.com/google/go-cmp v0.6.0 github.com/howeyc/crc16 v0.0.0-20171223171357-2b2a61e366a6 + github.com/icza/bitio v1.1.0 github.com/manifoldco/promptui v0.9.0 github.com/sirupsen/logrus v1.9.0 github.com/spf13/cobra v1.3.0 github.com/spf13/viper v1.10.1 - github.com/stretchr/testify v1.8.0 + github.com/stretchr/testify v1.9.0 go.bug.st/cleanup v1.0.0 go.bug.st/serial v1.3.3 golang.org/x/crypto v0.18.0 - golang.org/x/oauth2 v0.14.0 + golang.org/x/oauth2 v0.21.0 google.golang.org/grpc v1.61.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools v2.2.0+incompatible @@ -40,10 +40,9 @@ require ( github.com/fluxio/iohelpers v0.0.0-20160419043813-3a4dd67a94d2 // indirect github.com/fluxio/multierror v0.0.0-20160419044231-9c68d39025e5 // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect - github.com/golang/protobuf v1.5.3 // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/h2non/filetype v1.1.3 // indirect github.com/hashicorp/hcl v1.0.0 // indirect - github.com/icza/bitio v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect github.com/josharian/intern v1.0.0 // indirect @@ -71,7 +70,7 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/src-d/gcfg v1.4.0 // indirect - github.com/stretchr/objx v0.4.0 // indirect + github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.2.0 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect go.bug.st/downloader/v2 v2.1.1 // indirect @@ -82,9 +81,8 @@ require ( golang.org/x/sys v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.17.0 // indirect - google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/protobuf v1.32.0 // indirect + google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect gopkg.in/src-d/go-git.v4 v4.13.1 // indirect diff --git a/go.sum b/go.sum index 9759e937..64155a38 100644 --- a/go.sum +++ b/go.sum @@ -61,7 +61,6 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= -github.com/antihax/optional v1.0.0 h1:xK2lYat7ZLaVVcIuj82J8kIro4V6kDe0AUDFboUCwcg= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/arduino/arduino-cli v0.0.0-20221116144942-76251df9241a h1:jbGxP4VJXFXJGYJgA9p5kcJweLNOcaz5tXTgFjaEiRE= github.com/arduino/arduino-cli v0.0.0-20221116144942-76251df9241a/go.mod h1:pIrqM9m4MCRyMUhguneLOkPxvNydFfup8qZqgjIFcTg= @@ -75,8 +74,8 @@ github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkr github.com/arduino/go-properties-orderedmap v1.7.1/go.mod h1:DKjD2VXY/NZmlingh4lSFMEYCVubfeArCsGPGDwb2yk= github.com/arduino/go-win32-utils v1.0.0 h1:/cXB86sOJxOsCHP7sQmXGLkdValwJt56mIwOHYxgQjQ= github.com/arduino/go-win32-utils v1.0.0/go.mod h1:0jqM7doGEAs6DaJCxxhLBUDS5OawrqF48HqXkcEie/Q= -github.com/arduino/iot-client-go v1.4.4 h1:FICCXD5uCZ0scGG6RioOlpZamDqgSD1l/fQlFwKR284= -github.com/arduino/iot-client-go v1.4.4/go.mod h1:gYvpMt7Qw+OSScTLyIlCnpbvy9y96ey/2zhB4w6FoK0= +github.com/arduino/iot-client-go/v2 v2.0.2 h1:5Zh8ZtZ+O8WBlvXvbA8Sla18Fvaw+QdQsz0X7DK4XLU= +github.com/arduino/iot-client-go/v2 v2.0.2/go.mod h1:kwX4B2AVEWl5ug94QbQ087xbvLFa9Co//jhbM/Z2eSQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= @@ -199,8 +198,8 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -287,6 +286,7 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/icza/bitio v1.1.0 h1:ysX4vtldjdi3Ygai5m1cWy4oLkhWTAi+SyO6HC8L9T0= github.com/icza/bitio v1.1.0/go.mod h1:0jGnlLAx8MKMr9VGnn/4YrvZiprkvBelsVIbA9Jjr9A= +github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6 h1:8UsGZ2rr2ksmEru6lToqnXgA8Mz1DP11X4zSJ159C3k= github.com/icza/mighty v0.0.0-20180919140131-cfd07d671de6/go.mod h1:xQig96I1VNBDIWGCdTt54nHt6EeI639SmHycLYL7FkA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -447,17 +447,16 @@ github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jW github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4= -github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= -github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -469,7 +468,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.bug.st/cleanup v1.0.0 h1:XVj1HZxkBXeq3gMT7ijWUpHyIC1j8XAoNSyQ06CskgA= go.bug.st/cleanup v1.0.0/go.mod h1:EqVmTg2IBk4znLbPD28xne3abjsJftMdqqJEjhn70bk= go.bug.st/downloader/v2 v2.1.1 h1:nyqbUizo3E2IxCCm4YFac4FtSqqFpqWP+Aae5GCMuw4= @@ -507,7 +505,6 @@ golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= @@ -547,7 +544,6 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180406214816-61147c48b25b/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -593,7 +589,6 @@ golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -613,8 +608,8 @@ golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= +golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -626,7 +621,6 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -696,13 +690,10 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -713,7 +704,6 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -775,7 +765,6 @@ golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -821,8 +810,6 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= -google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -931,8 +918,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/iot/client.go b/internal/iot/client.go index 1ea50544..4025c4c5 100644 --- a/internal/iot/client.go +++ b/internal/iot/client.go @@ -22,9 +22,8 @@ import ( "fmt" "os" - "github.com/antihax/optional" "github.com/arduino/arduino-cloud-cli/config" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "golang.org/x/oauth2" ) @@ -48,6 +47,10 @@ func NewClient(cred *config.Credentials) (*Client, error) { return cl, nil } +func toStringPointer(s string) *string { + return &s +} + // DeviceCreate allows to create a new device on Arduino IoT Cloud. // It returns the newly created device, and an error. func (cl *Client) DeviceCreate(ctx context.Context, fqbn, name, serial, dType string, cType *string) (*iotclient.ArduinoDevicev2, error) { @@ -57,22 +60,24 @@ func (cl *Client) DeviceCreate(ctx context.Context, fqbn, name, serial, dType st } payload := iotclient.CreateDevicesV2Payload{ - Fqbn: fqbn, - Name: name, - Serial: serial, + Fqbn: toStringPointer(fqbn), + Name: toStringPointer(name), + Serial: toStringPointer(serial), Type: dType, } if cType != nil { - payload.ConnectionType = *cType + payload.ConnectionType = cType } - dev, _, err := cl.api.DevicesV2Api.DevicesV2Create(ctx, payload, nil) + req := cl.api.DevicesV2Api.DevicesV2Create(ctx) + req = req.CreateDevicesV2Payload(payload) + dev, _, err := cl.api.DevicesV2Api.DevicesV2CreateExecute(req) if err != nil { err = fmt.Errorf("creating device, %w", errorDetail(err)) return nil, err } - return &dev, nil + return dev, nil } // DeviceLoraCreate allows to create a new LoRa device on Arduino IoT Cloud. @@ -88,17 +93,19 @@ func (cl *Client) DeviceLoraCreate(ctx context.Context, name, serial, devType, e Eui: eui, FrequencyPlan: freq, Name: name, - Serial: serial, + Serial: toStringPointer(serial), Type: devType, UserId: "me", } - dev, _, err := cl.api.LoraDevicesV1Api.LoraDevicesV1Create(ctx, payload, nil) + req := cl.api.LoraDevicesV1Api.LoraDevicesV1Create(ctx) + req = req.CreateLoraDevicesV1Payload(payload) + dev, _, err := cl.api.LoraDevicesV1Api.LoraDevicesV1CreateExecute(req) if err != nil { err = fmt.Errorf("creating lora device: %w", errorDetail(err)) return nil, err } - return &dev, nil + return dev, nil } // DevicePassSet sets the device password to the one suggested by Arduino IoT Cloud. @@ -110,21 +117,23 @@ func (cl *Client) DevicePassSet(ctx context.Context, id string) (*iotclient.Ardu } // Fetch suggested password - opts := &iotclient.DevicesV2PassGetOpts{SuggestedPassword: optional.NewBool(true)} - pass, _, err := cl.api.DevicesV2PassApi.DevicesV2PassGet(ctx, id, opts) + req := cl.api.DevicesV2PassApi.DevicesV2PassGet(ctx, id) + req = req.SuggestedPassword(true) + pass, _, err := cl.api.DevicesV2PassApi.DevicesV2PassGetExecute(req) if err != nil { err = fmt.Errorf("fetching device suggested password: %w", errorDetail(err)) return nil, err } // Set password to the suggested one - p := iotclient.Devicev2Pass{Password: pass.SuggestedPassword} - pass, _, err = cl.api.DevicesV2PassApi.DevicesV2PassSet(ctx, id, p) + reqSet := cl.api.DevicesV2PassApi.DevicesV2PassSet(ctx, id) + reqSet = reqSet.Devicev2Pass(iotclient.Devicev2Pass{Password: pass.SuggestedPassword}) + pass, _, err = cl.api.DevicesV2PassApi.DevicesV2PassSetExecute(reqSet) if err != nil { err = fmt.Errorf("setting device password: %w", errorDetail(err)) return nil, err } - return &pass, nil + return pass, nil } // DeviceDelete deletes the device corresponding to the passed ID @@ -135,7 +144,8 @@ func (cl *Client) DeviceDelete(ctx context.Context, id string) error { return err } - _, err = cl.api.DevicesV2Api.DevicesV2Delete(ctx, id, nil) + req := cl.api.DevicesV2Api.DevicesV2Delete(ctx, id) + _, err = cl.api.DevicesV2Api.DevicesV2DeleteExecute(req) if err != nil { err = fmt.Errorf("deleting device: %w", errorDetail(err)) return err @@ -151,17 +161,16 @@ func (cl *Client) DeviceList(ctx context.Context, tags map[string]string) ([]iot return nil, err } - opts := &iotclient.DevicesV2ListOpts{} + req := cl.api.DevicesV2Api.DevicesV2List(ctx) if tags != nil { t := make([]string, 0, len(tags)) for key, val := range tags { // Use the 'key:value' format required from the backend t = append(t, key+":"+val) } - opts.Tags = optional.NewInterface(t) + req = req.Tags(t) } - - devices, _, err := cl.api.DevicesV2Api.DevicesV2List(ctx, opts) + devices, _, err := cl.api.DevicesV2Api.DevicesV2ListExecute(req) if err != nil { err = fmt.Errorf("listing devices: %w", errorDetail(err)) return nil, err @@ -177,12 +186,13 @@ func (cl *Client) DeviceShow(ctx context.Context, id string) (*iotclient.Arduino return nil, err } - dev, _, err := cl.api.DevicesV2Api.DevicesV2Show(ctx, id, nil) + req := cl.api.DevicesV2Api.DevicesV2Show(ctx, id) + dev, _, err := cl.api.DevicesV2Api.DevicesV2ShowExecute(req) if err != nil { err = fmt.Errorf("retrieving device, %w", errorDetail(err)) return nil, err } - return &dev, nil + return dev, nil } // DeviceOTA performs an OTA upload request to Arduino IoT Cloud, passing @@ -193,14 +203,14 @@ func (cl *Client) DeviceOTA(ctx context.Context, id string, file *os.File, expir return err } - opt := &iotclient.DevicesV2OtaUploadOpts{ - ExpireInMins: optional.NewInt32(int32(expireMins)), - Async: optional.NewBool(true), - } - resp, err := cl.api.DevicesV2OtaApi.DevicesV2OtaUpload(ctx, id, file, opt) + req := cl.api.DevicesV2OtaApi.DevicesV2OtaUpload(ctx, id) + req = req.ExpireInMins(int32(expireMins)) + req = req.Async(true) + req = req.OtaFile(file) + _, resp, err := cl.api.DevicesV2OtaApi.DevicesV2OtaUploadExecute(req) if err != nil { // 409 (Conflict) is the status code for an already existing OTA in progress for the same device. Handling it in a different way. - if resp.StatusCode == 409 { + if resp != nil && resp.StatusCode == 409 { return ErrOtaAlreadyInProgress } return fmt.Errorf("uploading device ota: %w", errorDetail(err)) @@ -216,8 +226,9 @@ func (cl *Client) DeviceTagsCreate(ctx context.Context, id string, tags map[stri } for key, val := range tags { - t := iotclient.Tag{Key: key, Value: val} - _, err := cl.api.DevicesV2TagsApi.DevicesV2TagsUpsert(ctx, id, t) + req := cl.api.DevicesV2TagsApi.DevicesV2TagsUpsert(ctx, id) + req = req.Tag(iotclient.Tag{Key: key, Value: val}) + _, err := cl.api.DevicesV2TagsApi.DevicesV2TagsUpsertExecute(req) if err != nil { err = fmt.Errorf("cannot create tag %s: %w", key, errorDetail(err)) return err @@ -235,7 +246,8 @@ func (cl *Client) DeviceTagsDelete(ctx context.Context, id string, keys []string } for _, key := range keys { - _, err := cl.api.DevicesV2TagsApi.DevicesV2TagsDelete(ctx, id, key) + req := cl.api.DevicesV2TagsApi.DevicesV2TagsDelete(ctx, id, key) + _, err := cl.api.DevicesV2TagsApi.DevicesV2TagsDeleteExecute(req) if err != nil { err = fmt.Errorf("cannot delete tag %s: %w", key, errorDetail(err)) return err @@ -252,7 +264,8 @@ func (cl *Client) LoraFrequencyPlansList(ctx context.Context) ([]iotclient.Ardui return nil, err } - freqs, _, err := cl.api.LoraFreqPlanV1Api.LoraFreqPlanV1List(ctx) + req := cl.api.LoraFreqPlanV1Api.LoraFreqPlanV1List(ctx) + freqs, _, err := cl.api.LoraFreqPlanV1Api.LoraFreqPlanV1ListExecute(req) if err != nil { err = fmt.Errorf("listing lora frequency plans: %w", errorDetail(err)) return nil, err @@ -269,12 +282,14 @@ func (cl *Client) CertificateCreate(ctx context.Context, id, csr string) (*iotcl } cert := iotclient.CreateDevicesV2CertsPayload{ - Ca: "Arduino", + Ca: toStringPointer("Arduino"), Csr: csr, Enabled: true, } - newCert, _, err := cl.api.DevicesV2CertsApi.DevicesV2CertsCreate(ctx, id, cert) + req := cl.api.DevicesV2CertsApi.DevicesV2CertsCreate(ctx, id) + req = req.CreateDevicesV2CertsPayload(cert) + newCert, _, err := cl.api.DevicesV2CertsApi.DevicesV2CertsCreateExecute(req) if err != nil { err = fmt.Errorf("creating certificate, %w", errorDetail(err)) return nil, err @@ -290,12 +305,14 @@ func (cl *Client) ThingCreate(ctx context.Context, thing *iotclient.ThingCreate, return nil, err } - opt := &iotclient.ThingsV2CreateOpts{Force: optional.NewBool(force)} - newThing, _, err := cl.api.ThingsV2Api.ThingsV2Create(ctx, *thing, opt) + req := cl.api.ThingsV2Api.ThingsV2Create(ctx) + req = req.ThingCreate(*thing) + req = req.Force(force) + newThing, _, err := cl.api.ThingsV2Api.ThingsV2CreateExecute(req) if err != nil { return nil, fmt.Errorf("%s: %w", "adding new thing", errorDetail(err)) } - return &newThing, nil + return newThing, nil } // ThingUpdate updates a thing on Arduino IoT Cloud. @@ -305,8 +322,10 @@ func (cl *Client) ThingUpdate(ctx context.Context, id string, thing *iotclient.T return err } - opt := &iotclient.ThingsV2UpdateOpts{Force: optional.NewBool(force)} - _, _, err = cl.api.ThingsV2Api.ThingsV2Update(ctx, id, *thing, opt) + req := cl.api.ThingsV2Api.ThingsV2Update(ctx, id) + req = req.Force(force) + req = req.ThingUpdate(*thing) + _, _, err = cl.api.ThingsV2Api.ThingsV2UpdateExecute(req) if err != nil { return fmt.Errorf("%s: %v", "updating thing", errorDetail(err)) } @@ -320,7 +339,8 @@ func (cl *Client) ThingDelete(ctx context.Context, id string) error { return err } - _, err = cl.api.ThingsV2Api.ThingsV2Delete(ctx, id, nil) + req := cl.api.ThingsV2Api.ThingsV2Delete(ctx, id) + _, err = cl.api.ThingsV2Api.ThingsV2DeleteExecute(req) if err != nil { err = fmt.Errorf("deleting thing: %w", errorDetail(err)) return err @@ -328,20 +348,36 @@ func (cl *Client) ThingDelete(ctx context.Context, id string) error { return nil } -// ThingShow allows to retrieve a specific thing, given its id, -// from Arduino IoT Cloud. +// ThingShow allows to retrieve a specific thing, given its id from Arduino IoT Cloud. func (cl *Client) ThingShow(ctx context.Context, id string) (*iotclient.ArduinoThing, error) { ctx, err := ctxWithToken(ctx, cl.token) if err != nil { return nil, err } - thing, _, err := cl.api.ThingsV2Api.ThingsV2Show(ctx, id, nil) + req := cl.api.ThingsV2Api.ThingsV2Show(ctx, id) + thing, _, err := cl.api.ThingsV2Api.ThingsV2ShowExecute(req) + if err != nil { + return nil, fmt.Errorf("retrieving thing, %w", errorDetail(err)) + } + return thing, nil +} + +// ThingClone allows to clone a specific thing, given its id from Arduino IoT Cloud. +func (cl *Client) ThingClone(ctx context.Context, id, newName string) (*iotclient.ArduinoThing, error) { + ctx, err := ctxWithToken(ctx, cl.token) if err != nil { - err = fmt.Errorf("retrieving thing, %w", errorDetail(err)) return nil, err } - return &thing, nil + + req := cl.api.ThingsV2Api.ThingsV2Clone(ctx, id) + includeTags := true + req = req.ThingClone(iotclient.ThingClone{Name: newName, IncludeTags: &includeTags}) + thing, _, err := cl.api.ThingsV2Api.ThingsV2CloneExecute(req) + if err != nil { + return nil, fmt.Errorf("cloning thing thing, %w", errorDetail(err)) + } + return thing, nil } // ThingList returns a list of things on Arduino IoT Cloud. @@ -351,15 +387,14 @@ func (cl *Client) ThingList(ctx context.Context, ids []string, device *string, p return nil, err } - opts := &iotclient.ThingsV2ListOpts{} - opts.ShowProperties = optional.NewBool(props) - + req := cl.api.ThingsV2Api.ThingsV2List(ctx) + req = req.ShowProperties(props) if ids != nil { - opts.Ids = optional.NewInterface(ids) + req = req.Ids(ids) } if device != nil { - opts.DeviceId = optional.NewString(*device) + req = req.DeviceId(*device) } if tags != nil { @@ -368,10 +403,9 @@ func (cl *Client) ThingList(ctx context.Context, ids []string, device *string, p // Use the 'key:value' format required from the backend t = append(t, key+":"+val) } - opts.Tags = optional.NewInterface(t) + req = req.Tags(t) } - - things, _, err := cl.api.ThingsV2Api.ThingsV2List(ctx, opts) + things, _, err := cl.api.ThingsV2Api.ThingsV2ListExecute(req) if err != nil { err = fmt.Errorf("retrieving things, %w", errorDetail(err)) return nil, err @@ -387,8 +421,9 @@ func (cl *Client) ThingTagsCreate(ctx context.Context, id string, tags map[strin } for key, val := range tags { - t := iotclient.Tag{Key: key, Value: val} - _, err := cl.api.ThingsV2TagsApi.ThingsV2TagsUpsert(ctx, id, t) + req := cl.api.ThingsV2TagsApi.ThingsV2TagsUpsert(ctx, id) + req = req.Tag(iotclient.Tag{Key: key, Value: val}) + _, err := cl.api.ThingsV2TagsApi.ThingsV2TagsUpsertExecute(req) if err != nil { err = fmt.Errorf("cannot create tag %s: %w", key, errorDetail(err)) return err @@ -406,7 +441,8 @@ func (cl *Client) ThingTagsDelete(ctx context.Context, id string, keys []string) } for _, key := range keys { - _, err := cl.api.ThingsV2TagsApi.ThingsV2TagsDelete(ctx, id, key) + req := cl.api.ThingsV2TagsApi.ThingsV2TagsDelete(ctx, id, key) + _, err := cl.api.ThingsV2TagsApi.ThingsV2TagsDeleteExecute(req) if err != nil { err = fmt.Errorf("cannot delete tag %s: %w", key, errorDetail(err)) return err @@ -422,11 +458,13 @@ func (cl *Client) DashboardCreate(ctx context.Context, dashboard *iotclient.Dash return nil, err } - newDashboard, _, err := cl.api.DashboardsV2Api.DashboardsV2Create(ctx, *dashboard, nil) + req := cl.api.DashboardsV2Api.DashboardsV2Create(ctx) + req = req.Dashboardv2(*dashboard) + newDashboard, _, err := cl.api.DashboardsV2Api.DashboardsV2CreateExecute(req) if err != nil { return nil, fmt.Errorf("%s: %w", "adding new dashboard", errorDetail(err)) } - return &newDashboard, nil + return newDashboard, nil } // DashboardShow allows to retrieve a specific dashboard, given its id, @@ -437,12 +475,13 @@ func (cl *Client) DashboardShow(ctx context.Context, id string) (*iotclient.Ardu return nil, err } - dashboard, _, err := cl.api.DashboardsV2Api.DashboardsV2Show(ctx, id, nil) + req := cl.api.DashboardsV2Api.DashboardsV2Show(ctx, id) + dashboard, _, err := cl.api.DashboardsV2Api.DashboardsV2ShowExecute(req) if err != nil { err = fmt.Errorf("retrieving dashboard, %w", errorDetail(err)) return nil, err } - return &dashboard, nil + return dashboard, nil } // DashboardList returns a list of dashboards on Arduino IoT Cloud. @@ -452,7 +491,8 @@ func (cl *Client) DashboardList(ctx context.Context) ([]iotclient.ArduinoDashboa return nil, err } - dashboards, _, err := cl.api.DashboardsV2Api.DashboardsV2List(ctx, nil) + req := cl.api.DashboardsV2Api.DashboardsV2List(ctx) + dashboards, _, err := cl.api.DashboardsV2Api.DashboardsV2ListExecute(req) if err != nil { err = fmt.Errorf("listing dashboards: %w", errorDetail(err)) return nil, err @@ -467,7 +507,8 @@ func (cl *Client) DashboardDelete(ctx context.Context, id string) error { return err } - _, err = cl.api.DashboardsV2Api.DashboardsV2Delete(ctx, id, nil) + req := cl.api.DashboardsV2Api.DashboardsV2Delete(ctx, id) + _, err = cl.api.DashboardsV2Api.DashboardsV2DeleteExecute(req) if err != nil { err = fmt.Errorf("deleting dashboard: %w", errorDetail(err)) return err @@ -483,9 +524,14 @@ func (cl *Client) setup(client, secret, organization string) error { config := iotclient.NewConfiguration() if organization != "" { - config.DefaultHeader = map[string]string{"X-Organization": organization} + config.AddDefaultHeader("X-Organization", organization) + } + config.Servers = iotclient.ServerConfigurations{ + { + URL: fmt.Sprintf("%s/iot", baseURL), + Description: "IoT API endpoint", + }, } - config.BasePath = baseURL + "/iot" cl.api = iotclient.NewAPIClient(config) return nil diff --git a/internal/iot/error.go b/internal/iot/error.go index 00c205de..e26de626 100644 --- a/internal/iot/error.go +++ b/internal/iot/error.go @@ -21,7 +21,7 @@ import ( "encoding/json" "fmt" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" ) // errorDetail takes a generic iot-client-go error @@ -34,7 +34,7 @@ func errorDetail(err error) error { modErr, ok := apiErr.Model().(iotclient.ModelError) if ok { - return fmt.Errorf("%w: %s", err, modErr.Detail) + return fmt.Errorf("%w: %s", err, modErr.GetDetail()) } body := make(map[string]interface{}) diff --git a/internal/iot/token.go b/internal/iot/token.go index 717ef342..ebca7536 100644 --- a/internal/iot/token.go +++ b/internal/iot/token.go @@ -25,7 +25,7 @@ import ( "os" "strings" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "golang.org/x/oauth2" cc "golang.org/x/oauth2/clientcredentials" ) @@ -58,12 +58,12 @@ func NewUserTokenSource(client, secret, baseURL string) oauth2.TokenSource { func ctxWithToken(ctx context.Context, src oauth2.TokenSource) (context.Context, error) { // Retrieve a valid token from the src. - tok, err := src.Token() + _, err := src.Token() if err != nil { if strings.Contains(err.Error(), "401") { return nil, errors.New("wrong credentials") } return nil, fmt.Errorf("cannot retrieve a valid token: %w", err) } - return context.WithValue(ctx, iotclient.ContextAccessToken, tok.AccessToken), nil + return context.WithValue(ctx, iotclient.ContextOAuth2, src), nil } diff --git a/internal/template/dashboard.go b/internal/template/dashboard.go index aeace762..eae04243 100644 --- a/internal/template/dashboard.go +++ b/internal/template/dashboard.go @@ -22,7 +22,7 @@ import ( "encoding/json" "fmt" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" ) type dashboardTemplate struct { @@ -76,7 +76,7 @@ func getVariableID(ctx context.Context, thingID string, variableName string, fet } for _, v := range thing.Properties { - if v.VariableName == variableName { + if v.VariableName != nil && *v.VariableName == variableName { return v.Id, nil } } diff --git a/internal/template/extract.go b/internal/template/extract.go index 843a37cc..ecbe3163 100644 --- a/internal/template/extract.go +++ b/internal/template/extract.go @@ -24,7 +24,7 @@ import ( "io/ioutil" "os" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "gopkg.in/yaml.v3" ) @@ -67,7 +67,7 @@ func FromDashboard(dashboard *iotclient.ArduinoDashboardv2) map[string]interface widget["x"] = w.X widget["y"] = w.Y - if w.WidthMobile != 0 && w.HeightMobile != 0 { + if w.WidthMobile != nil && w.HeightMobile != nil && *w.WidthMobile != 0 && *w.HeightMobile != 0 { widget["width_mobile"] = w.WidthMobile widget["height_mobile"] = w.HeightMobile widget["x_mobile"] = w.XMobile diff --git a/internal/template/load.go b/internal/template/load.go index eca76933..6086c25d 100644 --- a/internal/template/load.go +++ b/internal/template/load.go @@ -22,10 +22,10 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "os" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "github.com/gofrs/uuid" "gopkg.in/yaml.v3" ) @@ -41,7 +41,7 @@ func loadTemplate(file string, template interface{}) error { } defer templateFile.Close() - templateBytes, err := ioutil.ReadAll(templateFile) + templateBytes, err := io.ReadAll(templateFile) if err != nil { return err } @@ -111,9 +111,13 @@ func LoadDashboard(ctx context.Context, file string, override map[string]string, // Set the correct variable id, given the thing id and the variable name for j, variable := range widget.Variables { // Check if thing name should be overridden + precheck := variable.ThingID if id, ok := override[variable.ThingID]; ok { variable.ThingID = id } + if variable.ThingID == "" || variable.ThingID == precheck { + return nil, fmt.Errorf("no override provided for thing %s", precheck) + } variable.VariableID, err = getVariableID(ctx, variable.ThingID, variable.VariableName, thinger) if err != nil { return nil, err diff --git a/internal/template/load_test.go b/internal/template/load_test.go index 1d7cecc6..705dc0d1 100644 --- a/internal/template/load_test.go +++ b/internal/template/load_test.go @@ -21,7 +21,7 @@ import ( "context" "testing" - iotclient "github.com/arduino/iot-client-go" + iotclient "github.com/arduino/iot-client-go/v2" "github.com/gofrs/uuid" "github.com/google/go-cmp/cmp" ) @@ -33,10 +33,19 @@ const ( relayID = "relay-id" blinkSpeedID = "blink_speed-id" - thingOverriddenID = "thing-overridden-id" - switchyOverriddenID = "switchy-overridden-id" + thingOverriddenID = "thing-overridden-id" + thingRemoteControlOverriddenID = "remote-controlled-lights-overridden-id" + switchyOverriddenID = "switchy-overridden-id" ) +func toStringPointer(s string) *string { + return &s +} + +func toInt64Pointer(i int64) *int64 { + return &i +} + var ( dashboardTemplateTest = map[string]interface{}{ "id": "home-security-alarm-dashboard", @@ -55,53 +64,53 @@ var ( } dashboardDetailed = &iotclient.Dashboardv2{ - Name: "dashboard", + Name: toStringPointer("dashboard"), Widgets: []iotclient.Widget{ - {Name: "Switch-name", Height: 1, HeightMobile: 2, Width: 3, WidthMobile: 4, - X: 5, XMobile: 6, Y: 7, YMobile: 8, Options: map[string]interface{}{"showLabels": true}, + {Name: toStringPointer("Switch-name"), Height: 1, HeightMobile: toInt64Pointer(2), Width: 3, WidthMobile: toInt64Pointer(4), + X: 5, XMobile: toInt64Pointer(6), Y: 7, YMobile: toInt64Pointer(8), Options: map[string]interface{}{"showLabels": true}, Type: "Switch", }, }, } dashboardNoOptions = &iotclient.Dashboardv2{ - Name: "dashboard-no-options", + Name: toStringPointer("dashboard-no-options"), Widgets: []iotclient.Widget{ - {Name: "Switch-name", Height: 1, HeightMobile: 2, Width: 3, WidthMobile: 4, - X: 5, XMobile: 6, Y: 7, YMobile: 8, Options: map[string]interface{}{}, + {Name: toStringPointer("Switch-name"), Height: 1, HeightMobile: toInt64Pointer(2), Width: 3, WidthMobile: toInt64Pointer(4), + X: 5, XMobile: toInt64Pointer(6), Y: 7, YMobile: toInt64Pointer(8), Options: map[string]interface{}{}, Type: "Switch", }, }, } dashboardWithVariable = &iotclient.Dashboardv2{ - Name: "dashboard-with-variable", + Name: toStringPointer("dashboard-with-variable"), Widgets: []iotclient.Widget{ - {Name: "Switch-name", Height: 1, HeightMobile: 2, Width: 3, WidthMobile: 4, - X: 5, XMobile: 6, Y: 7, YMobile: 8, Options: map[string]interface{}{"showLabels": true}, Type: "Switch", + {Name: toStringPointer("Switch-name"), Height: 1, HeightMobile: toInt64Pointer(2), Width: 3, WidthMobile: toInt64Pointer(4), + X: 5, XMobile: toInt64Pointer(6), Y: 7, YMobile: toInt64Pointer(8), Options: map[string]interface{}{"showLabels": true}, Type: "Switch", Variables: []string{switchyID}, }, }, } dashboardVariableOverride = &iotclient.Dashboardv2{ - Name: "dashboard-with-variable", + Name: toStringPointer("dashboard-with-variable"), Widgets: []iotclient.Widget{ - {Name: "Switch-name", Height: 1, HeightMobile: 2, Width: 3, WidthMobile: 4, - X: 5, XMobile: 6, Y: 7, YMobile: 8, Options: map[string]interface{}{"showLabels": true}, Type: "Switch", + {Name: toStringPointer("Switch-name"), Height: 1, HeightMobile: toInt64Pointer(2), Width: 3, WidthMobile: toInt64Pointer(4), + X: 5, XMobile: toInt64Pointer(6), Y: 7, YMobile: toInt64Pointer(8), Options: map[string]interface{}{"showLabels": true}, Type: "Switch", Variables: []string{switchyOverriddenID}, }, }, } dashboardTwoWidgets = &iotclient.Dashboardv2{ - Name: "dashboard-two-widgets", + Name: toStringPointer("dashboard-two-widgets"), Widgets: []iotclient.Widget{ - {Name: "blink_speed", Height: 7, Width: 8, + {Name: toStringPointer("blink_speed"), Height: 7, Width: 8, X: 7, Y: 5, Options: map[string]interface{}{"min": float64(0), "max": float64(5000)}, Type: "Slider", Variables: []string{blinkSpeedID}, }, - {Name: "relay_2", Height: 5, Width: 5, + {Name: toStringPointer("relay_2"), Height: 5, Width: 5, X: 5, Y: 0, Options: map[string]interface{}{"showLabels": true}, Type: "Switch", Variables: []string{relayID}, }, @@ -150,15 +159,15 @@ func (t *thingShowTest) ThingShow(ctx context.Context, thingID string) (*iotclie if thingID == thingOverriddenID { return &iotclient.ArduinoThing{ Properties: []iotclient.ArduinoProperty{ - {Id: switchyOverriddenID, VariableName: "switchy"}, + {Id: switchyOverriddenID, VariableName: toStringPointer("switchy")}, }, }, nil } return &iotclient.ArduinoThing{ Properties: []iotclient.ArduinoProperty{ - {Id: switchyID, VariableName: "switchy"}, - {Id: relayID, VariableName: "relay_2"}, - {Id: blinkSpeedID, VariableName: "blink_speed"}, + {Id: switchyID, VariableName: toStringPointer("switchy")}, + {Id: relayID, VariableName: toStringPointer("relay_2")}, + {Id: blinkSpeedID, VariableName: toStringPointer("blink_speed")}, }, }, nil } @@ -177,39 +186,34 @@ func TestLoadDashboard(t *testing.T) { override: nil, want: dashboardDetailed, }, - { name: "dashboard with wrong options to be filtered out", file: "testdata/dashboard-wrong-options.yaml", override: nil, want: dashboardDetailed, }, - { name: "dashboard without options, should have a not nil map", file: "testdata/dashboard-no-options.yaml", override: nil, want: dashboardNoOptions, }, - { name: "dashboard with variable, mocked variable id is concatenation of thing_id and variable_id", file: "testdata/dashboard-with-variable.yaml", - override: nil, - want: dashboardWithVariable, + override: map[string]string{"thing": thingOverriddenID}, + want: dashboardVariableOverride, }, - { name: "dashboard with variable, thing is overridden", file: "testdata/dashboard-with-variable.yaml", override: map[string]string{"thing": thingOverriddenID}, want: dashboardVariableOverride, }, - { name: "dashboard with two widgets", file: "testdata/dashboard-two-widgets.yaml", - override: nil, + override: map[string]string{"remote-controlled-lights": thingRemoteControlOverriddenID}, want: dashboardTwoWidgets, }, }