diff --git a/.github/workflows/check-dependencies-task.yml b/.github/workflows/check-dependencies-task.yml index d4a41145..ee00aad0 100644 --- a/.github/workflows/check-dependencies-task.yml +++ b/.github/workflows/check-dependencies-task.yml @@ -3,7 +3,7 @@ name: Check Dependencies env: # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.19" + GO_VERSION: "1.23" # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows on: @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install licensed uses: jonabc/setup-licensed@v1 @@ -43,7 +43,7 @@ jobs: version: 3.x - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} @@ -69,9 +69,10 @@ jobs: # Some might find it convenient to have CI generate the cache rather than setting up for it locally - name: Upload cache to workflow artifact if: failure() && steps.diff.outcome == 'failure' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: if-no-files-found: error + include-hidden-files: true name: dep-licenses-cache path: .licenses/ @@ -80,7 +81,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install licensed uses: jonabc/setup-licensed@v1 @@ -89,7 +90,7 @@ jobs: version: 3.x - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/release-go-task.yml b/.github/workflows/release-go-task.yml index 27fe0763..05c92d3c 100644 --- a/.github/workflows/release-go-task.yml +++ b/.github/workflows/release-go-task.yml @@ -21,7 +21,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -43,7 +43,7 @@ jobs: run: task dist:all - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: ${{ env.ARTIFACT_NAME }} @@ -55,10 +55,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} @@ -99,12 +99,12 @@ jobs: run: | gon gon.config.hcl - - name: Re-package binary and update checksum + - name: Re-package amd64 binary and update checksum # This step performs the following: # 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file) # 2. Recalculate package checksum and replace it in the nnnnnn-checksums.txt file run: | - # GitHub's upload/download-artifact@v2 actions don't preserve file permissions, + # GitHub's upload/download-artifact@v4 actions don't preserve file permissions, # so we need to add execution permission back until the action is made to do this. chmod +x ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_darwin_amd64/${{ env.PROJECT_NAME }} TAG="${GITHUB_REF/refs\/tags\//}" @@ -118,10 +118,30 @@ jobs: -e "s/.*${{ env.PROJECT_NAME }}_${TAG}_macOS_64bit.tar.gz/${CHECKSUM} ${{ env.PROJECT_NAME }}_${TAG}_macOS_64bit.tar.gz/g;" \ ${{ env.DIST_DIR }}/*-checksums.txt + - name: Re-package ARM64 binary and update checksum + # This step performs the following: + # 1. Repackage the signed binary replaced in place by Gon (ignoring the output zip file) + # 2. Recalculate package checksum and replace it in the nnnnnn-checksums.txt file + run: | + # GitHub's upload/download-artifact@v4 actions don't preserve file permissions, + # so we need to add execution permission back until the action is made to do this. + chmod +x ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_darwin_arm64/${{ env.PROJECT_NAME }} + TAG="${GITHUB_REF/refs\/tags\//}" + tar -czvf "${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_${TAG}_macOS_ARM64.tar.gz" \ + -C ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_osx_darwin_arm64/ ${{ env.PROJECT_NAME }} \ + -C ../../ LICENSE.txt + CHECKSUM="$(shasum -a 256 ${{ env.DIST_DIR }}/${{ env.PROJECT_NAME }}_${TAG}_macOS_ARM64.tar.gz | cut -d " " -f 1)" + perl \ + -pi \ + -w \ + -e "s/.*${{ env.PROJECT_NAME }}_${TAG}_macOS_ARM64.tar.gz/${CHECKSUM} ${{ env.PROJECT_NAME }}_${TAG}_macOS_ARM64.tar.gz/g;" \ + ${{ env.DIST_DIR }}/*-checksums.txt + - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: if-no-files-found: error + overwrite: true name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} @@ -131,7 +151,7 @@ jobs: steps: - name: Download artifact - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: ${{ env.ARTIFACT_NAME }} path: ${{ env.DIST_DIR }} @@ -155,14 +175,3 @@ jobs: # NOTE: "Artifact is a directory" warnings are expected and don't indicate a problem # (all the files we need are in the DIST_DIR root) artifacts: ${{ env.DIST_DIR }}/* - - # TODO - # - name: Upload release files on Arduino downloads servers - # uses: docker://plugins/s3 - # env: - # PLUGIN_SOURCE: "${{ env.DIST_DIR }}/*" - # PLUGIN_TARGET: ${{ env.AWS_PLUGIN_TARGET }} - # PLUGIN_STRIP_PREFIX: "${{ env.DIST_DIR }}/" - # PLUGIN_BUCKET: ${{ secrets.DOWNLOADS_BUCKET }} - # AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - # AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/test-go-task.yml b/.github/workflows/test-go-task.yml index 0b729903..45484e16 100644 --- a/.github/workflows/test-go-task.yml +++ b/.github/workflows/test-go-task.yml @@ -3,7 +3,7 @@ name: Test Go env: # See: https://github.com/actions/setup-go/tree/v2#readme - GO_VERSION: "1.19" + GO_VERSION: "1.23" # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: @@ -75,10 +75,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} diff --git a/.licensed.yml b/.licensed.yml index 4906556a..9ff10357 100644 --- a/.licensed.yml +++ b/.licensed.yml @@ -4,8 +4,18 @@ reviewed: - golang.org/x/crypto/curve25519/internal/field - golang.org/x/crypto/internal/poly1305 - golang.org/x/crypto/curve25519 + - golang.org/x/net/bpf + - golang.org/x/net/internal/iana + - golang.org/x/net/internal/socket + - golang.org/x/net/ipv4 - google.golang.org/protobuf/encoding/protojson - google.golang.org/protobuf/internal/encoding/json + - github.com/klauspost/compress + - github.com/klauspost/compress/fse + - github.com/klauspost/compress/huff0 + - github.com/klauspost/compress/internal/cpuinfo + - github.com/klauspost/compress/internal/snapref + - github.com/klauspost/compress/zstd # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies/AGPL-3.0/.licensed.yml allowed: diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino.dep.yml index 1829eda7..0b130cee 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/cores.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/cores.dep.yml index bd81f42d..8c5d103d 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/cores.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/cores.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/cores -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/cores license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packageindex.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packageindex.dep.yml index fa811da4..d8fed56b 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packageindex.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packageindex.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/cores/packageindex -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/cores/packageindex license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packagemanager.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packagemanager.dep.yml index 3a19a59f..a34672ac 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packagemanager.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/cores/packagemanager.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/cores/packagemanager -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/cores/packagemanager license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery.dep.yml index e8ab3d4a..8c434189 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/discovery -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/discovery license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery/discoverymanager.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery/discoverymanager.dep.yml index 8e2c84fd..79fcf196 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery/discoverymanager.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/discovery/discoverymanager.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/discovery/discoverymanager -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/discovery/discoverymanager license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/globals.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/globals.dep.yml index a883eaa4..f9fb5093 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/globals.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/globals.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/globals -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/globals license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/httpclient.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/httpclient.dep.yml index 68eb6541..98d8895c 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/httpclient.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/httpclient.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/httpclient -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/httpclient license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries.dep.yml index ead92cd1..f12eea8b 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/libraries -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/libraries license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesindex.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesindex.dep.yml index 4f2403a8..cf177401 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesindex.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesindex.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/libraries/librariesindex -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/libraries/librariesindex license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.dep.yml index 0df3c15a..ffcbf7f8 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/libraries/librariesmanager.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/libraries/librariesmanager -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/libraries/librariesmanager license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/resources.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/resources.dep.yml index 20bbc09a..55e64f7c 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/resources.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/resources.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/resources -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/resources license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/security.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/security.dep.yml index d5dcb512..308e9ab8 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/security.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/security.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/security -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/security license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/serialutils.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/serialutils.dep.yml index 64343a05..2f3169c8 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/serialutils.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/serialutils.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/serialutils -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/serialutils license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/sketch.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/sketch.dep.yml index f8df363f..bdd0aa8d 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/sketch.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/sketch.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/sketch -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/sketch license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/arduino/utils.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/arduino/utils.dep.yml index fc5df73b..f6af2731 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/arduino/utils.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/arduino/utils.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/arduino/utils -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/arduino/utils license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/cli/errorcodes.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/cli/errorcodes.dep.yml index 9d377037..a2231c53 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/cli/errorcodes.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/cli/errorcodes.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/cli/errorcodes -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/cli/errorcodes license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/cli/feedback.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/cli/feedback.dep.yml index 63bf4d2e..b7ad6c1c 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/cli/feedback.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/cli/feedback.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/cli/feedback -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/cli/feedback license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/cli/globals.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/cli/globals.dep.yml index 3fdfd14f..6a05de77 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/cli/globals.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/cli/globals.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/cli/globals -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/cli/globals license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/cli/instance.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/cli/instance.dep.yml index e5aaf2ea..da28827e 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/cli/instance.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/cli/instance.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/cli/instance -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/cli/instance license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/cli/output.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/cli/output.dep.yml index bfbd0777..835ddc68 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/cli/output.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/cli/output.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/cli/output -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/cli/output license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/commands.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/commands.dep.yml index 3f7f50af..18a5dc4f 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/commands.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/commands.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/commands -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/commands license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/commands/board.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/commands/board.dep.yml index 03f32c21..822403ef 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/commands/board.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/commands/board.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/commands/board -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/commands/board license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/commands/upload.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/commands/upload.dep.yml index e6c658c4..2986961d 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/commands/upload.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/commands/upload.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/commands/upload -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/commands/upload license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/configuration.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/configuration.dep.yml index 2390e72c..9b25a6d6 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/configuration.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/configuration.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/configuration -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/configuration license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/executils.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/executils.dep.yml index 961c6ca6..cb2692b0 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/executils.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/executils.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/executils -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/executils license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/i18n.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/i18n.dep.yml index 830393fc..1e91f5cb 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/i18n.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/i18n.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/i18n -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/i18n license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/.licenses/go/github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1.dep.yml index 92ce73cc..287ac582 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1 -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1 license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/table.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/table.dep.yml index 05de0a34..4d8e29a0 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/table.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/table.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/table -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/table license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/arduino-cli/version.dep.yml b/.licenses/go/github.com/arduino/arduino-cli/version.dep.yml index 22535399..7f1e928b 100644 --- a/.licenses/go/github.com/arduino/arduino-cli/version.dep.yml +++ b/.licenses/go/github.com/arduino/arduino-cli/version.dep.yml @@ -1,12 +1,12 @@ --- name: github.com/arduino/arduino-cli/version -version: v0.0.0-20221116144942-76251df9241a +version: v0.0.0-20250901123057-20dd7c932f59 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/arduino-cli/version license: gpl-3.0 licenses: -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/LICENSE.txt +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/LICENSE.txt text: |2 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -682,7 +682,7 @@ licenses: the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . -- sources: arduino-cli@v0.0.0-20221116144942-76251df9241a/README.md +- sources: arduino-cli@v0.0.0-20250901123057-20dd7c932f59/README.md text: |- Arduino CLI is licensed under the [GPL 3.0] license. diff --git a/.licenses/go/github.com/arduino/board-discovery.dep.yml b/.licenses/go/github.com/arduino/board-discovery.dep.yml deleted file mode 100644 index 31d5d06a..00000000 --- a/.licenses/go/github.com/arduino/board-discovery.dep.yml +++ /dev/null @@ -1,358 +0,0 @@ ---- -name: github.com/arduino/board-discovery -version: v0.0.0-20211020061712-fd83c2e3c908 -type: go -summary: 'Package discovery keeps an updated list of the devices connected to the - computer, via serial ports or found in the network Usage: monitor := discovery.New(time.Millisecond) - ctx, _ := context.WithTimeout(context.Background(), 10*time.Second) monitor.Start(ctx) - time.Sleep(10 * time.Second) fmt.Println(monitor.Serial()) fmt.Println(monitor.Network()) - Output: map[/dev/ttyACM0:0x2341/0x8036] map[192.168.1.107:YunShield] You may also - decide to subscribe to the Events channel of the Monitor: monitor := discovery.New(time.Millisecond) - ctx, _ := context.WithTimeout(context.Background(), 10*time.Second) monitor.Start(ctx) - for ev := range monitor.Events { fmt.Println(ev) } Output: {add 0x2341/0x8036 } - {add YunShield}' -homepage: https://pkg.go.dev/github.com/arduino/board-discovery -license: gpl-2.0-or-later -licenses: -- sources: LICENSE - text: |2 - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your - freedom to share and change it. By contrast, the GNU General Public - License is intended to guarantee your freedom to share and change free - software--to make sure the software is free for all its users. This - General Public License applies to most of the Free Software - Foundation's software and to any other program whose authors commit to - using it. (Some other Free Software Foundation software is covered by - the GNU Lesser General Public License instead.) You can apply it to - your programs, too. - - When we speak of free software, we are referring to freedom, not - price. Our General Public Licenses are designed to make sure that you - have the freedom to distribute copies of free software (and charge for - this service if you wish), that you receive source code or can get it - if you want it, that you can change the software or use pieces of it - in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid - anyone to deny you these rights or to ask you to surrender the rights. - These restrictions translate to certain responsibilities for you if you - distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether - gratis or for a fee, you must give the recipients all the rights that - you have. You must make sure that they, too, receive or can get the - source code. And you must show them these terms so they know their - rights. - - We protect your rights with two steps: (1) copyright the software, and - (2) offer you this license which gives you legal permission to copy, - distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain - that everyone understands that there is no warranty for this free - software. If the software is modified by someone else and passed on, we - want its recipients to know that what they have is not the original, so - that any problems introduced by others will not reflect on the original - authors' reputations. - - Finally, any free program is threatened constantly by software - patents. We wish to avoid the danger that redistributors of a free - program will individually obtain patent licenses, in effect making the - program proprietary. To prevent this, we have made it clear that any - patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and - modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains - a notice placed by the copyright holder saying it may be distributed - under the terms of this General Public License. The "Program", below, - refers to any such program or work, and a "work based on the Program" - means either the Program or any derivative work under copyright law: - that is to say, a work containing the Program or a portion of it, - either verbatim or with modifications and/or translated into another - language. (Hereinafter, translation is included without limitation in - the term "modification".) Each licensee is addressed as "you". - - Activities other than copying, distribution and modification are not - covered by this License; they are outside its scope. The act of - running the Program is not restricted, and the output from the Program - is covered only if its contents constitute a work based on the - Program (independent of having been made by running the Program). - Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's - source code as you receive it, in any medium, provided that you - conspicuously and appropriately publish on each copy an appropriate - copyright notice and disclaimer of warranty; keep intact all the - notices that refer to this License and to the absence of any warranty; - and give any other recipients of the Program a copy of this License - along with the Program. - - You may charge a fee for the physical act of transferring a copy, and - you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion - of it, thus forming a work based on the Program, and copy and - distribute such modifications or work under the terms of Section 1 - above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - - These requirements apply to the modified work as a whole. If - identifiable sections of that work are not derived from the Program, - and can be reasonably considered independent and separate works in - themselves, then this License, and its terms, do not apply to those - sections when you distribute them as separate works. But when you - distribute the same sections as part of a whole which is a work based - on the Program, the distribution of the whole must be on the terms of - this License, whose permissions for other licensees extend to the - entire whole, and thus to each and every part regardless of who wrote it. - - Thus, it is not the intent of this section to claim rights or contest - your rights to work written entirely by you; rather, the intent is to - exercise the right to control the distribution of derivative or - collective works based on the Program. - - In addition, mere aggregation of another work not based on the Program - with the Program (or with a work based on the Program) on a volume of - a storage or distribution medium does not bring the other work under - the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, - under Section 2) in object code or executable form under the terms of - Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - - The source code for a work means the preferred form of the work for - making modifications to it. For an executable work, complete source - code means all the source code for all modules it contains, plus any - associated interface definition files, plus the scripts used to - control compilation and installation of the executable. However, as a - special exception, the source code distributed need not include - anything that is normally distributed (in either source or binary - form) with the major components (compiler, kernel, and so on) of the - operating system on which the executable runs, unless that component - itself accompanies the executable. - - If distribution of executable or object code is made by offering - access to copy from a designated place, then offering equivalent - access to copy the source code from the same place counts as - distribution of the source code, even though third parties are not - compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program - except as expressly provided under this License. Any attempt - otherwise to copy, modify, sublicense or distribute the Program is - void, and will automatically terminate your rights under this License. - However, parties who have received copies, or rights, from you under - this License will not have their licenses terminated so long as such - parties remain in full compliance. - - 5. You are not required to accept this License, since you have not - signed it. However, nothing else grants you permission to modify or - distribute the Program or its derivative works. These actions are - prohibited by law if you do not accept this License. Therefore, by - modifying or distributing the Program (or any work based on the - Program), you indicate your acceptance of this License to do so, and - all its terms and conditions for copying, distributing or modifying - the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the - Program), the recipient automatically receives a license from the - original licensor to copy, distribute or modify the Program subject to - these terms and conditions. You may not impose any further - restrictions on the recipients' exercise of the rights granted herein. - You are not responsible for enforcing compliance by third parties to - this License. - - 7. If, as a consequence of a court judgment or allegation of patent - infringement or for any other reason (not limited to patent issues), - conditions are imposed on you (whether by court order, agreement or - otherwise) that contradict the conditions of this License, they do not - excuse you from the conditions of this License. If you cannot - distribute so as to satisfy simultaneously your obligations under this - License and any other pertinent obligations, then as a consequence you - may not distribute the Program at all. For example, if a patent - license would not permit royalty-free redistribution of the Program by - all those who receive copies directly or indirectly through you, then - the only way you could satisfy both it and this License would be to - refrain entirely from distribution of the Program. - - If any portion of this section is held invalid or unenforceable under - any particular circumstance, the balance of the section is intended to - apply and the section as a whole is intended to apply in other - circumstances. - - It is not the purpose of this section to induce you to infringe any - patents or other property right claims or to contest validity of any - such claims; this section has the sole purpose of protecting the - integrity of the free software distribution system, which is - implemented by public license practices. Many people have made - generous contributions to the wide range of software distributed - through that system in reliance on consistent application of that - system; it is up to the author/donor to decide if he or she is willing - to distribute software through any other system and a licensee cannot - impose that choice. - - This section is intended to make thoroughly clear what is believed to - be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in - certain countries either by patents or by copyrighted interfaces, the - original copyright holder who places the Program under this License - may add an explicit geographical distribution limitation excluding - those countries, so that distribution is permitted only in or among - countries not thus excluded. In such case, this License incorporates - the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions - of the General Public License from time to time. Such new versions will - be similar in spirit to the present version, but may differ in detail to - address new problems or concerns. - - Each version is given a distinguishing version number. If the Program - specifies a version number of this License which applies to it and "any - later version", you have the option of following the terms and conditions - either of that version or of any later version published by the Free - Software Foundation. If the Program does not specify a version number of - this License, you may choose any version ever published by the Free Software - Foundation. - - 10. If you wish to incorporate parts of the Program into other free - programs whose distribution conditions are different, write to the author - to ask for permission. For software which is copyrighted by the Free - Software Foundation, write to the Free Software Foundation; we sometimes - make exceptions for this. Our decision will be guided by the two goals - of preserving the free status of all derivatives of our free software and - of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY - FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN - OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES - PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED - OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS - TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE - PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, - REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING - WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR - REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, - INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING - OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED - TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY - YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER - PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE - POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest - possible use to the public, the best way to achieve this is to make it - free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest - to attach them to the start of each source file to most effectively - convey the exclusion of warranty; and each file should have at least - the "copyright" line and a pointer to where the full notice is found. - - {description} - Copyright (C) {year} {fullname} - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - Also add information on how to contact you by electronic and paper mail. - - If the program is interactive, make it output a short notice like this - when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - - The hypothetical commands `show w' and `show c' should show the appropriate - parts of the General Public License. Of course, the commands you use may - be called something other than `show w' and `show c'; they could even be - mouse-clicks or menu items--whatever suits your program. - - You should also get your employer (if you work as a programmer) or your - school, if any, to sign a "copyright disclaimer" for the program, if - necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - {signature of Ty Coon}, 1 April 1989 - Ty Coon, President of Vice - - This General Public License does not permit incorporating your program into - proprietary programs. If your program is a subroutine library, you may - consider it more useful to permit linking proprietary applications with the - library. If this is what you want to do, use the GNU Lesser General - Public License instead of this License. -notices: [] diff --git a/.licenses/go/github.com/arduino/go-paths-helper.dep.yml b/.licenses/go/github.com/arduino/go-paths-helper.dep.yml index a85b5285..01899363 100644 --- a/.licenses/go/github.com/arduino/go-paths-helper.dep.yml +++ b/.licenses/go/github.com/arduino/go-paths-helper.dep.yml @@ -1,6 +1,6 @@ --- name: github.com/arduino/go-paths-helper -version: v1.7.0 +version: v1.12.1 type: go summary: homepage: https://pkg.go.dev/github.com/arduino/go-paths-helper diff --git a/.licenses/go/github.com/arduino/iot-client-go/v2.dep.yml b/.licenses/go/github.com/arduino/iot-client-go/v3.dep.yml similarity index 85% rename from .licenses/go/github.com/arduino/iot-client-go/v2.dep.yml rename to .licenses/go/github.com/arduino/iot-client-go/v3.dep.yml index 43ef0bb2..76c2942d 100644 --- a/.licenses/go/github.com/arduino/iot-client-go/v2.dep.yml +++ b/.licenses/go/github.com/arduino/iot-client-go/v3.dep.yml @@ -1,9 +1,9 @@ --- -name: github.com/arduino/iot-client-go/v2 -version: v2.0.3 +name: github.com/arduino/iot-client-go/v3 +version: v3.1.1 type: go summary: -homepage: https://pkg.go.dev/github.com/arduino/iot-client-go/v2 +homepage: https://pkg.go.dev/github.com/arduino/iot-client-go/v3 license: apache-2.0 licenses: - sources: LICENSE diff --git a/.licenses/go/github.com/beevik/ntp.dep.yml b/.licenses/go/github.com/beevik/ntp.dep.yml new file mode 100644 index 00000000..951e20d6 --- /dev/null +++ b/.licenses/go/github.com/beevik/ntp.dep.yml @@ -0,0 +1,36 @@ +--- +name: github.com/beevik/ntp +version: v1.4.3 +type: go +summary: Package ntp provides an implementation of a Simple NTP (SNTP) client capable + of querying the current time from a remote NTP server. +homepage: https://pkg.go.dev/github.com/beevik/ntp +license: bsd-2-clause +licenses: +- sources: LICENSE + text: | + Copyright © 2015-2023 Brett Vickers. All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. 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. + + THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``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 COPYRIGHT HOLDER 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. +notices: [] diff --git a/.licenses/go/github.com/codeclysm/extract/v3.dep.yml b/.licenses/go/github.com/codeclysm/extract/v4.dep.yml similarity index 91% rename from .licenses/go/github.com/codeclysm/extract/v3.dep.yml rename to .licenses/go/github.com/codeclysm/extract/v4.dep.yml index a2c2101e..9defe5f8 100644 --- a/.licenses/go/github.com/codeclysm/extract/v3.dep.yml +++ b/.licenses/go/github.com/codeclysm/extract/v4.dep.yml @@ -1,10 +1,10 @@ --- -name: github.com/codeclysm/extract/v3 -version: v3.0.2 +name: github.com/codeclysm/extract/v4 +version: v4.0.0 type: go summary: Package extract allows to extract archives in zip, tar.gz or tar.bz2 formats easily. -homepage: https://pkg.go.dev/github.com/codeclysm/extract/v3 +homepage: https://pkg.go.dev/github.com/codeclysm/extract/v4 license: mit licenses: - sources: LICENSE diff --git a/.licenses/go/github.com/fluxio/iohelpers/line.dep.yml b/.licenses/go/github.com/fluxio/iohelpers/line.dep.yml deleted file mode 100644 index 1d12c9b5..00000000 --- a/.licenses/go/github.com/fluxio/iohelpers/line.dep.yml +++ /dev/null @@ -1,194 +0,0 @@ ---- -name: github.com/fluxio/iohelpers/line -version: v0.0.0-20160419043813-3a4dd67a94d2 -type: go -summary: -homepage: https://pkg.go.dev/github.com/fluxio/iohelpers/line -license: apache-2.0 -licenses: -- sources: iohelpers@v0.0.0-20160419043813-3a4dd67a94d2/LICENSE - text: |2 - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -- sources: iohelpers@v0.0.0-20160419043813-3a4dd67a94d2/README.md - text: |- - This software is licensed under Apache License, Version 2.0. Please see - [LICENSE](https://raw.githubusercontent.com/fluxio/iohelpers/master/LICENSE) - for more information. - - Copyright© 2016, Flux Factory Inc. -notices: [] diff --git a/.licenses/go/github.com/fluxio/multierror.dep.yml b/.licenses/go/github.com/fluxio/multierror.dep.yml deleted file mode 100644 index efc9cff8..00000000 --- a/.licenses/go/github.com/fluxio/multierror.dep.yml +++ /dev/null @@ -1,194 +0,0 @@ ---- -name: github.com/fluxio/multierror -version: v0.0.0-20160419044231-9c68d39025e5 -type: go -summary: Package multierror defines an error Accumulator to contain multiple errors. -homepage: https://pkg.go.dev/github.com/fluxio/multierror -license: apache-2.0 -licenses: -- sources: LICENSE - text: |2 - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS -- sources: README.md - text: |- - This software is licensed under Apache License, Version 2.0. Please see - [LICENSE](https://raw.githubusercontent.com/fluxio/multierror/master/LICENSE) - for more information. - - Copyright© 2016, Flux Factory Inc. -notices: [] diff --git a/.licenses/go/github.com/oleksandr/bonjour.dep.yml b/.licenses/go/github.com/fxamacker/cbor/v2.dep.yml similarity index 63% rename from .licenses/go/github.com/oleksandr/bonjour.dep.yml rename to .licenses/go/github.com/fxamacker/cbor/v2.dep.yml index 8d44578d..ac73f337 100644 --- a/.licenses/go/github.com/oleksandr/bonjour.dep.yml +++ b/.licenses/go/github.com/fxamacker/cbor/v2.dep.yml @@ -1,17 +1,18 @@ --- -name: github.com/oleksandr/bonjour -version: v0.0.0-20210301155756-30f43c61b915 +name: github.com/fxamacker/cbor/v2 +version: v2.8.0 type: go -summary: bonjour This is a simple Multicast DNS-SD (Apple Bonjour) library written - in Golang. -homepage: https://pkg.go.dev/github.com/oleksandr/bonjour +summary: Package cbor is a modern CBOR codec (RFC 8949 & RFC 8742) with CBOR tags, + Go struct tag options (toarray/keyasint/omitempty/omitzero), Core Deterministic + Encoding, CTAP2, Canonical CBOR, float64->32->16, and duplicate map key detection. +homepage: https://pkg.go.dev/github.com/fxamacker/cbor/v2 license: mit licenses: - sources: LICENSE - text: |+ - The MIT License (MIT) + text: |- + MIT License - Copyright (c) 2014 Oleksandr Lobunets + Copyright (c) 2019-present Faye Amacker Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -30,5 +31,11 @@ licenses: 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. +- sources: README.md + text: |- + Copyright © 2019-2024 [Faye Amacker](https://github.com/fxamacker). + fxamacker/cbor is licensed under the MIT License. See [LICENSE](LICENSE) for the full license text. + +
notices: [] diff --git a/.licenses/go/github.com/klauspost/compress.dep.yml b/.licenses/go/github.com/klauspost/compress.dep.yml new file mode 100644 index 00000000..b896bb61 --- /dev/null +++ b/.licenses/go/github.com/klauspost/compress.dep.yml @@ -0,0 +1,318 @@ +--- +name: github.com/klauspost/compress +version: v1.15.13 +type: go +summary: +homepage: https://pkg.go.dev/github.com/klauspost/compress +license: other +licenses: +- sources: LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. 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. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + 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. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-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. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + 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. +- sources: README.md + text: This code is licensed under the same conditions as the original Go code. See + LICENSE file. +notices: [] diff --git a/.licenses/go/github.com/klauspost/compress/fse.dep.yml b/.licenses/go/github.com/klauspost/compress/fse.dep.yml new file mode 100644 index 00000000..e8ccb2ed --- /dev/null +++ b/.licenses/go/github.com/klauspost/compress/fse.dep.yml @@ -0,0 +1,315 @@ +--- +name: github.com/klauspost/compress/fse +version: v1.15.13 +type: go +summary: Package fse provides Finite State Entropy encoding and decoding. +homepage: https://pkg.go.dev/github.com/klauspost/compress/fse +license: other +licenses: +- sources: compress@v1.15.13/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. 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. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + 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. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-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. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + 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/klauspost/compress/huff0.dep.yml b/.licenses/go/github.com/klauspost/compress/huff0.dep.yml new file mode 100644 index 00000000..9aa94279 --- /dev/null +++ b/.licenses/go/github.com/klauspost/compress/huff0.dep.yml @@ -0,0 +1,316 @@ +--- +name: github.com/klauspost/compress/huff0 +version: v1.15.13 +type: go +summary: This file contains the specialisation of Decoder.Decompress4X and Decoder.Decompress1X + that use an asm implementation of thir main loops. +homepage: https://pkg.go.dev/github.com/klauspost/compress/huff0 +license: other +licenses: +- sources: compress@v1.15.13/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. 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. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + 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. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-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. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + 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/klauspost/compress/internal/cpuinfo.dep.yml b/.licenses/go/github.com/klauspost/compress/internal/cpuinfo.dep.yml new file mode 100644 index 00000000..db84f1fa --- /dev/null +++ b/.licenses/go/github.com/klauspost/compress/internal/cpuinfo.dep.yml @@ -0,0 +1,318 @@ +--- +name: github.com/klauspost/compress/internal/cpuinfo +version: v1.15.13 +type: go +summary: Package cpuinfo gives runtime info about the current CPU. +homepage: https://pkg.go.dev/github.com/klauspost/compress/internal/cpuinfo +license: other +licenses: +- sources: compress@v1.15.13/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. 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. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + 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. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-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. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + 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. +- sources: compress@v1.15.13/README.md + text: This code is licensed under the same conditions as the original Go code. See + LICENSE file. +notices: [] diff --git a/.licenses/go/github.com/klauspost/compress/internal/snapref.dep.yml b/.licenses/go/github.com/klauspost/compress/internal/snapref.dep.yml new file mode 100644 index 00000000..479566ce --- /dev/null +++ b/.licenses/go/github.com/klauspost/compress/internal/snapref.dep.yml @@ -0,0 +1,347 @@ +--- +name: github.com/klauspost/compress/internal/snapref +version: v1.15.13 +type: go +summary: Package snapref implements the Snappy compression format. +homepage: https://pkg.go.dev/github.com/klauspost/compress/internal/snapref +license: other +licenses: +- sources: LICENSE + text: | + Copyright (c) 2011 The Snappy-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: compress@v1.15.13/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. 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. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + 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. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-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. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + 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. +- sources: compress@v1.15.13/README.md + text: This code is licensed under the same conditions as the original Go code. See + LICENSE file. +notices: [] diff --git a/.licenses/go/github.com/klauspost/compress/zstd.dep.yml b/.licenses/go/github.com/klauspost/compress/zstd.dep.yml new file mode 100644 index 00000000..5bde3063 --- /dev/null +++ b/.licenses/go/github.com/klauspost/compress/zstd.dep.yml @@ -0,0 +1,315 @@ +--- +name: github.com/klauspost/compress/zstd +version: v1.15.13 +type: go +summary: Package zstd provides decompression of zstandard files. +homepage: https://pkg.go.dev/github.com/klauspost/compress/zstd +license: other +licenses: +- sources: compress@v1.15.13/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. 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. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + 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. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-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. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + 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/klauspost/compress/zstd/internal/xxhash.dep.yml b/.licenses/go/github.com/klauspost/compress/zstd/internal/xxhash.dep.yml new file mode 100644 index 00000000..84591662 --- /dev/null +++ b/.licenses/go/github.com/klauspost/compress/zstd/internal/xxhash.dep.yml @@ -0,0 +1,339 @@ +--- +name: github.com/klauspost/compress/zstd/internal/xxhash +version: v1.15.13 +type: go +summary: +homepage: https://pkg.go.dev/github.com/klauspost/compress/zstd/internal/xxhash +license: other +licenses: +- sources: compress@v1.15.13/LICENSE + text: | + Copyright (c) 2012 The Go Authors. All rights reserved. + Copyright (c) 2019 Klaus Post. 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. + + ------------------ + + Files: gzhttp/* + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2016-2017 The New York Times Company + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + ------------------ + + Files: s2/cmd/internal/readahead/* + + The MIT License (MIT) + + Copyright (c) 2015 Klaus Post + + 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. + + --------------------- + Files: snappy/* + Files: internal/snapref/* + + Copyright (c) 2011 The Snappy-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. + + ----------------- + + Files: s2/cmd/internal/filepathx/* + + Copyright 2016 The filepathx Authors + + 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. +- sources: LICENSE.txt + text: | + Copyright (c) 2016 Caleb Spare + + MIT License + + 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/miekg/dns.dep.yml b/.licenses/go/github.com/miekg/dns.dep.yml deleted file mode 100644 index b1400ded..00000000 --- a/.licenses/go/github.com/miekg/dns.dep.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: github.com/miekg/dns -version: v1.1.43 -type: go -summary: Package dns implements a full featured interface to the Domain Name System. -homepage: https://pkg.go.dev/github.com/miekg/dns -license: bsd-3-clause -licenses: -- sources: LICENSE - text: | - Copyright (c) 2009 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. - - As this is fork of the official Go code the same license applies. - Extensions of the original work are copyright (c) 2011 Miek Gieben -- sources: COPYRIGHT - text: | - Copyright 2009 The Go Authors. All rights reserved. Use of this source code - is governed by a BSD-style license that can be found in the LICENSE file. - Extensions of the original work are copyright (c) 2011 Miek Gieben - - Copyright 2011 Miek Gieben. All rights reserved. Use of this source code is - governed by a BSD-style license that can be found in the LICENSE file. - - Copyright 2014 CloudFlare. All rights reserved. Use of this source code is - governed by a BSD-style license that can be found in the LICENSE file. -notices: -- sources: AUTHORS - text: Miek Gieben diff --git a/.licenses/go/github.com/ulikunitz/xz.dep.yml b/.licenses/go/github.com/ulikunitz/xz.dep.yml new file mode 100644 index 00000000..b02e158f --- /dev/null +++ b/.licenses/go/github.com/ulikunitz/xz.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/ulikunitz/xz +version: v0.5.12 +type: go +summary: Package xz supports the compression and decompression of xz files. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz +license: bsd-3-clause +licenses: +- sources: LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + 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. + + * My name, Ulrich Kunitz, may not 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 HOLDER 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. +notices: [] diff --git a/.licenses/go/github.com/ulikunitz/xz/internal/hash.dep.yml b/.licenses/go/github.com/ulikunitz/xz/internal/hash.dep.yml new file mode 100644 index 00000000..c9a34e7a --- /dev/null +++ b/.licenses/go/github.com/ulikunitz/xz/internal/hash.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/ulikunitz/xz/internal/hash +version: v0.5.12 +type: go +summary: Package hash provides rolling hashes. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz/internal/hash +license: bsd-3-clause +licenses: +- sources: xz@v0.5.12/LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + 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. + + * My name, Ulrich Kunitz, may not 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 HOLDER 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. +notices: [] diff --git a/.licenses/go/github.com/ulikunitz/xz/internal/xlog.dep.yml b/.licenses/go/github.com/ulikunitz/xz/internal/xlog.dep.yml new file mode 100644 index 00000000..a5ec3008 --- /dev/null +++ b/.licenses/go/github.com/ulikunitz/xz/internal/xlog.dep.yml @@ -0,0 +1,38 @@ +--- +name: github.com/ulikunitz/xz/internal/xlog +version: v0.5.12 +type: go +summary: Package xlog provides a simple logging package that allows to disable certain + message categories. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz/internal/xlog +license: bsd-3-clause +licenses: +- sources: xz@v0.5.12/LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + 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. + + * My name, Ulrich Kunitz, may not 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 HOLDER 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. +notices: [] diff --git a/.licenses/go/github.com/ulikunitz/xz/lzma.dep.yml b/.licenses/go/github.com/ulikunitz/xz/lzma.dep.yml new file mode 100644 index 00000000..66a937e5 --- /dev/null +++ b/.licenses/go/github.com/ulikunitz/xz/lzma.dep.yml @@ -0,0 +1,37 @@ +--- +name: github.com/ulikunitz/xz/lzma +version: v0.5.12 +type: go +summary: Package lzma supports the decoding and encoding of LZMA streams. +homepage: https://pkg.go.dev/github.com/ulikunitz/xz/lzma +license: bsd-3-clause +licenses: +- sources: xz@v0.5.12/LICENSE + text: | + Copyright (c) 2014-2022 Ulrich Kunitz + 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. + + * My name, Ulrich Kunitz, may not 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 HOLDER 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. +notices: [] diff --git a/.licenses/go/github.com/codeclysm/cc.dep.yml b/.licenses/go/github.com/x448/float16.dep.yml similarity index 78% rename from .licenses/go/github.com/codeclysm/cc.dep.yml rename to .licenses/go/github.com/x448/float16.dep.yml index 166f837c..901125f9 100644 --- a/.licenses/go/github.com/codeclysm/cc.dep.yml +++ b/.licenses/go/github.com/x448/float16.dep.yml @@ -1,16 +1,16 @@ --- -name: github.com/codeclysm/cc -version: v1.2.2 +name: github.com/x448/float16 +version: v0.8.4 type: go summary: -homepage: https://pkg.go.dev/github.com/codeclysm/cc +homepage: https://pkg.go.dev/github.com/x448/float16 license: mit licenses: - sources: LICENSE - text: | + text: |+ MIT License - Copyright (c) 2017 codeclysm + Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -29,4 +29,10 @@ licenses: 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. + +- sources: README.md + text: |- + Copyright (c) 2019 Montgomery Edwards⁴⁴⁸ and Faye Amacker + + Licensed under [MIT License](LICENSE) notices: [] diff --git a/.licenses/go/go.bug.st/relaxed-semver.dep.yml b/.licenses/go/go.bug.st/relaxed-semver.dep.yml index bc044af9..90ec5ac2 100644 --- a/.licenses/go/go.bug.st/relaxed-semver.dep.yml +++ b/.licenses/go/go.bug.st/relaxed-semver.dep.yml @@ -1,6 +1,6 @@ --- name: go.bug.st/relaxed-semver -version: v0.9.0 +version: v0.10.1 type: go summary: homepage: https://pkg.go.dev/go.bug.st/relaxed-semver diff --git a/.licenses/go/go.bug.st/serial.dep.yml b/.licenses/go/go.bug.st/serial.dep.yml index 2d1d07b0..69008aa5 100644 --- a/.licenses/go/go.bug.st/serial.dep.yml +++ b/.licenses/go/go.bug.st/serial.dep.yml @@ -1,6 +1,6 @@ --- name: go.bug.st/serial -version: v1.3.3 +version: v1.6.2 type: go summary: Package serial is a cross-platform serial library for the go language. homepage: https://pkg.go.dev/go.bug.st/serial @@ -9,7 +9,7 @@ licenses: - sources: LICENSE text: |2+ - Copyright (c) 2014-2021, Cristian Maglie. + Copyright (c) 2014-2023, Cristian Maglie. All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/.licenses/go/go.bug.st/serial.v1.dep.yml b/.licenses/go/go.bug.st/serial.v1.dep.yml deleted file mode 100644 index 9c39d1fb..00000000 --- a/.licenses/go/go.bug.st/serial.v1.dep.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: go.bug.st/serial.v1 -version: v0.0.0-20191202182710-24a6610f0541 -type: go -summary: Package serial is a cross-platform serial library for the go language. -homepage: https://pkg.go.dev/go.bug.st/serial.v1 -license: bsd-3-clause -licenses: -- sources: LICENSE - text: |2+ - - Copyright (c) 2014-2020, Cristian Maglie. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - - 3. Neither the name of the copyright holder 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 HOLDER 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: README.md - text: |- - The software is release under a BSD 3-clause license - - https://github.com/bugst/go-serial/blob/v1/LICENSE -notices: [] diff --git a/.licenses/go/go.bug.st/serial.v1/enumerator.dep.yml b/.licenses/go/go.bug.st/serial.v1/enumerator.dep.yml deleted file mode 100644 index d69972d2..00000000 --- a/.licenses/go/go.bug.st/serial.v1/enumerator.dep.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: go.bug.st/serial.v1/enumerator -version: v0.0.0-20191202182710-24a6610f0541 -type: go -summary: Package enumerator is a golang cross-platform library for USB serial port - discovery. -homepage: https://pkg.go.dev/go.bug.st/serial.v1/enumerator -license: bsd-3-clause -licenses: -- sources: serial.v1@v0.0.0-20191202182710-24a6610f0541/LICENSE - text: |2+ - - Copyright (c) 2014-2020, Cristian Maglie. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - - 3. Neither the name of the copyright holder 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 HOLDER 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: serial.v1@v0.0.0-20191202182710-24a6610f0541/README.md - text: |- - The software is release under a BSD 3-clause license - - https://github.com/bugst/go-serial/blob/v1/LICENSE -notices: [] diff --git a/.licenses/go/go.bug.st/serial.v1/unixutils.dep.yml b/.licenses/go/go.bug.st/serial.v1/unixutils.dep.yml deleted file mode 100644 index a96a2ac2..00000000 --- a/.licenses/go/go.bug.st/serial.v1/unixutils.dep.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -name: go.bug.st/serial.v1/unixutils -version: v0.0.0-20191202182710-24a6610f0541 -type: go -summary: -homepage: https://pkg.go.dev/go.bug.st/serial.v1/unixutils -license: bsd-3-clause -licenses: -- sources: serial.v1@v0.0.0-20191202182710-24a6610f0541/LICENSE - text: |2+ - - Copyright (c) 2014-2020, Cristian Maglie. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. 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. - - 3. Neither the name of the copyright holder 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 HOLDER 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: serial.v1@v0.0.0-20191202182710-24a6610f0541/README.md - text: |- - The software is release under a BSD 3-clause license - - https://github.com/bugst/go-serial/blob/v1/LICENSE -notices: [] diff --git a/.licenses/go/go.bug.st/serial/unixutils.dep.yml b/.licenses/go/go.bug.st/serial/unixutils.dep.yml index 32a5d6b9..56868ecb 100644 --- a/.licenses/go/go.bug.st/serial/unixutils.dep.yml +++ b/.licenses/go/go.bug.st/serial/unixutils.dep.yml @@ -1,15 +1,15 @@ --- name: go.bug.st/serial/unixutils -version: v1.3.3 +version: v1.6.2 type: go summary: homepage: https://pkg.go.dev/go.bug.st/serial/unixutils license: bsd-3-clause licenses: -- sources: serial@v1.3.3/LICENSE +- sources: serial@v1.6.2/LICENSE text: |2+ - Copyright (c) 2014-2021, Cristian Maglie. + Copyright (c) 2014-2023, Cristian Maglie. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -41,7 +41,7 @@ licenses: ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- sources: serial@v1.3.3/README.md +- sources: serial@v1.6.2/README.md text: |- The software is release under a [BSD 3-clause license] diff --git a/.licenses/go/golang.org/x/crypto/blowfish.dep.yml b/.licenses/go/golang.org/x/crypto/blowfish.dep.yml index 449f8662..4f682e0d 100644 --- a/.licenses/go/golang.org/x/crypto/blowfish.dep.yml +++ b/.licenses/go/golang.org/x/crypto/blowfish.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/blowfish -version: v0.18.0 +version: v0.23.0 type: go summary: Package blowfish implements Bruce Schneier's Blowfish encryption algorithm. homepage: https://pkg.go.dev/golang.org/x/crypto/blowfish license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/cast5.dep.yml b/.licenses/go/golang.org/x/crypto/cast5.dep.yml index bcdeb025..369aae2e 100644 --- a/.licenses/go/golang.org/x/crypto/cast5.dep.yml +++ b/.licenses/go/golang.org/x/crypto/cast5.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/cast5 -version: v0.18.0 +version: v0.23.0 type: go summary: Package cast5 implements CAST5, as defined in RFC 2144. homepage: https://pkg.go.dev/golang.org/x/crypto/cast5 license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/internal/alias.dep.yml b/.licenses/go/golang.org/x/crypto/curve25519.dep.yml similarity index 89% rename from .licenses/go/golang.org/x/crypto/internal/alias.dep.yml rename to .licenses/go/golang.org/x/crypto/curve25519.dep.yml index cd614395..27ff49f5 100644 --- a/.licenses/go/golang.org/x/crypto/internal/alias.dep.yml +++ b/.licenses/go/golang.org/x/crypto/curve25519.dep.yml @@ -1,12 +1,13 @@ --- -name: golang.org/x/crypto/internal/alias -version: v0.18.0 +name: golang.org/x/crypto/curve25519 +version: v0.23.0 type: go -summary: Package alias implements memory aliasing tests. -homepage: https://pkg.go.dev/golang.org/x/crypto/internal/alias +summary: Package curve25519 provides an implementation of the X25519 function, which + performs scalar multiplication on the elliptic curve known as Curve25519. +homepage: https://pkg.go.dev/golang.org/x/crypto/curve25519 license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -35,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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/openpgp.dep.yml b/.licenses/go/golang.org/x/crypto/openpgp.dep.yml index af05f837..4ba5db06 100644 --- a/.licenses/go/golang.org/x/crypto/openpgp.dep.yml +++ b/.licenses/go/golang.org/x/crypto/openpgp.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/openpgp -version: v0.18.0 +version: v0.23.0 type: go summary: Package openpgp implements high level operations on OpenPGP messages. homepage: https://pkg.go.dev/golang.org/x/crypto/openpgp license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/openpgp/armor.dep.yml b/.licenses/go/golang.org/x/crypto/openpgp/armor.dep.yml index 0dc3804c..7784e1ad 100644 --- a/.licenses/go/golang.org/x/crypto/openpgp/armor.dep.yml +++ b/.licenses/go/golang.org/x/crypto/openpgp/armor.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/openpgp/armor -version: v0.18.0 +version: v0.23.0 type: go summary: Package armor implements OpenPGP ASCII Armor, see RFC 4880. homepage: https://pkg.go.dev/golang.org/x/crypto/openpgp/armor license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/openpgp/elgamal.dep.yml b/.licenses/go/golang.org/x/crypto/openpgp/elgamal.dep.yml index e8bdefb6..dc98ffd8 100644 --- a/.licenses/go/golang.org/x/crypto/openpgp/elgamal.dep.yml +++ b/.licenses/go/golang.org/x/crypto/openpgp/elgamal.dep.yml @@ -1,6 +1,6 @@ --- name: golang.org/x/crypto/openpgp/elgamal -version: v0.18.0 +version: v0.23.0 type: go summary: Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," @@ -8,7 +8,7 @@ summary: Package elgamal implements ElGamal encryption, suitable for OpenPGP, as homepage: https://pkg.go.dev/golang.org/x/crypto/openpgp/elgamal license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -37,7 +37,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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/openpgp/errors.dep.yml b/.licenses/go/golang.org/x/crypto/openpgp/errors.dep.yml index 38fd876f..484e001b 100644 --- a/.licenses/go/golang.org/x/crypto/openpgp/errors.dep.yml +++ b/.licenses/go/golang.org/x/crypto/openpgp/errors.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/openpgp/errors -version: v0.18.0 +version: v0.23.0 type: go summary: Package errors contains common error types for the OpenPGP packages. homepage: https://pkg.go.dev/golang.org/x/crypto/openpgp/errors license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/openpgp/packet.dep.yml b/.licenses/go/golang.org/x/crypto/openpgp/packet.dep.yml index 48b8a419..eb6d99c1 100644 --- a/.licenses/go/golang.org/x/crypto/openpgp/packet.dep.yml +++ b/.licenses/go/golang.org/x/crypto/openpgp/packet.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/crypto/openpgp/packet -version: v0.18.0 +version: v0.23.0 type: go summary: Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880. homepage: https://pkg.go.dev/golang.org/x/crypto/openpgp/packet license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/openpgp/s2k.dep.yml b/.licenses/go/golang.org/x/crypto/openpgp/s2k.dep.yml index c178e683..cc460fa6 100644 --- a/.licenses/go/golang.org/x/crypto/openpgp/s2k.dep.yml +++ b/.licenses/go/golang.org/x/crypto/openpgp/s2k.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/crypto/openpgp/s2k -version: v0.18.0 +version: v0.23.0 type: go summary: Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1. homepage: https://pkg.go.dev/golang.org/x/crypto/openpgp/s2k license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/ssh.dep.yml b/.licenses/go/golang.org/x/crypto/ssh.dep.yml index b2e4ec28..2c39eb21 100644 --- a/.licenses/go/golang.org/x/crypto/ssh.dep.yml +++ b/.licenses/go/golang.org/x/crypto/ssh.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/ssh -version: v0.18.0 +version: v0.23.0 type: go summary: Package ssh implements an SSH client and server. homepage: https://pkg.go.dev/golang.org/x/crypto/ssh license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/ssh/agent.dep.yml b/.licenses/go/golang.org/x/crypto/ssh/agent.dep.yml index b4f34666..85f57262 100644 --- a/.licenses/go/golang.org/x/crypto/ssh/agent.dep.yml +++ b/.licenses/go/golang.org/x/crypto/ssh/agent.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/crypto/ssh/agent -version: v0.18.0 +version: v0.23.0 type: go summary: Package agent implements the ssh-agent protocol, and provides both a client and a server. homepage: https://pkg.go.dev/golang.org/x/crypto/ssh/agent license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf.dep.yml b/.licenses/go/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf.dep.yml index e62bee50..38e497ed 100644 --- a/.licenses/go/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf.dep.yml +++ b/.licenses/go/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/crypto/ssh/internal/bcrypt_pbkdf -version: v0.18.0 +version: v0.23.0 type: go summary: Package bcrypt_pbkdf implements bcrypt_pbkdf(3) from OpenBSD. homepage: https://pkg.go.dev/golang.org/x/crypto/ssh/internal/bcrypt_pbkdf license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/crypto/ssh/knownhosts.dep.yml b/.licenses/go/golang.org/x/crypto/ssh/knownhosts.dep.yml index c8144dfa..777f3cfc 100644 --- a/.licenses/go/golang.org/x/crypto/ssh/knownhosts.dep.yml +++ b/.licenses/go/golang.org/x/crypto/ssh/knownhosts.dep.yml @@ -1,6 +1,6 @@ --- name: golang.org/x/crypto/ssh/knownhosts -version: v0.18.0 +version: v0.23.0 type: go summary: Package knownhosts implements a parser for the OpenSSH known_hosts host key database, and provides utility functions for writing OpenSSH compliant known_hosts @@ -8,7 +8,7 @@ summary: Package knownhosts implements a parser for the OpenSSH known_hosts host homepage: https://pkg.go.dev/golang.org/x/crypto/ssh/knownhosts license: bsd-3-clause licenses: -- sources: crypto@v0.18.0/LICENSE +- sources: crypto@v0.23.0/LICENSE text: | Copyright (c) 2009 The Go Authors. All rights reserved. @@ -37,7 +37,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: crypto@v0.18.0/PATENTS +- sources: crypto@v0.23.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/bpf.dep.yml b/.licenses/go/golang.org/x/net/bpf.dep.yml index 8d05d558..e75ae79d 100644 --- a/.licenses/go/golang.org/x/net/bpf.dep.yml +++ b/.licenses/go/golang.org/x/net/bpf.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/net/bpf -version: v0.20.0 +version: v0.25.0 type: go summary: Package bpf implements marshaling and unmarshaling of programs for the Berkeley Packet Filter virtual machine, and provides a Go implementation of the virtual machine. homepage: https://pkg.go.dev/golang.org/x/net/bpf -license: bsd-3-clause +license: other licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/context.dep.yml b/.licenses/go/golang.org/x/net/context.dep.yml index 3a5b464d..5ce2b786 100644 --- a/.licenses/go/golang.org/x/net/context.dep.yml +++ b/.licenses/go/golang.org/x/net/context.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/net/context -version: v0.20.0 +version: v0.25.0 type: go summary: Package context defines the Context type, which carries deadlines, cancelation signals, and other request-scoped values across API boundaries and between processes. homepage: https://pkg.go.dev/golang.org/x/net/context license: bsd-3-clause licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/http2.dep.yml b/.licenses/go/golang.org/x/net/http2.dep.yml index 7337b512..4e442b81 100644 --- a/.licenses/go/golang.org/x/net/http2.dep.yml +++ b/.licenses/go/golang.org/x/net/http2.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/http2 -version: v0.20.0 +version: v0.25.0 type: go summary: Package http2 implements the HTTP/2 protocol. homepage: https://pkg.go.dev/golang.org/x/net/http2 license: bsd-3-clause licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/internal/iana.dep.yml b/.licenses/go/golang.org/x/net/internal/iana.dep.yml index 54473855..3be2feba 100644 --- a/.licenses/go/golang.org/x/net/internal/iana.dep.yml +++ b/.licenses/go/golang.org/x/net/internal/iana.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/net/internal/iana -version: v0.20.0 +version: v0.25.0 type: go summary: Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA). homepage: https://pkg.go.dev/golang.org/x/net/internal/iana -license: bsd-3-clause +license: other licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/internal/socket.dep.yml b/.licenses/go/golang.org/x/net/internal/socket.dep.yml index 520d750e..bdcec430 100644 --- a/.licenses/go/golang.org/x/net/internal/socket.dep.yml +++ b/.licenses/go/golang.org/x/net/internal/socket.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/internal/socket -version: v0.20.0 +version: v0.25.0 type: go summary: Package socket provides a portable interface for socket system calls. homepage: https://pkg.go.dev/golang.org/x/net/internal/socket -license: bsd-3-clause +license: other licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/internal/socks.dep.yml b/.licenses/go/golang.org/x/net/internal/socks.dep.yml index c0776014..d87d267f 100644 --- a/.licenses/go/golang.org/x/net/internal/socks.dep.yml +++ b/.licenses/go/golang.org/x/net/internal/socks.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/internal/socks -version: v0.20.0 +version: v0.25.0 type: go summary: Package socks provides a SOCKS version 5 client implementation. homepage: https://pkg.go.dev/golang.org/x/net/internal/socks license: bsd-3-clause licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/internal/timeseries.dep.yml b/.licenses/go/golang.org/x/net/internal/timeseries.dep.yml index a612a972..6701aa7f 100644 --- a/.licenses/go/golang.org/x/net/internal/timeseries.dep.yml +++ b/.licenses/go/golang.org/x/net/internal/timeseries.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/internal/timeseries -version: v0.20.0 +version: v0.25.0 type: go summary: Package timeseries implements a time series structure for stats collection. homepage: https://pkg.go.dev/golang.org/x/net/internal/timeseries license: bsd-3-clause licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/ipv4.dep.yml b/.licenses/go/golang.org/x/net/ipv4.dep.yml index 8a43a700..34f6bc89 100644 --- a/.licenses/go/golang.org/x/net/ipv4.dep.yml +++ b/.licenses/go/golang.org/x/net/ipv4.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/net/ipv4 -version: v0.20.0 +version: v0.25.0 type: go summary: Package ipv4 implements IP-level socket options for the Internet Protocol version 4. homepage: https://pkg.go.dev/golang.org/x/net/ipv4 -license: bsd-3-clause +license: other licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/ipv6.dep.yml b/.licenses/go/golang.org/x/net/ipv6.dep.yml deleted file mode 100644 index e2a17556..00000000 --- a/.licenses/go/golang.org/x/net/ipv6.dep.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -name: golang.org/x/net/ipv6 -version: v0.20.0 -type: go -summary: Package ipv6 implements IP-level socket options for the Internet Protocol - version 6. -homepage: https://pkg.go.dev/golang.org/x/net/ipv6 -license: bsd-3-clause -licenses: -- sources: net@v0.20.0/LICENSE - text: | - Copyright (c) 2009 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: net@v0.20.0/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/golang.org/x/net/proxy.dep.yml b/.licenses/go/golang.org/x/net/proxy.dep.yml index 483ff363..4d60ef78 100644 --- a/.licenses/go/golang.org/x/net/proxy.dep.yml +++ b/.licenses/go/golang.org/x/net/proxy.dep.yml @@ -1,13 +1,13 @@ --- name: golang.org/x/net/proxy -version: v0.20.0 +version: v0.25.0 type: go summary: Package proxy provides support for a variety of protocols to proxy network data. homepage: https://pkg.go.dev/golang.org/x/net/proxy license: bsd-3-clause licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/net/trace.dep.yml b/.licenses/go/golang.org/x/net/trace.dep.yml index 7d486480..94ae6214 100644 --- a/.licenses/go/golang.org/x/net/trace.dep.yml +++ b/.licenses/go/golang.org/x/net/trace.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/net/trace -version: v0.20.0 +version: v0.25.0 type: go summary: Package trace implements tracing of requests and long-lived objects. homepage: https://pkg.go.dev/golang.org/x/net/trace license: bsd-3-clause licenses: -- sources: net@v0.20.0/LICENSE +- sources: net@v0.25.0/LICENSE text: | Copyright (c) 2009 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: net@v0.20.0/PATENTS +- sources: net@v0.25.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/oauth2.dep.yml b/.licenses/go/golang.org/x/oauth2.dep.yml index 7be49c5b..704a67c4 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.21.0 +version: v0.25.0 type: go summary: Package oauth2 provides support for making OAuth2 authorized and authenticated HTTP requests, as specified in RFC 6749. @@ -9,7 +9,7 @@ license: bsd-3-clause licenses: - sources: LICENSE text: | - Copyright (c) 2009 The Go Authors. All rights reserved. + Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -21,7 +21,7 @@ licenses: 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml b/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml index f5cc2b56..8ecbb7d7 100644 --- a/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml +++ b/.licenses/go/golang.org/x/oauth2/clientcredentials.dep.yml @@ -1,15 +1,15 @@ --- name: golang.org/x/oauth2/clientcredentials -version: v0.21.0 +version: v0.25.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.21.0/LICENSE +- sources: oauth2@v0.25.0/LICENSE text: | - Copyright (c) 2009 The Go Authors. All rights reserved. + Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -21,7 +21,7 @@ licenses: 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/.licenses/go/golang.org/x/oauth2/internal.dep.yml b/.licenses/go/golang.org/x/oauth2/internal.dep.yml index 4d1daff8..183fc7e3 100644 --- a/.licenses/go/golang.org/x/oauth2/internal.dep.yml +++ b/.licenses/go/golang.org/x/oauth2/internal.dep.yml @@ -1,14 +1,14 @@ --- name: golang.org/x/oauth2/internal -version: v0.21.0 +version: v0.25.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.21.0/LICENSE +- sources: oauth2@v0.25.0/LICENSE text: | - Copyright (c) 2009 The Go Authors. All rights reserved. + Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -20,7 +20,7 @@ licenses: 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 + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/.licenses/go/golang.org/x/sys/unix.dep.yml b/.licenses/go/golang.org/x/sys/unix.dep.yml index e04edef8..8c6dd955 100644 --- a/.licenses/go/golang.org/x/sys/unix.dep.yml +++ b/.licenses/go/golang.org/x/sys/unix.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/sys/unix -version: v0.16.0 +version: v0.20.0 type: go summary: Package unix contains an interface to the low-level operating system primitives. homepage: https://pkg.go.dev/golang.org/x/sys/unix license: bsd-3-clause licenses: -- sources: sys@v0.16.0/LICENSE +- sources: sys@v0.20.0/LICENSE text: | Copyright (c) 2009 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: sys@v0.16.0/PATENTS +- sources: sys@v0.20.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/.licenses/go/golang.org/x/text/runes.dep.yml b/.licenses/go/golang.org/x/text/runes.dep.yml index baa52fe7..aec13555 100644 --- a/.licenses/go/golang.org/x/text/runes.dep.yml +++ b/.licenses/go/golang.org/x/text/runes.dep.yml @@ -1,12 +1,12 @@ --- name: golang.org/x/text/runes -version: v0.14.0 +version: v0.15.0 type: go summary: Package runes provide transforms for UTF-8 encoded text. homepage: https://pkg.go.dev/golang.org/x/text/runes license: bsd-3-clause licenses: -- sources: text@v0.14.0/LICENSE +- sources: text@v0.15.0/LICENSE text: | Copyright (c) 2009 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: text@v0.14.0/PATENTS +- sources: text@v0.15.0/PATENTS text: | Additional IP Rights Grant (Patents) diff --git a/DistTasks.yml b/DistTasks.yml index 8915f899..eccd14ab 100644 --- a/DistTasks.yml +++ b/DistTasks.yml @@ -20,7 +20,7 @@ version: "3" vars: CONTAINER: "docker.elastic.co/beats-dev/golang-crossbuild" - GO_VERSION: "1.19" + GO_VERSION: "1.23.2" CHECKSUM_FILE: "{{.VERSION}}-checksums.txt" tasks: @@ -35,6 +35,7 @@ tasks: - task: Linux_ARMv7 - task: Linux_ARM64 - task: macOS_64bit + - task: macOS_ARM64 Windows_32bit: desc: Builds Windows 32 bit binaries @@ -168,37 +169,9 @@ tasks: vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_6" - BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}" + BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} -buildvcs=false" BUILD_PLATFORM: "linux/armv6" - # We are experiencing the following error with ARMv6 build: - # - # # github.com/arduino/arduino-cli - # net(.text): unexpected relocation type 296 (R_ARM_V4BX) - # panic: runtime error: invalid memory address or nil pointer dereference - # [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x51ae53] - # - # goroutine 1 [running]: - # cmd/link/internal/loader.(*Loader).SymName(0xc000095c00, 0x0, 0xc0000958d8, 0x5a0ac) - # /usr/local/go/src/cmd/link/internal/loader/loader.go:684 +0x53 - # cmd/link/internal/ld.dynrelocsym2(0xc000095880, 0x5a0ac) - # /usr/local/go/src/cmd/link/internal/ld/data.go:777 +0x295 - # cmd/link/internal/ld.(*dodataState).dynreloc2(0xc007df9800, 0xc000095880) - # /usr/local/go/src/cmd/link/internal/ld/data.go:794 +0x89 - # cmd/link/internal/ld.(*Link).dodata2(0xc000095880, 0xc007d00000, 0x60518, 0x60518) - # /usr/local/go/src/cmd/link/internal/ld/data.go:1434 +0x4d4 - # cmd/link/internal/ld.Main(0x8729a0, 0x4, 0x8, 0x1, 0xd, 0xe, 0x0, 0x0, 0x6d7737, 0x12, ...) - # /usr/local/go/src/cmd/link/internal/ld/main.go:302 +0x123a - # main.main() - # /usr/local/go/src/cmd/link/main.go:68 +0x1dc - # Error: failed building for linux/armv6: exit status 2 - # - # This seems to be a problem in the go builder 1.16.x that removed support for the R_ARM_V4BX instruction: - # https://github.com/golang/go/pull/44998 - # https://groups.google.com/g/golang-codereviews/c/yzN80xxwu2E - # - # Until there is a fix released we must use a recent gcc for Linux_ARMv6 build, so for this - # build we select the debian10 based container. - CONTAINER_TAG: "{{.GO_VERSION}}-armel-debian11" + CONTAINER_TAG: "{{.GO_VERSION}}-armel-debian12" PACKAGE_PLATFORM: "Linux_ARMv6" PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" @@ -225,7 +198,7 @@ tasks: PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" macOS_64bit: - desc: Builds Mac OS X 64 bit binaries + desc: Builds Mac OS X x86_64 bit binaries dir: "{{.DIST_DIR}}" cmds: - | @@ -240,7 +213,7 @@ tasks: vars: PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_amd64" - BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}}" + BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} -buildvcs=false" BUILD_PLATFORM: "darwin/amd64" # We are experiencing the following error with macOS_64bit build: # @@ -255,6 +228,28 @@ tasks: # # To compile it we need an SDK >=10.12 so we use the debian10 based container that # has the SDK 10.14 installed. - CONTAINER_TAG: "{{.GO_VERSION}}-darwin-debian11" + CONTAINER_TAG: "{{.GO_VERSION}}-darwin-debian10" PACKAGE_PLATFORM: "macOS_64bit" PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" + + macOS_ARM64: + desc: Builds Mac OS X ARM64 binaries + dir: "{{.DIST_DIR}}" + cmds: + - | + docker run -v `pwd`/..:/home/build -w /home/build \ + -e CGO_ENABLED=1 \ + {{.CONTAINER}}:{{.CONTAINER_TAG}} \ + --build-cmd "{{.BUILD_COMMAND}}" \ + -p "{{.BUILD_PLATFORM}}" + + tar cz -C {{.PLATFORM_DIR}} {{.PROJECT_NAME}} -C ../.. LICENSE.txt -f {{.PACKAGE_NAME}} + sha256sum {{.PACKAGE_NAME}} >> {{.CHECKSUM_FILE}} + + vars: + PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_arm64" + BUILD_COMMAND: "go build -o {{.DIST_DIR}}/{{.PLATFORM_DIR}}/{{.PROJECT_NAME}} {{.LDFLAGS}} -buildvcs=false" + BUILD_PLATFORM: "darwin/arm64" + CONTAINER_TAG: "{{.GO_VERSION}}-darwin-arm64-debian10" + PACKAGE_PLATFORM: "macOS_ARM64" + PACKAGE_NAME: "{{.PROJECT_NAME}}_{{.VERSION}}_{{.PACKAGE_PLATFORM}}.tar.gz" diff --git a/cli/device/configure.go b/cli/device/configure.go new file mode 100644 index 00000000..713a512a --- /dev/null +++ b/cli/device/configure.go @@ -0,0 +1,103 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package device + +import ( + "context" + "encoding/json" + "os" + + "github.com/arduino/arduino-cli/cli/errorcodes" + "github.com/arduino/arduino-cli/cli/feedback" + "github.com/arduino/arduino-cloud-cli/command/device" + "github.com/sirupsen/logrus" + "github.com/spf13/cobra" + "go.bug.st/cleanup" +) + +type netConfigurationFlags struct { + port string + connectionType int32 + fqbn string + configFile string +} + +func initConfigureCommand() *cobra.Command { + flags := &netConfigurationFlags{} + createCommand := &cobra.Command{ + Use: "configure", + Short: "Configure the network settings of a device running a sketch with the Network Configurator lib enabled", + Long: "Configure the network settings of a device running a sketch with the Network Configurator lib enabled", + Run: func(cmd *cobra.Command, args []string) { + if err := runConfigureCommand(flags); err != nil { + feedback.Errorf("Error during device configuration: %v", err) + os.Exit(errorcodes.ErrGeneric) + } + }, + } + createCommand.Flags().StringVarP(&flags.port, "port", "p", "", "Device port") + createCommand.Flags().StringVarP(&flags.fqbn, "fqbn", "b", "", "Device fqbn") + createCommand.Flags().Int32VarP(&flags.connectionType, "connection", "c", 0, "Device connection type (1: WiFi, 2: Ethernet, 3: NB-IoT, 4: GSM, 5: LoRaWan, 6:CAT-M1, 7: Cellular)") + createCommand.Flags().StringVarP(&flags.configFile, "config-file", "f", "", "Path to the configuration file (optional). View online documentation for the format") + createCommand.MarkFlagRequired("connection") + + return createCommand +} + +func runConfigureCommand(flags *netConfigurationFlags) error { + logrus.Infof("Configuring device with connection type %d", flags.connectionType) + + netParams := &device.NetConfig{ + Type: flags.connectionType, + } + + if flags.configFile != "" { + file, err := os.ReadFile(flags.configFile) + if err != nil { + logrus.Errorf("Error reading file %s: %v", flags.configFile, err) + return err + } + err = json.Unmarshal(file, &netParams) + if err != nil { + logrus.Errorf("Error parsing JSON from file %s: %v", flags.configFile, err) + return err + } + } else { + feedback.Print("Insert network configuration") + device.GetInputFromMenu(netParams) + } + + boardFilterParams := &device.CreateParams{} + + if flags.port != "" { + boardFilterParams.Port = &flags.port + } + if flags.fqbn != "" { + boardFilterParams.FQBN = &flags.fqbn + } + + ctx, cancel := cleanup.InterruptableContext(context.Background()) + defer cancel() + feedback.Print("Starting network configuration...") + err := device.NetConfigure(ctx, boardFilterParams, netParams) + if err != nil { + return err + } + feedback.Print("Network configuration successfully completed.") + return nil +} diff --git a/cli/device/create.go b/cli/device/create.go index bca5453e..0323a57c 100644 --- a/cli/device/create.go +++ b/cli/device/create.go @@ -83,6 +83,8 @@ func runCreateCommand(flags *createFlags) error { ctx, cancel := cleanup.InterruptableContext(context.Background()) defer cancel() + feedback.Printf("Creating device with name %s", flags.name) + dev, err := device.Create(ctx, params, cred) if err != nil { return err diff --git a/cli/device/device.go b/cli/device/device.go index 854336e3..07359a8f 100644 --- a/cli/device/device.go +++ b/cli/device/device.go @@ -30,6 +30,7 @@ func NewCommand() *cobra.Command { } deviceCommand.AddCommand(initCreateCommand()) + deviceCommand.AddCommand(initConfigureCommand()) deviceCommand.AddCommand(initListCommand()) deviceCommand.AddCommand(initShowCommand()) deviceCommand.AddCommand(initDeleteCommand()) diff --git a/cli/device/list.go b/cli/device/list.go index d7799a0d..99a339a4 100644 --- a/cli/device/list.go +++ b/cli/device/list.go @@ -34,6 +34,7 @@ import ( type listFlags struct { tags map[string]string + status string deviceIds string } @@ -58,6 +59,7 @@ func initListCommand() *cobra.Command { "List only devices that match the provided tags.", ) listCommand.Flags().StringVarP(&flags.deviceIds, "device-ids", "d", "", "Comma separated list of Device IDs") + listCommand.Flags().StringVarP(&flags.status, "device-status", "s", "", "List only devices according to the provided status [ONLINE|OFFLINE|UNKNOWN]") return listCommand } @@ -68,8 +70,11 @@ func runListCommand(flags *listFlags) error { if err != nil { return fmt.Errorf("retrieving credentials: %w", err) } + if flags.status != "" && flags.status != "ONLINE" && flags.status != "OFFLINE" && flags.status != "UNKNOWN" { + return fmt.Errorf("invalid status: %s", flags.status) + } - params := &device.ListParams{Tags: flags.tags, DeviceIds: flags.deviceIds} + params := &device.ListParams{Tags: flags.tags, DeviceIds: flags.deviceIds, Status: flags.status} devs, err := device.List(context.TODO(), params, cred) if err != nil { return err @@ -87,6 +92,11 @@ func (r listResult) Data() interface{} { return r.devices } +func cleanStrings(serial string) string { + serial = strings.Trim(serial, "\n") + return strings.Trim(serial, " ") +} + func (r listResult) String() string { if len(r.devices) == 0 { return "No devices found." @@ -95,11 +105,11 @@ func (r listResult) String() string { t.SetHeader("Name", "ID", "Board", "FQBN", "SerialNumber", "Status", "Tags") for _, device := range r.devices { t.AddRow( - device.Name, + cleanStrings(device.Name), device.ID, device.Board, device.FQBN, - device.Serial, + cleanStrings(device.Serial), dereferenceString(device.Status), strings.Join(device.Tags, ","), ) diff --git a/command/dashboard/dashboard.go b/command/dashboard/dashboard.go index 431fb6b4..a47abeb6 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" ) // DashboardInfo contains the most interesting diff --git a/command/device/board.go b/command/device/board.go index 568285c2..8d0a56f5 100644 --- a/command/device/board.go +++ b/command/device/board.go @@ -35,6 +35,8 @@ var ( "arduino:samd:mkrnb1500", "arduino:mbed_opta:opta", "arduino:mbed_giga:giga", + "arduino:renesas_uno:unor4wifi", + "arduino:renesas_portenta:portenta_c33", } loraFQBN = []string{ "arduino:samd:mkrwan1310", diff --git a/command/device/configurationstates.go b/command/device/configurationstates.go new file mode 100644 index 00000000..ec095452 --- /dev/null +++ b/command/device/configurationstates.go @@ -0,0 +1,340 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package device + +import ( + "context" + "errors" + "fmt" + "time" + + configurationprotocol "github.com/arduino/arduino-cloud-cli/internal/board-protocols/configuration-protocol" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/configuration-protocol/cborcoders" + "github.com/sirupsen/logrus" +) + +type ConfigStatus int + +// This enum represents the different states of the network configuration process +// of the Arduino Board Configuration Protocol. +const ( + NoneState ConfigStatus = iota + WaitForConnection + WaitingForInitialStatus + WaitingForNetworkOptions + BoardReady + FlashProvisioningSketch + GetSketchVersionRequest + WaitingSketchVersion + WiFiFWVersionRequest + WaitingWiFiFWVersion + RequestBLEMAC + WaitBLEMAC + SendInitialTS + MissingParameter + IDRequest + WaitingID + WaitingSignature + WaitingPublicKey + ClaimDevice + RegisterDevice + RequestReset + WaitResetResponse + GetNetConfigLibVersionRequest + WaitingNetConfigLibVersion + ConfigureNetwork + SendConnectionRequest + WaitingForConnectionCommandResult + WaitingForNetworkConfigResult + WaitingForProvisioningResult + UnclaimDevice + End + ErrorState +) + +const ( + CommandResponseTimeoutLong_s = 60 + CommandResponseTimeoutShort_s = 30 + ConnectResponseTimeout_s = 200 +) + +type ConfigurationStates struct { + configProtocol *configurationprotocol.NetworkConfigurationProtocol +} + +func NewConfigurationStates(configProtocol *configurationprotocol.NetworkConfigurationProtocol) *ConfigurationStates { + return &ConfigurationStates{ + configProtocol: configProtocol, + } +} + +func (c *ConfigurationStates) WaitForConnection() (ConfigStatus, error) { + if c.configProtocol.Connected() { + return WaitingForInitialStatus, nil + } + return ErrorState, errors.New("impossible to connect with the device") +} + +func (c *ConfigurationStates) WaitingForInitialStatus() (ConfigStatus, error) { + logrus.Info("NetworkConfigure: waiting for initial status from device") + res, err := c.configProtocol.ReceiveData(CommandResponseTimeoutShort_s) + if err != nil { + return ErrorState, fmt.Errorf("communication error: %w, please check the NetworkConfigurator lib is activated in the sketch", err) + } + + if res == nil { + return WaitingForNetworkOptions, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + if status.Status == 1 { + return WaitingForInitialStatus, nil + } + + if status.Status == -6 || status.Status < -101 { + return c.HandleStatusMessage(status.Status) + } + return WaitingForNetworkOptions, nil + } + + if res.Type() == cborcoders.WiFiNetworksType { + return BoardReady, nil + } + + return WaitingForNetworkOptions, nil +} + +// In this state the cli is waiting for the available network options as specified in the +// Arduino Board Configuration Protocol. +func (c *ConfigurationStates) WaitingForNetworkOptions() (ConfigStatus, error) { + logrus.Info("NetworkConfigure: waiting for network options from device") + res, err := c.configProtocol.ReceiveData(CommandResponseTimeoutShort_s) + if err != nil { + return ErrorState, err + } + + if res != nil { + // At the moment of writing, the only type of message that can be received in this state is the + // WiFiNetworksType, which contains the available WiFi networks list. + if res.Type() == cborcoders.WiFiNetworksType { + return BoardReady, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + if status.Status == 1 { + return WaitingForInitialStatus, nil + } + + return c.HandleStatusMessage(status.Status) + } + } + + return ErrorState, errors.New("timeout: no network options received from the device, please retry enabling the NetworkCofnigurator lib in the sketch") +} + +func (cs *ConfigurationStates) ConfigureNetwork(ctx context.Context, c *NetConfig) (ConfigStatus, error) { + logrus.Info("NetworkConfigure: Sending network configuration") + var cmd cborcoders.Cmd + if c.Type == 1 { // WiFi + cmd = cborcoders.From(cborcoders.ProvisioningWifiConfigMessage{ + SSID: c.WiFi.SSID, + PWD: c.WiFi.PWD, + }) + } else if c.Type == 2 { // Ethernet + cmd = cborcoders.From(cborcoders.ProvisioningEthernetConfigMessage{ + Static_ip: c.Eth.IP.Bytes[:], + Dns: c.Eth.DNS.Bytes[:], + Gateway: c.Eth.Gateway.Bytes[:], + Netmask: c.Eth.Netmask.Bytes[:], + Timeout: c.Eth.Timeout, + ResponseTimeout: c.Eth.ResponseTimeout, + }) + } else if c.Type == 3 { // NB-IoT + cmd = cborcoders.From(cborcoders.ProvisioningNBConfigMessage{ + PIN: c.NB.PIN, + Apn: c.NB.APN, + Login: c.NB.Login, + Pass: c.NB.Pass, + }) + } else if c.Type == 4 { // GSM + cmd = cborcoders.From(cborcoders.ProvisioningGSMConfigMessage{ + PIN: c.GSM.PIN, + Apn: c.GSM.APN, + Login: c.GSM.Login, + Pass: c.GSM.Pass, + }) + } else if c.Type == 5 { // LoRa + cmd = cborcoders.From(cborcoders.ProvisioningLoRaConfigMessage{ + AppEui: c.Lora.AppEUI, + AppKey: c.Lora.AppKey, + Band: c.Lora.Band, + ChannelMask: c.Lora.ChannelMask, + DeviceClass: c.Lora.DeviceClass, + }) + } else if c.Type == 6 { // CAT-M1 + cmd = cborcoders.From(cborcoders.ProvisioningCATM1ConfigMessage{ + PIN: c.CATM1.PIN, + Apn: c.CATM1.APN, + Login: c.CATM1.Login, + Pass: c.CATM1.Pass, + Band: nil, + }) + } else if c.Type == 7 { // Cellular + cmd = cborcoders.From(cborcoders.ProvisioningCellularConfigMessage{ + PIN: c.CellularSetting.PIN, + Apn: c.CellularSetting.APN, + Login: c.CellularSetting.Login, + Pass: c.CellularSetting.Pass, + }) + } else { + return ErrorState, errors.New("invalid configuration type") + } + + err := cs.configProtocol.SendData(cmd) + if err != nil { + return ErrorState, err + } + + sleepCtx(ctx, 1*time.Second) + return SendConnectionRequest, nil +} + +func (c *ConfigurationStates) SendConnectionRequest() (ConfigStatus, error) { + logrus.Info("NetworkConfigure: Sending connection request") + connectMessage := cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: configurationprotocol.Commands["Connect"]}) + err := c.configProtocol.SendData(connectMessage) + if err != nil { + return ErrorState, err + } + return WaitingForConnectionCommandResult, nil + +} + +func (c *ConfigurationStates) WaitingForConnectionCommandResult() (ConfigStatus, error) { + logrus.Info("NetworkConfigure: Waiting for connection command result") + res, err := c.configProtocol.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res != nil && res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + if status.Status == 1 { + return WaitingForNetworkConfigResult, nil + } + + if status.Status == -4 { + return ConfigureNetwork, nil + } + + return c.HandleStatusMessage(status.Status) + + } + + return ErrorState, errors.New("timeout: no confirmation of connection command received from the device, please retry") +} + +func (c *ConfigurationStates) WaitingForNetworkConfigResult() (ConfigStatus, error) { + logrus.Info("NetworkConfigure: Waiting for network configuration result") + res, err := c.configProtocol.ReceiveData(ConnectResponseTimeout_s) + if err != nil { + return ErrorState, err + } + + if res != nil && res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + + if status.Status == 2 { + return End, nil + } + //For boards of type Cellular, CAT-M1, GSM e NB-IOT that + //returns -3 or -101 when the network configuration is invalid + if status.Status == -3 || status.Status == -101 { + return ErrorState, errors.New("connection failed: invalid network configuration") + } + return c.HandleStatusMessage(status.Status) + + } + + return ErrorState, errors.New("timeout: no result received from the device for network configuration, please retry") +} + +// Keep for reference +/* +func (c *ConfigurationStates) printNetworkOption(msg *cborcoders.Cmd) { + if msg.Type() == cborcoders.WiFiNetworksType { + networks := msg.ToWiFiNetworks() + for _, network := range networks { + fmt.Printf("SSID: %s, RSSI %d \n", network.SSID, network.RSSI) + } + } +} +*/ + +func (c *ConfigurationStates) HandleStatusMessage(status int16) (ConfigStatus, error) { + statusMessage := configurationprotocol.StatusBoard[status] + logrus.Debugf("NetworkConfigure: status message received: %s", statusMessage) + + switch statusMessage { + case "Connecting": + return NoneState, nil + case "Connected": + return NoneState, nil + case "Resetted": + return NoneState, nil + case "Scanning for WiFi networks": + return WaitingForNetworkOptions, nil + case "Failed to connect": + return ErrorState, errors.New("connection failed: invalid network configuration") + case "Disconnected": + return NoneState, nil + case "Parameters not provided": + return MissingParameter, nil + case "Invalid parameters": + return ErrorState, errors.New("the provided parameters for network configuration are invalid") + case "Cannot execute anew request while another is pending": + return ErrorState, errors.New("board is busy, restart the board and try again") + case "Invalid request": + return ErrorState, errors.New("invalid request sent to the board") + case "Internet not available": + return ErrorState, errors.New("internet not available, check your network connection") + case "HW Error connectivity module": + return ErrorState, errors.New("hardware error in connectivity module, check the board") + case "HW Connectivity Module stopped": + return ErrorState, errors.New("hardware connectivity module stopped, restart the board and check your sketch") + case "Error initializing secure element": + return ErrorState, errors.New("error initializing secure element, check the board and try again") + case "Error configuring secure element": + return ErrorState, errors.New("error configuring secure element, check the board and try again") + case "Error locking secure element": + return ErrorState, errors.New("error locking secure element, check the board and try again") + case "Error generating UHWID": + return ErrorState, errors.New("error generating UHWID, check the board and try again") + case "Error storage begin module": + return ErrorState, errors.New("error beginning storage module, check the board storage partitioning and try again") + case "Fail to partition the storage": + return ErrorState, errors.New("failed to partition the storage, check the board storage and try again") + case "Generic error": + return ErrorState, errors.New("generic error, check the board and try again") + default: + return ErrorState, errors.New("generic error, check the board and try again") + } + +} diff --git a/command/device/configure.go b/command/device/configure.go new file mode 100644 index 00000000..b955009e --- /dev/null +++ b/command/device/configure.go @@ -0,0 +1,225 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package device + +import ( + "context" + "errors" + "fmt" + "net" + "strings" + + "github.com/arduino/arduino-cloud-cli/arduino/cli" + configurationprotocol "github.com/arduino/arduino-cloud-cli/internal/board-protocols/configuration-protocol" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" + "github.com/arduino/arduino-cloud-cli/internal/serial" +) + +func NetConfigure(ctx context.Context, boardFilters *CreateParams, NetConfig *NetConfig) error { + comm, err := cli.NewCommander() + if err != nil { + return err + } + + ports, err := comm.BoardList(ctx) + if err != nil { + return err + } + + board := boardFromPorts(ports, boardFilters) + if board == nil { + err = errors.New("no board found") + return err + } + var extInterface transport.TransportInterface + extInterface = &serial.Serial{} + configProtocol := configurationprotocol.NewNetworkConfigurationProtocol(&extInterface) + + err = configProtocol.Connect(board.address) + if err != nil { + return err + } + + nc := NewNetworkConfigure(configProtocol) + err = nc.Run(ctx, NetConfig) + + return err +} + +func GetInputFromMenu(config *NetConfig) error { + + switch config.Type { + case 1: + config.WiFi = getWiFiSetting() + case 2: + config.Eth = getEthernetSetting() + case 3: + config.NB = getCellularSetting() + case 4: + config.GSM = getCellularSetting() + case 5: + config.Lora = getLoraSetting() + case 6: + config.CATM1 = getCatM1Setting() + case 7: + config.CellularSetting = getCellularSetting() + default: + return errors.New("invalid connection type, please try again") + } + return nil +} + +func getWiFiSetting() WiFiSetting { + var wifi WiFiSetting + fmt.Print("Enter SSID: ") + fmt.Scanln(&wifi.SSID) + fmt.Print("Enter Password: ") + fmt.Scanln(&wifi.PWD) + return wifi +} + +func getEthernetSetting() EthernetSetting { + var eth EthernetSetting + fmt.Println("Do you want to use DHCP? (yes/no): ") + var useDHCP string + fmt.Scanln(&useDHCP) + if useDHCP == "yes" || useDHCP == "y" { + eth.IP = IPAddr{Type: 0, Bytes: [16]byte{}} + eth.Gateway = IPAddr{Type: 0, Bytes: [16]byte{}} + eth.Netmask = IPAddr{Type: 0, Bytes: [16]byte{}} + eth.DNS = IPAddr{Type: 0, Bytes: [16]byte{}} + } else { + fmt.Println("Enter IP Address: ") + eth.IP = getIPAddr() + fmt.Println("Enter DNS: ") + eth.DNS = getIPAddr() + fmt.Println("Enter Gateway: ") + eth.Gateway = getIPAddr() + fmt.Println("Enter Netmask: ") + eth.Netmask = getIPAddr() + } + + return eth +} + +func getIPAddr() IPAddr { + var ip IPAddr + var ipString string + fmt.Scanln(&ipString) + if ipString == "" { + return ip + } + if strings.Count(ipString, ":") > 0 { + ip.Type = 1 // IPv6 + } else { + ip.Type = 0 // IPv4 + } + ip.Bytes = [16]byte(net.ParseIP(ipString).To16()) + return ip +} + +func getCellularSetting() CellularSetting { + var cellular CellularSetting + fmt.Println("Enter PIN: ") + fmt.Scanln(&cellular.PIN) + fmt.Print("Enter APN: ") + fmt.Scanln(&cellular.APN) + fmt.Print("Enter Login: ") + fmt.Scanln(&cellular.Login) + fmt.Print("Enter Password: ") + fmt.Scanln(&cellular.Pass) + return cellular +} + +func getCatM1Setting() CATM1Setting { + var catm1 CATM1Setting + fmt.Print("Enter PIN: ") + fmt.Scanln(&catm1.PIN) + fmt.Print("Enter APN: ") + fmt.Scanln(&catm1.APN) + fmt.Print("Enter Login: ") + fmt.Scanln(&catm1.Login) + fmt.Print("Enter Password: ") + fmt.Scanln(&catm1.Pass) + return catm1 +} + +func getLoraSetting() LoraSetting { + var lora LoraSetting + fmt.Print("Enter AppEUI: ") + fmt.Scanln(&lora.AppEUI) + fmt.Print("Enter AppKey: ") + fmt.Scanln(&lora.AppKey) + fmt.Print("Enter Band (Byte hex format): ") + fmt.Scanln(&lora.Band) + fmt.Print("Enter Channel Mask: ") + fmt.Scanln(&lora.ChannelMask) + fmt.Print("Enter Device Class: ") + fmt.Scanln(&lora.DeviceClass) + return lora +} + +type NetworkConfigure struct { + configStates *ConfigurationStates + configProtocol *configurationprotocol.NetworkConfigurationProtocol +} + +func NewNetworkConfigure(configProtocol *configurationprotocol.NetworkConfigurationProtocol) *NetworkConfigure { + return &NetworkConfigure{ + configStates: NewConfigurationStates(configProtocol), + configProtocol: configProtocol, + } +} + +func (nc *NetworkConfigure) Run(ctx context.Context, netConfig *NetConfig) error { + state := WaitForConnection + nextState := state + var err error + + for state != End && state != ErrorState { + + switch state { + case WaitForConnection: + nextState, err = nc.configStates.WaitForConnection() + case WaitingForInitialStatus: + nextState, err = nc.configStates.WaitingForInitialStatus() + case WaitingForNetworkOptions: + nextState, err = nc.configStates.WaitingForNetworkOptions() + case BoardReady: + nextState = ConfigureNetwork + case ConfigureNetwork: + nextState, err = nc.configStates.ConfigureNetwork(ctx, netConfig) + case SendConnectionRequest: + nextState, err = nc.configStates.SendConnectionRequest() + case WaitingForConnectionCommandResult: + nextState, err = nc.configStates.WaitingForConnectionCommandResult() + case MissingParameter: + nextState = ConfigureNetwork + case WaitingForNetworkConfigResult: + nextState, err = nc.configStates.WaitingForNetworkConfigResult() + } + + if nextState != NoneState { + state = nextState + } + + } + + nc.configProtocol.Close() + return err +} diff --git a/command/device/create.go b/command/device/create.go index cabc9996..f255e6bf 100644 --- a/command/device/create.go +++ b/command/device/create.go @@ -22,9 +22,13 @@ import ( "errors" "fmt" + "github.com/arduino/arduino-cloud-cli/arduino" "github.com/arduino/arduino-cloud-cli/arduino/cli" "github.com/arduino/arduino-cloud-cli/config" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" "github.com/arduino/arduino-cloud-cli/internal/iot" + iotapiraw "github.com/arduino/arduino-cloud-cli/internal/iot-api-raw" + "github.com/arduino/arduino-cloud-cli/internal/serial" "github.com/sirupsen/logrus" ) @@ -65,19 +69,87 @@ func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) ) } - iotClient, err := iot.NewClient(cred) + iotApiRawClient := iotapiraw.NewClient(cred) + + boardProvisioningDetails, err := iotApiRawClient.GetBoardDetailByFQBN(board.fqbn) if err != nil { return nil, err } + var devInfo *DeviceInfo + if boardProvisioningDetails.Provisioning != nil && *boardProvisioningDetails.Provisioning == "v2" { + logrus.Info("Provisioning V2 started") + devInfo, err = runProvisioningV2(ctx, params, &comm, iotApiRawClient, cred, board, boardProvisioningDetails) + } else { + logrus.Info("Provisioning V1 started") + devInfo, err = runProvisioningV1(ctx, params, &comm, cred, board) + } + + return devInfo, err +} + +func runProvisioningV2(ctx context.Context, params *CreateParams, comm *arduino.Commander, iotClient *iotapiraw.IoTApiRawClient, cred *config.Credentials, board *board, boardProvisioningDetails *iotapiraw.BoardType) (*DeviceInfo, error) { + if params.ConnectionType == nil { + return nil, errors.New("connection type is required for Provisioning V2") + } + + netConfig := NetConfig{ + Type: connectionTypeIDByName[*params.ConnectionType], + } + + err := GetInputFromMenu(&netConfig) + if err != nil { + return nil, err + } + + var extInterface transport.TransportInterface + extInterface = &serial.Serial{} + + prov := NewProvisionV2(comm, iotClient, cred, extInterface) + // Start the provisioning process + err = prov.Run(ctx, ProvisioningV2BoardParams{ + fqbn: board.fqbn, + address: board.address, + protocol: board.protocol, + serial: board.serial, + minProvSketchVersion: *boardProvisioningDetails.MinProvSketchVersion, + minWiFiVersion: boardProvisioningDetails.MinWiFiVersion, + name: params.Name, + connectionType: *params.ConnectionType, + netConfig: netConfig, + }) + if err != nil { + return nil, err + } + + devId, err := prov.GetProvisioningResult() + if err != nil { + return nil, err + } + + devInfo := &DeviceInfo{ + Name: params.Name, + ID: devId, + Board: *params.ConnectionType, + Serial: board.serial, + FQBN: board.fqbn, + } + return devInfo, nil +} + +func runProvisioningV1(ctx context.Context, params *CreateParams, comm *arduino.Commander, cred *config.Credentials, board *board) (*DeviceInfo, error) { logrus.Info("Creating a new device on the cloud") + iotClient, err := iot.NewClient(cred) + if err != nil { + return nil, err + } dev, err := iotClient.DeviceCreate(ctx, board.fqbn, params.Name, board.serial, board.dType, params.ConnectionType) if err != nil { return nil, err } prov := &provision{ - Commander: comm, + Commander: *comm, cert: iotClient, board: board, id: dev.Id, @@ -94,7 +166,6 @@ func Create(ctx context.Context, params *CreateParams, cred *config.Credentials) } return nil, fmt.Errorf("cannot provision device: %w", err) } - devInfo := &DeviceInfo{ Name: dev.Name, ID: dev.Id, diff --git a/command/device/createlora.go b/command/device/createlora.go index 06542bad..84c9509d 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" "github.com/sirupsen/logrus" "go.bug.st/serial" ) diff --git a/command/device/device.go b/command/device/device.go index 8c9dede1..40f91b47 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" ) // DeviceInfo contains the most interesting diff --git a/command/device/list.go b/command/device/list.go index ba1ffd43..46004a21 100644 --- a/command/device/list.go +++ b/command/device/list.go @@ -31,6 +31,7 @@ import ( type ListParams struct { Tags map[string]string // If tags are provided, only devices that have all these tags are listed. DeviceIds string // If ids are provided, only devices with these ids are listed. + Status string // If status is provided, only devices with this status are listed. } // List command is used to list @@ -62,6 +63,9 @@ func List(ctx context.Context, params *ListParams, cred *config.Credentials) ([] if err != nil { return nil, fmt.Errorf("parsing device %s from cloud: %w", foundDev.Id, err) } + if params.Status != "" && dev.Status != nil && *dev.Status != params.Status { + continue + } devices = append(devices, *dev) } diff --git a/command/device/network_options.go b/command/device/network_options.go new file mode 100644 index 00000000..64a63c0f --- /dev/null +++ b/command/device/network_options.go @@ -0,0 +1,71 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package device + +type WiFiSetting struct { + SSID string `json:"ssid"` // Max length of ssid is 32 + \0 + PWD string `json:"pwd"` // Max length of password is 63 + \0 +} + +type IPAddr struct { + Type uint8 `json:"type"` + Bytes [16]byte `json:"bytes"` +} + +type EthernetSetting struct { + IP IPAddr `json:"ip"` + DNS IPAddr `json:"dns"` + Gateway IPAddr `json:"gateway"` + Netmask IPAddr `json:"netmask"` + Timeout uint `json:"timeout"` + ResponseTimeout uint `json:"response_timeout"` +} + +type CellularSetting struct { + PIN string `json:"pin"` // Max length of pin is 8 + \0 + APN string `json:"apn"` // Max length of apn is 100 + \0 + Login string `json:"login"` // Max length of login is 32 + \0 + Pass string `json:"pass"` // Max length of pass is 32 + \0 +} + +type CATM1Setting struct { + PIN string `json:"pin"` // Max length of pin is 8 + \0 + APN string `json:"apn"` // Max length of apn is 100 + \0 + Login string `json:"login"` // Max length of login is 32 + \0 + Pass string `json:"pass"` // Max length of pass is 32 + \0 + Band [4]uint32 `json:"band"` +} + +type LoraSetting struct { + AppEUI string `json:"appeui"` // appeui is 8 octets * 2 (hex format) + \0 + AppKey string `json:"appkey"` // appeui is 16 octets * 2 (hex format) + \0 + Band uint8 `json:"band"` + ChannelMask string `json:"channel_mask"` + DeviceClass string `json:"device_class"` +} + +type NetConfig struct { + Type int32 `json:"type"` + WiFi WiFiSetting `json:"wifi,omitempty"` + Eth EthernetSetting `json:"eth,omitempty"` + NB CellularSetting `json:"nb,omitempty"` + GSM CellularSetting `json:"gsm,omitempty"` + CATM1 CATM1Setting `json:"catm1,omitempty"` + CellularSetting CellularSetting `json:"cellular,omitempty"` + Lora LoraSetting `json:"lora,omitempty"` +} diff --git a/command/device/provision.go b/command/device/provision.go index 2515cb3a..62da9ba4 100644 --- a/command/device/provision.go +++ b/command/device/provision.go @@ -27,9 +27,11 @@ import ( "github.com/arduino/arduino-cloud-cli/arduino" "github.com/arduino/arduino-cloud-cli/internal/binary" + provisioningprotocol "github.com/arduino/arduino-cloud-cli/internal/board-protocols/provisioning-protocol" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" "github.com/arduino/arduino-cloud-cli/internal/serial" "github.com/arduino/go-paths-helper" - iotclient "github.com/arduino/iot-client-go/v2" + iotclient "github.com/arduino/iot-client-go/v3" "github.com/sirupsen/logrus" ) @@ -72,10 +74,11 @@ type certificateCreator interface { // procedures for boards with crypto-chip. type provision struct { arduino.Commander - cert certificateCreator - ser *serial.Serial - board *board - id string + cert certificateCreator + serial transport.TransportInterface + provProt *provisioningprotocol.ProvisioningProtocol + board *board + id string } // run provisioning procedure for boards with crypto-chip. @@ -104,15 +107,21 @@ func (p provision) run(ctx context.Context) error { if err = sleepCtx(ctx, 1500*time.Millisecond); err != nil { return err } - p.ser = serial.NewSerial() + p.serial = serial.NewSerial() + + p.provProt = provisioningprotocol.NewProvisioningProtocol(&p.serial) errMsg = "Error while connecting to the board" err = retry(ctx, 5, time.Millisecond*1000, errMsg, func() error { - return p.ser.Connect(p.board.address) + params := transport.TransportInterfaceParams{ + Port: p.board.address, + BoundRate: 57600, + } + return p.serial.Connect(params) }) if err != nil { return err } - defer p.ser.Close() + defer p.serial.Close() logrus.Infof("%s\n\n", "Connected to the board") // Wait some time before using the serial port @@ -131,7 +140,7 @@ func (p provision) run(ctx context.Context) error { func (p provision) configBoard(ctx context.Context) error { logrus.Info("Receiving the certificate") - csr, err := p.ser.SendReceive(ctx, serial.CSR, []byte(p.id)) + csr, err := p.provProt.SendReceive(ctx, provisioningprotocol.CSR, []byte(p.id)) if err != nil { return err } @@ -141,37 +150,37 @@ func (p provision) configBoard(ctx context.Context) error { } logrus.Info("Requesting begin storage") - if err = p.ser.Send(ctx, serial.BeginStorage, nil); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.BeginStorage, nil); err != nil { return err } s := strconv.Itoa(cert.NotBefore.Year()) logrus.Info("Sending year: ", s) - if err = p.ser.Send(ctx, serial.SetYear, []byte(s)); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetYear, []byte(s)); err != nil { return err } s = fmt.Sprintf("%02d", int(cert.NotBefore.Month())) logrus.Info("Sending month: ", s) - if err = p.ser.Send(ctx, serial.SetMonth, []byte(s)); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetMonth, []byte(s)); err != nil { return err } s = fmt.Sprintf("%02d", cert.NotBefore.Day()) logrus.Info("Sending day: ", s) - if err = p.ser.Send(ctx, serial.SetDay, []byte(s)); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetDay, []byte(s)); err != nil { return err } s = fmt.Sprintf("%02d", cert.NotBefore.Hour()) logrus.Info("Sending hour: ", s) - if err = p.ser.Send(ctx, serial.SetHour, []byte(s)); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetHour, []byte(s)); err != nil { return err } s = strconv.Itoa(31) logrus.Info("Sending validity: ", s) - if err = p.ser.Send(ctx, serial.SetValidity, []byte(s)); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetValidity, []byte(s)); err != nil { return err } @@ -180,7 +189,7 @@ func (p provision) configBoard(ctx context.Context) error { if err != nil { return fmt.Errorf("decoding certificate serial: %w", err) } - if err = p.ser.Send(ctx, serial.SetCertSerial, b); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetCertSerial, b); err != nil { return err } @@ -189,7 +198,7 @@ func (p provision) configBoard(ctx context.Context) error { if err != nil { return fmt.Errorf("decoding certificate authority key id: %w", err) } - if err = p.ser.Send(ctx, serial.SetAuthKey, b); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetAuthKey, b); err != nil { return err } @@ -199,7 +208,7 @@ func (p provision) configBoard(ctx context.Context) error { err = fmt.Errorf("decoding certificate signature: %w", err) return err } - if err = p.ser.Send(ctx, serial.SetSignature, b); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.SetSignature, b); err != nil { return err } @@ -208,7 +217,7 @@ func (p provision) configBoard(ctx context.Context) error { } logrus.Info("Requesting end storage") - if err = p.ser.Send(ctx, serial.EndStorage, nil); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.EndStorage, nil); err != nil { return err } @@ -217,7 +226,7 @@ func (p provision) configBoard(ctx context.Context) error { } logrus.Info("Requesting certificate reconstruction") - if err = p.ser.Send(ctx, serial.ReconstructCert, nil); err != nil { + if err = p.provProt.Send(ctx, provisioningprotocol.ReconstructCert, nil); err != nil { return err } diff --git a/command/device/provisionv2.go b/command/device/provisionv2.go new file mode 100644 index 00000000..6fd0b779 --- /dev/null +++ b/command/device/provisionv2.go @@ -0,0 +1,631 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2021 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package device + +import ( + "context" + "errors" + "fmt" + "os" + "strconv" + "strings" + "time" + "unicode" + + "github.com/arduino/arduino-cloud-cli/arduino" + "github.com/arduino/arduino-cloud-cli/config" + configurationprotocol "github.com/arduino/arduino-cloud-cli/internal/board-protocols/configuration-protocol" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/configuration-protocol/cborcoders" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" + "github.com/arduino/arduino-cloud-cli/internal/boardpids" + iotapiraw "github.com/arduino/arduino-cloud-cli/internal/iot-api-raw" + provisioningapi "github.com/arduino/arduino-cloud-cli/internal/provisioning-api" + "github.com/arduino/go-paths-helper" + "github.com/beevik/ntp" + "github.com/sirupsen/logrus" +) + +var connectionTypeIDByName = map[string]int32{ + "wifi": 1, + "eth": 2, + "nb": 3, + "gsm": 4, + "lora": 5, + "catm1": 6, + "cellular": 7, +} + +const ( + MaxRetriesFlashProvSketch = 5 + MaxRetriesProvisioningResult = 20 +) + +type ConnectedBoardInfos struct { + UHWID string + PublicKey string + Signature string + BLEMacAddress string +} + +type ProvisioningV2BoardParams struct { + fqbn string + address string + protocol string + serial string + minProvSketchVersion string + minWiFiVersion *string + name string + connectionType string + netConfig NetConfig +} + +type ProvisionV2 struct { + arduino.Commander + iotApiClient *iotapiraw.IoTApiRawClient + provisioningClient *provisioningapi.ProvisioningApiClient + provProt *configurationprotocol.NetworkConfigurationProtocol + configStates *ConfigurationStates + connectedBoardInfos ConnectedBoardInfos + provisioningId string + deviceId string +} + +func NewProvisionV2(comm *arduino.Commander, iotClient *iotapiraw.IoTApiRawClient, credentials *config.Credentials, extInterface transport.TransportInterface) *ProvisionV2 { + provProt := configurationprotocol.NewNetworkConfigurationProtocol(&extInterface) + return &ProvisionV2{ + Commander: *comm, + iotApiClient: iotClient, + provisioningClient: provisioningapi.NewClient(credentials), + provProt: provProt, + configStates: NewConfigurationStates(provProt), + deviceId: "", + } +} + +func (p *ProvisionV2) connectToBoard(address string) error { + err := p.provProt.Connect(address) + return err +} + +/* + * The function return the Arduino Cloud Device ID of the new created board + * if the process ends successfully. Otherwise, an error + */ +func (p *ProvisionV2) GetProvisioningResult() (string, error) { + if p.deviceId == "" { + return "", errors.New("device not provisioned") + } + return p.deviceId, nil +} + +func (p *ProvisionV2) Run(ctx context.Context, params ProvisioningV2BoardParams) error { + var err error + if err = p.connectToBoard(params.address); err != nil { + return err + } + state := WaitForConnection + nextState := NoneState + + // FSM for Provisioning 2.0 + for state != End && state != ErrorState { + + switch state { + case WaitForConnection: + nextState, err = p.configStates.WaitForConnection() + case WaitingForInitialStatus: + nextState, err = p.configStates.WaitingForInitialStatus() + if err != nil { + nextState = FlashProvisioningSketch + } + case WaitingForNetworkOptions: + nextState, err = p.configStates.WaitingForNetworkOptions() + if err != nil { + nextState = FlashProvisioningSketch + } + case BoardReady: + nextState = GetSketchVersionRequest + case GetSketchVersionRequest: + nextState, err = p.getSketchVersionRequest() + case WaitingSketchVersion: + nextState, err = p.waitingSketchVersion(params.minProvSketchVersion) + case FlashProvisioningSketch: + nextState, err = p.flashProvisioningSketch(ctx, params.fqbn, params.address, params.protocol) + case WiFiFWVersionRequest: + nextState, err = p.getWiFiFWVersionRequest(ctx) + case WaitingWiFiFWVersion: + nextState, err = p.waitWiFiFWVersion(params.minWiFiVersion) + case RequestBLEMAC: + nextState, err = p.getBLEMACRequest(ctx) + case WaitBLEMAC: + nextState, err = p.waitBLEMac() + case SendInitialTS: + nextState, err = p.sendInitialTS(ctx) + case IDRequest: + nextState, err = p.getIDRequest() + case WaitingPublicKey: + nextState, err = p.waitingPublicKey() + case WaitingID: + nextState, err = p.waitingUHWID() + case WaitingSignature: + nextState, err = p.waitingSignature() + case ClaimDevice: + nextState, err = p.claimDevice(params.name, params.connectionType) + case RegisterDevice: + nextState, err = p.registerDevice(params.fqbn, params.serial) + case RequestReset: + nextState, err = p.resetBoardRequest() + if err != nil { + nextState = UnclaimDevice + } + case WaitResetResponse: + nextState, err = p.waitingForResetResult() + if err != nil { + nextState = UnclaimDevice + } + case ConfigureNetwork: + nextState, err = p.configStates.ConfigureNetwork(ctx, ¶ms.netConfig) + if err != nil { + nextState = UnclaimDevice + } + case SendConnectionRequest: + nextState, err = p.configStates.SendConnectionRequest() + if err != nil { + nextState = UnclaimDevice + } + case WaitingForConnectionCommandResult: + nextState, err = p.configStates.WaitingForConnectionCommandResult() + if err != nil { + nextState = UnclaimDevice + } + + if nextState == MissingParameter { + nextState = ConfigureNetwork + } + case WaitingForNetworkConfigResult: + _, err = p.configStates.WaitingForNetworkConfigResult() + if err != nil { + nextState = UnclaimDevice + } else { + nextState = WaitingForProvisioningResult + } + case WaitingForProvisioningResult: + nextState, err = p.waitProvisioningResult(ctx) + if err != nil { + nextState = UnclaimDevice + } + case UnclaimDevice: + nextState, _ = p.unclaimDevice() + } + + if nextState != NoneState { + state = nextState + } + + } + + p.provProt.Close() + return err +} + +func (p *ProvisionV2) getSketchVersionRequest() (ConfigStatus, error) { + logrus.Info("Provisioning V2: Requesting Sketch Version") + getSketchVersionMessage := cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: configurationprotocol.Commands["GetSketchVersion"]}) + err := p.provProt.SendData(getSketchVersionMessage) + if err != nil { + return ErrorState, err + } + + return WaitingSketchVersion, nil +} + +/* + * This function returns + * - <0 if version1 < version2 + * - =0 if version1 == version2 + * - >0 if version1 > version2 + */ +func (p *ProvisionV2) compareVersions(version1, version2 string) int { + version1Tokens := strings.Split(version1, ".") + version2Tokens := strings.Split(version2, ".") + if len(version1Tokens) != len(version2Tokens) { + return -1 + } + for i := 0; i < len(version1Tokens) && i < len(version2Tokens); i++ { + version1Num, _ := strconv.Atoi(version1Tokens[i]) + version2Num, _ := strconv.Atoi(version2Tokens[i]) + if version1Num != version2Num { + return version1Num - version2Num + } + } + return 0 +} + +func (p *ProvisionV2) waitingSketchVersion(minSketchVersion string) (ConfigStatus, error) { + res, err := p.provProt.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res == nil { + logrus.Error("Provisioning V2: Requesting sketch Version failed, flashing...") + return FlashProvisioningSketch, nil + } + + if res.Type() == cborcoders.ProvisioningSketchVersionMessageType { + sketch_version := res.ToProvisioningSketchVersionMessage().ProvisioningSketchVersion + logrus.Infof("Provisioning V2: Received Sketch Version %s", sketch_version) + + if p.compareVersions(sketch_version, minSketchVersion) < 0 { + logrus.Infof("Provisioning V2: Sketch version %s is lower than required minimum %s. Updating...", sketch_version, minSketchVersion) + return FlashProvisioningSketch, nil + } + + return WiFiFWVersionRequest, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + if status.Status == -7 { + return FlashProvisioningSketch, nil + } + return p.configStates.HandleStatusMessage(status.Status) + } + + return NoneState, nil +} + +func (p *ProvisionV2) flashProvisioningSketch(ctx context.Context, fqbn, address, protocol string) (ConfigStatus, error) { + logrus.Info("Provisioning V2: Downloading provisioning sketch") + path := paths.TempDir().Join("cloud-cli").Join("provisioning_v2_sketch") + + file, err := p.iotApiClient.DownloadProvisioningV2Sketch(fqbn, path, nil) + if err != nil { + logrus.Error("Provisioning V2: Downloading provisioning sketch failed") + return ErrorState, err + } + + // Try to upload the provisioning sketch + logrus.Info("Uploading provisioning sketch on the board") + p.provProt.Close() + errMsg := "Provisioning V2: error while uploading the provisioning sketch" + err = retry(ctx, MaxRetriesFlashProvSketch, time.Millisecond*1000, errMsg, func() error { + return p.UploadBin(ctx, fqbn, file, address, protocol) + }) + if err != nil { + return ErrorState, err + } + + err = os.Remove(file) + if err != nil { + logrus.Error("Provisioning V2: Removing temporary file failed") + return ErrorState, err + } + + logrus.Info("Provisioning V2: Uploading provisioning sketch succeeded") + sleepCtx(ctx, 3*time.Second) + if err = p.connectToBoard(address); err != nil { + return ErrorState, err + } + + return WaitForConnection, nil +} + +func (p *ProvisionV2) getWiFiFWVersionRequest(ctx context.Context) (ConfigStatus, error) { + logrus.Info("Provisioning V2: Requesting WiFi FW Version") + getWiFiFWVersionMessage := cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: configurationprotocol.Commands["GetWiFiFWVersion"]}) + err := p.provProt.SendData(getWiFiFWVersionMessage) + if err != nil { + return ErrorState, err + } + sleepCtx(ctx, 1*time.Second) + return WaitingWiFiFWVersion, nil +} + +func (p *ProvisionV2) waitWiFiFWVersion(minWiFiVersion *string) (ConfigStatus, error) { + res, err := p.provProt.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res == nil { + return ErrorState, errors.New("provisioning V2: Requesting WiFi FW Version failed") + } + + if res.Type() == cborcoders.ProvisioningWiFiFWVersionMessageType { + wifi_version := res.ToProvisioningWiFiFWVersionMessage().WiFiFWVersion + logrus.Infof("Received WiFi FW Version: %s", wifi_version) + if minWiFiVersion != nil && + p.compareVersions(wifi_version, *minWiFiVersion) < 0 { + return ErrorState, fmt.Errorf("provisioning V2: WiFi FW version %s is lower than required minimum %s. Please update the board firmware using Arduino IDE or Arduino CLI", wifi_version, *minWiFiVersion) + } + + return RequestBLEMAC, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + return p.configStates.HandleStatusMessage(status.Status) + } + + return ErrorState, errors.New("provisioning V2: WiFi FW version not received") +} + +func (p *ProvisionV2) getBLEMACRequest(ctx context.Context) (ConfigStatus, error) { + logrus.Info("Provisioning V2: Requesting BLE MAC") + getblemacMessage := cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: configurationprotocol.Commands["GetBLEMac"]}) + err := p.provProt.SendData(getblemacMessage) + if err != nil { + return ErrorState, err + } + sleepCtx(ctx, 1*time.Second) + return WaitBLEMAC, nil +} + +func (p *ProvisionV2) waitBLEMac() (ConfigStatus, error) { + res, err := p.provProt.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res == nil { + return ErrorState, errors.New("provisioning V2: BLEMac was not received") + } + + if res.Type() == cborcoders.ProvisioningBLEMacAddressMessageType { + mac := res.ToProvisioningBLEMacAddressMessage().BLEMacAddress + logrus.Infof("Provisioning V2: Received MAC in hex: %02X", mac) + macStr := fmt.Sprintf("%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]) + p.connectedBoardInfos.BLEMacAddress = macStr + return SendInitialTS, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + return p.configStates.HandleStatusMessage(status.Status) + } + + return ErrorState, errors.New("provisioning V2: BLE MAC address not received") +} + +func (p *ProvisionV2) sendInitialTS(ctx context.Context) (ConfigStatus, error) { + logrus.Info("Provisioning V2: Sending initial timestamp") + var ts int64 + t, err := ntp.Time("time.arduino.cc") + if err == nil { + ts = t.Unix() + } else { + logrus.Warnf("Provisioning V2: Cannot get time from NTP server, using local time: %v", err) + ts = time.Now().Unix() + } + + logrus.Infof("Provisioning V2: Sending timestamp: %d", ts) + tsMessage := cborcoders.From(cborcoders.ProvisioningTimestampMessage{Timestamp: uint64(ts)}) + err = p.provProt.SendData(tsMessage) + if err != nil { + return ErrorState, err + } + sleepCtx(ctx, 1*time.Second) + return IDRequest, nil +} + +func (p *ProvisionV2) getIDRequest() (ConfigStatus, error) { + logrus.Info("Provisioning V2: Requesting UniqueID") + getuuidMessage := cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: configurationprotocol.Commands["GetID"]}) + err := p.provProt.SendData(getuuidMessage) + if err != nil { + return ErrorState, err + } + + return WaitingPublicKey, nil +} + +func (p *ProvisionV2) waitingPublicKey() (ConfigStatus, error) { + res, err := p.provProt.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res == nil { + return ErrorState, errors.New("provisioning V2: public key was not received") + } + + if res.Type() == cborcoders.ProvisioningPublicKeyMessageType { + pubKey := res.ToProvisioningPublicKeyMessage().ProvisioningPublicKey + logrus.Info("Provisioning V2: Received Public Key") + p.connectedBoardInfos.PublicKey = pubKey + return WaitingID, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + newState, err := p.configStates.HandleStatusMessage(status.Status) + if newState == MissingParameter { + return SendInitialTS, nil + } + return newState, err + } + return ErrorState, errors.New("provisioning V2: Public Key not received") +} + +func (p *ProvisionV2) waitingUHWID() (ConfigStatus, error) { + res, err := p.provProt.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res == nil { + return ErrorState, errors.New("provisioning V2: UniqueID was not received") + } + + if res.Type() == cborcoders.ProvisioningUniqueIdMessageType { + uhwid := res.ToProvisioningUniqueIdMessage().UniqueId + logrus.Infof("Provisioning V2: Received UniqueID") + uhwidString := fmt.Sprintf("%02x", uhwid) + p.connectedBoardInfos.UHWID = uhwidString + return WaitingSignature, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + return p.configStates.HandleStatusMessage(status.Status) + } + + return ErrorState, errors.New("provisioning V2: UniqueID was not received") +} + +func (p *ProvisionV2) waitingSignature() (ConfigStatus, error) { + res, err := p.provProt.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res == nil { + return ErrorState, errors.New("provisioning V2: Signature was not received") + } + + if res.Type() == cborcoders.ProvisioningSignatureMessageType { + signature := res.ToProvisioningSignatureMessage().Signature + logrus.Infof("Provisioning V2: Received Signature") + + signatureString := strings.TrimRightFunc(fmt.Sprintf("%s", signature), func(r rune) bool { + return unicode.IsLetter(r) == false && unicode.IsNumber(r) == false + }) + p.connectedBoardInfos.Signature = signatureString + return ClaimDevice, nil + } + + if res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + return p.configStates.HandleStatusMessage(status.Status) + } + + return ErrorState, errors.New("provisioning V2: Signature was not received") +} + +func (p *ProvisionV2) claimDevice(name, connectionType string) (ConfigStatus, error) { + logrus.Info("Provisioning V2: Claiming device...") + + claimData := provisioningapi.ClaimData{ + BLEMac: p.connectedBoardInfos.BLEMacAddress, + BoardToken: p.connectedBoardInfos.Signature, + ConnectionType: connectionType, + DeviceName: name, + } + + provResp, provErr, err := p.provisioningClient.ClaimDevice(claimData) + if err != nil { + return ErrorState, fmt.Errorf("provisioning V2: failed to claim device: %w", err) + } + + if provErr != nil { + if provErr.ErrCode == 1 || provErr.ErrCode == 2 { + logrus.Warn("Provisioning V2: Device claim failed. The board has to migrate") + return RegisterDevice, nil + } + + if provErr.ErrCode == 3 { + // If the device key and the DB key are different + return ErrorState, fmt.Errorf("provisioning V2: Device claim failed. Keys do not match. Please contact the Arduino Support with this hardware id: %s", p.connectedBoardInfos.UHWID) + } + + return ErrorState, fmt.Errorf("provisioning V2: Device claim failed with error: %s", provErr.Err) + } + + if provResp != nil { + p.provisioningId = provResp.OnboardId + return RequestReset, nil + } + + return ErrorState, errors.New("provisioning V2: Device ID not received") +} + +func (p *ProvisionV2) registerDevice(fqbn, serial string) (ConfigStatus, error) { + logrus.Info("Provisioning V2: Registering device...") + + registerData := provisioningapi.RegisterBoardData{ + PID: boardpids.ArduinoFqbnToPID[fqbn], + PublicKey: p.connectedBoardInfos.PublicKey, + Serial: &serial, + UniqueHardwareID: p.connectedBoardInfos.UHWID, + VID: boardpids.ArduinoVendorID, //Only Arduino boards can support Provisioning 2.0 + } + + provErr, err := p.provisioningClient.RegisterDevice(registerData) + if err != nil { + return ErrorState, fmt.Errorf("provisioning V2: failed to register device: %w", err) + } + + if provErr != nil { + return ErrorState, fmt.Errorf("provisioning V2: Device registration failed with error: %s", provErr.Err) + } + + logrus.Info("Provisioning V2: Device registered successfully, claiming...") + return ClaimDevice, nil +} + +func (p *ProvisionV2) resetBoardRequest() (ConfigStatus, error) { + logrus.Info("Provisioning V2: Requesting Reset Stored Credentials") + resetMessage := cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: configurationprotocol.Commands["Reset"]}) + err := p.provProt.SendData(resetMessage) + if err != nil { + return ErrorState, err + } + + return WaitResetResponse, nil +} + +func (p *ProvisionV2) waitingForResetResult() (ConfigStatus, error) { + res, err := p.provProt.ReceiveData(CommandResponseTimeoutLong_s) + if err != nil { + return ErrorState, err + } + + if res != nil && res.Type() == cborcoders.ProvisioningStatusMessageType { + status := res.ToProvisioningStatusMessage() + if status.Status == 4 { + logrus.Info("Provisioning V2: Reset Stored Credentials successful") + return ConfigureNetwork, nil + } + return p.configStates.HandleStatusMessage(status.Status) + } + + return ErrorState, errors.New("provisioning V2: Reset Stored Credentials failed") +} + +func (p *ProvisionV2) waitProvisioningResult(ctx context.Context) (ConfigStatus, error) { + logrus.Info("Provisioning V2: Waiting for provisioning result...") + + for n := 0; n < MaxRetriesProvisioningResult; n++ { + res, err := p.provisioningClient.GetProvisioningDetail(p.provisioningId) + if err != nil { + return ErrorState, err + } + if res.DeviceID != nil { + p.deviceId = *res.DeviceID + return End, nil + } + sleepCtx(ctx, 10*time.Second) + } + return ErrorState, errors.New("provisioning V2: Timeout expires for board provisioning. The board was not able to reach the Arduino IoT Cloud for completing the provisioning") +} + +func (p *ProvisionV2) unclaimDevice() (ConfigStatus, error) { + logrus.Warnf("Provisioning V2: Something went wrong, unclaiming device...") + _, err := p.provisioningClient.UnclaimDevice(p.provisioningId) + return End, err +} diff --git a/command/device/show.go b/command/device/show.go index 18d53c77..38fa01d1 100644 --- a/command/device/show.go +++ b/command/device/show.go @@ -58,7 +58,12 @@ func Show(ctx context.Context, deviceId string, cred *config.Credentials) (*Devi return nil, net, err } for _, netCred := range netCredentialsArray { - net = append(net, netCredentials(netCred)) + var netCredToShow netCredentials + netCredToShow.FriendlyName = netCred.FriendlyName + netCredToShow.Required = netCred.Required + netCredToShow.SecretName = netCred.SecretName + netCredToShow.Sensitive = netCred.Sensitive + net = append(net, netCredToShow) } } diff --git a/command/ota/generate.go b/command/ota/generate.go index 50663222..caf1eaa9 100644 --- a/command/ota/generate.go +++ b/command/ota/generate.go @@ -23,6 +23,7 @@ import ( "os" "strings" + "github.com/arduino/arduino-cloud-cli/internal/boardpids" inota "github.com/arduino/arduino-cloud-cli/internal/ota" ) @@ -37,12 +38,12 @@ func Generate(binFile string, outFile string, fqbn string) error { // Esp32 boards have a wide range of vid and pid, we don't map all of them // If the fqbn is the one of an ESP32 board, we force a default magic number that matches the same default expected on the fw side if !strings.HasPrefix(fqbn, "arduino:esp32") && strings.HasPrefix(fqbn, "esp32") { - magicNumberPart1 = inota.Esp32MagicNumberPart1 - magicNumberPart2 = inota.Esp32MagicNumberPart2 + magicNumberPart1 = boardpids.Esp32MagicNumberPart1 + magicNumberPart2 = boardpids.Esp32MagicNumberPart2 } else { //For Arduino Boards we use vendorId and productID to form the magic number - magicNumberPart1 = inota.ArduinoVendorID - productID, ok := inota.ArduinoFqbnToPID[fqbn] + magicNumberPart1 = boardpids.ArduinoVendorID + productID, ok := boardpids.ArduinoFqbnToPID[fqbn] if !ok { return errors.New("fqbn not valid") } diff --git a/command/ota/massupload.go b/command/ota/massupload.go index 1fbffa38..efa3d689 100644 --- a/command/ota/massupload.go +++ b/command/ota/massupload.go @@ -31,7 +31,7 @@ import ( "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/v2" + iotclient "github.com/arduino/iot-client-go/v3" ) const ( diff --git a/command/ota/massupload_test.go b/command/ota/massupload_test.go index ba50d9fa..1b3676c3 100644 --- a/command/ota/massupload_test.go +++ b/command/ota/massupload_test.go @@ -25,7 +25,7 @@ import ( "testing" otaapi "github.com/arduino/arduino-cloud-cli/internal/ota-api" - iotclient "github.com/arduino/iot-client-go/v2" + iotclient "github.com/arduino/iot-client-go/v3" "github.com/gofrs/uuid" "github.com/stretchr/testify/assert" ) diff --git a/command/ota/status.go b/command/ota/status.go index 4bb9d067..f6077d2a 100644 --- a/command/ota/status.go +++ b/command/ota/status.go @@ -44,9 +44,11 @@ func PrintOtaStatus(otaid, otaids, device string, cred *config.Credentials, limi res, err := otapi.GetOtaStatusByOtaID(otaid, limit, order) if err == nil && res != nil { feedback.PrintResult(otaapi.OtaStatusDetail{ - FirmwareSize: res.FirmwareSize, + FirmwareSize: res.Ota.FirmwareSize, Ota: res.Ota, Details: res.States, + MaxRetries: res.Ota.MaxRetries, + RetryAttempt: res.Ota.RetryAttempt, }) } else if err != nil { return err diff --git a/command/template/apply.go b/command/template/apply.go index 8ba09e4c..b0630ca1 100644 --- a/command/template/apply.go +++ b/command/template/apply.go @@ -31,7 +31,7 @@ import ( "github.com/arduino/arduino-cloud-cli/config" "github.com/arduino/arduino-cloud-cli/internal/iot" storageapi "github.com/arduino/arduino-cloud-cli/internal/storage-api" - iotclient "github.com/arduino/iot-client-go/v2" + iotclient "github.com/arduino/iot-client-go/v3" "github.com/gofrs/uuid" "github.com/sirupsen/logrus" ) diff --git a/command/thing/bind.go b/command/thing/bind.go index c6ee8983..7fdc217d 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" ) // BindParams contains the parameters needed to diff --git a/command/thing/thing.go b/command/thing/thing.go index 8b10defb..61ba305b 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" ) // ThingInfo contains the main parameters of diff --git a/go.mod b/go.mod index 75b05308..8c85a5bc 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,14 @@ module github.com/arduino/arduino-cloud-cli -go 1.19 +go 1.23 require ( - github.com/arduino/arduino-cli v0.0.0-20221116144942-76251df9241a - github.com/arduino/go-paths-helper v1.7.0 + github.com/arduino/arduino-cli v0.0.0-20250901123057-20dd7c932f59 + github.com/arduino/go-paths-helper v1.12.1 github.com/arduino/go-win32-utils v1.0.0 - github.com/arduino/iot-client-go/v2 v2.0.3 + github.com/arduino/iot-client-go/v3 v3.1.1 + github.com/beevik/ntp v1.4.3 + github.com/fxamacker/cbor/v2 v2.8.0 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 @@ -17,9 +19,9 @@ require ( github.com/spf13/viper v1.10.1 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.21.0 + go.bug.st/serial v1.6.2 + golang.org/x/crypto v0.23.0 + golang.org/x/oauth2 v0.25.0 google.golang.org/grpc v1.61.0 gopkg.in/yaml.v3 v3.0.1 gotest.tools v2.2.0+incompatible @@ -27,18 +29,14 @@ require ( require ( github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/arduino/board-discovery v0.0.0-20211020061712-fd83c2e3c908 // indirect github.com/arduino/go-properties-orderedmap v1.7.1 // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/cmaglie/pb v1.0.27 // indirect - github.com/codeclysm/cc v1.2.2 // indirect - github.com/codeclysm/extract/v3 v3.0.2 // indirect + github.com/codeclysm/extract/v4 v4.0.0 // indirect github.com/creack/goselect v0.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/fatih/color v1.13.0 // indirect - 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.4 // indirect github.com/h2non/filetype v1.1.3 // indirect @@ -48,23 +46,21 @@ require ( github.com/josharian/intern v1.0.0 // indirect github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect + github.com/klauspost/compress v1.15.13 // indirect github.com/leonelquinteros/gotext v1.4.0 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/miekg/dns v1.1.43 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect - github.com/oleksandr/bonjour v0.0.0-20210301155756-30f43c61b915 // indirect github.com/pelletier/go-toml v1.9.4 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmylund/sortutil v0.0.0-20120526081524-abeda66eb583 // indirect github.com/rivo/uniseg v0.2.0 // indirect github.com/sergi/go-diff v1.3.1 // indirect - github.com/smartystreets/goconvey v1.7.2 // indirect github.com/spf13/afero v1.6.0 // indirect github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect @@ -72,14 +68,15 @@ require ( github.com/src-d/gcfg v1.4.0 // indirect github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.2.0 // indirect + github.com/ulikunitz/xz v0.5.12 // indirect + github.com/x448/float16 v0.8.4 // indirect github.com/xanzy/ssh-agent v0.3.3 // indirect go.bug.st/downloader/v2 v2.1.1 // indirect - go.bug.st/relaxed-semver v0.9.0 // indirect - go.bug.st/serial.v1 v0.0.0-20191202182710-24a6610f0541 // indirect + go.bug.st/relaxed-semver v0.10.1 // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.16.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect golang.org/x/tools v0.17.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240205150955-31a09d347014 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/go.sum b/go.sum index c375bb31..1f3605b6 100644 --- a/go.sum +++ b/go.sum @@ -62,22 +62,17 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF 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/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= -github.com/arduino/board-discovery v0.0.0-20211020061712-fd83c2e3c908 h1:GgkPq0AbuE/pA7KdXYRvNo5p4JuO2BMBRgfgUXTv9I4= -github.com/arduino/board-discovery v0.0.0-20211020061712-fd83c2e3c908/go.mod h1:HK7SpkEax/3P+0w78iRQx1sz1vCDYYw9RXwHjQTB5i8= +github.com/arduino/arduino-cli v0.0.0-20250901123057-20dd7c932f59 h1:KjD3s14n+hc6G+NFzg6gh5F3AZU9zfoSSoa/ivZizbk= +github.com/arduino/arduino-cli v0.0.0-20250901123057-20dd7c932f59/go.mod h1:jkWY40xUrKH6CYi1ppeFF4h6LS3UaOUMo+fk4zYf74I= github.com/arduino/go-paths-helper v1.0.1/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.2.0/go.mod h1:HpxtKph+g238EJHq4geEPv9p+gl3v5YYu35Yb+w31Ck= -github.com/arduino/go-paths-helper v1.7.0 h1:S9l5BP2aogz1CgyqqnncXt0PLpK4yvwOW/wu/LaR3tc= -github.com/arduino/go-paths-helper v1.7.0/go.mod h1:V82BWgAAp4IbmlybxQdk9Bpkz8M4Qyx+RAFKaG9NuvU= +github.com/arduino/go-paths-helper v1.12.1 h1:WkxiVUxBjKWlLMiMuYy8DcmVrkxdP7aKxQOAq7r2lVM= +github.com/arduino/go-paths-helper v1.12.1/go.mod h1:jcpW4wr0u69GlXhTYydsdsqAjLaYK5n7oWHfKqOG6LM= github.com/arduino/go-properties-orderedmap v1.7.1 h1:HQ9Pn/mk3+XyfrE39EEvaZwJkrvgiVSY5Oq3JSEfOR4= 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/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/arduino/iot-client-go/v2 v2.0.3 h1:/mYkInEgr2a4s3bSFhjCzynBApPcYlpDwsuTQiyMbag= -github.com/arduino/iot-client-go/v2 v2.0.3/go.mod h1:kwX4B2AVEWl5ug94QbQ087xbvLFa9Co//jhbM/Z2eSQ= +github.com/arduino/iot-client-go/v3 v3.1.1 h1:bQhbV5PlH8tDuSmeimw9Rjrh5KbIUhqvYWWI/xYMi1M= +github.com/arduino/iot-client-go/v3 v3.1.1/go.mod h1:r2QEAP5Jalkr0YWNPhFl0EJzFRQNy24wN5CVbn11f64= 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= @@ -85,6 +80,8 @@ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= +github.com/beevik/ntp v1.4.3 h1:PlbTvE5NNy4QHmA4Mg57n7mcFTmr1W1j3gcK7L1lqho= +github.com/beevik/ntp v1.4.3/go.mod h1:Unr8Zg+2dRn7d8bHFuehIMSvvUYssHMxW3Q5Nx4RW5Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -115,10 +112,8 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/codeclysm/cc v1.2.2 h1:1ChS4EvWTjw6bH2sd6QiMcmih0itVVrWdh9MmOliX/I= -github.com/codeclysm/cc v1.2.2/go.mod h1:XtW4ArCNgQwFphcRGG9+sPX5WM1J6/u0gMy5ZdV3obA= -github.com/codeclysm/extract/v3 v3.0.2 h1:sB4LcE3Php7LkhZwN0n2p8GCwZe92PEQutdbGURf5xc= -github.com/codeclysm/extract/v3 v3.0.2/go.mod h1:NKsw+hqua9H+Rlwy/w/3Qgt9jDonYEgB6wJu+25eOKw= +github.com/codeclysm/extract/v4 v4.0.0 h1:H87LFsUNaJTu2e/8p/oiuiUsOK/TaPQ5wxsjPnwPEIY= +github.com/codeclysm/extract/v4 v4.0.0/go.mod h1:SFju1lj6as7FvUgalpSct7torJE0zttbJUWtryPRG6s= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= @@ -146,13 +141,11 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fluxio/iohelpers v0.0.0-20160419043813-3a4dd67a94d2 h1:C6sOwknxwWfLBEQ91zhmptlfxf7pVEs5s6wOnDxNpS4= -github.com/fluxio/iohelpers v0.0.0-20160419043813-3a4dd67a94d2/go.mod h1:c7sGIpDbBo0JZZ1tKyC1p5smWf8QcUjK4bFtZjHAecg= -github.com/fluxio/multierror v0.0.0-20160419044231-9c68d39025e5 h1:R8jFW6G/bjoXjWPFrEfw9G5YQDlYhwV4AC+Eonu6wmk= -github.com/fluxio/multierror v0.0.0-20160419044231-9c68d39025e5/go.mod h1:BEUDl7FG1cc76sM0J0x8dqr6RhiL4uqvk6oFkwuNyuM= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/fxamacker/cbor/v2 v2.8.0 h1:fFtUGXUzXPHTIUdne5+zzMPTfffl3RD5qYnkY40vtxU= +github.com/fxamacker/cbor/v2 v2.8.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2 h1:6zsha5zo/TWhRhwqCD3+EarCAgZ2yN28ipRnGPnwkI0= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -244,10 +237,7 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/h2non/filetype v1.0.6/go.mod h1:isekKqOuhMj+s/7r3rIeTErIRy4Rub5uBWHfvMusLMU= github.com/h2non/filetype v1.1.3 h1:FKkx9QbD7HR/zjK1Ia5XiBsq9zdLi5Kf3zGyFTAFkGg= github.com/h2non/filetype v1.1.3/go.mod h1:319b3zT68BvV+WRj7cwy856M2ehB3HqNOt6sy1HndBY= github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= @@ -303,27 +293,22 @@ github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/ github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/clock v0.0.0-20180524022203-d293bb356ca4/go.mod h1:nD0vlnrUjcjJhqN5WuCWZyzfd5AHZAC9/ajvbSx69xA= -github.com/juju/errors v0.0.0-20150916125642-1b5e39b83d18/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= -github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q= github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff h1:WLHwK6yMswDvGUNrkxp4GYnrbQS8WULu1D3qteVdUIg= github.com/juju/errors v0.0.0-20210818161939-5560c4c073ff/go.mod h1:i1eL7XREII6aHpQ2gApI/v6FkVUDEBremNkcBCKYAcY= github.com/juju/loggo v0.0.0-20170605014607-8232ab8918d9/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 h1:UUHMLvzt/31azWTN/ifGWef4WUqvXk0iRqdhdy/2uzI= -github.com/juju/retry v0.0.0-20160928201858-1998d01ba1c3/go.mod h1:OohPQGsr4pnxwD5YljhQ+TZnuVRYpa5irjugL1Yuif4= +github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U= github.com/juju/testing v0.0.0-20180517134105-72703b1e95eb/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA= github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0 h1:+WWUkhnTjV6RNOxkcwk79qrjeyHEHvBzlneueBsatX4= github.com/juju/testing v0.0.0-20200510222523-6c8c298c77a0/go.mod h1:hpGvhGHPVbNBraRLZEhoQwFLMrjK8PSlO4D3nDjKYXo= -github.com/juju/utils v0.0.0-20180808125547-9dfc6dbfb02b/go.mod h1:6/KLg8Wz/y2KVGWEpkK9vMNGkOnu4k/cqs8Z1fKjTOk= -github.com/juju/version v0.0.0-20161031051906-1f41e27e54f2/go.mod h1:kE8gK5X0CImdr7qpSKl3xB2PmpySSmfj7zVbkZFs81U= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.15.13 h1:NFn1Wr8cfnenSJSA46lLq4wHCcBzKTSjnBIexDMMOV0= +github.com/klauspost/compress v1.15.13/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -333,6 +318,7 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leonelquinteros/gotext v1.4.0 h1:2NHPCto5IoMXbrT0bldPrxj0qM5asOCwtb1aUQZ1tys= github.com/leonelquinteros/gotext v1.4.0/go.mod h1:yZGXREmoGTtBvZHNcc+Yfug49G/2spuF/i/Qlsvz1Us= github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= @@ -361,8 +347,6 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.43 h1:JKfpVSCB84vrAmHzyrsxB5NAr5kLoMXZArPSw7Qlgyg= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -379,8 +363,6 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/oleksandr/bonjour v0.0.0-20210301155756-30f43c61b915 h1:d291KOLbN1GthTPA1fLKyWdclX3k1ZP+CzYtun+a5Es= -github.com/oleksandr/bonjour v0.0.0-20210301155756-30f43c61b915/go.mod h1:MGuVJ1+5TX1SCoO2Sx0eAnjpdRytYla2uC1YIZfkC9c= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= @@ -425,10 +407,6 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs= -github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo= -github.com/smartystreets/goconvey v1.7.2 h1:9RBaZCeXEQ3UselpuwUQHltGVXvdwm6cv1hgR6gDIPg= -github.com/smartystreets/goconvey v1.7.2/go.mod h1:Vw0tHAZW6lzCRk3xgdin6fKYcG+G3Pg9vgXWeJpQFMM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= @@ -462,6 +440,10 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8 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= +github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= +github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= @@ -474,12 +456,10 @@ 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= go.bug.st/downloader/v2 v2.1.1/go.mod h1:VZW2V1iGKV8rJL2ZEGIDzzBeKowYv34AedJz13RzVII= -go.bug.st/relaxed-semver v0.9.0 h1:qt0T8W70VCurvsbxRK25fQwiTOFjkzwC/fDOpyPnchQ= -go.bug.st/relaxed-semver v0.9.0/go.mod h1:ug0/W/RPYUjliE70Ghxg77RDHmPxqpo7SHV16ijss7Q= -go.bug.st/serial v1.3.3 h1:lOSLGmZSB7qU6pSOaZqlRholjC8SmmFTGv4ib9oPwYo= -go.bug.st/serial v1.3.3/go.mod h1:jDkjqASf/qSjmaOxHSHljwUQ6eHo/ZX/bxJLQqSlvZg= -go.bug.st/serial.v1 v0.0.0-20191202182710-24a6610f0541 h1:eQfoPfT+gNSh63t/oKanQlZyKgblRa/LMZRPIT+MHzA= -go.bug.st/serial.v1 v0.0.0-20191202182710-24a6610f0541/go.mod h1:dRSl/CVCTf56CkXgJMDOdSwNfo2g1orOGE/gBGdvjZw= +go.bug.st/relaxed-semver v0.10.1 h1:g61DeaZ48IsikiPpd52wE/extF+sqX0SyllzsEIWhBM= +go.bug.st/relaxed-semver v0.10.1/go.mod h1:lPVGdtzbQ9/2fv6iXqIXWHOj6cMTUJ/l/Lu1w+sgdio= +go.bug.st/serial v1.6.2 h1:kn9LRX3sdm+WxWKufMlIRndwGfPWsH1/9lCWXQCasq8= +go.bug.st/serial v1.6.2/go.mod h1:UABfsluHAiaNI+La2iESysd9Vetq7VRdpxvjx7CmmOE= go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= @@ -494,7 +474,6 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -golang.org/x/crypto v0.0.0-20180214000028-650f4a345ab4/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -508,8 +487,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U 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-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= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -548,7 +527,6 @@ 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.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= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -591,8 +569,8 @@ 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.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -610,8 +588,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.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= -golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= +golang.org/x/oauth2 v0.25.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= @@ -624,6 +602,7 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ 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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -693,10 +672,11 @@ golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBc 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-20220715151400-c0bba94af5f8/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/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.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.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= 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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -706,8 +686,8 @@ 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.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -717,7 +697,6 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -934,6 +913,7 @@ gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/mgo.v2 v2.0.0-20160818015218-f2b6f6c918c4/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce h1:xcEWjVhvbDy+nHP67nPDDpbYrY+ILlfndk4bRioVHaU= +gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA= gopkg.in/src-d/go-billy.v4 v4.3.2 h1:0SQA1pRztfTFx2miS8sA97XvooFeNOmvUenF4o0EcVg= gopkg.in/src-d/go-billy.v4 v4.3.2/go.mod h1:nDjArDMp+XMs1aFAESLRjfGSgfvoYN0hDfzEk0GjC98= gopkg.in/src-d/go-git-fixtures.v3 v3.5.0 h1:ivZFOIltbce2Mo8IjzUHAFoq/IylO9WHhNOAJK+LsJg= diff --git a/gon.config.hcl b/gon.config.hcl index f32ba1ed..4a4eefdf 100644 --- a/gon.config.hcl +++ b/gon.config.hcl @@ -1,6 +1,6 @@ # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/general/gon.config.hcl # See: https://github.com/Bearer/gon#configuration-file -source = ["dist/arduino-cloud-cli_osx_darwin_amd64/arduino-cloud-cli"] +source = ["dist/arduino-cloud-cli_osx_darwin_amd64/arduino-cloud-cli", "dist/arduino-cloud-cli_osx_darwin_arm64/arduino-cloud-cli"] bundle_id = "cc.arduino.arduino-cloud-cli" sign { diff --git a/internal/board-protocols/configuration-protocol/cborcoders/enc_dec.go b/internal/board-protocols/configuration-protocol/cborcoders/enc_dec.go new file mode 100644 index 00000000..e9ff9aa7 --- /dev/null +++ b/internal/board-protocols/configuration-protocol/cborcoders/enc_dec.go @@ -0,0 +1,276 @@ +package cborcoders + +import ( + "bytes" + "errors" + "fmt" + "reflect" + "slices" + + "github.com/fxamacker/cbor/v2" +) + +var _dm cbor.DecMode +var _em cbor.EncMode + +var wifiListBeginMessage = []byte{0xda, 0x00, 0x01, 0x20, 0x01} + +// Provisioning commands +var ProvisioningStatusMessageType = reflect.TypeOf(ProvisioningStatusMessage{}) +var WiFiNetworksType = reflect.TypeOf(WiFiNetworks{}) +var ProvisioningUniqueIdMessageType = reflect.TypeOf(ProvisioningUniqueIdMessage{}) +var ProvisioningBLEMacAddressMessageType = reflect.TypeOf(ProvisioningBLEMacAddressMessage{}) +var ProvisioningWiFiFWVersionMessageType = reflect.TypeOf(ProvisioningWiFiFWVersionMessage{}) +var ProvisioningSketchVersionMessageType = reflect.TypeOf(ProvisioningSketchVersionMessage{}) +var ProvisioningNetConfigLibVersionMessageType = reflect.TypeOf(ProvisioningNetworkConfigLibVersionMessage{}) +var ProvisioningSignatureMessageType = reflect.TypeOf(ProvisioningSignatureMessage{}) +var ProvisioningPublicKeyMessageType = reflect.TypeOf(ProvisioningPublicKeyMessage{}) +var ProvisioningTimestampMessageType = reflect.TypeOf(ProvisioningTimestampMessage{}) +var ProvisioningCommandsMessageType = reflect.TypeOf(ProvisioningCommandsMessage{}) +var ProvisioningWifiConfigMessageType = reflect.TypeOf(ProvisioningWifiConfigMessage{}) +var ProvisioningLoRaConfigMessageType = reflect.TypeOf(ProvisioningLoRaConfigMessage{}) +var ProvisioningGSMConfigMessageType = reflect.TypeOf(ProvisioningGSMConfigMessage{}) +var ProvisioningNBIoTConfigMessageType = reflect.TypeOf(ProvisioningNBConfigMessage{}) +var ProvisioningCATM1ConfigMessageType = reflect.TypeOf(ProvisioningCATM1ConfigMessage{}) +var ProvisioningEthernetConfigMessageType = reflect.TypeOf(ProvisioningEthernetConfigMessage{}) +var ProvisioningCellularConfigMessageType = reflect.TypeOf(ProvisioningCellularConfigMessage{}) + +type tag struct { + tag uint64 + ty reflect.Type +} + +var tagCommands = []tag{ + // provisioning commands + {0x012000, ProvisioningStatusMessageType}, + {0x012001, WiFiNetworksType}, + {0x012013, ProvisioningBLEMacAddressMessageType}, + {0x012014, ProvisioningWiFiFWVersionMessageType}, + {0x012015, ProvisioningSketchVersionMessageType}, + {0x012016, ProvisioningNetConfigLibVersionMessageType}, + {0x012010, ProvisioningUniqueIdMessageType}, + {0x012011, ProvisioningSignatureMessageType}, + {0x012017, ProvisioningPublicKeyMessageType}, + {0x012002, ProvisioningTimestampMessageType}, + {0x012003, ProvisioningCommandsMessageType}, + {0x012004, ProvisioningWifiConfigMessageType}, + {0x012005, ProvisioningLoRaConfigMessageType}, + {0x012006, ProvisioningGSMConfigMessageType}, + {0x012007, ProvisioningNBIoTConfigMessageType}, + {0x012008, ProvisioningCATM1ConfigMessageType}, + {0x012009, ProvisioningEthernetConfigMessageType}, + {0x012012, ProvisioningCellularConfigMessageType}, +} + +func init() { + tags := cbor.NewTagSet() + for _, t := range tagCommands { + err := tags.Add( + cbor.TagOptions{EncTag: cbor.EncTagRequired, DecTag: cbor.DecTagRequired}, + t.ty, + t.tag) + if err != nil { + panic(err) + } + } + var err error + _dm, err = cbor.DecOptions{}.DecModeWithTags(tags) + if err != nil { + panic(err) + } + + _em, err = cbor.EncOptions{IndefLength: 1, NilContainers: cbor.NilContainerAsEmpty}.EncModeWithTags(tags) + + if err != nil { + panic(err) + } +} + +type Cmd struct { + inner interface{} +} + +func getCBORType(data byte) byte { + return data & 0xe0 +} + +func getCBORFieldLength(data []byte) (len, i int) { + additional_information := data[0] & 0x1f + if additional_information <= 23 { + return int(additional_information), 0 + } else if additional_information == 24 { + return int(data[1]), 1 + } else if additional_information == 25 { + return int(data[1])<<8 | int(data[2]), 2 + } + return 0, 0 +} + +func getString(data []byte, len int) string { + return string(data[:len]) +} + +func DecodeWiFiNetworks(data []byte, wf *WiFiNetworks) error { + len := len(data) + if len == 0 { + return errors.New("empty data") + } + networks := []WiFiNetwork{} + i := 0 + for i < len { + if getCBORType(data[i]) != 0x80 { //check if it's an array + return errors.New("invalid data not initial array") + } + + array_length, l := getCBORFieldLength(data[i:]) + i += l + i++ + for j := 0; j < array_length; j = j + 2 { + if getCBORType(data[i]) != 0x60 { //check if it's a text string + return errors.New("invalid data not text string") + } + + text_length, l := getCBORFieldLength(data[i:]) + i += l + i++ + ssid := getString(data[i:], text_length) + i += text_length + if getCBORType(data[i]) != 0x20 { //check if it's a negative number + return errors.New("invalid data not negative number") + } + val, l := getCBORFieldLength(data[i:]) + rssi := int(-1) ^ int(val) + i += l + i++ + networks = append(networks, WiFiNetwork{SSID: ssid, RSSI: rssi}) + } + } + *wf = networks + + return nil +} + +func Decode(message []byte) (cmd Cmd, err error) { + c := Cmd{} + if bytes.Equal(message[0:5], wifiListBeginMessage) { + wf := WiFiNetworks{} + e := DecodeWiFiNetworks(message[5:], &wf) + c.inner = wf + return c, e + } + + if err := _dm.Unmarshal(message, &c.inner); err != nil { + return Cmd{}, err + } + + match := slices.ContainsFunc(tagCommands, func(t tag) bool { + return t.ty == c.Type() + }) + if !match { + return Cmd{}, fmt.Errorf("unknown command type: %v", c.Type()) + } + + return c, nil + +} + +func (c Cmd) Encode() ([]byte, error) { + p, err := _em.Marshal(c.inner) + if err != nil { + return nil, err + } + return p, nil +} + +func (c Cmd) String() string { + idx := slices.IndexFunc(tagCommands, func(t tag) bool { + return t.ty == c.Type() + }) + return fmt.Sprintf("%x=%+v", tagCommands[idx].tag, c.inner) +} + +func From[T ProvisioningStatusMessage | WiFiNetworks | ProvisioningBLEMacAddressMessage | ProvisioningWiFiFWVersionMessage | + ProvisioningSketchVersionMessage | ProvisioningNetworkConfigLibVersionMessage | ProvisioningUniqueIdMessage | + ProvisioningSignatureMessage | ProvisioningPublicKeyMessage | ProvisioningTimestampMessage | + ProvisioningCommandsMessage | ProvisioningWifiConfigMessage | + ProvisioningLoRaConfigMessage | ProvisioningCellularConfigMessage | + ProvisioningEthernetConfigMessage | ProvisioningCATM1ConfigMessage | + ProvisioningGSMConfigMessage | ProvisioningNBConfigMessage](c T) Cmd { + return Cmd{inner: c} +} + +func (c Cmd) Type() reflect.Type { + return reflect.TypeOf(c.inner) +} + +func (c Cmd) ToProvisioningStatusMessage() ProvisioningStatusMessage { + return c.inner.(ProvisioningStatusMessage) +} + +func (c Cmd) ToWiFiNetworks() WiFiNetworks { + return c.inner.(WiFiNetworks) +} + +func (c Cmd) ToProvisioningBLEMacAddressMessage() ProvisioningBLEMacAddressMessage { + return c.inner.(ProvisioningBLEMacAddressMessage) +} + +func (c Cmd) ToProvisioningWiFiFWVersionMessage() ProvisioningWiFiFWVersionMessage { + return c.inner.(ProvisioningWiFiFWVersionMessage) +} + +func (c Cmd) ToProvisioningSketchVersionMessage() ProvisioningSketchVersionMessage { + return c.inner.(ProvisioningSketchVersionMessage) +} + +func (c Cmd) ToProvisioningNetworkConfigLibVersionMessage() ProvisioningNetworkConfigLibVersionMessage { + return c.inner.(ProvisioningNetworkConfigLibVersionMessage) +} + +func (c Cmd) ToProvisioningUniqueIdMessage() ProvisioningUniqueIdMessage { + return c.inner.(ProvisioningUniqueIdMessage) +} + +func (c Cmd) ToProvisioningSignatureMessage() ProvisioningSignatureMessage { + return c.inner.(ProvisioningSignatureMessage) +} + +func (c Cmd) ToProvisioningPublicKeyMessage() ProvisioningPublicKeyMessage { + return c.inner.(ProvisioningPublicKeyMessage) +} + +func (c Cmd) ToProvisioningTimestampMessage() ProvisioningTimestampMessage { + return c.inner.(ProvisioningTimestampMessage) +} + +func (c Cmd) ToProvisioningCommandsMessage() ProvisioningCommandsMessage { + return c.inner.(ProvisioningCommandsMessage) +} + +func (c Cmd) ToProvisioningWifiConfigMessage() ProvisioningWifiConfigMessage { + return c.inner.(ProvisioningWifiConfigMessage) +} + +func (c Cmd) ToProvisioningLoRaConfigMessage() ProvisioningLoRaConfigMessage { + return c.inner.(ProvisioningLoRaConfigMessage) +} + +func (c Cmd) ToProvisioningCellularConfigMessage() ProvisioningCellularConfigMessage { + return c.inner.(ProvisioningCellularConfigMessage) +} + +func (c Cmd) ToProvisioningEthernetConfigMessage() ProvisioningEthernetConfigMessage { + return c.inner.(ProvisioningEthernetConfigMessage) +} + +func (c Cmd) ToProvisioningCATM1ConfigMessage() ProvisioningCATM1ConfigMessage { + return c.inner.(ProvisioningCATM1ConfigMessage) +} + +func (c Cmd) ToProvisioningGSMConfigMessage() ProvisioningGSMConfigMessage { + return c.inner.(ProvisioningGSMConfigMessage) +} + +func (c Cmd) ToProvisioningNBConfigMessage() ProvisioningNBConfigMessage { + return c.inner.(ProvisioningNBConfigMessage) +} diff --git a/internal/board-protocols/configuration-protocol/cborcoders/enc_dec_test.go b/internal/board-protocols/configuration-protocol/cborcoders/enc_dec_test.go new file mode 100644 index 00000000..3abe5b52 --- /dev/null +++ b/internal/board-protocols/configuration-protocol/cborcoders/enc_dec_test.go @@ -0,0 +1,263 @@ +package cborcoders + +import ( + "encoding/hex" + "strings" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestEncodeDecode(t *testing.T) { + fixedTime := uint64(1709208245) // time.Date(2024, 2, 29, 12, 4, 5, 0, time.UTC) + + tests := []struct { + name string + in Cmd + want string + }{ + { + name: "provisioning status", + in: From(ProvisioningStatusMessage{Status: -100}), + want: "da00012000813863", + }, + { + name: "provisioning BLE mac address", + in: From(ProvisioningBLEMacAddressMessage{ + BLEMacAddress: [6]uint8{0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF}}), + want: "DA000120138146AFAFAFAFAFAF", + }, + { + name: "provisioning WiFi FW Version", + in: From(ProvisioningWiFiFWVersionMessage{ + WiFiFWVersion: "1.6.0"}), + want: "DA000120148165312E362E30", + }, + { + name: "provisioning sketch Version", + in: From(ProvisioningSketchVersionMessage{ + ProvisioningSketchVersion: "1.6.0"}), + want: "DA000120158165312E362E30", + }, + { + name: "provisioning network configurator Version", + in: From(ProvisioningNetworkConfigLibVersionMessage{ + NetworkConfigLibVersion: "1.6.0"}), + want: "DA000120168165312E362E30", + }, + { + name: "provisioning unique id", + in: From(ProvisioningUniqueIdMessage{ + UniqueId: [32]uint8{0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA}}), + want: "DA00012010815820CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA", + }, + { + name: "provisioning signature", + in: From(ProvisioningSignatureMessage{ + Signature: [268]uint8{0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, 0xCA, + 0xCA, 0xCA, 0xCA, 0xCA}}), + want: "DA000120118159010CCACACACACACACACACACACACACACACACACACA" + + "CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA" + + "CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA" + + "CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA" + + "CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA" + + "CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA" + + "CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA" + + "CACACACACACACACACACACACACACACACACACACACACACACACACACACACACACA" + + "cacacacacacacacacacacacacacacacacacacacacacacacacacacacacaca" + + "cacacacacacacacacaca", + }, + { + name: "provisioning public key", + in: From(ProvisioningPublicKeyMessage{ + ProvisioningPublicKey: "-----BEGIN PUBLIC KEY-----\n" + + "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE7JxCtXl5SvIrHmiasqyN4pyoXRlm44d5WXNpqmvJ\n" + + "k0tH8UpmIeHG7YPAkKLaqid95v/wLVoWeX5EbjxmlCkFtw==\n-----END PUBLIC KEY-----\n", + }), + want: "DA000120178178B22D2D2D2D2D424547494E205055424C4943204B45592D2D2D2D2" + + "D0A4D466B77457759484B6F5A497A6A3043415159494B6F5A497A6A304441516344" + + "51674145374A784374586C3553764972486D69617371794E3470796F58526C6D343" + + "4643557584E70716D764A0A6B3074483855706D49654847375950416B4B4C617169" + + "643935762F774C566F5765583545626A786D6C436B4674773D3D0A2D2D2D2D2D454" + + "E44205055424C4943204B45592D2D2D2D2D0A", + }, + { + name: "provisioning timestamp", + in: From(ProvisioningTimestampMessage{Timestamp: fixedTime}), + want: "DA00012002811A65E072B5", + }, + { + name: "provisioning commands", + in: From(ProvisioningCommandsMessage{Command: 100}), + want: "DA00012003811864", + }, + { + name: "provisioning wifi config", + in: From(ProvisioningWifiConfigMessage{SSID: "SSID1", PWD: "PASSWORDSSID1"}), + want: "DA00012004826553534944316D50415353574F52445353494431", + }, + { + name: "provisioning lora config", + in: From(ProvisioningLoRaConfigMessage{ + AppEui: "APPEUI1", + AppKey: "APPKEY", + Band: 5, + ChannelMask: "01110", + DeviceClass: "A", + }), + want: "DA00012005856741505045554931664150504B4559056530313131306141", + }, + { + name: "provisioning gsm config", + in: From(ProvisioningGSMConfigMessage{ + PIN: "12345678", + Apn: "apn.arduino.cc", + Login: "TESTUSER", + Pass: "TESTPASSWORD", + }), + want: "DA00012006846831323334353637386E61706E2E61726475696E6F2E63636854455354555345526C5445535450415353574F5244", + }, + { + name: "provisoning gsm config without pin", + in: From(ProvisioningGSMConfigMessage{ + Apn: "apn.arduino.cc", + Login: "TESTUSER", + Pass: "TESTPASSWORD", + }), + want: "DA0001200684606E61706E2E61726475696E6F2E63636854455354555345526C5445535450415353574F5244", + }, + { + name: "provisioning nb config", + in: From(ProvisioningNBConfigMessage{ + PIN: "12345678", + Apn: "apn.arduino.cc", + Login: "TESTUSER", + Pass: "TESTPASSWORD", + }), + want: "DA00012007846831323334353637386E61706E2E61726475696E6F2E63636854455354555345526C5445535450415353574F5244", + }, + { + name: "provisioning nb config without pin, login and pass", + in: From(ProvisioningNBConfigMessage{ + PIN: "", + Apn: "apn.arduino.cc", + Login: "", + Pass: "", + }), + want: "DA0001200784606E61706E2E61726475696E6F2E63636060", + }, + { + name: "provisioning catm1 config", + in: From(ProvisioningCATM1ConfigMessage{ + PIN: "12345678", + Band: []uint32{1, 2, 524288, 134217728}, + Apn: "apn.arduino.cc", + Login: "TESTUSER", + Pass: "TESTPASSWORD", + }), + want: "DA00012008856831323334353637388401021A000800001A080000006E61706E2E61726475696E6F2E63636854455354555345526C5445535450415353574F5244", + }, + { + name: "provisioning catm1 config no band", + in: From(ProvisioningCATM1ConfigMessage{ + PIN: "12345678", + Band: []uint32{}, + Apn: "apn.arduino.cc", + Login: "TESTUSER", + Pass: "TESTPASSWORD", + }), + want: "DA0001200885683132333435363738806E61706E2E61726475696E6F2E63636854455354555345526C5445535450415353574F5244", + }, + { + name: "provisioning ethernet config ipv4", + in: From(ProvisioningEthernetConfigMessage{ + Static_ip: []byte{192, 168, 0, 2}, + Dns: []byte{8, 8, 8, 8}, + Gateway: []byte{192, 168, 1, 1}, + Netmask: []byte{255, 255, 255, 0}, + Timeout: 15, + ResponseTimeout: 200, + }), + want: "DA000120098644C0A80002440808080844C0A8010144FFFFFF000F18C8", + }, + { + name: "provisioning ethernet config ipv6", + in: From(ProvisioningEthernetConfigMessage{ + Static_ip: []byte{0x1a, 0x4f, 0xa7, 0xa9, 0x92, 0x8f, 0x7b, 0x1c, 0xec, 0x3b, 0x1e, 0xcd, 0x88, 0x58, 0x0d, 0x1e}, + Dns: []byte{0x21, 0xf6, 0x3b, 0x22, 0x99, 0x6f, 0x5b, 0x72, 0x25, 0xd9, 0xe0, 0x24, 0xf0, 0x36, 0xb5, 0xd2}, + Gateway: []byte{0x2e, 0xc2, 0x27, 0xf1, 0xf1, 0x9a, 0x0c, 0x11, 0x47, 0x1b, 0x84, 0xaf, 0x96, 0x10, 0xb0, 0x17}, + Netmask: []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, + Timeout: 15, + ResponseTimeout: 200, + }), + want: "DA0001200986501A4FA7A9928F7B1CEC3B1ECD88580D1E5021F63B22996F5B7225D9E024F036B5D2502EC227F1F19A0C11471B84AF9610B01750FFFFFFFFFFFFFFFF00000000000000000F18C8", + }, + { + name: "provisioning cellular config", + in: From(ProvisioningCellularConfigMessage{ + PIN: "12345678", + Apn: "apn.arduino.cc", + Login: "TESTUSER", + Pass: "TESTPASSWORD", + }), + want: "DA00012012846831323334353637386E61706E2E61726475696E6F2E63636854455354555345526C5445535450415353574F5244", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + + got, err := tt.in.Encode() + assert.NoError(t, err) + tt.want = strings.ToLower(tt.want) + hexGot := hex.EncodeToString(got) + assert.Equal(t, tt.want, hexGot) + + cmd, err := Decode(got) + assert.NoError(t, err) + assert.Equal(t, tt.in, cmd) + }) + } +} + +func TestDecodeWiFiList(t *testing.T) { + list := From(WiFiNetworks{{SSID: "SSID1", RSSI: -76}, {SSID: "SSID2", RSSI: -56}}) + encoded_list, _ := hex.DecodeString("DA0001200184655353494431384B6553534944323837") + decoded, err := Decode(encoded_list) + assert.NoError(t, err) + assert.Equal(t, list, decoded) +} diff --git a/internal/board-protocols/configuration-protocol/cborcoders/model.go b/internal/board-protocols/configuration-protocol/cborcoders/model.go new file mode 100644 index 00000000..158af8c3 --- /dev/null +++ b/internal/board-protocols/configuration-protocol/cborcoders/model.go @@ -0,0 +1,194 @@ +package cborcoders + +import ( + "fmt" +) + +// Provisioning commands +type ProvisioningStatusMessage struct { + _ struct{} `cbor:",toarray"` + Status int16 +} + +func (t ProvisioningStatusMessage) String() string { + return fmt.Sprintf("ProvisioningStatusMessage{Status: %d}", t.Status) +} + +type WiFiNetwork struct { + _ struct{} `cbor:",toarray"` + SSID string + RSSI int +} + +func (w WiFiNetwork) String() string { + return fmt.Sprintf("WiFiNetwork{SSID: %s, RSSI: %d}", w.SSID, w.RSSI) +} + +type WiFiNetworks []WiFiNetwork + +type ProvisioningUniqueIdMessage struct { + _ struct{} `cbor:",toarray"` + UniqueId [32]uint8 +} + +func (t ProvisioningUniqueIdMessage) String() string { + return fmt.Sprintf("ProvisioningUniqueIdMessage{UniqueId: %v}", t.UniqueId) +} + +type ProvisioningSignatureMessage struct { + _ struct{} `cbor:",toarray"` + Signature [268]uint8 +} + +func (t ProvisioningSignatureMessage) String() string { + return fmt.Sprintf("ProvisioningSignatureMessage{Signature: %v}", t.Signature) +} + +type ProvisioningPublicKeyMessage struct { + _ struct{} `cbor:",toarray"` + ProvisioningPublicKey string +} + +func (t ProvisioningPublicKeyMessage) String() string { + return fmt.Sprintf("ProvisioningPublicKeyMessage{ProvisioningPublicKey: %s}", t.ProvisioningPublicKey) +} + +type ProvisioningBLEMacAddressMessage struct { + _ struct{} `cbor:",toarray"` + BLEMacAddress [6]uint8 +} + +func (t ProvisioningBLEMacAddressMessage) String() string { + return fmt.Sprintf("ProvisioningSignatureMessage{Signature: %v}", t.BLEMacAddress) +} + +type ProvisioningWiFiFWVersionMessage struct { + _ struct{} `cbor:",toarray"` + WiFiFWVersion string +} + +func (t ProvisioningWiFiFWVersionMessage) String() string { + return fmt.Sprintf("ProvisioningWiFiFWVersionMessage{WiFiFWVersion: %s}", t.WiFiFWVersion) +} + +type ProvisioningSketchVersionMessage struct { + _ struct{} `cbor:",toarray"` + ProvisioningSketchVersion string +} + +func (t ProvisioningSketchVersionMessage) String() string { + return fmt.Sprintf("ProvisioningSketchVersionMessage{ProvisioningSketchVersion: %s}", t.ProvisioningSketchVersion) +} + +type ProvisioningNetworkConfigLibVersionMessage struct { + _ struct{} `cbor:",toarray"` + NetworkConfigLibVersion string +} + +func (t ProvisioningNetworkConfigLibVersionMessage) String() string { + return fmt.Sprintf("ProvisioningNetworkConfigLibVersionMessage{NetworkConfigLibVersion: %s}", t.NetworkConfigLibVersion) +} + +type ProvisioningTimestampMessage struct { + _ struct{} `cbor:",toarray"` + Timestamp uint64 +} + +func (t ProvisioningTimestampMessage) String() string { + return fmt.Sprintf("ProvisioningTimestampMessage{Timestamp: %d}", t.Timestamp) +} + +type ProvisioningCommandsMessage struct { + _ struct{} `cbor:",toarray"` + Command uint8 +} + +func (t ProvisioningCommandsMessage) String() string { + return fmt.Sprintf("ProvisioningCommandsMessage{Command: %d}", t.Command) +} + +type ProvisioningWifiConfigMessage struct { + _ struct{} `cbor:",toarray"` + SSID string + PWD string +} + +func (t ProvisioningWifiConfigMessage) String() string { + return fmt.Sprintf("ProvisioningWifiConfigMessage{SSID: %s, PWD: %s}", t.SSID, t.PWD) +} + +type ProvisioningLoRaConfigMessage struct { + _ struct{} `cbor:",toarray"` + AppEui string + AppKey string + Band uint8 + ChannelMask string + DeviceClass string +} + +func (t ProvisioningLoRaConfigMessage) String() string { + return fmt.Sprintf("ProvisioningLoRaConfigMessage{appEui: %s, appKey: %s, band: %d, channelMask: %s, deviceClass: %s}", t.AppEui, t.AppKey, t.Band, t.ChannelMask, t.DeviceClass) +} + +type ProvisioningCATM1ConfigMessage struct { + _ struct{} `cbor:",toarray"` + PIN string + Band []uint32 + Apn string + Login string + Pass string +} + +func (t ProvisioningCATM1ConfigMessage) String() string { + return fmt.Sprintf("ProvisioningCATM1ConfigMessage{PIN: %s, Band: %v, Apn: %s, Login: %s, Pass: %s}", t.PIN, t.Band, t.Apn, t.Login, t.Pass) +} + +type ProvisioningEthernetConfigMessage struct { + _ struct{} `cbor:",toarray"` + Static_ip []uint8 `cbor:",toarray"` + Dns []uint8 `cbor:",toarray"` + Gateway []uint8 `cbor:",toarray"` + Netmask []uint8 `cbor:",toarray"` + Timeout uint + ResponseTimeout uint +} + +func (t ProvisioningEthernetConfigMessage) String() string { + return fmt.Sprintf("ProvisioningEthernetConfigMessage{Static_ip: %v, Dns: %v, Gateway: %v, Netmask: %v, Timeout: %d, ResponseTimeout: %d}", t.Static_ip, t.Dns, t.Gateway, t.Netmask, t.Timeout, t.ResponseTimeout) +} + +type ProvisioningCellularConfigMessage struct { + _ struct{} `cbor:",toarray"` + PIN string + Apn string + Login string + Pass string +} + +func (t ProvisioningCellularConfigMessage) String() string { + return fmt.Sprintf("ProvisioningCellularConfigMessage{PIN: %s, Apn: %s, Login: %s, Pass: %s}", t.PIN, t.Apn, t.Login, t.Pass) +} + +type ProvisioningGSMConfigMessage struct { + _ struct{} `cbor:",toarray"` + PIN string + Apn string + Login string + Pass string +} + +func (t ProvisioningGSMConfigMessage) String() string { + return fmt.Sprintf("ProvisioningGSMConfigMessage{PIN: %s, Apn: %s, Login: %s, Pass: %s}", t.PIN, t.Apn, t.Login, t.Pass) +} + +type ProvisioningNBConfigMessage struct { + _ struct{} `cbor:",toarray"` + PIN string + Apn string + Login string + Pass string +} + +func (t ProvisioningNBConfigMessage) String() string { + return fmt.Sprintf("ProvisioningNBConfigMessage{PIN: %s, Apn: %s, Login: %s, Pass: %s}", t.PIN, t.Apn, t.Login, t.Pass) +} diff --git a/internal/board-protocols/configuration-protocol/configuration_protocol.go b/internal/board-protocols/configuration-protocol/configuration_protocol.go new file mode 100644 index 00000000..ea467ae5 --- /dev/null +++ b/internal/board-protocols/configuration-protocol/configuration_protocol.go @@ -0,0 +1,217 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package configurationprotocol + +import ( + "fmt" + "time" + + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/configuration-protocol/cborcoders" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" + "github.com/sirupsen/logrus" +) + +var StatusBoard = map[int16]string{ + 1: "Connecting", + 2: "Connected", + 4: "Resetted", + 100: "Scanning for WiFi networks", + -1: "Failed to connect", + -3: "Disconnected", + -4: "Parameters not provided", + -5: "Invalid parameters", + -6: "Cannot execute anew request while another is pending", + -7: "Invalid request", + -8: "Internet not available", + -101: "HW Error connectivity module", + -102: "HW Connectivity Module stopped", + -150: "Error initializing secure element", + -151: "Error configuring secure element", + -152: "Error locking secure element", + -160: "Error generating UHWID", + -200: "Error storage begin module", + -201: "Fail to partition the storage", + -255: "Generic error", +} + +var Commands = map[string]uint8{ + "Connect": 1, + "GetID": 2, + "GetBLEMac": 3, + "Reset": 4, + "ScanWiFi": 100, + "GetWiFiFWVersion": 101, + "GetSketchVersion": 200, + "GetNetConfigLibVersion": 201, +} + +const ( + serialInitByte = 0x01 + serialEndByte = 0x02 + nackByte = 0x03 +) + +type NetworkConfigurationProtocol struct { + transport *transport.TransportInterface + msgList []cborcoders.Cmd + lastPacket frame.Frame +} + +func NewNetworkConfigurationProtocol(transport *transport.TransportInterface) *NetworkConfigurationProtocol { + return &NetworkConfigurationProtocol{ + transport: transport, + msgList: make([]cborcoders.Cmd, 0), + } +} + +func (ncp *NetworkConfigurationProtocol) Connect(address string) error { + err := (*ncp.transport).Connect(transport.TransportInterfaceParams{ + Port: address, + BoundRate: 9600, + }) + + if err != nil { + err = fmt.Errorf("%s: %w", "connecting to serial port", err) + return err + } + + if (*ncp.transport).Type() == transport.Serial { + p := frame.CreateFrame([]byte{serialInitByte}, frame.TransmissionControl) + + err = (*ncp.transport).Send(p.ToBytes()) + } + return err + +} + +func (ncp *NetworkConfigurationProtocol) Connected() bool { + if ncp.transport == nil || *ncp.transport == nil { + return false + } + return (*ncp.transport).Connected() +} + +func (ncp *NetworkConfigurationProtocol) Close() error { + if ncp.transport == nil || *ncp.transport == nil { + return fmt.Errorf("NetworkConfigurationProtocol: transport interface is not initialized") + } + + if (*ncp.transport).Type() == transport.Serial { + p := frame.CreateFrame([]byte{serialEndByte}, frame.TransmissionControl) + + err := (*ncp.transport).Send(p.ToBytes()) + if err != nil { + return fmt.Errorf("error sending end of transmission: %w", err) + } + time.Sleep(1 * time.Second) + } + + err := (*ncp.transport).Close() + if err != nil { + return fmt.Errorf("error closing transport: %w", err) + } + + ncp.msgList = make([]cborcoders.Cmd, 0) + ncp.lastPacket = frame.Frame{} + + return nil +} + +func (ncp *NetworkConfigurationProtocol) SendData(msg cborcoders.Cmd) error { + databuf, err := msg.Encode() + if err != nil { + return err + } + + if !(*ncp.transport).Connected() { + return fmt.Errorf("ProvisioningProtocol: transport interface is not connected") + } + + packet := frame.CreateFrame(databuf, frame.Data) + + ncp.lastPacket = packet + + return (*ncp.transport).Send(packet.ToBytes()) +} + +func (ncp *NetworkConfigurationProtocol) ReceiveData(timeoutSeconds int) (*cborcoders.Cmd, error) { + if (ncp.msgList != nil) && (len(ncp.msgList) > 0) { + + return ncp.popMsg(), nil + } + + if ncp.transport == nil || *ncp.transport == nil { + return nil, fmt.Errorf("NetworkConfigurationProtocol: transport interface is not initialized") + } + + if !(*ncp.transport).Connected() { + return nil, fmt.Errorf("NetworkConfigurationProtocol: transport interface is not connected") + } + + frames, err := (*ncp.transport).Receive(timeoutSeconds) + if err != nil { + return nil, err + } + + for _, f := range frames { + if !f.Validate() { + ncp.SendNack() + return nil, nil + } + + msgType := f.GetType() + if msgType == frame.TransmissionControl { + if f.GetPayload()[0] == nackByte { + // Resend packet + logrus.Debug("NetworkConfigurationProtocol: Received NACK, resending last packet") + (*ncp.transport).Send(ncp.lastPacket.ToBytes()) + break + } else if f.GetPayload()[0] == serialEndByte { + logrus.Debug("NetworkConfigurationProtocol: Received end of transmission signal") + (*ncp.transport).Close() + break + } + } + payload := f.GetPayload() + + res, err := cborcoders.Decode(payload) + if err != nil { + logrus.Warnf("NetworkConfigurationProtocol: error decoding payload: %s", err.Error()) + continue + } + + ncp.msgList = append(ncp.msgList, res) + } + + return ncp.popMsg(), nil +} + +func (ncp *NetworkConfigurationProtocol) SendNack() error { + packet := frame.CreateFrame([]byte{nackByte}, frame.TransmissionControl) + return (*ncp.transport).Send(packet.ToBytes()) +} + +func (ncp *NetworkConfigurationProtocol) popMsg() *cborcoders.Cmd { + if len(ncp.msgList) == 0 { + return nil + } + msg := ncp.msgList[0] + ncp.msgList = ncp.msgList[1:] + return &msg +} diff --git a/internal/board-protocols/configuration-protocol/configuration_protocol_test.go b/internal/board-protocols/configuration-protocol/configuration_protocol_test.go new file mode 100644 index 00000000..69641e32 --- /dev/null +++ b/internal/board-protocols/configuration-protocol/configuration_protocol_test.go @@ -0,0 +1,223 @@ +package configurationprotocol + +import ( + "errors" + "testing" + + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/configuration-protocol/cborcoders" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +func newMockTransportSerial() *mocks.TransportInterface { + m := &mocks.TransportInterface{} + m.On("Type").Return(transport.Serial) + + return m +} + +func TestNewNetworkConfigurationProtocolSerial(t *testing.T) { + mockTr := newMockTransportSerial() + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + assert.NotNil(t, ncp) + assert.Equal(t, &tr, ncp.transport) + assert.Empty(t, ncp.msgList) +} + +func TestConnectSerial_Success(t *testing.T) { + mockTr := newMockTransportSerial() + mockTr.On("Connect", mock.Anything).Return(nil) + mockTr.On("Send", mock.Anything).Return(nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + connectMsg := frame.CreateFrame([]byte{serialInitByte}, frame.TransmissionControl) + connectParams := transport.TransportInterfaceParams{ + Port: "COM1", + BoundRate: 9600, + } + + err := ncp.Connect("COM1") + assert.NoError(t, err) + mockTr.AssertCalled(t, "Connect", connectParams) + mockTr.AssertCalled(t, "Send", connectMsg.ToBytes()) +} + +func TestConnectSerial_Error(t *testing.T) { + mockTr := newMockTransportSerial() + mockTr.On("Connect", mock.Anything).Return(errors.New("port busy")) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + err := ncp.Connect("COM1") + assert.Error(t, err) + assert.Contains(t, err.Error(), "connecting to serial port") +} + +func TestCloseSerial_Success(t *testing.T) { + mockTr := newMockTransportSerial() + mockTr.On("Send", mock.Anything).Return(nil) + mockTr.On("Close").Return(nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + closeMsg := []byte{0x55, 0xaa, 0x03, 0x00, 0x03, 0x02, 0xD3, 0x6A, 0xaa, 0x55} + + err := ncp.Close() + assert.NoError(t, err) + mockTr.AssertCalled(t, "Send", closeMsg) + mockTr.AssertCalled(t, "Close") + assert.Empty(t, ncp.msgList) +} + +func TestSendData_Success(t *testing.T) { + mockTr := newMockTransportSerial() + mockTr.On("Connected").Return(true) + mockTr.On("Send", mock.Anything).Return(nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + connectMessage := cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: Commands["Connect"]}) + + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x09, 0xda, 0x00, 0x01, 0x20, 0x03, 0x81, 0x01, 0x7e, 0x1b, 0xaa, 0x55} + err := ncp.SendData(connectMessage) + assert.NoError(t, err) + mockTr.AssertCalled(t, "Send", want) +} + +func TestReceiveData_TransportNotConnected(t *testing.T) { + mockTr := newMockTransportSerial() + mockTr.On("Connected").Return(false) + mockTr.On("Receive", mock.Anything).Return(nil, nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + res, err := ncp.ReceiveData(1) + assert.Nil(t, res) + assert.Error(t, err) + assert.Contains(t, err.Error(), "transport interface is not connected") +} + +func TestReceiveData_ReceiveTimeout(t *testing.T) { + mockTr := newMockTransportSerial() + mockTr.On("Connected").Return(true) + mockTr.On("Receive", mock.Anything).Return(nil, errors.New("recv error")) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + res, err := ncp.ReceiveData(1) + assert.Nil(t, res) + assert.Error(t, err) + assert.Contains(t, err.Error(), "recv error") +} + +func TestReceiveData_FrameInvalid(t *testing.T) { + mockTr := newMockTransportSerial() + invalidFrame := frame.Frame{} + invalidFrame.SetHeader([]byte{0x55, 0xaa, 0x02, 0x00, 0x03}) + invalidFrame.SetPayload([]byte{0x04}) + invalidFrame.SetCrc([]byte{0x00, 0x00}) + invalidFrame.SetFooter([]byte{0xaa, 0x55}) + want := []byte{0x55, 0xaa, 0x03, 0x00, 0x03, 0x03, 0xC2, 0xE3, 0xaa, 0x55} + mockTr.On("Connected").Return(true) + mockTr.On("Receive", mock.Anything).Return([]frame.Frame{invalidFrame}, nil) + mockTr.On("Send", mock.Anything).Return(nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + res, err := ncp.ReceiveData(1) + assert.Nil(t, res) + assert.NoError(t, err) + mockTr.AssertCalled(t, "Send", want) +} + +func TestReceiveData_NackReceived(t *testing.T) { + mockTr := newMockTransportSerial() + nackFrame := frame.CreateFrame([]byte{nackByte}, frame.TransmissionControl) + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x09, 0xda, 0x00, 0x01, 0x20, 0x03, 0x81, 0x01, 0x7e, 0x1b, 0xaa, 0x55} + mockTr.On("Connected").Return(true) + mockTr.On("Receive", mock.Anything).Return([]frame.Frame{nackFrame}, nil) + mockTr.On("Send", mock.Anything).Return(nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + err := ncp.SendData(cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: Commands["Connect"]})) + assert.NoError(t, err) + mockTr.AssertCalled(t, "Send", want) + res, err := ncp.ReceiveData(1) + assert.Nil(t, res) + assert.NoError(t, err) + mockTr.AssertCalled(t, "Send", want) +} + +func TestReceiveData_SerialEndReceived(t *testing.T) { + mockTr := newMockTransportSerial() + endFrame := frame.CreateFrame([]byte{serialEndByte}, frame.TransmissionControl) + mockTr.On("Connected").Return(true) + mockTr.On("Close").Return(nil) + mockTr.On("Receive", mock.Anything).Return([]frame.Frame{endFrame}, nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + res, err := ncp.ReceiveData(1) + assert.Nil(t, res) + assert.NoError(t, err) + mockTr.AssertCalled(t, "Close") +} + +func TestReceiveData_MsgAndSerialEndReceived(t *testing.T) { + mockTr := newMockTransportSerial() + frameData := frame.CreateFrame([]byte{0xda, 0x00, 0x01, 0x20, 0x00, 0x81, 0x01}, frame.Data) + endFrame := frame.CreateFrame([]byte{serialEndByte}, frame.TransmissionControl) + mockTr.On("Connected").Return(true) + mockTr.On("Close").Return(nil) + mockTr.On("Receive", mock.Anything).Return([]frame.Frame{frameData, endFrame}, nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + res, err := ncp.ReceiveData(1) + assert.NoError(t, err) + mockTr.AssertCalled(t, "Close") + assert.NotNil(t, res) + assert.Equal(t, res.Type(), cborcoders.ProvisioningStatusMessageType) + assert.Equal(t, res.ToProvisioningStatusMessage().Status, int16(1)) +} + +func TestReceiveData_MsgAndNackReceived(t *testing.T) { + mockTr := newMockTransportSerial() + frameData := frame.CreateFrame([]byte{0xda, 0x00, 0x01, 0x20, 0x00, 0x81, 0x01}, frame.Data) + nackFrame := frame.CreateFrame([]byte{nackByte}, frame.TransmissionControl) + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x09, 0xda, 0x00, 0x01, 0x20, 0x03, 0x81, 0x01, 0x7e, 0x1b, 0xaa, 0x55} + mockTr.On("Connected").Return(true) + mockTr.On("Receive", mock.Anything).Return([]frame.Frame{frameData, nackFrame}, nil) + mockTr.On("Send", mock.Anything).Return(nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + err := ncp.SendData(cborcoders.From(cborcoders.ProvisioningCommandsMessage{Command: Commands["Connect"]})) + assert.NoError(t, err) + mockTr.AssertCalled(t, "Send", want) + res, err := ncp.ReceiveData(1) + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, res.Type(), cborcoders.ProvisioningStatusMessageType) + assert.Equal(t, res.ToProvisioningStatusMessage().Status, int16(1)) + mockTr.AssertCalled(t, "Send", want) +} + +func TestReceiveData_ReceiveData(t *testing.T) { + mockTr := newMockTransportSerial() + frameData := frame.CreateFrame([]byte{0xda, 0x00, 0x01, 0x20, 0x00, 0x81, 0x01}, frame.Data) + mockTr.On("Connected").Return(true) + mockTr.On("Receive", mock.Anything).Return([]frame.Frame{frameData}, nil) + tr := transport.TransportInterface(mockTr) + ncp := NewNetworkConfigurationProtocol(&tr) + + res, err := ncp.ReceiveData(1) + assert.NoError(t, err) + assert.NotNil(t, res) + assert.Equal(t, res.Type(), cborcoders.ProvisioningStatusMessageType) + assert.Equal(t, res.ToProvisioningStatusMessage().Status, int16(1)) +} diff --git a/internal/board-protocols/frame/frame.go b/internal/board-protocols/frame/frame.go new file mode 100644 index 00000000..b7b60de9 --- /dev/null +++ b/internal/board-protocols/frame/frame.go @@ -0,0 +1,209 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2021 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package frame + +import ( + "bytes" + "encoding/binary" + + "github.com/howeyc/crc16" +) + +/* + * The ArduinoBoardConfiguration Protocol frame structure + * 0x55 0xaa 0xaa 0x55 + * ____________________________________________________________________________________________________________________________________ + * | Byte[0] | Byte[1] | Byte[2] | Byte[3] | Byte[4] | Byte[5].......Byte[len -3] | Byte[len-2] | Byte[len-1] | Byte[len] | Byte[len+1] | + * |______________________HEADER_____________________|__________ PAYLOAD _________|___________ CRC ___________|________ FOOTER _________| + * | 0x55 | 0xaa | | | | | 0xaa | 0x55 | + * |____________________________________________________________________________________________________________________________________| + * = MessageType: 2 = DATA, 3 = TRANSMISSION_CONTROL + * = length of the payload + 2 bytes for the CRC + * = the data to be sent or received + * = CRC16 of the payload + */ + +var ( + // msgStart is the initial byte sequence of every packet. + msgStart = [2]byte{0x55, 0xAA} + // msgEnd is the final byte sequence of every packet. + msgEnd = [2]byte{0xAA, 0x55} +) + +const ( + // headerLen indicates the length of the header. + headerLen = 5 + // payloadField indicates the position of payload field. + payloadField = 5 + // payloadLenField indicates the position of payload length field. + payloadLenField = 3 + // payloadLenFieldLen indicatest the length of payload length field. + payloadLenFieldLen = 2 + // crcFieldLen indicates the length of the signature field. + crcFieldLen = 2 +) + +// MsgType indicates the type of the packet. +type MsgType byte + +const ( + None MsgType = iota + Cmd + Data + Response + TransmissionControl = Response // Alias for Response, used for clarity in ArduinoBoardConfiguration Protocol +) + +type Frame struct { + header []byte + payload []byte + crc []byte + footer []byte + payloadLen int + length int +} + +func (p *Frame) FillByte(b byte) bool { + + if len(p.header) < headerLen { + if p.fillHeader(b) { + p.extractPayloadLength() + p.length = headerLen + p.payloadLen + crcFieldLen + len(msgEnd) + } + } else if len(p.payload) < p.payloadLen { + p.payload = append(p.payload, b) + } else if len(p.crc) < crcFieldLen { + p.crc = append(p.crc, b) + } else if len(p.footer) < 2 { + p.footer = append(p.footer, b) + } + + return len(p.header) == headerLen && len(p.payload) == p.payloadLen && len(p.crc) == crcFieldLen && len(p.footer) == 2 +} + +func (p *Frame) fillHeader(data byte) bool { + p.header = append(p.header, data) + return len(p.header) == 5 +} + +func (p *Frame) extractPayloadLength() bool { + if len(p.header) < 5 { + return false + } + p.payloadLen = int(binary.BigEndian.Uint16(p.header[payloadLenField:])) - crcFieldLen + return true +} + +func (p *Frame) Validate() bool { + if len(p.header) != headerLen && !bytes.Equal(p.header[:2], msgStart[:]) { + return false + } + + if p.payloadLen == 0 { + return false + } + + if len(p.payload) != p.payloadLen { + return false + } + + if len(p.crc) != crcFieldLen { + return false + } + + if len(p.footer) != 2 && !bytes.Equal(p.footer[:], msgEnd[:]) { + return false + } + + ch := crc16.Checksum(p.payload, crc16.CCITTTable) + // crc is contained in the last bytes of the payload + cp := binary.BigEndian.Uint16(p.crc) + if ch != cp { + return false + } + + return true +} + +func (p *Frame) GetPayload() []byte { + if !p.Validate() { + return nil + } + return p.payload +} + +func (p *Frame) GetType() MsgType { + if !p.Validate() { + return None + } + return MsgType(p.header[2]) +} + +func (p *Frame) GetLength() int { + return p.length +} + +func (p *Frame) ToBytes() []byte { + return append(append(append(p.header, p.payload...), p.crc...), p.footer...) +} + +func (p *Frame) SetPayload(payload []byte) { + p.length += len(payload) + p.payload = payload + p.payloadLen = len(payload) +} + +func (p *Frame) SetHeader(header []byte) { + p.length += len(header) + p.header = header +} + +func (p *Frame) SetCrc(crc []byte) { + p.length += len(crc) + p.crc = crc +} + +func (p *Frame) SetFooter(footer []byte) { + p.length += len(footer) + p.footer = footer +} + +func CreateFrame(data []byte, mType MsgType) Frame { + // Create the packet + packet := Frame{} + packetHeader := append(msgStart[:], byte(mType)) + + // Append the packet length + bLen := make([]byte, payloadLenFieldLen) + binary.BigEndian.PutUint16(bLen, (uint16(len(data) + crcFieldLen))) + packetHeader = append(packetHeader, bLen...) + + packet.SetHeader(packetHeader) + // Append the message payload + packet.SetPayload(data) + + // Calculate and append the message signature + ch := crc16.Checksum(data, crc16.CCITTTable) + checksum := make([]byte, crcFieldLen) + binary.BigEndian.PutUint16(checksum, ch) + packet.SetCrc(checksum) + + // Append final byte sequence + packet.SetFooter(msgEnd[:]) + return packet +} diff --git a/internal/board-protocols/provisioning-protocol/provisioning_protocol.go b/internal/board-protocols/provisioning-protocol/provisioning_protocol.go new file mode 100644 index 00000000..1d038e64 --- /dev/null +++ b/internal/board-protocols/provisioning-protocol/provisioning_protocol.go @@ -0,0 +1,143 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package provisioningprotocol + +import ( + "context" + "errors" + "fmt" + + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" +) + +// Command indicates the command that should be +// executed on the board to be provisioned. +type Command byte + +const ( + SketchInfo Command = iota + 1 + CSR + Locked + GetLocked + WriteCrypto + BeginStorage + SetDeviceID + SetYear + SetMonth + SetDay + SetHour + SetValidity + SetCertSerial + SetAuthKey + SetSignature + EndStorage + ReconstructCert +) + +const ( + timeoutSeconds = 2 +) + +type ProvisioningProtocol struct { + transport *transport.TransportInterface + packetList []frame.Frame +} + +func NewProvisioningProtocol(transport *transport.TransportInterface) *ProvisioningProtocol { + return &ProvisioningProtocol{ + transport: transport, + } +} + +// Send allows to send a provisioning command to a connected arduino device. +func (p *ProvisioningProtocol) Send(ctx context.Context, cmd Command, payload []byte) error { + if p.transport == nil || *p.transport == nil { + return fmt.Errorf("ProvisioningProtocol: transport interface is not initialized") + } + + if !(*p.transport).Connected() { + return fmt.Errorf("ProvisioningProtocol: transport interface is not connected") + } + + if err := ctx.Err(); err != nil { + return fmt.Errorf("context error: %w", err) + } + payload = append([]byte{byte(cmd)}, payload...) + frame := frame.CreateFrame(payload, frame.Cmd) + + err := (*p.transport).Send(frame.ToBytes()) + return err + +} + +// SendReceive allows to send a provisioning command to a connected arduino device. +// Then, it waits for a response from the device and, if any, returns it. +// If no response is received after 2 seconds, an error is returned. +func (p *ProvisioningProtocol) SendReceive(ctx context.Context, cmd Command, payload []byte) ([]byte, error) { + if err := p.Send(ctx, cmd, payload); err != nil { + return nil, err + } + return p.receive(ctx) +} + +// receive allows to wait for a response from an arduino device under provisioning. +// Its timeout is set to 2 seconds. It returns an error if the response is not valid +// or if the timeout expires. +func (p *ProvisioningProtocol) receive(ctx context.Context) ([]byte, error) { + if p.packetList != nil || len(p.packetList) > 0 { + return p.popMsg().GetPayload(), nil + } + + if p.transport == nil || *p.transport == nil { + return nil, errors.New("ProvisioningProtocol: transport interface is not initialized") + } + + if err := ctx.Err(); err != nil { + return nil, err + } + + packets, err := (*p.transport).Receive(timeoutSeconds) + + if err != nil { + return nil, fmt.Errorf("error receiving packets: %w", err) + } + + if len(packets) == 0 { + return nil, nil + } + + for _, packet := range packets { + if !packet.Validate() { + return nil, errors.New("received invalid packet") + } + } + + p.packetList = append(p.packetList, packets...) + + return p.popMsg().GetPayload(), nil +} + +func (p *ProvisioningProtocol) popMsg() *frame.Frame { + if len(p.packetList) == 0 { + return nil + } + msg := p.packetList[0] + p.packetList = p.packetList[1:] + return &msg +} diff --git a/internal/board-protocols/provisioning-protocol/provisioning_protocol_test.go b/internal/board-protocols/provisioning-protocol/provisioning_protocol_test.go new file mode 100644 index 00000000..31d5c496 --- /dev/null +++ b/internal/board-protocols/provisioning-protocol/provisioning_protocol_test.go @@ -0,0 +1,52 @@ +package provisioningprotocol + +import ( + "context" + "testing" + + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport/mocks" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" +) + +func TestSend_Success(t *testing.T) { + mockTransportInterface := &mocks.TransportInterface{} + var tr transport.TransportInterface = mockTransportInterface + provProt := NewProvisioningProtocol(&tr) + mockTransportInterface.On("Connected").Return(true) + mockTransportInterface.On("Send", mock.AnythingOfType("[]uint8")).Return(nil) + + payload := []byte{1, 2} + cmd := SetDay + want := []byte{0x55, 0xaa, 1, 0, 5, 10, 1, 2, 143, 124, 0xaa, 0x55} + + err := provProt.Send(context.TODO(), cmd, payload) + assert.NoError(t, err) + mockTransportInterface.AssertCalled(t, "Send", want) +} + +func TestSendReceive_Success(t *testing.T) { + + mockTransportInterface := &mocks.TransportInterface{} + var tr transport.TransportInterface = mockTransportInterface + provProt := NewProvisioningProtocol(&tr) + + want := []byte{1, 2, 3} + rec := frame.CreateFrame(want, frame.Response) + receivedListFrame := []frame.Frame{ + rec, + } + + mockTransportInterface.On("Connected").Return(true) + mockTransportInterface.On("Send", mock.AnythingOfType("[]uint8")).Return(nil) + mockTransportInterface.On("Receive", mock.Anything).Return(receivedListFrame, nil) + + res, err := provProt.SendReceive(context.TODO(), BeginStorage, []byte{1, 2}) + assert.NoError(t, err) + + assert.NotNil(t, res, "Expected non-nil response") + assert.Equal(t, res, want, "Expected %v but received %v", want, res) + +} diff --git a/internal/board-protocols/transport/mocks/Transport.go b/internal/board-protocols/transport/mocks/Transport.go new file mode 100644 index 00000000..d3500e74 --- /dev/null +++ b/internal/board-protocols/transport/mocks/Transport.go @@ -0,0 +1,149 @@ +// Code generated by mockery v2.42.2. DO NOT EDIT. + +package mocks + +import ( + frame "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" + mock "github.com/stretchr/testify/mock" + + transport "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" +) + +// TransportInterface is an autogenerated mock type for the TransportInterface type +type TransportInterface struct { + mock.Mock +} + +// Close provides a mock function with given fields: +func (_m *TransportInterface) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Connect provides a mock function with given fields: params +func (_m *TransportInterface) Connect(params transport.TransportInterfaceParams) error { + ret := _m.Called(params) + + if len(ret) == 0 { + panic("no return value specified for Connect") + } + + var r0 error + if rf, ok := ret.Get(0).(func(transport.TransportInterfaceParams) error); ok { + r0 = rf(params) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Connected provides a mock function with given fields: +func (_m *TransportInterface) Connected() bool { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Connected") + } + + var r0 bool + if rf, ok := ret.Get(0).(func() bool); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(bool) + } + + return r0 +} + +// Receive provides a mock function with given fields: timeoutSeconds +func (_m *TransportInterface) Receive(timeoutSeconds int) ([]frame.Frame, error) { + ret := _m.Called(timeoutSeconds) + + if len(ret) == 0 { + panic("no return value specified for Receive") + } + + var r0 []frame.Frame + var r1 error + if rf, ok := ret.Get(0).(func(int) ([]frame.Frame, error)); ok { + return rf(timeoutSeconds) + } + if rf, ok := ret.Get(0).(func(int) []frame.Frame); ok { + r0 = rf(timeoutSeconds) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]frame.Frame) + } + } + + if rf, ok := ret.Get(1).(func(int) error); ok { + r1 = rf(timeoutSeconds) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// Send provides a mock function with given fields: data +func (_m *TransportInterface) Send(data []byte) error { + ret := _m.Called(data) + + if len(ret) == 0 { + panic("no return value specified for Send") + } + + var r0 error + if rf, ok := ret.Get(0).(func([]byte) error); ok { + r0 = rf(data) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Type provides a mock function with given fields: +func (_m *TransportInterface) Type() transport.InterfaceType { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Type") + } + + var r0 transport.InterfaceType + if rf, ok := ret.Get(0).(func() transport.InterfaceType); ok { + r0 = rf() + } else { + r0 = ret.Get(0).(transport.InterfaceType) + } + + return r0 +} + +// NewTransportInterface creates a new instance of TransportInterface. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewTransportInterface(t interface { + mock.TestingT + Cleanup(func()) +}) *TransportInterface { + mock := &TransportInterface{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/board-protocols/transport/transport_controller.go b/internal/board-protocols/transport/transport_controller.go new file mode 100644 index 00000000..e587a536 --- /dev/null +++ b/internal/board-protocols/transport/transport_controller.go @@ -0,0 +1,101 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package transport + +import ( + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" +) + +type TransportController struct { + packetList []frame.Frame + receivingPacket frame.Frame + filledPacket bool + foundStart bool + foundFirstByteStart bool +} + +func NewTransportController() *TransportController { + return &TransportController{ + packetList: make([]frame.Frame, 0), + receivingPacket: frame.Frame{}, + filledPacket: false, + foundStart: false, + foundFirstByteStart: false, + } +} + +func (tc *TransportController) HandleReceivedData(data []byte) []frame.Frame { + // if in the previous iteration the last byte was the beginning of a new packet, + // check if the first byte of the current iteration is the second byte of the begin frame + if tc.foundFirstByteStart { + if len(data) > 0 && data[0] == 0xaa { + tc.foundStart = true + //force fill byte + tc.filledPacket = tc.receivingPacket.FillByte(0x55) + } + tc.foundFirstByteStart = false + } + + n := tc.searchStartPacket(data) + if n != -1 && !tc.foundStart { + tc.foundStart = true + data = data[n:] + } + + if tc.foundStart { + for i := 0; i < len(data); i++ { + if tc.filledPacket { + tc.foundStart = false + n = tc.searchStartPacket(data[i:]) + if n != -1 { + tc.foundStart = true + tc.filledPacket = false + tc.packetList = append(tc.packetList, tc.receivingPacket) + tc.receivingPacket = frame.Frame{} + + i = i + n + } else { + break + } + } + tc.filledPacket = tc.receivingPacket.FillByte(data[i]) + } + } else { + // Discard data + //Check if the last byte is the beginning of a new packet in case the begin is split in two packets + if len(data) > 0 && data[len(data)-1] == 0x55 { + tc.foundFirstByteStart = true + } + } + + if !tc.filledPacket { + return nil + } + + tc.packetList = append(tc.packetList, tc.receivingPacket) + return tc.packetList +} + +func (tc *TransportController) searchStartPacket(data []byte) int { + for i := 0; i < len(data)-1; i++ { + if data[i] == 0x55 && data[i+1] == 0xaa { + return i + } + } + return -1 +} diff --git a/internal/board-protocols/transport/transport_controller_test.go b/internal/board-protocols/transport/transport_controller_test.go new file mode 100644 index 00000000..9a95807c --- /dev/null +++ b/internal/board-protocols/transport/transport_controller_test.go @@ -0,0 +1,152 @@ +package transport + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestHandleReceivedData_FullPacket(t *testing.T) { + tc := NewTransportController() + + data := []byte{0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55} + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55} + got := tc.HandleReceivedData(data) + + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 1, "expected 1 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want, "expected packet bytes %v, got %v", want, got[0].ToBytes()) +} + +func TestHandleReceivedData_FullPacketWithJunk(t *testing.T) { + tc := NewTransportController() + + data := []byte{0x65, 0x45, 0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55, 0x65, 0x24, 0x67} + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55} + got := tc.HandleReceivedData(data) + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 1, "expected 1 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want, "expected packet bytes %v, got %v", want, got[0].ToBytes()) +} + +func TestHandleReceivedData_SplitStartSequence(t *testing.T) { + tc := NewTransportController() + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55} + // First call: only 0x55 + got := tc.HandleReceivedData([]byte{0x55}) + + assert.Nil(t, got, "expected nil packet list") + + // Second call: 0xaa and 0x02, should complete start and fill + got = tc.HandleReceivedData([]byte{0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55}) + + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 1, "expected 1 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want, "expected packet bytes %v, got %v", want, got[0].ToBytes()) +} + +func TestHandleReceivedData_SplitStartSequenceWithJunk(t *testing.T) { + tc := NewTransportController() + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55} + // First call: only 0x55 + got := tc.HandleReceivedData([]byte{0x00, 0x00, 0x12, 0x70, 0x55}) + + assert.Nil(t, got, "expected nil packet list") + // Second call: 0xaa and 0x02, should complete start and fill + got = tc.HandleReceivedData([]byte{0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55}) + + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 1, "expected 1 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want, "expected packet bytes %v, got %v", want, got[0].ToBytes()) +} + +func TestHandleReceivedData_MultiplePackets(t *testing.T) { + tc := NewTransportController() + // Two packets in one buffer + data := []byte{0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55, 0x55, 0xaa, 0x02, 0x00, 0x03, 0x05, 0xA7, 0xD5, 0xaa, 0x55, 0x55, 0xaa, 0x02, 0x00, 0x03, 0x06, 0x95, 0x4E, 0xaa, 0x55} + want := [][]byte{ + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55}, + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x05, 0xA7, 0xD5, 0xaa, 0x55}, + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x06, 0x95, 0x4E, 0xaa, 0x55}, + } + got := tc.HandleReceivedData(data) + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 3, "expected 1 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want[0], "expected packet bytes %v, got %v", want[0], got[0].ToBytes()) + assert.Equal(t, got[1].ToBytes(), want[1], "expected packet bytes %v, got %v", want[1], got[1].ToBytes()) + assert.Equal(t, got[2].ToBytes(), want[2], "expected packet bytes %v, got %v", want[2], got[2].ToBytes()) +} + +func TestHandleReceivedData_MultiplePacketsWithJunk(t *testing.T) { + tc := NewTransportController() + // Two packets in one buffer + data := []byte{0x00, 0x01, 0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55, + 0x00, 0x34, 0x45, 0x55, 0xaa, 0x02, 0x00, 0x03, 0x05, 0xA7, 0xD5, 0xaa, 0x55, 0x55, 0xaa, 0x02, 0x00, 0x03, 0x06, 0x95, 0x4E, 0xaa, 0x55, 0x00, 0x03} + want := [][]byte{ + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55}, + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x05, 0xA7, 0xD5, 0xaa, 0x55}, + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x06, 0x95, 0x4E, 0xaa, 0x55}, + } + got := tc.HandleReceivedData(data) + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 3, "expected 1 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want[0], "expected packet bytes %v, got %v", want[0], got[0].ToBytes()) + assert.Equal(t, got[1].ToBytes(), want[1], "expected packet bytes %v, got %v", want[1], got[1].ToBytes()) + assert.Equal(t, got[2].ToBytes(), want[2], "expected packet bytes %v, got %v", want[2], got[2].ToBytes()) +} + +func TestHandleReceivedData_NoStartSequence(t *testing.T) { + tc := NewTransportController() + data := []byte{0x01, 0x02, 0x03} + got := tc.HandleReceivedData(data) + assert.Nil(t, got, "expected nil packet list for data without start sequence") + +} + +func TestHandleReceivedData_PartialPacket(t *testing.T) { + tc := NewTransportController() + want := []byte{0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55} + // Only part of the packet arrives + + got := tc.HandleReceivedData([]byte{0x55, 0xaa}) + assert.Nil(t, got, "expected nil packet list for partial packet") + // Second call: more data arrives, but still not complete + got = tc.HandleReceivedData([]byte{0x02, 0x00, 0x03, 0x04, 0xB6}) + assert.Nil(t, got, "expected nil packet list for partial packet") + + // Third call: more data arrives + got = tc.HandleReceivedData([]byte{0x5C, 0xaa}) + assert.Nil(t, got, "expected nil packet list for partial packet") + + // Fourth call: complete packet arrives + got = tc.HandleReceivedData([]byte{0x55}) + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 1, "expected 1 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want, "expected packet bytes %v, got %v", want, got[0].ToBytes()) +} + +func TestHandleReceivedData_PartialPacketMultiplePacket(t *testing.T) { + tc := NewTransportController() + want := [][]byte{ + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x04, 0xB6, 0x5C, 0xaa, 0x55}, + {0x55, 0xaa, 0x02, 0x00, 0x03, 0x05, 0xA7, 0xD5, 0xaa, 0x55}, + } + // Only part of the packet arrives + + got := tc.HandleReceivedData([]byte{0x55, 0xaa}) + assert.Nil(t, got, "expected nil packet list for partial packet") + // Second call: more data arrives, but still not complete + got = tc.HandleReceivedData([]byte{0x02, 0x00, 0x03, 0x04, 0xB6}) + assert.Nil(t, got, "expected nil packet list for partial packet") + + // Third call: more data arrives + got = tc.HandleReceivedData([]byte{0x5C, 0xaa}) + assert.Nil(t, got, "expected nil packet list for partial packet") + + // Fourth call: complete packet arrives + got = tc.HandleReceivedData([]byte{0x55, 0x55, 0xaa, 0x02, 0x00, 0x03, 0x05, 0xA7, 0xD5, 0xaa, 0x55}) + assert.NotEmpty(t, got, "expected non-nil packet list") + assert.Equal(t, len(got), 2, "expected 2 packet, got %d", len(got)) + assert.Equal(t, got[0].ToBytes(), want[0], "expected packet bytes %v, got %v", want[0], got[0].ToBytes()) + assert.Equal(t, got[1].ToBytes(), want[1], "expected packet bytes %v, got %v", want[1], got[1].ToBytes()) +} diff --git a/internal/board-protocols/transport/transport_interface.go b/internal/board-protocols/transport/transport_interface.go new file mode 100644 index 00000000..06aeb38b --- /dev/null +++ b/internal/board-protocols/transport/transport_interface.go @@ -0,0 +1,44 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package transport + +import ( + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" +) + +type TransportInterfaceParams struct { + Port string + BoundRate int +} + +// MsgType indicates the type of the packet. +type InterfaceType byte + +const ( + Serial InterfaceType = iota + BLE +) + +type TransportInterface interface { + Connect(params TransportInterfaceParams) error + Send(data []byte) error + Receive(timeoutSeconds int) ([]frame.Frame, error) + Connected() bool + Type() InterfaceType + Close() error +} diff --git a/internal/ota/boardpids.go b/internal/boardpids/boardpids.go similarity index 70% rename from internal/ota/boardpids.go rename to internal/boardpids/boardpids.go index 6b4b824f..78733c12 100644 --- a/internal/ota/boardpids.go +++ b/internal/boardpids/boardpids.go @@ -15,7 +15,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -package ota +package boardpids var ( BoardTypes = map[uint32]string{ @@ -44,21 +44,23 @@ var ( "025F": "arduino:mbed_nicla:nicla_vision", "0064": "arduino:mbed_opta:opta", "0266": "arduino:mbed_giga:giga", + "0068": "arduino:renesas_portenta:portenta_c33", } ArduinoFqbnToPID = map[string]string{ - "arduino:samd:nano_33_iot": "8057", - "arduino:samd:mkr1000": "804E", - "arduino:samd:mkrgsm1400": "8052", - "arduino:samd:mkrnb1500": "8055", - "arduino:samd:mkrwifi1010": "8054", - "arduino:mbed_nano:nanorp2040connect": "005E", - "arduino:mbed_portenta:envie_m7": "025B", - "arduino:mbed_nicla:nicla_vision": "025F", - "arduino:mbed_opta:opta": "0064", - "arduino:mbed_giga:giga": "0266", - "arduino:renesas_uno:unor4wifi": "1002", - "arduino:esp32:nano_nora": "0070", + "arduino:samd:nano_33_iot": "8057", + "arduino:samd:mkr1000": "804E", + "arduino:samd:mkrgsm1400": "8052", + "arduino:samd:mkrnb1500": "8055", + "arduino:samd:mkrwifi1010": "8054", + "arduino:mbed_nano:nanorp2040connect": "005E", + "arduino:mbed_portenta:envie_m7": "025B", + "arduino:mbed_nicla:nicla_vision": "025F", + "arduino:mbed_opta:opta": "0064", + "arduino:mbed_giga:giga": "0266", + "arduino:renesas_uno:unor4wifi": "1002", + "arduino:esp32:nano_nora": "0070", + "arduino:renesas_portenta:portenta_c33": "0068", } ArduinoVendorID = "2341" diff --git a/internal/iot-api-raw/client.go b/internal/iot-api-raw/client.go new file mode 100644 index 00000000..2565cee5 --- /dev/null +++ b/internal/iot-api-raw/client.go @@ -0,0 +1,163 @@ +package iotapiraw + +import ( + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + + "github.com/arduino/arduino-cloud-cli/config" + "github.com/arduino/arduino-cloud-cli/internal/iot" + "github.com/arduino/go-paths-helper" + "golang.org/x/oauth2" +) + +type IoTApiRawClient struct { + client *http.Client + host string + src oauth2.TokenSource + organization string +} + +func NewClient(credentials *config.Credentials) *IoTApiRawClient { + host := iot.GetArduinoAPIBaseURL() + tokenSource := iot.NewUserTokenSource(credentials.Client, credentials.Secret, host, credentials.Organization) + return &IoTApiRawClient{ + client: &http.Client{}, + src: tokenSource, + host: host, + organization: credentials.Organization, + } +} + +func (c *IoTApiRawClient) performRequest(endpoint, method, token string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest(method, endpoint, body) + if err != nil { + return nil, err + } + req.Header.Add("Authorization", "Bearer "+token) + req.Header.Add("Content-Type", "application/json") + if c.organization != "" { + req.Header.Add("X-Organization", c.organization) + } + res, err := c.client.Do(req) + if err != nil { + return nil, err + } + return res, nil +} + +func (c *IoTApiRawClient) GetBoardsDetail() (*BoardTypeList, error) { + endpoint := c.host + "/iot/v1/supported/devices" + token, err := iot.GetToken(c.src) + if err != nil { + return nil, err + } + + res, err := c.performRequest(endpoint, http.MethodGet, token.AccessToken, nil) + if err != nil { + return nil, err + } + defer res.Body.Close() + + if res.StatusCode == http.StatusOK { + var response BoardTypeList + + respBytes, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + err = json.Unmarshal(respBytes, &response) + if err != nil { + return nil, err + } + return &response, nil + } else if res.StatusCode == 400 { + return nil, errors.New(endpoint + " returned bad request") + } else if res.StatusCode == 401 { + return nil, errors.New(endpoint + " returned unauthorized request") + } else if res.StatusCode == 403 { + return nil, errors.New(endpoint + " returned forbidden request") + } else if res.StatusCode == 500 { + return nil, errors.New(endpoint + " returned internal server error") + } + + return nil, err +} + +func (c *IoTApiRawClient) GetBoardDetailByFQBN(fqbn string) (*BoardType, error) { + boardsList, err := c.GetBoardsDetail() + if err != nil { + return nil, err + } + + for _, b := range *boardsList { + if b.FQBN != nil && *b.FQBN == fqbn { + return &b, nil + } + } + return nil, fmt.Errorf("board with fqbn %s not found", fqbn) +} + +func (c *IoTApiRawClient) DownloadProvisioningV2Sketch(fqbn string, path *paths.Path, filename *string) (string, error) { + endpoint := c.host + "/iot/v2/binaries/provisioningv2?fqbn=" + fqbn + token, err := iot.GetToken(c.src) + if err != nil { + return "", err + } + + res, err := c.performRequest(endpoint, http.MethodGet, token.AccessToken, nil) + if err != nil { + return "", err + } + defer res.Body.Close() + + if res.StatusCode == http.StatusOK { + var response Prov2SketchBinRes + respBytes, err := io.ReadAll(res.Body) + if err != nil { + return "", err + } + + err = json.Unmarshal(respBytes, &response) + if err != nil { + return "", err + } + + if filename != nil { + path = path.Join(*filename) + } else { + path = path.Join(response.FileName) + } + + path.Parent().MkdirAll() + + bytes, err := base64.StdEncoding.DecodeString(response.Binary) + if err != nil { + return "", err + } + + if err = path.WriteFile(bytes); err != nil { + return "", fmt.Errorf("writing provisioning v2 binary: %w", err) + } + p, err := path.Abs() + if err != nil { + return "", fmt.Errorf("cannot retrieve absolute path of downloaded provisioning v2 binary: %w", err) + } + return p.String(), nil + } else if res.StatusCode == 400 { + return "", errors.New(endpoint + " returned bad request") + } else if res.StatusCode == 401 { + return "", errors.New(endpoint + " returned unauthorized request") + } else if res.StatusCode == 403 { + return "", errors.New(endpoint + " returned forbidden request") + } else if res.StatusCode == 500 { + return "", errors.New(endpoint + " returned internal server error") + } + + return "", errors.New("failed to download the provisioning v2 binary: unknown error") + +} diff --git a/internal/iot-api-raw/dto.go b/internal/iot-api-raw/dto.go new file mode 100644 index 00000000..69d07968 --- /dev/null +++ b/internal/iot-api-raw/dto.go @@ -0,0 +1,23 @@ +package iotapiraw + +type BoardType struct { + FQBN *string `json:"fqbn,omitempty"` + Label string `json:"label"` + MinProvSketchVersion *string `json:"min_provisioning_sketch_version,omitempty"` + MinWiFiVersion *string `json:"min_provisioning_wifi_version,omitempty"` + Provisioning *string `json:"provisioning,omitempty"` + Tags []string `json:"tags"` + Type string `json:"type"` + Vendor string `json:"vendor"` + OTAAvailable *bool `json:"ota_available,omitempty"` +} + +type BoardTypeList []BoardType + +type Prov2SketchBinRes struct { + Binary string `json:"bin"` + FileName string `json:"filename"` + FQBN string `json:"fqbn"` + Name string `json:"name"` + SHA256 string `json:"sha256"` +} diff --git a/internal/iot/client.go b/internal/iot/client.go index ece0d015..36d71e5c 100644 --- a/internal/iot/client.go +++ b/internal/iot/client.go @@ -23,7 +23,7 @@ import ( "os" "github.com/arduino/arduino-cloud-cli/config" - iotclient "github.com/arduino/iot-client-go/v2" + iotclient "github.com/arduino/iot-client-go/v3" "golang.org/x/oauth2" ) @@ -70,9 +70,9 @@ func (cl *Client) DeviceCreate(ctx context.Context, fqbn, name, serial, dType st payload.ConnectionType = cType } - req := cl.api.DevicesV2Api.DevicesV2Create(ctx) + req := cl.api.DevicesV2API.DevicesV2Create(ctx) req = req.CreateDevicesV2Payload(payload) - dev, _, err := cl.api.DevicesV2Api.DevicesV2CreateExecute(req) + dev, _, err := cl.api.DevicesV2API.DevicesV2CreateExecute(req) if err != nil { err = fmt.Errorf("creating device, %w", errorDetail(err)) return nil, err @@ -98,9 +98,9 @@ func (cl *Client) DeviceLoraCreate(ctx context.Context, name, serial, devType, e UserId: "me", } - req := cl.api.LoraDevicesV1Api.LoraDevicesV1Create(ctx) + req := cl.api.LoraDevicesV1API.LoraDevicesV1Create(ctx) req = req.CreateLoraDevicesV1Payload(payload) - dev, _, err := cl.api.LoraDevicesV1Api.LoraDevicesV1CreateExecute(req) + dev, _, err := cl.api.LoraDevicesV1API.LoraDevicesV1CreateExecute(req) if err != nil { err = fmt.Errorf("creating lora device: %w", errorDetail(err)) return nil, err @@ -117,18 +117,18 @@ func (cl *Client) DevicePassSet(ctx context.Context, id string) (*iotclient.Ardu } // Fetch suggested password - req := cl.api.DevicesV2PassApi.DevicesV2PassGet(ctx, id) + req := cl.api.DevicesV2PassAPI.DevicesV2PassGet(ctx, id) req = req.SuggestedPassword(true) - pass, _, err := cl.api.DevicesV2PassApi.DevicesV2PassGetExecute(req) + 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 - reqSet := cl.api.DevicesV2PassApi.DevicesV2PassSet(ctx, id) + reqSet := cl.api.DevicesV2PassAPI.DevicesV2PassSet(ctx, id) reqSet = reqSet.Devicev2Pass(iotclient.Devicev2Pass{Password: pass.SuggestedPassword}) - pass, _, err = cl.api.DevicesV2PassApi.DevicesV2PassSetExecute(reqSet) + pass, _, err = cl.api.DevicesV2PassAPI.DevicesV2PassSetExecute(reqSet) if err != nil { err = fmt.Errorf("setting device password: %w", errorDetail(err)) return nil, err @@ -144,8 +144,8 @@ func (cl *Client) DeviceDelete(ctx context.Context, id string) error { return err } - req := cl.api.DevicesV2Api.DevicesV2Delete(ctx, id) - _, err = cl.api.DevicesV2Api.DevicesV2DeleteExecute(req) + 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 @@ -161,7 +161,7 @@ func (cl *Client) DeviceList(ctx context.Context, tags map[string]string) ([]iot return nil, err } - req := cl.api.DevicesV2Api.DevicesV2List(ctx) + req := cl.api.DevicesV2API.DevicesV2List(ctx) if tags != nil { t := make([]string, 0, len(tags)) for key, val := range tags { @@ -170,7 +170,7 @@ func (cl *Client) DeviceList(ctx context.Context, tags map[string]string) ([]iot } req = req.Tags(t) } - devices, _, err := cl.api.DevicesV2Api.DevicesV2ListExecute(req) + devices, _, err := cl.api.DevicesV2API.DevicesV2ListExecute(req) if err != nil { err = fmt.Errorf("listing devices: %w", errorDetail(err)) return nil, err @@ -186,8 +186,8 @@ func (cl *Client) DeviceShow(ctx context.Context, id string) (*iotclient.Arduino return nil, err } - req := cl.api.DevicesV2Api.DevicesV2Show(ctx, id) - dev, _, err := cl.api.DevicesV2Api.DevicesV2ShowExecute(req) + 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 @@ -202,9 +202,9 @@ func (cl *Client) DeviceNetworkCredentials(ctx context.Context, deviceType, conn return nil, err } - req := cl.api.NetworkCredentialsV1Api.NetworkCredentialsV1Show(ctx, deviceType) + req := cl.api.NetworkCredentialsV1API.NetworkCredentialsV1Show(ctx, deviceType) req = req.Connection(connection) - dev, _, err := cl.api.NetworkCredentialsV1Api.NetworkCredentialsV1ShowExecute(req) + dev, _, err := cl.api.NetworkCredentialsV1API.NetworkCredentialsV1ShowExecute(req) if err != nil { err = fmt.Errorf("retrieving device network configuration, %w", errorDetail(err)) return nil, err @@ -220,11 +220,11 @@ func (cl *Client) DeviceOTA(ctx context.Context, id string, file *os.File, expir return err } - req := cl.api.DevicesV2OtaApi.DevicesV2OtaUpload(ctx, id) + 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) + _, 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 != nil && resp.StatusCode == 409 { @@ -243,9 +243,9 @@ func (cl *Client) DeviceTagsCreate(ctx context.Context, id string, tags map[stri } for key, val := range tags { - req := cl.api.DevicesV2TagsApi.DevicesV2TagsUpsert(ctx, id) + req := cl.api.DevicesV2TagsAPI.DevicesV2TagsUpsert(ctx, id) req = req.Tag(iotclient.Tag{Key: key, Value: val}) - _, err := cl.api.DevicesV2TagsApi.DevicesV2TagsUpsertExecute(req) + _, err := cl.api.DevicesV2TagsAPI.DevicesV2TagsUpsertExecute(req) if err != nil { err = fmt.Errorf("cannot create tag %s: %w", key, errorDetail(err)) return err @@ -263,8 +263,8 @@ func (cl *Client) DeviceTagsDelete(ctx context.Context, id string, keys []string } for _, key := range keys { - req := cl.api.DevicesV2TagsApi.DevicesV2TagsDelete(ctx, id, key) - _, err := cl.api.DevicesV2TagsApi.DevicesV2TagsDeleteExecute(req) + 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 @@ -281,8 +281,8 @@ func (cl *Client) LoraFrequencyPlansList(ctx context.Context) ([]iotclient.Ardui return nil, err } - req := cl.api.LoraFreqPlanV1Api.LoraFreqPlanV1List(ctx) - freqs, _, err := cl.api.LoraFreqPlanV1Api.LoraFreqPlanV1ListExecute(req) + 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 @@ -299,14 +299,14 @@ func (cl *Client) CertificateCreate(ctx context.Context, id, csr string) (*iotcl } cert := iotclient.CreateDevicesV2CertsPayload{ - Ca: toStringPointer("Arduino"), + Ca: toStringPointer("Arduino_v2"), Csr: csr, Enabled: true, } - req := cl.api.DevicesV2CertsApi.DevicesV2CertsCreate(ctx, id) + req := cl.api.DevicesV2CertsAPI.DevicesV2CertsCreate(ctx, id) req = req.CreateDevicesV2CertsPayload(cert) - newCert, _, err := cl.api.DevicesV2CertsApi.DevicesV2CertsCreateExecute(req) + newCert, _, err := cl.api.DevicesV2CertsAPI.DevicesV2CertsCreateExecute(req) if err != nil { err = fmt.Errorf("creating certificate, %w", errorDetail(err)) return nil, err @@ -322,10 +322,10 @@ func (cl *Client) ThingCreate(ctx context.Context, thing *iotclient.ThingCreate, return nil, err } - req := cl.api.ThingsV2Api.ThingsV2Create(ctx) + req := cl.api.ThingsV2API.ThingsV2Create(ctx) req = req.ThingCreate(*thing) req = req.Force(force) - newThing, _, err := cl.api.ThingsV2Api.ThingsV2CreateExecute(req) + newThing, _, err := cl.api.ThingsV2API.ThingsV2CreateExecute(req) if err != nil { return nil, fmt.Errorf("%s: %w", "adding new thing", errorDetail(err)) } @@ -339,10 +339,10 @@ func (cl *Client) ThingUpdate(ctx context.Context, id string, thing *iotclient.T return err } - req := cl.api.ThingsV2Api.ThingsV2Update(ctx, id) + req := cl.api.ThingsV2API.ThingsV2Update(ctx, id) req = req.Force(force) req = req.ThingUpdate(*thing) - _, _, err = cl.api.ThingsV2Api.ThingsV2UpdateExecute(req) + _, _, err = cl.api.ThingsV2API.ThingsV2UpdateExecute(req) if err != nil { return fmt.Errorf("%s: %v", "updating thing", errorDetail(err)) } @@ -356,8 +356,8 @@ func (cl *Client) ThingDelete(ctx context.Context, id string) error { return err } - req := cl.api.ThingsV2Api.ThingsV2Delete(ctx, id) - _, err = cl.api.ThingsV2Api.ThingsV2DeleteExecute(req) + 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 @@ -372,8 +372,8 @@ func (cl *Client) ThingShow(ctx context.Context, id string) (*iotclient.ArduinoT return nil, err } - req := cl.api.ThingsV2Api.ThingsV2Show(ctx, id) - thing, _, err := cl.api.ThingsV2Api.ThingsV2ShowExecute(req) + 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)) } @@ -387,10 +387,10 @@ func (cl *Client) ThingClone(ctx context.Context, id, newName string) (*iotclien return nil, err } - req := cl.api.ThingsV2Api.ThingsV2Clone(ctx, id) + 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) + thing, _, err := cl.api.ThingsV2API.ThingsV2CloneExecute(req) if err != nil { return nil, fmt.Errorf("cloning thing thing, %w", errorDetail(err)) } @@ -404,7 +404,7 @@ func (cl *Client) ThingList(ctx context.Context, ids []string, device *string, p return nil, err } - req := cl.api.ThingsV2Api.ThingsV2List(ctx) + req := cl.api.ThingsV2API.ThingsV2List(ctx) req = req.ShowProperties(props) if ids != nil { req = req.Ids(ids) @@ -422,7 +422,7 @@ func (cl *Client) ThingList(ctx context.Context, ids []string, device *string, p } req = req.Tags(t) } - things, _, err := cl.api.ThingsV2Api.ThingsV2ListExecute(req) + things, _, err := cl.api.ThingsV2API.ThingsV2ListExecute(req) if err != nil { err = fmt.Errorf("retrieving things, %w", errorDetail(err)) return nil, err @@ -438,9 +438,9 @@ func (cl *Client) ThingTagsCreate(ctx context.Context, id string, tags map[strin } for key, val := range tags { - req := cl.api.ThingsV2TagsApi.ThingsV2TagsUpsert(ctx, id) + req := cl.api.ThingsV2TagsAPI.ThingsV2TagsUpsert(ctx, id) req = req.Tag(iotclient.Tag{Key: key, Value: val}) - _, err := cl.api.ThingsV2TagsApi.ThingsV2TagsUpsertExecute(req) + _, err := cl.api.ThingsV2TagsAPI.ThingsV2TagsUpsertExecute(req) if err != nil { err = fmt.Errorf("cannot create tag %s: %w", key, errorDetail(err)) return err @@ -458,8 +458,8 @@ func (cl *Client) ThingTagsDelete(ctx context.Context, id string, keys []string) } for _, key := range keys { - req := cl.api.ThingsV2TagsApi.ThingsV2TagsDelete(ctx, id, key) - _, err := cl.api.ThingsV2TagsApi.ThingsV2TagsDeleteExecute(req) + 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 @@ -475,9 +475,9 @@ func (cl *Client) DashboardCreate(ctx context.Context, dashboard *iotclient.Dash return nil, err } - req := cl.api.DashboardsV2Api.DashboardsV2Create(ctx) + req := cl.api.DashboardsV2API.DashboardsV2Create(ctx) req = req.Dashboardv2(*dashboard) - newDashboard, _, err := cl.api.DashboardsV2Api.DashboardsV2CreateExecute(req) + newDashboard, _, err := cl.api.DashboardsV2API.DashboardsV2CreateExecute(req) if err != nil { return nil, fmt.Errorf("%s: %w", "adding new dashboard", errorDetail(err)) } @@ -492,8 +492,8 @@ func (cl *Client) DashboardShow(ctx context.Context, id string) (*iotclient.Ardu return nil, err } - req := cl.api.DashboardsV2Api.DashboardsV2Show(ctx, id) - dashboard, _, err := cl.api.DashboardsV2Api.DashboardsV2ShowExecute(req) + 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 @@ -508,8 +508,8 @@ func (cl *Client) DashboardList(ctx context.Context) ([]iotclient.ArduinoDashboa return nil, err } - req := cl.api.DashboardsV2Api.DashboardsV2List(ctx) - dashboards, _, err := cl.api.DashboardsV2Api.DashboardsV2ListExecute(req) + 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 @@ -524,8 +524,8 @@ func (cl *Client) DashboardDelete(ctx context.Context, id string) error { return err } - req := cl.api.DashboardsV2Api.DashboardsV2Delete(ctx, id) - _, err = cl.api.DashboardsV2Api.DashboardsV2DeleteExecute(req) + 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 @@ -544,7 +544,7 @@ func (cl *Client) TemplateApply(ctx context.Context, id, thingId, prefix, device thingOption["device_id"] = deviceId thingOption["secrets"] = credentials - req := cl.api.TemplatesApi.TemplatesApply(ctx) + req := cl.api.TemplatesAPI.TemplatesApply(ctx) req = req.Template(iotclient.Template{ PrefixName: toStringPointer(prefix), CustomTemplateId: toStringPointer(id), @@ -552,7 +552,7 @@ func (cl *Client) TemplateApply(ctx context.Context, id, thingId, prefix, device thingId: thingOption, }, }) - dev, _, err := cl.api.TemplatesApi.TemplatesApplyExecute(req) + dev, _, err := cl.api.TemplatesAPI.TemplatesApplyExecute(req) if err != nil { err = fmt.Errorf("retrieving device, %w", errorDetail(err)) return nil, err @@ -560,19 +560,19 @@ func (cl *Client) TemplateApply(ctx context.Context, id, thingId, prefix, device return dev, nil } -func (cl *Client) setup(client, secret, organization string) error { +func (cl *Client) setup(client, secret, organizationId string) error { baseURL := GetArduinoAPIBaseURL() // Configure a token source given the user's credentials. - cl.token = NewUserTokenSource(client, secret, baseURL) + cl.token = NewUserTokenSource(client, secret, baseURL, organizationId) config := iotclient.NewConfiguration() - if organization != "" { - config.AddDefaultHeader("X-Organization", organization) + if organizationId != "" { + config.AddDefaultHeader("X-Organization", organizationId) } config.Servers = iotclient.ServerConfigurations{ { - URL: fmt.Sprintf("%s/iot", baseURL), + URL: baseURL, Description: "IoT API endpoint", }, } diff --git a/internal/iot/client_test.go b/internal/iot/client_test.go new file mode 100644 index 00000000..4c13608c --- /dev/null +++ b/internal/iot/client_test.go @@ -0,0 +1,41 @@ +package iot + +import ( + "testing" + + iotclient "github.com/arduino/iot-client-go/v3" + "github.com/stretchr/testify/assert" +) + +func TestJSON_UnknownFields_areAccepted(t *testing.T) { + + cert := iotclient.ArduinoDevicev2Cert{} + + // Add unknown fields to the JSON and verify that marshalling and unmarshalling works without raising error. + // This is useful when the API is extended with new fields and the client is not updated yet. + certJson := `{ + "compressed": { + "not_after": "0001-01-01T00:00:00Z", + "not_before": "0001-01-01T00:00:00Z", + "serial": "", + "signature": "signature", + "signature_asn1_x": "", + "signature_asn1_y": "" + }, + "der": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA", + "device_id": "123", + "enabled": true, + "href": "", + "id": "", + "pem": "-----BEGIN CERTIFICATE-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA", + "unknown_field": "value", + "unknown_field2": "value2", + "new_api_field": 2222 + }` + + err := cert.UnmarshalJSON([]byte(certJson)) + if err != nil { + t.Errorf("UnmarshalJSON failed: %s", err) + } + assert.Equal(t, 3, len(cert.AdditionalProperties)) +} diff --git a/internal/iot/error.go b/internal/iot/error.go index e26de626..74f29120 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" ) // errorDetail takes a generic iot-client-go error diff --git a/internal/iot/token.go b/internal/iot/token.go index ebca7536..3c1912d2 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" "golang.org/x/oauth2" cc "golang.org/x/oauth2/clientcredentials" ) @@ -39,10 +39,13 @@ func GetArduinoAPIBaseURL() string { } // Build a new token source to forge api JWT tokens based on provided credentials -func NewUserTokenSource(client, secret, baseURL string) oauth2.TokenSource { +func NewUserTokenSource(client, secret, baseURL, organizationId string) oauth2.TokenSource { // We need to pass the additional "audience" var to request an access token. additionalValues := url.Values{} additionalValues.Add("audience", "https://api2.arduino.cc/iot") + if organizationId != "" { + additionalValues.Add("organization_id", organizationId) + } // Set up OAuth2 configuration. config := cc.Config{ ClientID: client, @@ -67,3 +70,14 @@ func ctxWithToken(ctx context.Context, src oauth2.TokenSource) (context.Context, } return context.WithValue(ctx, iotclient.ContextOAuth2, src), nil } + +func GetToken(src oauth2.TokenSource) (*oauth2.Token, error) { + 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 token, nil +} diff --git a/internal/ota-api/client.go b/internal/ota-api/client.go index 1c4bd52f..9c2536d9 100644 --- a/internal/ota-api/client.go +++ b/internal/ota-api/client.go @@ -49,7 +49,7 @@ type OtaApiClient struct { func NewClient(credentials *config.Credentials) *OtaApiClient { host := iot.GetArduinoAPIBaseURL() - tokenSource := iot.NewUserTokenSource(credentials.Client, credentials.Secret, host) + tokenSource := iot.NewUserTokenSource(credentials.Client, credentials.Secret, host, credentials.Organization) return &OtaApiClient{ client: &http.Client{}, src: tokenSource, diff --git a/internal/ota-api/dto.go b/internal/ota-api/dto.go index 04184ed8..edb55909 100644 --- a/internal/ota-api/dto.go +++ b/internal/ota-api/dto.go @@ -31,9 +31,8 @@ const progressBarMultiplier = 2 type ( OtaStatusResponse struct { - FirmwareSize *int64 `json:"firmware_size,omitempty"` - Ota Ota `json:"ota"` - States []State `json:"states,omitempty"` + Ota Ota `json:"ota"` + States []State `json:"states,omitempty"` } OtaStatusList struct { @@ -41,12 +40,15 @@ type ( } Ota struct { - ID string `json:"id,omitempty" yaml:"id,omitempty"` - DeviceID string `json:"device_id,omitempty" yaml:"device_id,omitempty"` - Status string `json:"status" yaml:"status"` - StartedAt string `json:"started_at" yaml:"started_at"` - EndedAt string `json:"ended_at,omitempty" yaml:"ended_at,omitempty"` - ErrorReason string `json:"error_reason,omitempty" yaml:"error_reason,omitempty"` + ID string `json:"id,omitempty" yaml:"id,omitempty"` + DeviceID string `json:"device_id,omitempty" yaml:"device_id,omitempty"` + Status string `json:"status" yaml:"status"` + StartedAt string `json:"started_at" yaml:"started_at"` + EndedAt string `json:"ended_at,omitempty" yaml:"ended_at,omitempty"` + ErrorReason string `json:"error_reason,omitempty" yaml:"error_reason,omitempty"` + FirmwareSize int64 `json:"firmware_size,omitempty"` + MaxRetries int64 `json:"max_retries,omitempty"` + RetryAttempt int64 `json:"retry_attempt,omitempty"` } State struct { @@ -57,7 +59,9 @@ type ( } OtaStatusDetail struct { - FirmwareSize *int64 `json:"firmware_size,omitempty"` + FirmwareSize int64 `json:"firmware_size,omitempty"` + MaxRetries int64 `json:"max_retries,omitempty"` + RetryAttempt int64 `json:"retry_attempt,omitempty"` Ota Ota `json:"ota"` Details []State `json:"details,omitempty"` } @@ -81,7 +85,7 @@ func (r OtaStatusList) String() string { } if hasErrorReason { - t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason") + t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason", "Retry Attempt") } else { t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At") } @@ -91,6 +95,7 @@ func (r OtaStatusList) String() string { line := []any{r.DeviceID, r.ID, r.MapStatus(), formatHumanReadableTs(r.StartedAt), formatHumanReadableTs(r.EndedAt)} if hasErrorReason { line = append(line, r.ErrorReason) + line = append(line, strconv.FormatInt(r.RetryAttempt, 10)) } t.AddRow(line...) } @@ -114,7 +119,7 @@ func (r Ota) String() string { hasErrorReason := r.ErrorReason != "" if hasErrorReason { - t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason") + t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason", "Retry Attempt") } else { t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At") } @@ -123,6 +128,7 @@ func (r Ota) String() string { line := []any{r.DeviceID, r.ID, r.MapStatus(), formatHumanReadableTs(r.StartedAt), formatHumanReadableTs(r.EndedAt)} if hasErrorReason { line = append(line, r.ErrorReason) + line = append(line, strconv.FormatInt(r.RetryAttempt, 10)) } t.AddRow(line...) @@ -138,18 +144,21 @@ func (r OtaStatusDetail) String() string { return "No OTA found" } t := table.New() - hasErrorReason := r.Ota.ErrorReason != "" - if hasErrorReason { - t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason") + succeeded := strings.ToLower(r.Ota.Status) == "succeeded" + hasError := r.Ota.ErrorReason != "" || !succeeded + + if hasError { + t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At", "Error Reason", "Retry Attempt") } else { t.SetHeader("Device ID", "Ota ID", "Status", "Started At", "Ended At") } // Now print the table line := []any{r.Ota.DeviceID, r.Ota.ID, r.Ota.MapStatus(), formatHumanReadableTs(r.Ota.StartedAt), formatHumanReadableTs(r.Ota.EndedAt)} - if hasErrorReason { + if hasError { line = append(line, r.Ota.ErrorReason) + line = append(line, strconv.FormatInt(r.RetryAttempt, 10)) } t.AddRow(line...) @@ -160,22 +169,37 @@ func (r OtaStatusDetail) String() string { t = table.New() t.SetHeader("Time", "Status", "Detail") fwSize := int64(0) - if r.FirmwareSize != nil { - fwSize = *r.FirmwareSize + if r.FirmwareSize > 0 { + fwSize = r.FirmwareSize + } + + firstTS := formatHumanReadableTs(r.Details[0].Timestamp) + if !containsResetState(r.Details) && !hasError { + t.AddRow(firstTS, "Flash", "") } + + hasReachedFlashState := hasReachedFlashState(r.Details, succeeded) for _, s := range r.Details { - stateData := formatStateData(s.State, s.StateData, fwSize, hasReachedFlashState(r.Details)) + stateData := formatStateData(s.State, s.StateData, fwSize, hasReachedFlashState) t.AddRow(formatHumanReadableTs(s.Timestamp), upperCaseFirst(s.State), stateData) } + output += "\nDetails:\n" + t.Render() } return output } -func hasReachedFlashState(states []State) bool { +func hasReachedFlashState(states []State, succeeded bool) bool { + if succeeded { + return true + } + return containsResetState(states) +} + +func containsResetState(states []State) bool { for _, s := range states { - if s.State == "flash" || s.State == "reboot" { + if strings.ToLower(s.State) == "flash" || strings.ToLower(s.State) == "reboot" { return true } } @@ -193,15 +217,15 @@ func formatStateData(state, data string, firmware_size int64, hasReceivedFlashSt return data } if hasReceivedFlashState { - return buildSimpleProgressBar(float64(100)) + return buildSimpleProgressBar(float64(100), firmware_size) } percentage := (float64(actualDownloadedData) / float64(firmware_size)) * 100 - return buildSimpleProgressBar(percentage) + return buildSimpleProgressBar(percentage, firmware_size) } return data } -func buildSimpleProgressBar(progress float64) string { +func buildSimpleProgressBar(progress float64, fw_size int64) string { progressInt := int(progress) / 10 progressInt = progressInt * progressBarMultiplier maxProgress := 10 * progressBarMultiplier @@ -210,8 +234,10 @@ func buildSimpleProgressBar(progress float64) string { bar.WriteString(strings.Repeat("=", progressInt)) bar.WriteString(strings.Repeat(" ", maxProgress-progressInt)) bar.WriteString("] ") - bar.WriteString(strconv.FormatFloat(progress, 'f', 2, 64)) - bar.WriteString("%") + bar.WriteString(strconv.FormatFloat(progress, 'f', 0, 64)) + bar.WriteString("% (firmware size: ") + bar.WriteString(strconv.FormatInt(fw_size, 10)) + bar.WriteString(" bytes)") return bar.String() } diff --git a/internal/ota-api/dto_test.go b/internal/ota-api/dto_test.go index bb91225f..619a7101 100644 --- a/internal/ota-api/dto_test.go +++ b/internal/ota-api/dto_test.go @@ -9,11 +9,11 @@ import ( func TestProgressBar_notCompletePct(t *testing.T) { firmwareSize := int64(25665 * 2) bar := formatStateData("fetch", "25665", firmwareSize, false) - assert.Equal(t, "[========== ] 50.00%", bar) + assert.Equal(t, "[========== ] 50% (firmware size: 51330 bytes)", bar) } func TestProgressBar_ifFlashState_goTo100Pct(t *testing.T) { firmwareSize := int64(25665 * 2) bar := formatStateData("fetch", "25665", firmwareSize, true) // If in flash status, go to 100% - assert.Equal(t, "[====================] 100.00%", bar) + assert.Equal(t, "[====================] 100% (firmware size: 51330 bytes)", bar) } diff --git a/internal/ota/decoder_test.go b/internal/ota/decoder_test.go index 49290b91..5b3d9347 100644 --- a/internal/ota/decoder_test.go +++ b/internal/ota/decoder_test.go @@ -3,6 +3,7 @@ package ota import ( "testing" + "github.com/arduino/arduino-cloud-cli/internal/boardpids" "github.com/stretchr/testify/assert" ) @@ -10,17 +11,17 @@ func TestDecodeHeader(t *testing.T) { header, err := DecodeOtaFirmwareHeaderFromFile("testdata/cloud.ota") assert.Nil(t, err) - assert.Equal(t, ArduinoVendorID, header.VID) + assert.Equal(t, boardpids.ArduinoVendorID, header.VID) assert.Equal(t, "8057", header.PID) assert.Equal(t, "arduino:samd:nano_33_iot", *header.FQBN) - assert.Equal(t, ArduinoFqbnToPID["arduino:samd:nano_33_iot"], header.PID) + assert.Equal(t, boardpids.ArduinoFqbnToPID["arduino:samd:nano_33_iot"], header.PID) header, err = DecodeOtaFirmwareHeaderFromFile("testdata/blink.ota") assert.Nil(t, err) - assert.Equal(t, ArduinoVendorID, header.VID) + assert.Equal(t, boardpids.ArduinoVendorID, header.VID) assert.Equal(t, "8057", header.PID) assert.Equal(t, "arduino:samd:nano_33_iot", *header.FQBN) - assert.Equal(t, ArduinoFqbnToPID["arduino:samd:nano_33_iot"], header.PID) + assert.Equal(t, boardpids.ArduinoFqbnToPID["arduino:samd:nano_33_iot"], header.PID) } @@ -40,8 +41,8 @@ func TestDecodeEsp32Header(t *testing.T) { header, err := DecodeOtaFirmwareHeaderFromFile("testdata/esp32.ota") assert.Nil(t, err) - assert.Equal(t, Esp32MagicNumberPart1, header.VID) - assert.Equal(t, Esp32MagicNumberPart2, header.PID) + assert.Equal(t, boardpids.Esp32MagicNumberPart1, header.VID) + assert.Equal(t, boardpids.Esp32MagicNumberPart2, header.PID) assert.Nil(t, header.FQBN) assert.Equal(t, "ESP32", header.BoardType) diff --git a/internal/provisioning-api/client.go b/internal/provisioning-api/client.go new file mode 100644 index 00000000..3bba5591 --- /dev/null +++ b/internal/provisioning-api/client.go @@ -0,0 +1,227 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package provisioningapi + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + + "github.com/arduino/arduino-cloud-cli/config" + "github.com/arduino/arduino-cloud-cli/internal/iot" + "golang.org/x/oauth2" +) + +type ProvisioningApiClient struct { + client *http.Client + host string + src oauth2.TokenSource + organization string +} + +func NewClient(credentials *config.Credentials) *ProvisioningApiClient { + host := iot.GetArduinoAPIBaseURL() + tokenSource := iot.NewUserTokenSource(credentials.Client, credentials.Secret, host, credentials.Organization) + return &ProvisioningApiClient{ + client: &http.Client{}, + src: tokenSource, + host: host, + organization: credentials.Organization, + } +} + +func (c *ProvisioningApiClient) performRequest(endpoint, method, token string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest(method, endpoint, body) + if err != nil { + return nil, err + } + req.Header.Add("Authorization", "Bearer "+token) + req.Header.Add("Content-Type", "application/json") + if c.organization != "" { + req.Header.Add("X-Organization", c.organization) + } + res, err := c.client.Do(req) + if err != nil { + return nil, err + } + return res, nil +} + +func (c *ProvisioningApiClient) ClaimDevice(data ClaimData) (*ClaimResponse, *BadResponse, error) { + endpoint := c.host + "/provisioning/v1/onboarding/claim" + token, err := iot.GetToken(c.src) + if err != nil { + return nil, nil, err + } + + dataJson, err := json.Marshal(data) + if err != nil { + return nil, nil, fmt.Errorf("failed to marshal claim data: %w", err) + } + + res, err := c.performRequest(endpoint, http.MethodPost, token.AccessToken, bytes.NewReader(dataJson)) + if err != nil { + return nil, nil, err + } + defer res.Body.Close() + + respBytes, err := io.ReadAll(res.Body) + if err != nil { + return nil, nil, err + } + + if res.StatusCode == http.StatusOK { + var response ClaimResponse + + err = json.Unmarshal(respBytes, &response) + if err != nil { + return nil, nil, err + } + return &response, nil, nil + } + var badResponse BadResponse + + err = json.Unmarshal(respBytes, &badResponse) + if err != nil { + return nil, nil, fmt.Errorf("failed to unmarshal bad response: %s", respBytes) + } + + return nil, &badResponse, nil +} + +func (c *ProvisioningApiClient) RegisterDevice(data RegisterBoardData) (*BadResponse, error) { + endpoint := c.host + "/provisioning/v1/boards/register" + token, err := iot.GetToken(c.src) + if err != nil { + return nil, err + } + + dataJson, err := json.Marshal(data) + if err != nil { + return nil, fmt.Errorf("failed to marshal register data: %w", err) + } + + res, err := c.performRequest(endpoint, http.MethodPost, token.AccessToken, bytes.NewReader(dataJson)) + if err != nil { + return nil, err + } + defer res.Body.Close() + + respBytes, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + if res.StatusCode == http.StatusOK { + return nil, nil + } + var badResponse BadResponse + + err = json.Unmarshal(respBytes, &badResponse) + if err != nil { + return nil, err + } + + return &badResponse, nil +} + +func (c *ProvisioningApiClient) UnclaimDevice(provisioningId string) (*BadResponse, error) { + endpoint := c.host + "/provisioning/v1/onboarding/" + provisioningId + token, err := iot.GetToken(c.src) + if err != nil { + return nil, err + } + + res, err := c.performRequest(endpoint, http.MethodDelete, token.AccessToken, nil) + if err != nil { + return nil, err + } + defer res.Body.Close() + + if res.StatusCode == http.StatusOK { + return nil, nil + } + var badResponse BadResponse + respBytes, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + err = json.Unmarshal(respBytes, &badResponse) + if err != nil { + return nil, err + } + + return &badResponse, nil +} + +func (c *ProvisioningApiClient) GetProvisioningList() (*OnboardingsResponse, error) { + endpoint := c.host + "/provisioning/v1/onboarding?all=true" + token, err := iot.GetToken(c.src) + if err != nil { + return nil, err + } + + res, err := c.performRequest(endpoint, http.MethodGet, token.AccessToken, nil) + if err != nil { + return nil, err + } + defer res.Body.Close() + + if res.StatusCode == http.StatusOK { + var response OnboardingsResponse + + respBytes, err := io.ReadAll(res.Body) + if err != nil { + return nil, err + } + + err = json.Unmarshal(respBytes, &response) + if err != nil { + return nil, err + } + return &response, nil + } else if res.StatusCode == 400 { + return nil, errors.New(endpoint + " returned bad request") + } else if res.StatusCode == 401 { + return nil, errors.New(endpoint + " returned unauthorized request") + } else if res.StatusCode == 403 { + return nil, errors.New(endpoint + " returned forbidden request") + } else if res.StatusCode == 500 { + return nil, errors.New(endpoint + " returned internal server error") + } + + return nil, err +} + +func (c *ProvisioningApiClient) GetProvisioningDetail(provID string) (*Onboarding, error) { + onboardingList, err := c.GetProvisioningList() + if err != nil { + return nil, fmt.Errorf("failed to get provisioning list: %w", err) + } + + for _, onboarding := range onboardingList.Onboardings { + if onboarding.ID == provID { + return &onboarding, nil + } + } + + return nil, fmt.Errorf("onboarding with ID %s not found", provID) +} diff --git a/internal/provisioning-api/dto.go b/internal/provisioning-api/dto.go new file mode 100644 index 00000000..f2da081d --- /dev/null +++ b/internal/provisioning-api/dto.go @@ -0,0 +1,62 @@ +// This file is part of arduino-cloud-cli. +// +// Copyright (C) 2025 ARDUINO SA (http://www.arduino.cc/) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package provisioningapi + +type RegisterBoardData struct { + PID string `json:"pid"` + PublicKey string `json:"public_key"` + Serial *string `json:"serial"` + UniqueHardwareID string `json:"unique_hardware_id"` + VID string `json:"vid"` +} + +type ClaimData struct { + BLEMac string `json:"ble_mac"` + BoardToken string `json:"board_token"` + ConnectionType string `json:"connection_type"` + DeviceName string `json:"device_name"` +} + +type BadResponse struct { + Err string `json:"err"` + ErrCode int `json:"err_code"` +} + +type ClaimResponse struct { + OnboardId string `json:"id"` +} + +type Onboarding struct { + ID string `json:"id"` + UniqueHardwareID string `json:"unique_hardware_id"` + DeviceName string `json:"device_name"` + ConnectionType string `json:"connection_type"` + DeviceID *string `json:"device_id"` + UserID string `json:"user_id"` + OrgID *string `json:"org_id"` + BLEMac string `json:"ble_mac"` + CreatedAt string `json:"created_at"` + ProvisionedAt *string `json:"provisioned_at"` + ClaimedAt string `json:"claimed_at"` + EndedAt *string `json:"ended_at"` + FQBN string `json:"fqbn"` +} + +type OnboardingsResponse struct { + Onboardings []Onboarding `json:"onboardings"` +} diff --git a/internal/serial/mocks/Port.go b/internal/serial/mocks/Port.go index 97efa4a1..3c4294d1 100644 --- a/internal/serial/mocks/Port.go +++ b/internal/serial/mocks/Port.go @@ -1,10 +1,10 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package mocks import ( mock "github.com/stretchr/testify/mock" - go_bug_stserial "go.bug.st/serial" + serial "go.bug.st/serial" time "time" ) @@ -14,10 +14,50 @@ type Port struct { mock.Mock } +// Break provides a mock function with given fields: _a0 +func (_m *Port) Break(_a0 time.Duration) error { + ret := _m.Called(_a0) + + if len(ret) == 0 { + panic("no return value specified for Break") + } + + var r0 error + if rf, ok := ret.Get(0).(func(time.Duration) error); ok { + r0 = rf(_a0) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // Close provides a mock function with given fields: func (_m *Port) Close() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// Drain provides a mock function with given fields: +func (_m *Port) Drain() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Drain") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -29,19 +69,26 @@ func (_m *Port) Close() error { } // GetModemStatusBits provides a mock function with given fields: -func (_m *Port) GetModemStatusBits() (*go_bug_stserial.ModemStatusBits, error) { +func (_m *Port) GetModemStatusBits() (*serial.ModemStatusBits, error) { ret := _m.Called() - var r0 *go_bug_stserial.ModemStatusBits - if rf, ok := ret.Get(0).(func() *go_bug_stserial.ModemStatusBits); ok { + if len(ret) == 0 { + panic("no return value specified for GetModemStatusBits") + } + + var r0 *serial.ModemStatusBits + var r1 error + if rf, ok := ret.Get(0).(func() (*serial.ModemStatusBits, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() *serial.ModemStatusBits); ok { r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*go_bug_stserial.ModemStatusBits) + r0 = ret.Get(0).(*serial.ModemStatusBits) } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -55,14 +102,21 @@ func (_m *Port) GetModemStatusBits() (*go_bug_stserial.ModemStatusBits, error) { func (_m *Port) Read(p []byte) (int, error) { ret := _m.Called(p) + if len(ret) == 0 { + panic("no return value specified for Read") + } + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { + return rf(p) + } if rf, ok := ret.Get(0).(func([]byte) int); ok { r0 = rf(p) } else { r0 = ret.Get(0).(int) } - var r1 error if rf, ok := ret.Get(1).(func([]byte) error); ok { r1 = rf(p) } else { @@ -76,6 +130,10 @@ func (_m *Port) Read(p []byte) (int, error) { func (_m *Port) ResetInputBuffer() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ResetInputBuffer") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -90,6 +148,10 @@ func (_m *Port) ResetInputBuffer() error { func (_m *Port) ResetOutputBuffer() error { ret := _m.Called() + if len(ret) == 0 { + panic("no return value specified for ResetOutputBuffer") + } + var r0 error if rf, ok := ret.Get(0).(func() error); ok { r0 = rf() @@ -104,6 +166,10 @@ func (_m *Port) ResetOutputBuffer() error { func (_m *Port) SetDTR(dtr bool) error { ret := _m.Called(dtr) + if len(ret) == 0 { + panic("no return value specified for SetDTR") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(dtr) @@ -115,11 +181,15 @@ func (_m *Port) SetDTR(dtr bool) error { } // SetMode provides a mock function with given fields: mode -func (_m *Port) SetMode(mode *go_bug_stserial.Mode) error { +func (_m *Port) SetMode(mode *serial.Mode) error { ret := _m.Called(mode) + if len(ret) == 0 { + panic("no return value specified for SetMode") + } + var r0 error - if rf, ok := ret.Get(0).(func(*go_bug_stserial.Mode) error); ok { + if rf, ok := ret.Get(0).(func(*serial.Mode) error); ok { r0 = rf(mode) } else { r0 = ret.Error(0) @@ -132,6 +202,10 @@ func (_m *Port) SetMode(mode *go_bug_stserial.Mode) error { func (_m *Port) SetRTS(rts bool) error { ret := _m.Called(rts) + if len(ret) == 0 { + panic("no return value specified for SetRTS") + } + var r0 error if rf, ok := ret.Get(0).(func(bool) error); ok { r0 = rf(rts) @@ -146,6 +220,10 @@ func (_m *Port) SetRTS(rts bool) error { func (_m *Port) SetReadTimeout(t time.Duration) error { ret := _m.Called(t) + if len(ret) == 0 { + panic("no return value specified for SetReadTimeout") + } + var r0 error if rf, ok := ret.Get(0).(func(time.Duration) error); ok { r0 = rf(t) @@ -160,14 +238,21 @@ func (_m *Port) SetReadTimeout(t time.Duration) error { func (_m *Port) Write(p []byte) (int, error) { ret := _m.Called(p) + if len(ret) == 0 { + panic("no return value specified for Write") + } + var r0 int + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (int, error)); ok { + return rf(p) + } if rf, ok := ret.Get(0).(func([]byte) int); ok { r0 = rf(p) } else { r0 = ret.Get(0).(int) } - var r1 error if rf, ok := ret.Get(1).(func([]byte) error); ok { r1 = rf(p) } else { @@ -176,3 +261,17 @@ func (_m *Port) Write(p []byte) (int, error) { return r0, r1 } + +// NewPort creates a new instance of Port. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewPort(t interface { + mock.TestingT + Cleanup(func()) +}) *Port { + mock := &Port{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/internal/serial/protocol.go b/internal/serial/protocol.go deleted file mode 100644 index d4a95497..00000000 --- a/internal/serial/protocol.go +++ /dev/null @@ -1,70 +0,0 @@ -// This file is part of arduino-cloud-cli. -// -// Copyright (C) 2021 ARDUINO SA (http://www.arduino.cc/) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package serial - -var ( - // msgStart is the initial byte sequence of every packet. - msgStart = [2]byte{0x55, 0xAA} - // msgEnd is the final byte sequence of every packet. - msgEnd = [2]byte{0xAA, 0x55} -) - -const ( - // payloadField indicates the position of payload field. - payloadField = 5 - // payloadLenField indicates the position of payload length field. - payloadLenField = 3 - // payloadLenFieldLen indicatest the length of payload length field. - payloadLenFieldLen = 2 - // crcFieldLen indicates the length of the signature field. - crcFieldLen = 2 -) - -// MsgType indicates the type of the packet. -type MsgType byte - -const ( - None MsgType = iota - Cmd - Data - Response -) - -// Command indicates the command that should be -// executed on the board to be provisioned. -type Command byte - -const ( - SketchInfo Command = iota + 1 - CSR - Locked - GetLocked - WriteCrypto - BeginStorage - SetDeviceID - SetYear - SetMonth - SetDay - SetHour - SetValidity - SetCertSerial - SetAuthKey - SetSignature - EndStorage - ReconstructCert -) diff --git a/internal/serial/serial.go b/internal/serial/serial.go index abcb4951..aed7c404 100644 --- a/internal/serial/serial.go +++ b/internal/serial/serial.go @@ -18,14 +18,12 @@ package serial import ( - "bytes" - "context" - "encoding/binary" "errors" "fmt" "time" - "github.com/howeyc/crc16" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/frame" + "github.com/arduino/arduino-cloud-cli/internal/board-protocols/transport" "go.bug.st/serial" ) @@ -33,7 +31,8 @@ import ( // features specific functions to send provisioning // commands through the serial port to an arduino device. type Serial struct { - port serial.Port + port serial.Port + connected bool } // NewSerial instantiate and returns a Serial instance. @@ -41,35 +40,28 @@ type Serial struct { // its send/receive functions. func NewSerial() *Serial { s := &Serial{} + s.connected = false return s } // Connect tries to connect Serial to a specific serial port. -func (s *Serial) Connect(address string) error { +func (s *Serial) Connect(params transport.TransportInterfaceParams) error { mode := &serial.Mode{ - BaudRate: 57600, + BaudRate: params.BoundRate, } - port, err := serial.Open(address, mode) + port, err := serial.Open(params.Port, mode) if err != nil { err = fmt.Errorf("%s: %w", "connecting to serial port", err) return err } s.port = port - + s.connected = true s.port.SetReadTimeout(time.Millisecond * 2500) return nil } -// Send allows to send a provisioning command to a connected arduino device. -func (s *Serial) Send(ctx context.Context, cmd Command, payload []byte) error { - if err := ctx.Err(); err != nil { - return err - } - - payload = append([]byte{byte(cmd)}, payload...) - msg := encode(Cmd, payload) - - _, err := s.port.Write(msg) +func (s *Serial) Send(data []byte) error { + _, err := s.port.Write(data) if err != nil { err = fmt.Errorf("%s: %w", "sending message through serial", err) return err @@ -78,103 +70,47 @@ func (s *Serial) Send(ctx context.Context, cmd Command, payload []byte) error { return nil } -// SendReceive allows to send a provisioning command to a connected arduino device. -// Then, it waits for a response from the device and, if any, returns it. -// If no response is received after 2 seconds, an error is returned. -func (s *Serial) SendReceive(ctx context.Context, cmd Command, payload []byte) ([]byte, error) { - if err := s.Send(ctx, cmd, payload); err != nil { - return nil, err - } - return s.receive(ctx) -} - // Close should be used when the Serial connection isn't used anymore. // After that, Serial could Connect again to any port. func (s *Serial) Close() error { + s.connected = false return s.port.Close() } -// receive allows to wait for a response from an arduino device under provisioning. -// Its timeout is set to 2 seconds. It returns an error if the response is not valid -// or if the timeout expires. -// TODO: consider refactoring using a more explicit procedure: -// start := s.Read(buff, MsgStartLength) -// payloadLen := s.Read(buff, payloadFieldLen) -func (s *Serial) receive(ctx context.Context) ([]byte, error) { - buff := make([]byte, 1000) - var resp []byte - - received := 0 - payloadLen := 0 - // Wait to receive the entire packet that is long as the preamble (from msgStart to payload length field) - // plus the actual payload length plus the length of the ending sequence. - for received < (payloadLenField+payloadLenFieldLen)+payloadLen+len(msgEnd) { - if err := ctx.Err(); err != nil { - return nil, err - } +func (s *Serial) Receive(timeoutSeconds int) ([]frame.Frame, error) { + if !s.connected { + return nil, errors.New("serial port not connected") + } - n, err := s.port.Read(buff) + expireTimeout := time.Now().Add(time.Duration(timeoutSeconds) * time.Second) + received := false + transportController := transport.NewTransportController() + packets := []frame.Frame{} + + for !received && time.Now().Before(expireTimeout) { + buffer := make([]byte, 1024) + n, err := s.port.Read(buffer) if err != nil { - err = fmt.Errorf("%s: %w", "receiving from serial", err) return nil, err } - if n == 0 { - break - } - received += n - resp = append(resp, buff[:n]...) - // Update the payload length as soon as it is received. - if payloadLen == 0 && received >= (payloadLenField+payloadLenFieldLen) { - payloadLen = int(binary.BigEndian.Uint16(resp[payloadLenField:(payloadLenField + payloadLenFieldLen)])) - // TODO: return error if payloadLen is too large. + packets = transportController.HandleReceivedData(buffer[:n]) + if len(packets) > 0 { + received = true } } - if received == 0 { - err := errors.New("receiving from serial: timeout, nothing received") - return nil, err - } - - // TODO: check if msgStart is present - - if !bytes.Equal(resp[received-len(msgEnd):], msgEnd[:]) { - err := errors.New("receiving from serial: end of message (0xAA, 0x55) not found") - return nil, err + if !received { + return nil, fmt.Errorf("no response received after %d seconds", timeoutSeconds) } - payload := resp[payloadField : payloadField+payloadLen-crcFieldLen] - ch := crc16.Checksum(payload, crc16.CCITTTable) - // crc is contained in the last bytes of the payload - cp := binary.BigEndian.Uint16(resp[payloadField+payloadLen-crcFieldLen : payloadField+payloadLen]) - if ch != cp { - err := errors.New("receiving from serial: signature of received message is not valid") - return nil, err - } - - return payload, nil + return packets, nil } -// encode is internally used to create a valid provisioning packet. -func encode(mType MsgType, msg []byte) []byte { - // Insert the preamble sequence followed by the message type - packet := append(msgStart[:], byte(mType)) - - // Append the packet length - bLen := make([]byte, payloadLenFieldLen) - binary.BigEndian.PutUint16(bLen, (uint16(len(msg) + crcFieldLen))) - packet = append(packet, bLen...) - - // Append the message payload - packet = append(packet, msg...) - - // Calculate and append the message signature - ch := crc16.Checksum(msg, crc16.CCITTTable) - checksum := make([]byte, crcFieldLen) - binary.BigEndian.PutUint16(checksum, ch) - packet = append(packet, checksum...) +func (s *Serial) Type() transport.InterfaceType { + return transport.Serial +} - // Append final byte sequence - packet = append(packet, msgEnd[:]...) - return packet +func (s *Serial) Connected() bool { + return s.connected } diff --git a/internal/serial/serial_test.go b/internal/serial/serial_test.go deleted file mode 100644 index 1c049393..00000000 --- a/internal/serial/serial_test.go +++ /dev/null @@ -1,102 +0,0 @@ -// This file is part of arduino-cloud-cli. -// -// Copyright (C) 2021 ARDUINO SA (http://www.arduino.cc/) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published -// by the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see . - -package serial - -import ( - "bytes" - "context" - "testing" - - "github.com/arduino/arduino-cloud-cli/internal/serial/mocks" - "github.com/stretchr/testify/mock" -) - -func TestSendReceive(t *testing.T) { - mockPort := &mocks.Port{} - mockSerial := &Serial{mockPort} - - want := []byte{1, 2, 3} - resp := encode(Response, want) - respIdx := 0 - - mockRead := func(msg []uint8) int { - if respIdx >= len(resp) { - return 0 - } - copy(msg, resp[respIdx:respIdx+2]) - respIdx += 2 - return 2 - } - - mockPort.On("Write", mock.AnythingOfType("[]uint8")).Return(0, nil) - mockPort.On("Read", mock.AnythingOfType("[]uint8")).Return(mockRead, nil) - - res, err := mockSerial.SendReceive(context.TODO(), BeginStorage, []byte{1, 2}) - if err != nil { - t.Error(err) - } - - if !bytes.Equal(res, want) { - t.Errorf("Expected %v but received %v", want, res) - } -} - -func TestSend(t *testing.T) { - mockPort := &mocks.Port{} - mockSerial := &Serial{mockPort} - mockPort.On("Write", mock.AnythingOfType("[]uint8")).Return(0, nil) - - payload := []byte{1, 2} - cmd := SetDay - want := []byte{msgStart[0], msgStart[1], 1, 0, 5, 10, 1, 2, 143, 124, msgEnd[0], msgEnd[1]} - - err := mockSerial.Send(context.TODO(), cmd, payload) - if err != nil { - t.Error(err) - } - - mockPort.AssertCalled(t, "Write", want) -} - -func TestEncode(t *testing.T) { - tests := []struct { - name string - msg []byte - want []byte - }{ - { - name: "begin-storage", - msg: []byte{byte(BeginStorage)}, - want: []byte{msgStart[0], msgStart[1], 1, 0, 3, 6, 0x95, 0x4e, msgEnd[0], msgEnd[1]}, - }, - - { - name: "set-year", - msg: append([]byte{byte(SetYear)}, []byte("2021")...), - want: []byte{msgStart[0], msgStart[1], 1, 0, 7, 0x8, 0x32, 0x30, 0x32, 0x31, 0xc3, 0x65, msgEnd[0], msgEnd[1]}, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - got := encode(Cmd, tt.msg) - if !bytes.Equal(tt.want, got) { - t.Errorf("Expected %v, received %v", tt.want, got) - } - }) - } -} diff --git a/internal/storage-api/client.go b/internal/storage-api/client.go index fb00a792..c3d4e1f2 100644 --- a/internal/storage-api/client.go +++ b/internal/storage-api/client.go @@ -57,7 +57,7 @@ func getArduinoAPIBaseURL() string { func NewClient(credentials *config.Credentials) *StorageApiClient { host := getArduinoAPIBaseURL() iothost := iot.GetArduinoAPIBaseURL() - tokenSource := iot.NewUserTokenSource(credentials.Client, credentials.Secret, iothost) + tokenSource := iot.NewUserTokenSource(credentials.Client, credentials.Secret, iothost, credentials.Organization) return &StorageApiClient{ client: &http.Client{}, src: tokenSource, diff --git a/internal/template/dashboard.go b/internal/template/dashboard.go index eae04243..a8490c91 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" ) type dashboardTemplate struct { diff --git a/internal/template/extract.go b/internal/template/extract.go index ecbe3163..5418e0b4 100644 --- a/internal/template/extract.go +++ b/internal/template/extract.go @@ -21,10 +21,9 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" "os" - iotclient "github.com/arduino/iot-client-go/v2" + iotclient "github.com/arduino/iot-client-go/v3" "gopkg.in/yaml.v3" ) @@ -48,6 +47,16 @@ func FromThing(thing *iotclient.ArduinoThing) map[string]interface{} { } template["variables"] = props + if thing.Tags != nil { + tags := []map[string]any{} + for k, v := range thing.Tags { + tag := make(map[string]any) + tag[k] = v + tags = append(tags, tag) + } + template["tags"] = tags + } + return template } @@ -119,7 +128,7 @@ func ToFile(template map[string]interface{}, outfile string, format string) erro return errors.New("format is not valid: only 'json' and 'yaml' are supported") } - err = ioutil.WriteFile(outfile, file, os.FileMode(0644)) + err = os.WriteFile(outfile, file, os.FileMode(0644)) if err != nil { return fmt.Errorf("%s: %w", "cannot write outfile: ", err) } diff --git a/internal/template/load.go b/internal/template/load.go index 6086c25d..e07e76f1 100644 --- a/internal/template/load.go +++ b/internal/template/load.go @@ -25,7 +25,7 @@ import ( "io" "os" - iotclient "github.com/arduino/iot-client-go/v2" + iotclient "github.com/arduino/iot-client-go/v3" "github.com/gofrs/uuid" "gopkg.in/yaml.v3" ) diff --git a/internal/template/load_test.go b/internal/template/load_test.go index 705dc0d1..53d275ec 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/v2" + iotclient "github.com/arduino/iot-client-go/v3" "github.com/gofrs/uuid" "github.com/google/go-cmp/cmp" ) @@ -68,9 +68,10 @@ var ( Widgets: []iotclient.Widget{ {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", + Type: "Switch", AdditionalProperties: map[string]any{}, }, }, + AdditionalProperties: map[string]any{}, } dashboardNoOptions = &iotclient.Dashboardv2{ @@ -78,9 +79,10 @@ var ( Widgets: []iotclient.Widget{ {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", + Type: "Switch", AdditionalProperties: map[string]any{}, }, }, + AdditionalProperties: map[string]any{}, } dashboardWithVariable = &iotclient.Dashboardv2{ @@ -88,9 +90,10 @@ var ( Widgets: []iotclient.Widget{ {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}, + Variables: []string{switchyID}, AdditionalProperties: map[string]any{}, }, }, + AdditionalProperties: map[string]any{}, } dashboardVariableOverride = &iotclient.Dashboardv2{ @@ -98,9 +101,10 @@ var ( Widgets: []iotclient.Widget{ {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}, + Variables: []string{switchyOverriddenID}, AdditionalProperties: map[string]any{}, }, }, + AdditionalProperties: map[string]any{}, } dashboardTwoWidgets = &iotclient.Dashboardv2{ @@ -108,13 +112,14 @@ var ( Widgets: []iotclient.Widget{ {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}, + Variables: []string{blinkSpeedID}, AdditionalProperties: map[string]any{}, }, {Name: toStringPointer("relay_2"), Height: 5, Width: 5, X: 5, Y: 0, Options: map[string]interface{}{"showLabels": true}, Type: "Switch", - Variables: []string{relayID}, + Variables: []string{relayID}, AdditionalProperties: map[string]any{}, }, }, + AdditionalProperties: map[string]any{}, } )