From 67d63a609c81aeb3a34012020e16c3670200032e Mon Sep 17 00:00:00 2001 From: cpanato Date: Wed, 31 Aug 2022 10:10:55 +0200 Subject: [PATCH] upgrade to go1.19 Signed-off-by: cpanato --- .github/workflows/build.yml | 2 +- .github/workflows/main.yml | 40 +++++++++++-------- .github/workflows/validate-release.yml | 5 ++- .github/workflows/verify.yml | 10 ++++- .golangci.yml | 4 +- Dockerfile | 4 +- cmd/rekor-cli/app/pflags_test.go | 28 ++++++------- cmd/rekor-cli/app/search.go | 5 +-- cmd/rekor-cli/app/state/state.go | 5 +-- cmd/rekor-server/app/root.go | 10 ++++- cmd/rekor-server/app/serve.go | 8 +++- .../entries/create_log_entry_parameters.go | 8 ++-- .../entries/create_log_entry_responses.go | 12 ++++-- .../client/entries/entries_client.go | 13 +++--- .../get_log_entry_by_index_parameters.go | 8 ++-- .../get_log_entry_by_index_responses.go | 9 +++-- .../get_log_entry_by_uuid_parameters.go | 8 ++-- .../get_log_entry_by_uuid_responses.go | 9 +++-- .../entries/search_log_query_parameters.go | 8 ++-- .../entries/search_log_query_responses.go | 9 +++-- pkg/generated/client/index/index_client.go | 2 +- .../client/index/search_index_parameters.go | 8 ++-- .../client/index/search_index_responses.go | 9 +++-- .../pubkey/get_public_key_parameters.go | 8 ++-- .../client/pubkey/get_public_key_responses.go | 6 ++- pkg/generated/client/pubkey/pubkey_client.go | 4 +- .../server/get_rekor_version_parameters.go | 8 ++-- .../server/get_rekor_version_responses.go | 6 ++- pkg/generated/client/server/server_client.go | 2 +- .../client/tlog/get_log_info_parameters.go | 8 ++-- .../client/tlog/get_log_info_responses.go | 6 ++- .../client/tlog/get_log_proof_parameters.go | 8 ++-- .../client/tlog/get_log_proof_responses.go | 9 +++-- pkg/generated/client/tlog/tlog_client.go | 8 ++-- pkg/generated/models/alpine_schema.go | 2 +- pkg/generated/models/alpine_v001_schema.go | 2 +- pkg/generated/models/cose_schema.go | 2 +- pkg/generated/models/cose_v001_schema.go | 2 +- pkg/generated/models/hashedrekord_schema.go | 2 +- .../models/hashedrekord_v001_schema.go | 2 +- pkg/generated/models/helm_schema.go | 2 +- pkg/generated/models/helm_v001_schema.go | 2 +- pkg/generated/models/intoto_schema.go | 2 +- pkg/generated/models/intoto_v001_schema.go | 2 +- pkg/generated/models/intoto_v002_schema.go | 2 +- pkg/generated/models/jar_schema.go | 2 +- pkg/generated/models/jar_v001_schema.go | 2 +- pkg/generated/models/rekord_schema.go | 2 +- pkg/generated/models/rekord_v001_schema.go | 2 +- pkg/generated/models/rfc3161_schema.go | 2 +- pkg/generated/models/rfc3161_v001_schema.go | 2 +- pkg/generated/models/rpm_schema.go | 2 +- pkg/generated/models/rpm_v001_schema.go | 2 +- pkg/generated/models/tuf_schema.go | 2 +- pkg/generated/models/tuf_v001_schema.go | 2 +- pkg/generated/restapi/doc.go | 26 ++++++------ .../operations/entries/create_log_entry.go | 7 ++-- .../entries/create_log_entry_responses.go | 12 ++++-- .../entries/get_log_entry_by_index.go | 4 +- .../get_log_entry_by_index_responses.go | 9 +++-- .../entries/get_log_entry_by_uuid.go | 6 +-- .../get_log_entry_by_uuid_responses.go | 9 +++-- .../operations/entries/search_log_query.go | 4 +- .../entries/search_log_query_responses.go | 9 +++-- .../restapi/operations/index/search_index.go | 4 +- .../index/search_index_responses.go | 9 +++-- .../operations/pubkey/get_public_key.go | 6 +-- .../pubkey/get_public_key_responses.go | 6 ++- .../operations/server/get_rekor_version.go | 4 +- .../server/get_rekor_version_responses.go | 6 ++- .../restapi/operations/tlog/get_log_info.go | 6 +-- .../operations/tlog/get_log_info_responses.go | 6 ++- .../restapi/operations/tlog/get_log_proof.go | 6 +-- .../tlog/get_log_proof_responses.go | 9 +++-- pkg/pki/pgp/pgp.go | 8 ++-- pkg/pki/pgp/pgp_test.go | 5 +-- pkg/pki/pkcs7/pkcs7.go | 5 +-- pkg/pki/ssh/sign_test.go | 6 +-- pkg/pki/ssh/ssh.go | 5 +-- pkg/pki/tuf/tuf.go | 5 +-- pkg/pki/x509/x509.go | 5 +-- pkg/sharding/ranges.go | 4 +- pkg/sharding/ranges_test.go | 8 ++-- pkg/types/alpine/v0.0.1/entry.go | 5 +-- pkg/types/alpine/v0.0.1/entry_test.go | 6 +-- pkg/types/cose/v0.0.1/entry.go | 6 +-- pkg/types/hashedrekord/v0.0.1/entry.go | 6 +-- pkg/types/helm/provenance.go | 3 +- pkg/types/helm/v0.0.1/entry.go | 5 +-- pkg/types/helm/v0.0.1/entry_test.go | 6 +-- pkg/types/intoto/v0.0.1/entry.go | 6 +-- pkg/types/intoto/v0.0.2/entry.go | 6 +-- pkg/types/jar/v0.0.1/entry.go | 5 +-- pkg/types/jar/v0.0.1/entry_test.go | 4 +- pkg/types/rekord/v0.0.1/entry.go | 7 ++-- pkg/types/rekord/v0.0.1/entry_test.go | 8 ++-- pkg/types/rfc3161/v0.0.1/entry.go | 4 +- pkg/types/rfc3161/v0.0.1/entry_test.go | 4 +- pkg/types/rpm/v0.0.1/entry.go | 7 ++-- pkg/types/rpm/v0.0.1/entry_test.go | 6 +-- pkg/types/tuf/tuf.go | 2 +- pkg/types/tuf/v0.0.1/entry.go | 7 ++-- pkg/types/tuf/v0.0.1/entry_test.go | 8 ++-- pkg/util/fetch.go | 3 +- pkg/util/signed_note.go | 8 ++-- release/cloudbuild.yaml | 8 ++-- release/ko-sign-release-images.sh | 16 ++++---- 107 files changed, 383 insertions(+), 301 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 208127434..cf7841346 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: - uses: imjasonh/setup-ko@78eea08f10db87a7a23a666a4a6fe2734f2eeb8d # v0.4 with: - version: v0.11.2 + version: v0.12.0 - name: Set up Cloud SDK uses: google-github-actions/auth@dac4e13deb3640f22e3ffe758fd3f95e6e89f712 # v0.8.1 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f85adabfc..5964bc811 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,6 +35,7 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - name: Build run: make -C $GITHUB_WORKSPACE all - name: Fuzz-Build @@ -55,9 +56,10 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - uses: imjasonh/setup-ko@78eea08f10db87a7a23a666a4a6fe2734f2eeb8d # v0.4 with: - version: v0.11.2 + version: v0.12.0 - name: container run: | make ko-local 2>&1 | tee output.txt @@ -78,6 +80,7 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - name: CLI run: ./tests/e2e-test.sh - name: Upload logs if they exist @@ -102,6 +105,7 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - name: Sharding Test run: ./tests/sharding-e2e-test.sh - name: Upload logs if they exist @@ -124,6 +128,7 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - name: Test for Attestation begin returned that was previously persisted in tlog run: ./tests/issue-872-e2e-test.sh - name: Upload logs if they exist @@ -137,19 +142,20 @@ jobs: runs-on: ubuntu-20.04 needs: build steps: - - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 - - name: Create git branch - run: git switch -c harness-test-branch - - name: Extract version of Go to use - run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV - - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 - with: - go-version: ${{ env.GOVERSION }} - - name: Run test harness - run: ./tests/rekor-harness.sh - - name: Upload logs if they exist - uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3 - if: failure() - with: - name: E2E Docker Compose logs - path: /tmp/docker-compose.log + - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 + - name: Create git branch + run: git switch -c harness-test-branch + - name: Extract version of Go to use + run: echo "GOVERSION=$(cat Dockerfile|grep golang | awk ' { print $2 } ' | cut -d '@' -f 1 | cut -d ':' -f 2 | uniq)" >> $GITHUB_ENV + - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 + with: + go-version: ${{ env.GOVERSION }} + + - name: Run test harness + run: ./tests/rekor-harness.sh + - name: Upload logs if they exist + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3 + if: failure() + with: + name: E2E Docker Compose logs + path: /tmp/docker-compose.log diff --git a/.github/workflows/validate-release.yml b/.github/workflows/validate-release.yml index cd7166dc5..b27d9f1e7 100644 --- a/.github/workflows/validate-release.yml +++ b/.github/workflows/validate-release.yml @@ -39,8 +39,8 @@ jobs: statuses: none env: - CROSS_BUILDER_IMAGE: ghcr.io/gythialy/golang-cross:v1.18.5-1@sha256:7dda2158ee68f0e4f53ca9bdf3971b2db01084dad4bdc775391e5f3bf40056a5 - COSIGN_IMAGE: gcr.io/projectsigstore/cosign:v1.10.1@sha256:9377edd13ae515dcb97c15052e577a2cbce098f36b0361bdb2348e3bdd8fe536 + CROSS_BUILDER_IMAGE: ghcr.io/gythialy/golang-cross:v1.19.0-0@sha256:904f22549b631c34c92fa696aa39144f8b5da3ee1dff095d4e3164fd50090767 + COSIGN_IMAGE: gcr.io/projectsigstore/cosign:v1.11.1@sha256:f9fd5a287a67f4b955d08062a966df10f9a600b6b8583fd367bce3f1f000a429 steps: - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2 @@ -49,6 +49,7 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - uses: anchore/sbom-action/download-syft@b5042e9d19d8b32849779bfe17673ff84aec702d # v0.12.0 - name: Install GoReleaser uses: goreleaser/goreleaser-action@ff11ca24a9b39f2d36796d1fbd7a4e39c182630a # v3.1.0 diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 7e92e2e24..c697a0c54 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -15,7 +15,11 @@ name: Verify -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: permissions: contents: read @@ -31,6 +35,7 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - name: Install addlicense run: go install github.com/google/addlicense@v1.0.0 - name: Check license headers @@ -49,8 +54,9 @@ jobs: - uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3.1.0 with: go-version: ${{ env.GOVERSION }} + - name: golangci-lint uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # v3.2.0 timeout-minutes: 5 with: - version: v1.46.0 + version: v1.49 diff --git a/.golangci.yml b/.golangci.yml index 80ac11453..93b50c3d8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,13 +15,13 @@ linters: enable: - - deadcode + - unused - errcheck - gofmt - goimports - gosec - gocritic - - golint + - revive - misspell output: uniq-by-line: false diff --git a/Dockerfile b/Dockerfile index 5c811efd2..cfa0d8d25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.18.5@sha256:fb249eca1b9172732de4950b0fb0fb5c231b83c2c90952c56d822d8a9de4d64b AS builder +FROM golang:1.19@sha256:d3f734e1f46ec36da8c1bce67cd48536138085289e24cfc8765f483c401b7d96 AS builder ENV APP_ROOT=/opt/app-root ENV GOPATH=$APP_ROOT @@ -30,7 +30,7 @@ RUN go build -ldflags "${SERVER_LDFLAGS}" ./cmd/rekor-server RUN CGO_ENABLED=0 go build -gcflags "all=-N -l" -ldflags "${SERVER_LDFLAGS}" -o rekor-server_debug ./cmd/rekor-server # Multi-Stage production build -FROM golang:1.18.5@sha256:fb249eca1b9172732de4950b0fb0fb5c231b83c2c90952c56d822d8a9de4d64b as deploy +FROM golang:1.19@sha256:d3f734e1f46ec36da8c1bce67cd48536138085289e24cfc8765f483c401b7d96 as deploy # Retrieve the binary from the previous stage COPY --from=builder /opt/app-root/src/rekor-server /usr/local/bin/rekor-server diff --git a/cmd/rekor-cli/app/pflags_test.go b/cmd/rekor-cli/app/pflags_test.go index c48efc3f9..2e3501774 100644 --- a/cmd/rekor-cli/app/pflags_test.go +++ b/cmd/rekor-cli/app/pflags_test.go @@ -18,9 +18,9 @@ package app import ( "context" "errors" - "io/ioutil" "net/http" "net/http/httptest" + "os" "testing" "github.com/spf13/cobra" @@ -54,27 +54,27 @@ func TestArtifactPFlags(t *testing.T) { switch r.URL.Path { case "/artifact": - file, err = ioutil.ReadFile("../../../tests/test_file.txt") + file, err = os.ReadFile("../../../tests/test_file.txt") case "/signature": - file, err = ioutil.ReadFile("../../../tests/test_file.sig") + file, err = os.ReadFile("../../../tests/test_file.sig") case "/publicKey": - file, err = ioutil.ReadFile("../../../tests/test_public_key.key") + file, err = os.ReadFile("../../../tests/test_public_key.key") case "/rekord": - file, err = ioutil.ReadFile("../../../tests/rekor.json") + file, err = os.ReadFile("../../../tests/rekor.json") case "/rpmEntry": - file, err = ioutil.ReadFile("../../../tests/rpm.json") + file, err = os.ReadFile("../../../tests/rpm.json") case "/rpm": - file, err = ioutil.ReadFile("../../../tests/test.rpm") + file, err = os.ReadFile("../../../tests/test.rpm") case "/rpmPublicKey": - file, err = ioutil.ReadFile("../../../tests/test_rpm_public_key.key") + file, err = os.ReadFile("../../../tests/test_rpm_public_key.key") case "/alpine": - file, err = ioutil.ReadFile("../../../tests/test_alpine.apk") + file, err = os.ReadFile("../../../tests/test_alpine.apk") case "/alpinePublicKey": - file, err = ioutil.ReadFile("../../../tests/test_alpine.pub") + file, err = os.ReadFile("../../../tests/test_alpine.pub") case "/alpineEntry": - file, err = ioutil.ReadFile("../../../tests/alpine.json") + file, err = os.ReadFile("../../../tests/alpine.json") case "/helmEntry": - file, err = ioutil.ReadFile("../../../tests/helm.json") + file, err = os.ReadFile("../../../tests/helm.json") case "/not_found": err = errors.New("file not found") } @@ -524,9 +524,9 @@ func TestSearchPFlags(t *testing.T) { switch r.URL.Path { case "/artifact": - file, err = ioutil.ReadFile("../../../tests/test_file.txt") + file, err = os.ReadFile("../../../tests/test_file.txt") case "/publicKey": - file, err = ioutil.ReadFile("../../../tests/test_public_key.key") + file, err = os.ReadFile("../../../tests/test_public_key.key") case "/not_found": err = errors.New("file not found") } diff --git a/cmd/rekor-cli/app/search.go b/cmd/rekor-cli/app/search.go index 1e85dbd8b..346aa1e9d 100644 --- a/cmd/rekor-cli/app/search.go +++ b/cmd/rekor-cli/app/search.go @@ -21,7 +21,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "net/http" "os" "path/filepath" @@ -136,7 +135,7 @@ var searchCmd = &cobra.Command{ tee = io.TeeReader(file, hasher) } - if _, err := ioutil.ReadAll(tee); err != nil { + if _, err := io.ReadAll(tee); err != nil { return nil, fmt.Errorf("error processing '%v': %w", artifactStr, err) } @@ -170,7 +169,7 @@ var searchCmd = &cobra.Command{ if isURL(splitPubKeyString[0]) { params.Query.PublicKey.URL = strfmt.URI(splitPubKeyString[0]) } else { - keyBytes, err := ioutil.ReadFile(filepath.Clean(splitPubKeyString[0])) + keyBytes, err := os.ReadFile(filepath.Clean(splitPubKeyString[0])) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/cmd/rekor-cli/app/state/state.go b/cmd/rekor-cli/app/state/state.go index cfe450801..39ec59dd7 100644 --- a/cmd/rekor-cli/app/state/state.go +++ b/cmd/rekor-cli/app/state/state.go @@ -17,7 +17,6 @@ package state import ( "encoding/json" - "io/ioutil" "os" "path/filepath" @@ -44,7 +43,7 @@ func Dump(key string, sth *util.SignedCheckpoint) error { if err != nil { return err } - if err := ioutil.WriteFile(statePath, b, 0600); err != nil { + if err := os.WriteFile(statePath, b, 0600); err != nil { return err } return nil @@ -56,7 +55,7 @@ func loadStateFile() persistedState { return nil } fp := filepath.Join(rekorDir, "state.json") - b, err := ioutil.ReadFile(filepath.Clean(fp)) + b, err := os.ReadFile(filepath.Clean(fp)) if err != nil { return nil } diff --git a/cmd/rekor-server/app/root.go b/cmd/rekor-server/app/root.go index 954e451c3..13bc56c03 100644 --- a/cmd/rekor-server/app/root.go +++ b/cmd/rekor-server/app/root.go @@ -20,6 +20,7 @@ import ( "net/http" "net/http/pprof" "os" + "time" homedir "github.com/mitchellh/go-homedir" "github.com/sigstore/rekor/pkg/log" @@ -100,7 +101,14 @@ func init() { mux.HandleFunc("/debug/pprof/{action}", pprof.Index) mux.HandleFunc("/debug/pprof/symbol", pprof.Symbol) - if err := http.ListenAndServe(":6060", mux); err != nil && err != http.ErrServerClosed { + srv := &http.Server{ + Addr: ":6060", + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + Handler: mux, + } + + if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed { log.Logger.Fatalf("Error when starting or running http server: %v", err) } }() diff --git a/cmd/rekor-server/app/serve.go b/cmd/rekor-server/app/serve.go index 536443e8e..240b64183 100644 --- a/cmd/rekor-server/app/serve.go +++ b/cmd/rekor-server/app/serve.go @@ -18,6 +18,7 @@ package app import ( "flag" "net/http" + "time" "github.com/go-openapi/loads" "github.com/prometheus/client_golang/prometheus/promhttp" @@ -114,7 +115,12 @@ var serveCmd = &cobra.Command{ http.Handle("/metrics", promhttp.Handler()) go func() { - _ = http.ListenAndServe(":2112", nil) + srv := &http.Server{ + Addr: ":2112", + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, + } + _ = srv.ListenAndServe() }() if err := server.Serve(); err != nil { diff --git a/pkg/generated/client/entries/create_log_entry_parameters.go b/pkg/generated/client/entries/create_log_entry_parameters.go index c5ccd2128..481fa2bda 100644 --- a/pkg/generated/client/entries/create_log_entry_parameters.go +++ b/pkg/generated/client/entries/create_log_entry_parameters.go @@ -70,10 +70,12 @@ func NewCreateLogEntryParamsWithHTTPClient(client *http.Client) *CreateLogEntryP } } -/* CreateLogEntryParams contains all the parameters to send to the API endpoint - for the create log entry operation. +/* +CreateLogEntryParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the create log entry operation. + + Typically these are written to a http.Request. */ type CreateLogEntryParams struct { diff --git a/pkg/generated/client/entries/create_log_entry_responses.go b/pkg/generated/client/entries/create_log_entry_responses.go index 135bf9ca7..e0e3ee156 100644 --- a/pkg/generated/client/entries/create_log_entry_responses.go +++ b/pkg/generated/client/entries/create_log_entry_responses.go @@ -75,7 +75,8 @@ func NewCreateLogEntryCreated() *CreateLogEntryCreated { return &CreateLogEntryCreated{} } -/* CreateLogEntryCreated describes a response with status code 201, with default header values. +/* +CreateLogEntryCreated describes a response with status code 201, with default header values. Returns the entry created in the transparency log */ @@ -134,7 +135,8 @@ func NewCreateLogEntryBadRequest() *CreateLogEntryBadRequest { return &CreateLogEntryBadRequest{} } -/* CreateLogEntryBadRequest describes a response with status code 400, with default header values. +/* +CreateLogEntryBadRequest describes a response with status code 400, with default header values. The content supplied to the server was invalid */ @@ -166,7 +168,8 @@ func NewCreateLogEntryConflict() *CreateLogEntryConflict { return &CreateLogEntryConflict{} } -/* CreateLogEntryConflict describes a response with status code 409, with default header values. +/* +CreateLogEntryConflict describes a response with status code 409, with default header values. The request conflicts with the current state of the transparency log */ @@ -213,7 +216,8 @@ func NewCreateLogEntryDefault(code int) *CreateLogEntryDefault { } } -/* CreateLogEntryDefault describes a response with status code -1, with default header values. +/* +CreateLogEntryDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/entries/entries_client.go b/pkg/generated/client/entries/entries_client.go index 05c6abb92..fe2630eaf 100644 --- a/pkg/generated/client/entries/entries_client.go +++ b/pkg/generated/client/entries/entries_client.go @@ -56,10 +56,9 @@ type ClientService interface { } /* - CreateLogEntry creates an entry in the transparency log - - Creates an entry in the transparency log for a detached signature, public key, and content. Items can be included in the request or fetched by the server when URLs are specified. +CreateLogEntry creates an entry in the transparency log +Creates an entry in the transparency log for a detached signature, public key, and content. Items can be included in the request or fetched by the server when URLs are specified. */ func (a *Client) CreateLogEntry(params *CreateLogEntryParams, opts ...ClientOption) (*CreateLogEntryCreated, error) { // TODO: Validate the params before sending @@ -96,7 +95,7 @@ func (a *Client) CreateLogEntry(params *CreateLogEntryParams, opts ...ClientOpti } /* - GetLogEntryByIndex retrieves an entry and inclusion proof from the transparency log if it exists by index +GetLogEntryByIndex retrieves an entry and inclusion proof from the transparency log if it exists by index */ func (a *Client) GetLogEntryByIndex(params *GetLogEntryByIndexParams, opts ...ClientOption) (*GetLogEntryByIndexOK, error) { // TODO: Validate the params before sending @@ -133,9 +132,9 @@ func (a *Client) GetLogEntryByIndex(params *GetLogEntryByIndexParams, opts ...Cl } /* - GetLogEntryByUUID gets log entry and information required to generate an inclusion proof for the entry in the transparency log +GetLogEntryByUUID gets log entry and information required to generate an inclusion proof for the entry in the transparency log - Returns the entry, root hash, tree size, and a list of hashes that can be used to calculate proof of an entry being included in the transparency log +Returns the entry, root hash, tree size, and a list of hashes that can be used to calculate proof of an entry being included in the transparency log */ func (a *Client) GetLogEntryByUUID(params *GetLogEntryByUUIDParams, opts ...ClientOption) (*GetLogEntryByUUIDOK, error) { // TODO: Validate the params before sending @@ -172,7 +171,7 @@ func (a *Client) GetLogEntryByUUID(params *GetLogEntryByUUIDParams, opts ...Clie } /* - SearchLogQuery searches transparency log for one or more log entries +SearchLogQuery searches transparency log for one or more log entries */ func (a *Client) SearchLogQuery(params *SearchLogQueryParams, opts ...ClientOption) (*SearchLogQueryOK, error) { // TODO: Validate the params before sending diff --git a/pkg/generated/client/entries/get_log_entry_by_index_parameters.go b/pkg/generated/client/entries/get_log_entry_by_index_parameters.go index 405dee67c..e22522751 100644 --- a/pkg/generated/client/entries/get_log_entry_by_index_parameters.go +++ b/pkg/generated/client/entries/get_log_entry_by_index_parameters.go @@ -69,10 +69,12 @@ func NewGetLogEntryByIndexParamsWithHTTPClient(client *http.Client) *GetLogEntry } } -/* GetLogEntryByIndexParams contains all the parameters to send to the API endpoint - for the get log entry by index operation. +/* +GetLogEntryByIndexParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the get log entry by index operation. + + Typically these are written to a http.Request. */ type GetLogEntryByIndexParams struct { diff --git a/pkg/generated/client/entries/get_log_entry_by_index_responses.go b/pkg/generated/client/entries/get_log_entry_by_index_responses.go index 8b510fcad..fd8419e17 100644 --- a/pkg/generated/client/entries/get_log_entry_by_index_responses.go +++ b/pkg/generated/client/entries/get_log_entry_by_index_responses.go @@ -68,7 +68,8 @@ func NewGetLogEntryByIndexOK() *GetLogEntryByIndexOK { return &GetLogEntryByIndexOK{} } -/* GetLogEntryByIndexOK describes a response with status code 200, with default header values. +/* +GetLogEntryByIndexOK describes a response with status code 200, with default header values. the entry in the transparency log requested along with an inclusion proof */ @@ -98,7 +99,8 @@ func NewGetLogEntryByIndexNotFound() *GetLogEntryByIndexNotFound { return &GetLogEntryByIndexNotFound{} } -/* GetLogEntryByIndexNotFound describes a response with status code 404, with default header values. +/* +GetLogEntryByIndexNotFound describes a response with status code 404, with default header values. The content requested could not be found */ @@ -121,7 +123,8 @@ func NewGetLogEntryByIndexDefault(code int) *GetLogEntryByIndexDefault { } } -/* GetLogEntryByIndexDefault describes a response with status code -1, with default header values. +/* +GetLogEntryByIndexDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go b/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go index 560bee016..5c88b5265 100644 --- a/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go +++ b/pkg/generated/client/entries/get_log_entry_by_uuid_parameters.go @@ -68,10 +68,12 @@ func NewGetLogEntryByUUIDParamsWithHTTPClient(client *http.Client) *GetLogEntryB } } -/* GetLogEntryByUUIDParams contains all the parameters to send to the API endpoint - for the get log entry by UUID operation. +/* +GetLogEntryByUUIDParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the get log entry by UUID operation. + + Typically these are written to a http.Request. */ type GetLogEntryByUUIDParams struct { diff --git a/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go b/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go index 9d46b2fa4..2f800f38a 100644 --- a/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go +++ b/pkg/generated/client/entries/get_log_entry_by_uuid_responses.go @@ -68,7 +68,8 @@ func NewGetLogEntryByUUIDOK() *GetLogEntryByUUIDOK { return &GetLogEntryByUUIDOK{} } -/* GetLogEntryByUUIDOK describes a response with status code 200, with default header values. +/* +GetLogEntryByUUIDOK describes a response with status code 200, with default header values. Information needed for a client to compute the inclusion proof */ @@ -98,7 +99,8 @@ func NewGetLogEntryByUUIDNotFound() *GetLogEntryByUUIDNotFound { return &GetLogEntryByUUIDNotFound{} } -/* GetLogEntryByUUIDNotFound describes a response with status code 404, with default header values. +/* +GetLogEntryByUUIDNotFound describes a response with status code 404, with default header values. The content requested could not be found */ @@ -121,7 +123,8 @@ func NewGetLogEntryByUUIDDefault(code int) *GetLogEntryByUUIDDefault { } } -/* GetLogEntryByUUIDDefault describes a response with status code -1, with default header values. +/* +GetLogEntryByUUIDDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/entries/search_log_query_parameters.go b/pkg/generated/client/entries/search_log_query_parameters.go index 459f1208e..ed158ce23 100644 --- a/pkg/generated/client/entries/search_log_query_parameters.go +++ b/pkg/generated/client/entries/search_log_query_parameters.go @@ -70,10 +70,12 @@ func NewSearchLogQueryParamsWithHTTPClient(client *http.Client) *SearchLogQueryP } } -/* SearchLogQueryParams contains all the parameters to send to the API endpoint - for the search log query operation. +/* +SearchLogQueryParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the search log query operation. + + Typically these are written to a http.Request. */ type SearchLogQueryParams struct { diff --git a/pkg/generated/client/entries/search_log_query_responses.go b/pkg/generated/client/entries/search_log_query_responses.go index c459c0cce..6107ec807 100644 --- a/pkg/generated/client/entries/search_log_query_responses.go +++ b/pkg/generated/client/entries/search_log_query_responses.go @@ -68,7 +68,8 @@ func NewSearchLogQueryOK() *SearchLogQueryOK { return &SearchLogQueryOK{} } -/* SearchLogQueryOK describes a response with status code 200, with default header values. +/* +SearchLogQueryOK describes a response with status code 200, with default header values. Returns zero or more entries from the transparency log, according to how many were included in request query */ @@ -98,7 +99,8 @@ func NewSearchLogQueryBadRequest() *SearchLogQueryBadRequest { return &SearchLogQueryBadRequest{} } -/* SearchLogQueryBadRequest describes a response with status code 400, with default header values. +/* +SearchLogQueryBadRequest describes a response with status code 400, with default header values. The content supplied to the server was invalid */ @@ -132,7 +134,8 @@ func NewSearchLogQueryDefault(code int) *SearchLogQueryDefault { } } -/* SearchLogQueryDefault describes a response with status code -1, with default header values. +/* +SearchLogQueryDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/index/index_client.go b/pkg/generated/client/index/index_client.go index f80b04afb..35964c0d6 100644 --- a/pkg/generated/client/index/index_client.go +++ b/pkg/generated/client/index/index_client.go @@ -50,7 +50,7 @@ type ClientService interface { } /* - SearchIndex searches index by entry metadata +SearchIndex searches index by entry metadata */ func (a *Client) SearchIndex(params *SearchIndexParams, opts ...ClientOption) (*SearchIndexOK, error) { // TODO: Validate the params before sending diff --git a/pkg/generated/client/index/search_index_parameters.go b/pkg/generated/client/index/search_index_parameters.go index d54879b0f..c1694193e 100644 --- a/pkg/generated/client/index/search_index_parameters.go +++ b/pkg/generated/client/index/search_index_parameters.go @@ -70,10 +70,12 @@ func NewSearchIndexParamsWithHTTPClient(client *http.Client) *SearchIndexParams } } -/* SearchIndexParams contains all the parameters to send to the API endpoint - for the search index operation. +/* +SearchIndexParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the search index operation. + + Typically these are written to a http.Request. */ type SearchIndexParams struct { diff --git a/pkg/generated/client/index/search_index_responses.go b/pkg/generated/client/index/search_index_responses.go index 587a93817..34d4d9712 100644 --- a/pkg/generated/client/index/search_index_responses.go +++ b/pkg/generated/client/index/search_index_responses.go @@ -68,7 +68,8 @@ func NewSearchIndexOK() *SearchIndexOK { return &SearchIndexOK{} } -/* SearchIndexOK describes a response with status code 200, with default header values. +/* +SearchIndexOK describes a response with status code 200, with default header values. Returns zero or more entry UUIDs from the transparency log based on search query */ @@ -98,7 +99,8 @@ func NewSearchIndexBadRequest() *SearchIndexBadRequest { return &SearchIndexBadRequest{} } -/* SearchIndexBadRequest describes a response with status code 400, with default header values. +/* +SearchIndexBadRequest describes a response with status code 400, with default header values. The content supplied to the server was invalid */ @@ -132,7 +134,8 @@ func NewSearchIndexDefault(code int) *SearchIndexDefault { } } -/* SearchIndexDefault describes a response with status code -1, with default header values. +/* +SearchIndexDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/pubkey/get_public_key_parameters.go b/pkg/generated/client/pubkey/get_public_key_parameters.go index d878ea00d..b4248c933 100644 --- a/pkg/generated/client/pubkey/get_public_key_parameters.go +++ b/pkg/generated/client/pubkey/get_public_key_parameters.go @@ -68,10 +68,12 @@ func NewGetPublicKeyParamsWithHTTPClient(client *http.Client) *GetPublicKeyParam } } -/* GetPublicKeyParams contains all the parameters to send to the API endpoint - for the get public key operation. +/* +GetPublicKeyParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the get public key operation. + + Typically these are written to a http.Request. */ type GetPublicKeyParams struct { diff --git a/pkg/generated/client/pubkey/get_public_key_responses.go b/pkg/generated/client/pubkey/get_public_key_responses.go index 10f69739f..babe73ca0 100644 --- a/pkg/generated/client/pubkey/get_public_key_responses.go +++ b/pkg/generated/client/pubkey/get_public_key_responses.go @@ -62,7 +62,8 @@ func NewGetPublicKeyOK() *GetPublicKeyOK { return &GetPublicKeyOK{} } -/* GetPublicKeyOK describes a response with status code 200, with default header values. +/* +GetPublicKeyOK describes a response with status code 200, with default header values. The public key */ @@ -94,7 +95,8 @@ func NewGetPublicKeyDefault(code int) *GetPublicKeyDefault { } } -/* GetPublicKeyDefault describes a response with status code -1, with default header values. +/* +GetPublicKeyDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/pubkey/pubkey_client.go b/pkg/generated/client/pubkey/pubkey_client.go index 0f780ad9b..714d2de26 100644 --- a/pkg/generated/client/pubkey/pubkey_client.go +++ b/pkg/generated/client/pubkey/pubkey_client.go @@ -50,9 +50,9 @@ type ClientService interface { } /* - GetPublicKey retrieves the public key that can be used to validate the signed tree head +GetPublicKey retrieves the public key that can be used to validate the signed tree head - Returns the public key that can be used to validate the signed tree head +Returns the public key that can be used to validate the signed tree head */ func (a *Client) GetPublicKey(params *GetPublicKeyParams, opts ...ClientOption) (*GetPublicKeyOK, error) { // TODO: Validate the params before sending diff --git a/pkg/generated/client/server/get_rekor_version_parameters.go b/pkg/generated/client/server/get_rekor_version_parameters.go index 419217f70..fd4e30c2b 100644 --- a/pkg/generated/client/server/get_rekor_version_parameters.go +++ b/pkg/generated/client/server/get_rekor_version_parameters.go @@ -68,10 +68,12 @@ func NewGetRekorVersionParamsWithHTTPClient(client *http.Client) *GetRekorVersio } } -/* GetRekorVersionParams contains all the parameters to send to the API endpoint - for the get rekor version operation. +/* +GetRekorVersionParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the get rekor version operation. + + Typically these are written to a http.Request. */ type GetRekorVersionParams struct { timeout time.Duration diff --git a/pkg/generated/client/server/get_rekor_version_responses.go b/pkg/generated/client/server/get_rekor_version_responses.go index fe165eae3..4c84daf90 100644 --- a/pkg/generated/client/server/get_rekor_version_responses.go +++ b/pkg/generated/client/server/get_rekor_version_responses.go @@ -62,7 +62,8 @@ func NewGetRekorVersionOK() *GetRekorVersionOK { return &GetRekorVersionOK{} } -/* GetRekorVersionOK describes a response with status code 200, with default header values. +/* +GetRekorVersionOK describes a response with status code 200, with default header values. A JSON object with the running rekor version */ @@ -96,7 +97,8 @@ func NewGetRekorVersionDefault(code int) *GetRekorVersionDefault { } } -/* GetRekorVersionDefault describes a response with status code -1, with default header values. +/* +GetRekorVersionDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/server/server_client.go b/pkg/generated/client/server/server_client.go index f48e55062..fb7a6222f 100644 --- a/pkg/generated/client/server/server_client.go +++ b/pkg/generated/client/server/server_client.go @@ -50,7 +50,7 @@ type ClientService interface { } /* - GetRekorVersion gets the current version of the rekor server +GetRekorVersion gets the current version of the rekor server */ func (a *Client) GetRekorVersion(params *GetRekorVersionParams, opts ...ClientOption) (*GetRekorVersionOK, error) { // TODO: Validate the params before sending diff --git a/pkg/generated/client/tlog/get_log_info_parameters.go b/pkg/generated/client/tlog/get_log_info_parameters.go index f051485ae..e0ae2cdd3 100644 --- a/pkg/generated/client/tlog/get_log_info_parameters.go +++ b/pkg/generated/client/tlog/get_log_info_parameters.go @@ -68,10 +68,12 @@ func NewGetLogInfoParamsWithHTTPClient(client *http.Client) *GetLogInfoParams { } } -/* GetLogInfoParams contains all the parameters to send to the API endpoint - for the get log info operation. +/* +GetLogInfoParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the get log info operation. + + Typically these are written to a http.Request. */ type GetLogInfoParams struct { timeout time.Duration diff --git a/pkg/generated/client/tlog/get_log_info_responses.go b/pkg/generated/client/tlog/get_log_info_responses.go index d8157506a..7d6d15405 100644 --- a/pkg/generated/client/tlog/get_log_info_responses.go +++ b/pkg/generated/client/tlog/get_log_info_responses.go @@ -62,7 +62,8 @@ func NewGetLogInfoOK() *GetLogInfoOK { return &GetLogInfoOK{} } -/* GetLogInfoOK describes a response with status code 200, with default header values. +/* +GetLogInfoOK describes a response with status code 200, with default header values. A JSON object with the root hash and tree size as properties */ @@ -96,7 +97,8 @@ func NewGetLogInfoDefault(code int) *GetLogInfoDefault { } } -/* GetLogInfoDefault describes a response with status code -1, with default header values. +/* +GetLogInfoDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/tlog/get_log_proof_parameters.go b/pkg/generated/client/tlog/get_log_proof_parameters.go index 8d504b6cf..2b21ad887 100644 --- a/pkg/generated/client/tlog/get_log_proof_parameters.go +++ b/pkg/generated/client/tlog/get_log_proof_parameters.go @@ -69,10 +69,12 @@ func NewGetLogProofParamsWithHTTPClient(client *http.Client) *GetLogProofParams } } -/* GetLogProofParams contains all the parameters to send to the API endpoint - for the get log proof operation. +/* +GetLogProofParams contains all the parameters to send to the API endpoint - Typically these are written to a http.Request. + for the get log proof operation. + + Typically these are written to a http.Request. */ type GetLogProofParams struct { diff --git a/pkg/generated/client/tlog/get_log_proof_responses.go b/pkg/generated/client/tlog/get_log_proof_responses.go index 76ebadb10..2ec83fcaf 100644 --- a/pkg/generated/client/tlog/get_log_proof_responses.go +++ b/pkg/generated/client/tlog/get_log_proof_responses.go @@ -68,7 +68,8 @@ func NewGetLogProofOK() *GetLogProofOK { return &GetLogProofOK{} } -/* GetLogProofOK describes a response with status code 200, with default header values. +/* +GetLogProofOK describes a response with status code 200, with default header values. All hashes required to compute the consistency proof */ @@ -100,7 +101,8 @@ func NewGetLogProofBadRequest() *GetLogProofBadRequest { return &GetLogProofBadRequest{} } -/* GetLogProofBadRequest describes a response with status code 400, with default header values. +/* +GetLogProofBadRequest describes a response with status code 400, with default header values. The content supplied to the server was invalid */ @@ -134,7 +136,8 @@ func NewGetLogProofDefault(code int) *GetLogProofDefault { } } -/* GetLogProofDefault describes a response with status code -1, with default header values. +/* +GetLogProofDefault describes a response with status code -1, with default header values. There was an internal error in the server while processing the request */ diff --git a/pkg/generated/client/tlog/tlog_client.go b/pkg/generated/client/tlog/tlog_client.go index 7fd8ffa19..f53f6c7f8 100644 --- a/pkg/generated/client/tlog/tlog_client.go +++ b/pkg/generated/client/tlog/tlog_client.go @@ -52,9 +52,9 @@ type ClientService interface { } /* - GetLogInfo gets information about the current state of the transparency log +GetLogInfo gets information about the current state of the transparency log - Returns the current root hash and size of the merkle tree used to store the log entries. +Returns the current root hash and size of the merkle tree used to store the log entries. */ func (a *Client) GetLogInfo(params *GetLogInfoParams, opts ...ClientOption) (*GetLogInfoOK, error) { // TODO: Validate the params before sending @@ -91,9 +91,9 @@ func (a *Client) GetLogInfo(params *GetLogInfoParams, opts ...ClientOption) (*Ge } /* - GetLogProof gets information required to generate a consistency proof for the transparency log +GetLogProof gets information required to generate a consistency proof for the transparency log - Returns a list of hashes for specified tree sizes that can be used to confirm the consistency of the transparency log +Returns a list of hashes for specified tree sizes that can be used to confirm the consistency of the transparency log */ func (a *Client) GetLogProof(params *GetLogProofParams, opts ...ClientOption) (*GetLogProofOK, error) { // TODO: Validate the params before sending diff --git a/pkg/generated/models/alpine_schema.go b/pkg/generated/models/alpine_schema.go index 49dd12b6b..edd25408b 100644 --- a/pkg/generated/models/alpine_schema.go +++ b/pkg/generated/models/alpine_schema.go @@ -23,7 +23,7 @@ package models // AlpineSchema Alpine Package Schema // -// Schema for Alpine package objects +// # Schema for Alpine package objects // // swagger:model alpineSchema type AlpineSchema interface{} diff --git a/pkg/generated/models/alpine_v001_schema.go b/pkg/generated/models/alpine_v001_schema.go index 999a48697..6cf1181b0 100644 --- a/pkg/generated/models/alpine_v001_schema.go +++ b/pkg/generated/models/alpine_v001_schema.go @@ -33,7 +33,7 @@ import ( // AlpineV001Schema Alpine v0.0.1 Schema // -// Schema for Alpine Package entries +// # Schema for Alpine Package entries // // swagger:model alpineV001Schema type AlpineV001Schema struct { diff --git a/pkg/generated/models/cose_schema.go b/pkg/generated/models/cose_schema.go index 1d4f0dca1..e653f2202 100644 --- a/pkg/generated/models/cose_schema.go +++ b/pkg/generated/models/cose_schema.go @@ -23,7 +23,7 @@ package models // CoseSchema COSE Schema // -// COSE for Rekord objects +// # COSE for Rekord objects // // swagger:model coseSchema type CoseSchema interface{} diff --git a/pkg/generated/models/cose_v001_schema.go b/pkg/generated/models/cose_v001_schema.go index caadb44d4..ea7f467da 100644 --- a/pkg/generated/models/cose_v001_schema.go +++ b/pkg/generated/models/cose_v001_schema.go @@ -33,7 +33,7 @@ import ( // CoseV001Schema cose v0.0.1 Schema // -// Schema for cose object +// # Schema for cose object // // swagger:model coseV001Schema type CoseV001Schema struct { diff --git a/pkg/generated/models/hashedrekord_schema.go b/pkg/generated/models/hashedrekord_schema.go index 49d5831f8..387a9392b 100644 --- a/pkg/generated/models/hashedrekord_schema.go +++ b/pkg/generated/models/hashedrekord_schema.go @@ -23,7 +23,7 @@ package models // HashedrekordSchema Rekor Schema // -// Schema for Rekord objects +// # Schema for Rekord objects // // swagger:model hashedrekordSchema type HashedrekordSchema interface{} diff --git a/pkg/generated/models/hashedrekord_v001_schema.go b/pkg/generated/models/hashedrekord_v001_schema.go index fb9edfb38..72937c640 100644 --- a/pkg/generated/models/hashedrekord_v001_schema.go +++ b/pkg/generated/models/hashedrekord_v001_schema.go @@ -33,7 +33,7 @@ import ( // HashedrekordV001Schema Hashed Rekor v0.0.1 Schema // -// Schema for Hashed Rekord object +// # Schema for Hashed Rekord object // // swagger:model hashedrekordV001Schema type HashedrekordV001Schema struct { diff --git a/pkg/generated/models/helm_schema.go b/pkg/generated/models/helm_schema.go index a6981eb63..0ab87df9c 100644 --- a/pkg/generated/models/helm_schema.go +++ b/pkg/generated/models/helm_schema.go @@ -23,7 +23,7 @@ package models // HelmSchema Helm Schema // -// Schema for Helm objects +// # Schema for Helm objects // // swagger:model helmSchema type HelmSchema interface{} diff --git a/pkg/generated/models/helm_v001_schema.go b/pkg/generated/models/helm_v001_schema.go index 1512dad32..e0942574b 100644 --- a/pkg/generated/models/helm_v001_schema.go +++ b/pkg/generated/models/helm_v001_schema.go @@ -33,7 +33,7 @@ import ( // HelmV001Schema Helm v0.0.1 Schema // -// Schema for Helm object +// # Schema for Helm object // // swagger:model helmV001Schema type HelmV001Schema struct { diff --git a/pkg/generated/models/intoto_schema.go b/pkg/generated/models/intoto_schema.go index 3533f9d59..a7fdaa6a6 100644 --- a/pkg/generated/models/intoto_schema.go +++ b/pkg/generated/models/intoto_schema.go @@ -23,7 +23,7 @@ package models // IntotoSchema Intoto Schema // -// Intoto for Rekord objects +// # Intoto for Rekord objects // // swagger:model intotoSchema type IntotoSchema interface{} diff --git a/pkg/generated/models/intoto_v001_schema.go b/pkg/generated/models/intoto_v001_schema.go index e43e699f7..dffbecd33 100644 --- a/pkg/generated/models/intoto_v001_schema.go +++ b/pkg/generated/models/intoto_v001_schema.go @@ -33,7 +33,7 @@ import ( // IntotoV001Schema intoto v0.0.1 Schema // -// Schema for intoto object +// # Schema for intoto object // // swagger:model intotoV001Schema type IntotoV001Schema struct { diff --git a/pkg/generated/models/intoto_v002_schema.go b/pkg/generated/models/intoto_v002_schema.go index 3e3b7bb69..86c0b47f5 100644 --- a/pkg/generated/models/intoto_v002_schema.go +++ b/pkg/generated/models/intoto_v002_schema.go @@ -34,7 +34,7 @@ import ( // IntotoV002Schema intoto v0.0.2 Schema // -// Schema for intoto object +// # Schema for intoto object // // swagger:model intotoV002Schema type IntotoV002Schema struct { diff --git a/pkg/generated/models/jar_schema.go b/pkg/generated/models/jar_schema.go index d45c53da7..e7b9a590e 100644 --- a/pkg/generated/models/jar_schema.go +++ b/pkg/generated/models/jar_schema.go @@ -23,7 +23,7 @@ package models // JarSchema JAR Schema // -// Schema for JAR objects +// # Schema for JAR objects // // swagger:model jarSchema type JarSchema interface{} diff --git a/pkg/generated/models/jar_v001_schema.go b/pkg/generated/models/jar_v001_schema.go index 24f6d3b2b..7a49b3e2e 100644 --- a/pkg/generated/models/jar_v001_schema.go +++ b/pkg/generated/models/jar_v001_schema.go @@ -33,7 +33,7 @@ import ( // JarV001Schema JAR v0.0.1 Schema // -// Schema for JAR entries +// # Schema for JAR entries // // swagger:model jarV001Schema type JarV001Schema struct { diff --git a/pkg/generated/models/rekord_schema.go b/pkg/generated/models/rekord_schema.go index 7bf278330..e85442ae9 100644 --- a/pkg/generated/models/rekord_schema.go +++ b/pkg/generated/models/rekord_schema.go @@ -23,7 +23,7 @@ package models // RekordSchema Rekor Schema // -// Schema for Rekord objects +// # Schema for Rekord objects // // swagger:model rekordSchema type RekordSchema interface{} diff --git a/pkg/generated/models/rekord_v001_schema.go b/pkg/generated/models/rekord_v001_schema.go index ddc6ec290..3d0446a5b 100644 --- a/pkg/generated/models/rekord_v001_schema.go +++ b/pkg/generated/models/rekord_v001_schema.go @@ -33,7 +33,7 @@ import ( // RekordV001Schema Rekor v0.0.1 Schema // -// Schema for Rekord object +// # Schema for Rekord object // // swagger:model rekordV001Schema type RekordV001Schema struct { diff --git a/pkg/generated/models/rfc3161_schema.go b/pkg/generated/models/rfc3161_schema.go index 90667a4aa..826013a28 100644 --- a/pkg/generated/models/rfc3161_schema.go +++ b/pkg/generated/models/rfc3161_schema.go @@ -23,7 +23,7 @@ package models // Rfc3161Schema Timestamp Schema // -// Schema for RFC 3161 timestamp objects +// # Schema for RFC 3161 timestamp objects // // swagger:model rfc3161Schema type Rfc3161Schema interface{} diff --git a/pkg/generated/models/rfc3161_v001_schema.go b/pkg/generated/models/rfc3161_v001_schema.go index 49f317a76..fe668412d 100644 --- a/pkg/generated/models/rfc3161_v001_schema.go +++ b/pkg/generated/models/rfc3161_v001_schema.go @@ -32,7 +32,7 @@ import ( // Rfc3161V001Schema Timestamp v0.0.1 Schema // -// Schema for RFC3161 entries +// # Schema for RFC3161 entries // // swagger:model rfc3161V001Schema type Rfc3161V001Schema struct { diff --git a/pkg/generated/models/rpm_schema.go b/pkg/generated/models/rpm_schema.go index 0304bbe77..5cb378366 100644 --- a/pkg/generated/models/rpm_schema.go +++ b/pkg/generated/models/rpm_schema.go @@ -23,7 +23,7 @@ package models // RpmSchema RPM Schema // -// Schema for RPM objects +// # Schema for RPM objects // // swagger:model rpmSchema type RpmSchema interface{} diff --git a/pkg/generated/models/rpm_v001_schema.go b/pkg/generated/models/rpm_v001_schema.go index 6f3cb07c9..82a75c1de 100644 --- a/pkg/generated/models/rpm_v001_schema.go +++ b/pkg/generated/models/rpm_v001_schema.go @@ -33,7 +33,7 @@ import ( // RpmV001Schema RPM v0.0.1 Schema // -// Schema for RPM entries +// # Schema for RPM entries // // swagger:model rpmV001Schema type RpmV001Schema struct { diff --git a/pkg/generated/models/tuf_schema.go b/pkg/generated/models/tuf_schema.go index 425a546ec..37dca8b68 100644 --- a/pkg/generated/models/tuf_schema.go +++ b/pkg/generated/models/tuf_schema.go @@ -23,7 +23,7 @@ package models // TUFSchema TUF Schema // -// Schema for TUF metadata objects +// # Schema for TUF metadata objects // // swagger:model tufSchema type TUFSchema interface{} diff --git a/pkg/generated/models/tuf_v001_schema.go b/pkg/generated/models/tuf_v001_schema.go index d015607ff..f8bf4b020 100644 --- a/pkg/generated/models/tuf_v001_schema.go +++ b/pkg/generated/models/tuf_v001_schema.go @@ -32,7 +32,7 @@ import ( // TUFV001Schema TUF v0.0.1 Schema // -// Schema for TUF metadata entries +// # Schema for TUF metadata entries // // swagger:model tufV001Schema type TUFV001Schema struct { diff --git a/pkg/generated/restapi/doc.go b/pkg/generated/restapi/doc.go index 72dfdc654..8b8735f1c 100644 --- a/pkg/generated/restapi/doc.go +++ b/pkg/generated/restapi/doc.go @@ -17,19 +17,19 @@ // Package restapi Rekor // -// Rekor is a cryptographically secure, immutable transparency log for signed software releases. -// Schemes: -// http -// Host: rekor.sigstore.dev -// BasePath: / -// Version: 0.0.1 -// -// Consumes: -// - application/json -// -// Produces: -// - application/x-pem-file -// - application/json +// Rekor is a cryptographically secure, immutable transparency log for signed software releases. +// Schemes: +// http +// Host: rekor.sigstore.dev +// BasePath: / +// Version: 0.0.1 +// +// Consumes: +// - application/json +// +// Produces: +// - application/x-pem-file +// - application/json // // swagger:meta package restapi diff --git a/pkg/generated/restapi/operations/entries/create_log_entry.go b/pkg/generated/restapi/operations/entries/create_log_entry.go index 6860514d3..b95c892fb 100644 --- a/pkg/generated/restapi/operations/entries/create_log_entry.go +++ b/pkg/generated/restapi/operations/entries/create_log_entry.go @@ -45,13 +45,12 @@ func NewCreateLogEntry(ctx *middleware.Context, handler CreateLogEntryHandler) * return &CreateLogEntry{Context: ctx, Handler: handler} } -/* CreateLogEntry swagger:route POST /api/v1/log/entries entries createLogEntry +/* + CreateLogEntry swagger:route POST /api/v1/log/entries entries createLogEntry -Creates an entry in the transparency log +# Creates an entry in the transparency log Creates an entry in the transparency log for a detached signature, public key, and content. Items can be included in the request or fetched by the server when URLs are specified. - - */ type CreateLogEntry struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/entries/create_log_entry_responses.go b/pkg/generated/restapi/operations/entries/create_log_entry_responses.go index ddc2839c1..3ff2489f0 100644 --- a/pkg/generated/restapi/operations/entries/create_log_entry_responses.go +++ b/pkg/generated/restapi/operations/entries/create_log_entry_responses.go @@ -33,7 +33,8 @@ import ( // CreateLogEntryCreatedCode is the HTTP code returned for type CreateLogEntryCreated const CreateLogEntryCreatedCode int = 201 -/*CreateLogEntryCreated Returns the entry created in the transparency log +/* +CreateLogEntryCreated Returns the entry created in the transparency log swagger:response createLogEntryCreated */ @@ -124,7 +125,8 @@ func (o *CreateLogEntryCreated) WriteResponse(rw http.ResponseWriter, producer r // CreateLogEntryBadRequestCode is the HTTP code returned for type CreateLogEntryBadRequest const CreateLogEntryBadRequestCode int = 400 -/*CreateLogEntryBadRequest The content supplied to the server was invalid +/* +CreateLogEntryBadRequest The content supplied to the server was invalid swagger:response createLogEntryBadRequest */ @@ -168,7 +170,8 @@ func (o *CreateLogEntryBadRequest) WriteResponse(rw http.ResponseWriter, produce // CreateLogEntryConflictCode is the HTTP code returned for type CreateLogEntryConflict const CreateLogEntryConflictCode int = 409 -/*CreateLogEntryConflict The request conflicts with the current state of the transparency log +/* +CreateLogEntryConflict The request conflicts with the current state of the transparency log swagger:response createLogEntryConflict */ @@ -231,7 +234,8 @@ func (o *CreateLogEntryConflict) WriteResponse(rw http.ResponseWriter, producer } } -/*CreateLogEntryDefault There was an internal error in the server while processing the request +/* +CreateLogEntryDefault There was an internal error in the server while processing the request swagger:response createLogEntryDefault */ diff --git a/pkg/generated/restapi/operations/entries/get_log_entry_by_index.go b/pkg/generated/restapi/operations/entries/get_log_entry_by_index.go index a27e5f608..ee804e5b9 100644 --- a/pkg/generated/restapi/operations/entries/get_log_entry_by_index.go +++ b/pkg/generated/restapi/operations/entries/get_log_entry_by_index.go @@ -45,10 +45,10 @@ func NewGetLogEntryByIndex(ctx *middleware.Context, handler GetLogEntryByIndexHa return &GetLogEntryByIndex{Context: ctx, Handler: handler} } -/* GetLogEntryByIndex swagger:route GET /api/v1/log/entries entries getLogEntryByIndex +/* + GetLogEntryByIndex swagger:route GET /api/v1/log/entries entries getLogEntryByIndex Retrieves an entry and inclusion proof from the transparency log (if it exists) by index - */ type GetLogEntryByIndex struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/entries/get_log_entry_by_index_responses.go b/pkg/generated/restapi/operations/entries/get_log_entry_by_index_responses.go index 3b14b1a36..08d6215ec 100644 --- a/pkg/generated/restapi/operations/entries/get_log_entry_by_index_responses.go +++ b/pkg/generated/restapi/operations/entries/get_log_entry_by_index_responses.go @@ -32,7 +32,8 @@ import ( // GetLogEntryByIndexOKCode is the HTTP code returned for type GetLogEntryByIndexOK const GetLogEntryByIndexOKCode int = 200 -/*GetLogEntryByIndexOK the entry in the transparency log requested along with an inclusion proof +/* +GetLogEntryByIndexOK the entry in the transparency log requested along with an inclusion proof swagger:response getLogEntryByIndexOK */ @@ -79,7 +80,8 @@ func (o *GetLogEntryByIndexOK) WriteResponse(rw http.ResponseWriter, producer ru // GetLogEntryByIndexNotFoundCode is the HTTP code returned for type GetLogEntryByIndexNotFound const GetLogEntryByIndexNotFoundCode int = 404 -/*GetLogEntryByIndexNotFound The content requested could not be found +/* +GetLogEntryByIndexNotFound The content requested could not be found swagger:response getLogEntryByIndexNotFound */ @@ -100,7 +102,8 @@ func (o *GetLogEntryByIndexNotFound) WriteResponse(rw http.ResponseWriter, produ rw.WriteHeader(404) } -/*GetLogEntryByIndexDefault There was an internal error in the server while processing the request +/* +GetLogEntryByIndexDefault There was an internal error in the server while processing the request swagger:response getLogEntryByIndexDefault */ diff --git a/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid.go b/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid.go index ea40f9025..eb04b8693 100644 --- a/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid.go +++ b/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid.go @@ -45,12 +45,12 @@ func NewGetLogEntryByUUID(ctx *middleware.Context, handler GetLogEntryByUUIDHand return &GetLogEntryByUUID{Context: ctx, Handler: handler} } -/* GetLogEntryByUUID swagger:route GET /api/v1/log/entries/{entryUUID} entries getLogEntryByUuid +/* + GetLogEntryByUUID swagger:route GET /api/v1/log/entries/{entryUUID} entries getLogEntryByUuid -Get log entry and information required to generate an inclusion proof for the entry in the transparency log +# Get log entry and information required to generate an inclusion proof for the entry in the transparency log Returns the entry, root hash, tree size, and a list of hashes that can be used to calculate proof of an entry being included in the transparency log - */ type GetLogEntryByUUID struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid_responses.go b/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid_responses.go index ccabfba23..1e45fb1cd 100644 --- a/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid_responses.go +++ b/pkg/generated/restapi/operations/entries/get_log_entry_by_uuid_responses.go @@ -32,7 +32,8 @@ import ( // GetLogEntryByUUIDOKCode is the HTTP code returned for type GetLogEntryByUUIDOK const GetLogEntryByUUIDOKCode int = 200 -/*GetLogEntryByUUIDOK Information needed for a client to compute the inclusion proof +/* +GetLogEntryByUUIDOK Information needed for a client to compute the inclusion proof swagger:response getLogEntryByUuidOK */ @@ -79,7 +80,8 @@ func (o *GetLogEntryByUUIDOK) WriteResponse(rw http.ResponseWriter, producer run // GetLogEntryByUUIDNotFoundCode is the HTTP code returned for type GetLogEntryByUUIDNotFound const GetLogEntryByUUIDNotFoundCode int = 404 -/*GetLogEntryByUUIDNotFound The content requested could not be found +/* +GetLogEntryByUUIDNotFound The content requested could not be found swagger:response getLogEntryByUuidNotFound */ @@ -100,7 +102,8 @@ func (o *GetLogEntryByUUIDNotFound) WriteResponse(rw http.ResponseWriter, produc rw.WriteHeader(404) } -/*GetLogEntryByUUIDDefault There was an internal error in the server while processing the request +/* +GetLogEntryByUUIDDefault There was an internal error in the server while processing the request swagger:response getLogEntryByUuidDefault */ diff --git a/pkg/generated/restapi/operations/entries/search_log_query.go b/pkg/generated/restapi/operations/entries/search_log_query.go index 098e225d7..343f3ec52 100644 --- a/pkg/generated/restapi/operations/entries/search_log_query.go +++ b/pkg/generated/restapi/operations/entries/search_log_query.go @@ -45,10 +45,10 @@ func NewSearchLogQuery(ctx *middleware.Context, handler SearchLogQueryHandler) * return &SearchLogQuery{Context: ctx, Handler: handler} } -/* SearchLogQuery swagger:route POST /api/v1/log/entries/retrieve entries searchLogQuery +/* + SearchLogQuery swagger:route POST /api/v1/log/entries/retrieve entries searchLogQuery Searches transparency log for one or more log entries - */ type SearchLogQuery struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/entries/search_log_query_responses.go b/pkg/generated/restapi/operations/entries/search_log_query_responses.go index 3694ef3d8..10d09ff2b 100644 --- a/pkg/generated/restapi/operations/entries/search_log_query_responses.go +++ b/pkg/generated/restapi/operations/entries/search_log_query_responses.go @@ -32,7 +32,8 @@ import ( // SearchLogQueryOKCode is the HTTP code returned for type SearchLogQueryOK const SearchLogQueryOKCode int = 200 -/*SearchLogQueryOK Returns zero or more entries from the transparency log, according to how many were included in request query +/* +SearchLogQueryOK Returns zero or more entries from the transparency log, according to how many were included in request query swagger:response searchLogQueryOK */ @@ -79,7 +80,8 @@ func (o *SearchLogQueryOK) WriteResponse(rw http.ResponseWriter, producer runtim // SearchLogQueryBadRequestCode is the HTTP code returned for type SearchLogQueryBadRequest const SearchLogQueryBadRequestCode int = 400 -/*SearchLogQueryBadRequest The content supplied to the server was invalid +/* +SearchLogQueryBadRequest The content supplied to the server was invalid swagger:response searchLogQueryBadRequest */ @@ -120,7 +122,8 @@ func (o *SearchLogQueryBadRequest) WriteResponse(rw http.ResponseWriter, produce } } -/*SearchLogQueryDefault There was an internal error in the server while processing the request +/* +SearchLogQueryDefault There was an internal error in the server while processing the request swagger:response searchLogQueryDefault */ diff --git a/pkg/generated/restapi/operations/index/search_index.go b/pkg/generated/restapi/operations/index/search_index.go index 5848525c2..f3c1ac6ca 100644 --- a/pkg/generated/restapi/operations/index/search_index.go +++ b/pkg/generated/restapi/operations/index/search_index.go @@ -45,10 +45,10 @@ func NewSearchIndex(ctx *middleware.Context, handler SearchIndexHandler) *Search return &SearchIndex{Context: ctx, Handler: handler} } -/* SearchIndex swagger:route POST /api/v1/index/retrieve index searchIndex +/* + SearchIndex swagger:route POST /api/v1/index/retrieve index searchIndex Searches index by entry metadata - */ type SearchIndex struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/index/search_index_responses.go b/pkg/generated/restapi/operations/index/search_index_responses.go index 4a160125d..6211b99eb 100644 --- a/pkg/generated/restapi/operations/index/search_index_responses.go +++ b/pkg/generated/restapi/operations/index/search_index_responses.go @@ -32,7 +32,8 @@ import ( // SearchIndexOKCode is the HTTP code returned for type SearchIndexOK const SearchIndexOKCode int = 200 -/*SearchIndexOK Returns zero or more entry UUIDs from the transparency log based on search query +/* +SearchIndexOK Returns zero or more entry UUIDs from the transparency log based on search query swagger:response searchIndexOK */ @@ -79,7 +80,8 @@ func (o *SearchIndexOK) WriteResponse(rw http.ResponseWriter, producer runtime.P // SearchIndexBadRequestCode is the HTTP code returned for type SearchIndexBadRequest const SearchIndexBadRequestCode int = 400 -/*SearchIndexBadRequest The content supplied to the server was invalid +/* +SearchIndexBadRequest The content supplied to the server was invalid swagger:response searchIndexBadRequest */ @@ -120,7 +122,8 @@ func (o *SearchIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer r } } -/*SearchIndexDefault There was an internal error in the server while processing the request +/* +SearchIndexDefault There was an internal error in the server while processing the request swagger:response searchIndexDefault */ diff --git a/pkg/generated/restapi/operations/pubkey/get_public_key.go b/pkg/generated/restapi/operations/pubkey/get_public_key.go index 939566b94..688c7bb36 100644 --- a/pkg/generated/restapi/operations/pubkey/get_public_key.go +++ b/pkg/generated/restapi/operations/pubkey/get_public_key.go @@ -45,12 +45,12 @@ func NewGetPublicKey(ctx *middleware.Context, handler GetPublicKeyHandler) *GetP return &GetPublicKey{Context: ctx, Handler: handler} } -/* GetPublicKey swagger:route GET /api/v1/log/publicKey pubkey getPublicKey +/* + GetPublicKey swagger:route GET /api/v1/log/publicKey pubkey getPublicKey -Retrieve the public key that can be used to validate the signed tree head +# Retrieve the public key that can be used to validate the signed tree head Returns the public key that can be used to validate the signed tree head - */ type GetPublicKey struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/pubkey/get_public_key_responses.go b/pkg/generated/restapi/operations/pubkey/get_public_key_responses.go index 6ecb5bf19..1cd51a9df 100644 --- a/pkg/generated/restapi/operations/pubkey/get_public_key_responses.go +++ b/pkg/generated/restapi/operations/pubkey/get_public_key_responses.go @@ -32,7 +32,8 @@ import ( // GetPublicKeyOKCode is the HTTP code returned for type GetPublicKeyOK const GetPublicKeyOKCode int = 200 -/*GetPublicKeyOK The public key +/* +GetPublicKeyOK The public key swagger:response getPublicKeyOK */ @@ -71,7 +72,8 @@ func (o *GetPublicKeyOK) WriteResponse(rw http.ResponseWriter, producer runtime. } } -/*GetPublicKeyDefault There was an internal error in the server while processing the request +/* +GetPublicKeyDefault There was an internal error in the server while processing the request swagger:response getPublicKeyDefault */ diff --git a/pkg/generated/restapi/operations/server/get_rekor_version.go b/pkg/generated/restapi/operations/server/get_rekor_version.go index 0297c5202..461be3017 100644 --- a/pkg/generated/restapi/operations/server/get_rekor_version.go +++ b/pkg/generated/restapi/operations/server/get_rekor_version.go @@ -45,10 +45,10 @@ func NewGetRekorVersion(ctx *middleware.Context, handler GetRekorVersionHandler) return &GetRekorVersion{Context: ctx, Handler: handler} } -/* GetRekorVersion swagger:route GET /api/v1/version server getRekorVersion +/* + GetRekorVersion swagger:route GET /api/v1/version server getRekorVersion Get the current version of the rekor server - */ type GetRekorVersion struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/server/get_rekor_version_responses.go b/pkg/generated/restapi/operations/server/get_rekor_version_responses.go index 8845dce14..28c607895 100644 --- a/pkg/generated/restapi/operations/server/get_rekor_version_responses.go +++ b/pkg/generated/restapi/operations/server/get_rekor_version_responses.go @@ -32,7 +32,8 @@ import ( // GetRekorVersionOKCode is the HTTP code returned for type GetRekorVersionOK const GetRekorVersionOKCode int = 200 -/*GetRekorVersionOK A JSON object with the running rekor version +/* +GetRekorVersionOK A JSON object with the running rekor version swagger:response getRekorVersionOK */ @@ -73,7 +74,8 @@ func (o *GetRekorVersionOK) WriteResponse(rw http.ResponseWriter, producer runti } } -/*GetRekorVersionDefault There was an internal error in the server while processing the request +/* +GetRekorVersionDefault There was an internal error in the server while processing the request swagger:response getRekorVersionDefault */ diff --git a/pkg/generated/restapi/operations/tlog/get_log_info.go b/pkg/generated/restapi/operations/tlog/get_log_info.go index 2c7ccbcab..e5395bd77 100644 --- a/pkg/generated/restapi/operations/tlog/get_log_info.go +++ b/pkg/generated/restapi/operations/tlog/get_log_info.go @@ -45,12 +45,12 @@ func NewGetLogInfo(ctx *middleware.Context, handler GetLogInfoHandler) *GetLogIn return &GetLogInfo{Context: ctx, Handler: handler} } -/* GetLogInfo swagger:route GET /api/v1/log tlog getLogInfo +/* + GetLogInfo swagger:route GET /api/v1/log tlog getLogInfo -Get information about the current state of the transparency log +# Get information about the current state of the transparency log Returns the current root hash and size of the merkle tree used to store the log entries. - */ type GetLogInfo struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/tlog/get_log_info_responses.go b/pkg/generated/restapi/operations/tlog/get_log_info_responses.go index 94efef292..28e747fda 100644 --- a/pkg/generated/restapi/operations/tlog/get_log_info_responses.go +++ b/pkg/generated/restapi/operations/tlog/get_log_info_responses.go @@ -32,7 +32,8 @@ import ( // GetLogInfoOKCode is the HTTP code returned for type GetLogInfoOK const GetLogInfoOKCode int = 200 -/*GetLogInfoOK A JSON object with the root hash and tree size as properties +/* +GetLogInfoOK A JSON object with the root hash and tree size as properties swagger:response getLogInfoOK */ @@ -73,7 +74,8 @@ func (o *GetLogInfoOK) WriteResponse(rw http.ResponseWriter, producer runtime.Pr } } -/*GetLogInfoDefault There was an internal error in the server while processing the request +/* +GetLogInfoDefault There was an internal error in the server while processing the request swagger:response getLogInfoDefault */ diff --git a/pkg/generated/restapi/operations/tlog/get_log_proof.go b/pkg/generated/restapi/operations/tlog/get_log_proof.go index c05f21197..18872a172 100644 --- a/pkg/generated/restapi/operations/tlog/get_log_proof.go +++ b/pkg/generated/restapi/operations/tlog/get_log_proof.go @@ -45,12 +45,12 @@ func NewGetLogProof(ctx *middleware.Context, handler GetLogProofHandler) *GetLog return &GetLogProof{Context: ctx, Handler: handler} } -/* GetLogProof swagger:route GET /api/v1/log/proof tlog getLogProof +/* + GetLogProof swagger:route GET /api/v1/log/proof tlog getLogProof -Get information required to generate a consistency proof for the transparency log +# Get information required to generate a consistency proof for the transparency log Returns a list of hashes for specified tree sizes that can be used to confirm the consistency of the transparency log - */ type GetLogProof struct { Context *middleware.Context diff --git a/pkg/generated/restapi/operations/tlog/get_log_proof_responses.go b/pkg/generated/restapi/operations/tlog/get_log_proof_responses.go index 7f842ad5c..34900c4ad 100644 --- a/pkg/generated/restapi/operations/tlog/get_log_proof_responses.go +++ b/pkg/generated/restapi/operations/tlog/get_log_proof_responses.go @@ -32,7 +32,8 @@ import ( // GetLogProofOKCode is the HTTP code returned for type GetLogProofOK const GetLogProofOKCode int = 200 -/*GetLogProofOK All hashes required to compute the consistency proof +/* +GetLogProofOK All hashes required to compute the consistency proof swagger:response getLogProofOK */ @@ -76,7 +77,8 @@ func (o *GetLogProofOK) WriteResponse(rw http.ResponseWriter, producer runtime.P // GetLogProofBadRequestCode is the HTTP code returned for type GetLogProofBadRequest const GetLogProofBadRequestCode int = 400 -/*GetLogProofBadRequest The content supplied to the server was invalid +/* +GetLogProofBadRequest The content supplied to the server was invalid swagger:response getLogProofBadRequest */ @@ -117,7 +119,8 @@ func (o *GetLogProofBadRequest) WriteResponse(rw http.ResponseWriter, producer r } } -/*GetLogProofDefault There was an internal error in the server while processing the request +/* +GetLogProofDefault There was an internal error in the server while processing the request swagger:response getLogProofDefault */ diff --git a/pkg/pki/pgp/pgp.go b/pkg/pki/pgp/pgp.go index 52f13cc02..f966fd078 100644 --- a/pkg/pki/pgp/pgp.go +++ b/pkg/pki/pgp/pgp.go @@ -25,9 +25,11 @@ import ( "net/http" validator "github.com/go-playground/validator/v10" - "golang.org/x/crypto/openpgp" - "golang.org/x/crypto/openpgp/armor" - "golang.org/x/crypto/openpgp/packet" + + //TODO: https://github.com/sigstore/rekor/issues/286 + "golang.org/x/crypto/openpgp" //nolint:staticcheck + "golang.org/x/crypto/openpgp/armor" //nolint:staticcheck + "golang.org/x/crypto/openpgp/packet" //nolint:staticcheck sigsig "github.com/sigstore/sigstore/pkg/signature" ) diff --git a/pkg/pki/pgp/pgp_test.go b/pkg/pki/pgp/pgp_test.go index 366fb181c..063c9a9cb 100644 --- a/pkg/pki/pgp/pgp_test.go +++ b/pkg/pki/pgp/pgp_test.go @@ -20,7 +20,6 @@ import ( "context" "errors" "io" - "io/ioutil" "net/http" "net/http/httptest" "os" @@ -126,7 +125,7 @@ func TestFetchPublicKey(t *testing.T) { return } - file, err := ioutil.ReadFile(r.URL.Path[1:]) + file, err := os.ReadFile(r.URL.Path[1:]) if err != nil { w.WriteHeader(http.StatusNotFound) return @@ -166,7 +165,7 @@ func TestFetchSignature(t *testing.T) { return } - file, err := ioutil.ReadFile(r.URL.Path[1:]) + file, err := os.ReadFile(r.URL.Path[1:]) if err != nil { w.WriteHeader(http.StatusNotFound) return diff --git a/pkg/pki/pkcs7/pkcs7.go b/pkg/pki/pkcs7/pkcs7.go index b2939f766..f36095678 100644 --- a/pkg/pki/pkcs7/pkcs7.go +++ b/pkg/pki/pkcs7/pkcs7.go @@ -25,7 +25,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "strings" "github.com/sassoftware/relic/lib/pkcs7" @@ -43,7 +42,7 @@ type Signature struct { // NewSignature creates and validates an PKCS7 signature object func NewSignature(r io.Reader) (*Signature, error) { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return nil, err } @@ -142,7 +141,7 @@ type PublicKey struct { // NewPublicKey implements the pki.PublicKey interface func NewPublicKey(r io.Reader) (*PublicKey, error) { - rawPub, err := ioutil.ReadAll(r) + rawPub, err := io.ReadAll(r) if err != nil { return nil, err } diff --git a/pkg/pki/ssh/sign_test.go b/pkg/pki/ssh/sign_test.go index 8456fb4ad..91e2ba068 100644 --- a/pkg/pki/ssh/sign_test.go +++ b/pkg/pki/ssh/sign_test.go @@ -17,7 +17,7 @@ package ssh import ( "bytes" - "io/ioutil" + "os" "os/exec" "path/filepath" "strings" @@ -158,7 +158,7 @@ func TestFromOpenSSH(t *testing.T) { sigPath := dataPath + ".sig" run(t, nil, "ssh-keygen", "-Y", "sign", "-n", "file", "-f", privPath, dataPath) - sigBytes, err := ioutil.ReadFile(sigPath) + sigBytes, err := os.ReadFile(sigPath) if err != nil { t.Fatal(err) } @@ -301,7 +301,7 @@ func TestRoundTrip(t *testing.T) { func write(t *testing.T, d []byte, fp ...string) string { p := filepath.Join(fp...) - if err := ioutil.WriteFile(p, d, 0600); err != nil { + if err := os.WriteFile(p, d, 0600); err != nil { t.Fatal(err) } return p diff --git a/pkg/pki/ssh/ssh.go b/pkg/pki/ssh/ssh.go index 79c10f651..86696e3f4 100644 --- a/pkg/pki/ssh/ssh.go +++ b/pkg/pki/ssh/ssh.go @@ -18,7 +18,6 @@ package ssh import ( "fmt" "io" - "io/ioutil" sigsig "github.com/sigstore/sigstore/pkg/signature" "golang.org/x/crypto/ssh" @@ -32,7 +31,7 @@ type Signature struct { // NewSignature creates and Validates an ssh signature object func NewSignature(r io.Reader) (*Signature, error) { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return nil, err } @@ -77,7 +76,7 @@ type PublicKey struct { // NewPublicKey implements the pki.PublicKey interface func NewPublicKey(r io.Reader) (*PublicKey, error) { - rawPub, err := ioutil.ReadAll(r) + rawPub, err := io.ReadAll(r) if err != nil { return nil, err } diff --git a/pkg/pki/tuf/tuf.go b/pkg/pki/tuf/tuf.go index f90c7c3b9..a4d51c81d 100644 --- a/pkg/pki/tuf/tuf.go +++ b/pkg/pki/tuf/tuf.go @@ -19,7 +19,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "time" sigsig "github.com/sigstore/sigstore/pkg/signature" @@ -43,7 +42,7 @@ type signedMeta struct { // NewSignature creates and validates a TUF signed manifest func NewSignature(r io.Reader) (*Signature, error) { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return nil, err } @@ -103,7 +102,7 @@ type PublicKey struct { // NewPublicKey implements the pki.PublicKey interface func NewPublicKey(r io.Reader) (*PublicKey, error) { - rawRoot, err := ioutil.ReadAll(r) + rawRoot, err := io.ReadAll(r) if err != nil { return nil, err } diff --git a/pkg/pki/x509/x509.go b/pkg/pki/x509/x509.go index e82ec9f00..6b5e30270 100644 --- a/pkg/pki/x509/x509.go +++ b/pkg/pki/x509/x509.go @@ -24,7 +24,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "strings" validator "github.com/go-playground/validator/v10" @@ -41,7 +40,7 @@ type Signature struct { // NewSignature creates and validates an x509 signature object func NewSignature(r io.Reader) (*Signature, error) { - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { return nil, err } @@ -103,7 +102,7 @@ type cert struct { // NewPublicKey implements the pki.PublicKey interface func NewPublicKey(r io.Reader) (*PublicKey, error) { - rawPub, err := ioutil.ReadAll(r) + rawPub, err := io.ReadAll(r) if err != nil { return nil, err } diff --git a/pkg/sharding/ranges.go b/pkg/sharding/ranges.go index 70485ec5d..859f7e6e3 100644 --- a/pkg/sharding/ranges.go +++ b/pkg/sharding/ranges.go @@ -21,7 +21,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "os" "strconv" "strings" @@ -74,7 +74,7 @@ func NewLogRanges(ctx context.Context, logClient trillian.TrillianLogClient, pat func logRangesFromPath(path string) (Ranges, error) { var ranges Ranges - contents, err := ioutil.ReadFile(path) + contents, err := os.ReadFile(path) if err != nil { return Ranges{}, err } diff --git a/pkg/sharding/ranges_test.go b/pkg/sharding/ranges_test.go index ae9d1123b..0eb1fadd8 100644 --- a/pkg/sharding/ranges_test.go +++ b/pkg/sharding/ranges_test.go @@ -17,7 +17,7 @@ package sharding import ( "context" - "io/ioutil" + "os" "path/filepath" "reflect" "testing" @@ -34,7 +34,7 @@ func TestNewLogRanges(t *testing.T) { - treeID: 0002 treeLength: 4` file := filepath.Join(t.TempDir(), "sharding-config") - if err := ioutil.WriteFile(file, []byte(contents), 0644); err != nil { + if err := os.WriteFile(file, []byte(contents), 0644); err != nil { t.Fatal(err) } treeID := uint(45) @@ -73,7 +73,7 @@ func TestLogRangesFromPath(t *testing.T) { - treeID: 0002 treeLength: 4` file := filepath.Join(t.TempDir(), "sharding-config") - if err := ioutil.WriteFile(file, []byte(contents), 0644); err != nil { + if err := os.WriteFile(file, []byte(contents), 0644); err != nil { t.Fatal(err) } expected := Ranges{ @@ -99,7 +99,7 @@ func TestLogRangesFromPath(t *testing.T) { func TestLogRangesFromPathJSON(t *testing.T) { contents := `[{"treeID": 0001, "treeLength": 3, "encodedPublicKey":"c2hhcmRpbmcK"}, {"treeID": 0002, "treeLength": 4}]` file := filepath.Join(t.TempDir(), "sharding-config") - if err := ioutil.WriteFile(file, []byte(contents), 0644); err != nil { + if err := os.WriteFile(file, []byte(contents), 0644); err != nil { t.Fatal(err) } expected := Ranges{ diff --git a/pkg/types/alpine/v0.0.1/entry.go b/pkg/types/alpine/v0.0.1/entry.go index 09da6c9e6..be3f1336c 100644 --- a/pkg/types/alpine/v0.0.1/entry.go +++ b/pkg/types/alpine/v0.0.1/entry.go @@ -24,7 +24,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -313,7 +312,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types return nil, fmt.Errorf("error opening artifact file: %w", err) } } - artifactBytes, err = ioutil.ReadAll(artifactReader) + artifactBytes, err = io.ReadAll(artifactReader) if err != nil { return nil, fmt.Errorf("error reading artifact file: %w", err) } @@ -326,7 +325,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one public key must be provided") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/alpine/v0.0.1/entry_test.go b/pkg/types/alpine/v0.0.1/entry_test.go index 153e748ea..e006128c6 100644 --- a/pkg/types/alpine/v0.0.1/entry_test.go +++ b/pkg/types/alpine/v0.0.1/entry_test.go @@ -18,7 +18,7 @@ package alpine import ( "bytes" "context" - "io/ioutil" + "os" "reflect" "testing" @@ -50,8 +50,8 @@ func TestCrossFieldValidation(t *testing.T) { expectCanonicalizeSuccess bool } - keyBytes, _ := ioutil.ReadFile("../../../../tests/test_alpine.pub") - dataBytes, _ := ioutil.ReadFile("../../../../tests/test_alpine.apk") + keyBytes, _ := os.ReadFile("../../../../tests/test_alpine.pub") + dataBytes, _ := os.ReadFile("../../../../tests/test_alpine.apk") testCases := []TestCase{ { diff --git a/pkg/types/cose/v0.0.1/entry.go b/pkg/types/cose/v0.0.1/entry.go index 48b4296cb..ecec75c63 100644 --- a/pkg/types/cose/v0.0.1/entry.go +++ b/pkg/types/cose/v0.0.1/entry.go @@ -26,7 +26,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "os" "path/filepath" "strings" @@ -310,7 +310,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A if props.ArtifactPath.IsAbs() { return nil, errors.New("cose envelopes cannot be fetched over HTTP(S)") } - messageBytes, err = ioutil.ReadFile(filepath.Clean(props.ArtifactPath.Path)) + messageBytes, err = os.ReadFile(filepath.Clean(props.ArtifactPath.Path)) if err != nil { return nil, err } @@ -320,7 +320,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one public key must be provided to verify signature") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/hashedrekord/v0.0.1/entry.go b/pkg/types/hashedrekord/v0.0.1/entry.go index 74d6654e8..b5e7d7ee7 100644 --- a/pkg/types/hashedrekord/v0.0.1/entry.go +++ b/pkg/types/hashedrekord/v0.0.1/entry.go @@ -24,7 +24,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "os" "path/filepath" "strings" @@ -208,7 +208,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if props.SignaturePath == nil { return nil, errors.New("a detached signature must be provided") } - sigBytes, err = ioutil.ReadFile(filepath.Clean(props.SignaturePath.Path)) + sigBytes, err = os.ReadFile(filepath.Clean(props.SignaturePath.Path)) if err != nil { return nil, fmt.Errorf("error reading signature file: %w", err) } @@ -221,7 +221,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one public key must be provided to verify detached signature") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/helm/provenance.go b/pkg/types/helm/provenance.go index f5a8bc8f3..74936042a 100644 --- a/pkg/types/helm/provenance.go +++ b/pkg/types/helm/provenance.go @@ -24,7 +24,8 @@ import ( "github.com/ghodss/yaml" - "golang.org/x/crypto/openpgp/clearsign" + //TODO: https://github.com/sigstore/rekor/issues/286 + "golang.org/x/crypto/openpgp/clearsign" //nolint:staticcheck ) type Provenance struct { diff --git a/pkg/types/helm/v0.0.1/entry.go b/pkg/types/helm/v0.0.1/entry.go index 000cb2c70..dc538e527 100644 --- a/pkg/types/helm/v0.0.1/entry.go +++ b/pkg/types/helm/v0.0.1/entry.go @@ -24,7 +24,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -308,7 +307,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types return nil, fmt.Errorf("error opening chart file: %w", err) } } - artifactBytes, err = ioutil.ReadAll(artifactReader) + artifactBytes, err = io.ReadAll(artifactReader) if err != nil { return nil, fmt.Errorf("error reading chart file: %w", err) } @@ -321,7 +320,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one public key must be provided") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/helm/v0.0.1/entry_test.go b/pkg/types/helm/v0.0.1/entry_test.go index 69eb38f8f..44e161b6c 100644 --- a/pkg/types/helm/v0.0.1/entry_test.go +++ b/pkg/types/helm/v0.0.1/entry_test.go @@ -18,7 +18,7 @@ package helm import ( "bytes" "context" - "io/ioutil" + "os" "reflect" "testing" @@ -50,8 +50,8 @@ func TestCrossFieldValidation(t *testing.T) { expectCanonicalizeSuccess bool } - keyBytes, _ := ioutil.ReadFile("../../../../tests/test_helm_armor.pub") - provenanceBytes, _ := ioutil.ReadFile("../../../../tests/test-0.1.0.tgz.prov") + keyBytes, _ := os.ReadFile("../../../../tests/test_helm_armor.pub") + provenanceBytes, _ := os.ReadFile("../../../../tests/test-0.1.0.tgz.prov") testCases := []TestCase{ { diff --git a/pkg/types/intoto/v0.0.1/entry.go b/pkg/types/intoto/v0.0.1/entry.go index 438f08392..a07ded9af 100644 --- a/pkg/types/intoto/v0.0.1/entry.go +++ b/pkg/types/intoto/v0.0.1/entry.go @@ -25,7 +25,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "os" "path/filepath" "strings" @@ -286,7 +286,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A if props.ArtifactPath.IsAbs() { return nil, errors.New("intoto envelopes cannot be fetched over HTTP(S)") } - artifactBytes, err = ioutil.ReadFile(filepath.Clean(props.ArtifactPath.Path)) + artifactBytes, err = os.ReadFile(filepath.Clean(props.ArtifactPath.Path)) if err != nil { return nil, err } @@ -296,7 +296,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one public key must be provided to verify signature") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/intoto/v0.0.2/entry.go b/pkg/types/intoto/v0.0.2/entry.go index 7313cce39..6b7a62a45 100644 --- a/pkg/types/intoto/v0.0.2/entry.go +++ b/pkg/types/intoto/v0.0.2/entry.go @@ -25,7 +25,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "os" "path/filepath" "strings" @@ -303,7 +303,7 @@ func (v V002Entry) CreateFromArtifactProperties(_ context.Context, props types.A if props.ArtifactPath.IsAbs() { return nil, errors.New("intoto envelopes cannot be fetched over HTTP(S)") } - artifactBytes, err = ioutil.ReadFile(filepath.Clean(props.ArtifactPath.Path)) + artifactBytes, err = os.ReadFile(filepath.Clean(props.ArtifactPath.Path)) if err != nil { return nil, err } @@ -325,7 +325,7 @@ func (v V002Entry) CreateFromArtifactProperties(_ context.Context, props types.A return nil, errors.New("dsse public keys cannot be fetched over HTTP(S)") } - publicKeyBytes, err := ioutil.ReadFile(filepath.Clean(path.Path)) + publicKeyBytes, err := os.ReadFile(filepath.Clean(path.Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/jar/v0.0.1/entry.go b/pkg/types/jar/v0.0.1/entry.go index d694c38b7..28f600e02 100644 --- a/pkg/types/jar/v0.0.1/entry.go +++ b/pkg/types/jar/v0.0.1/entry.go @@ -25,7 +25,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path" "path/filepath" @@ -258,7 +257,7 @@ func extractPKCS7SignatureFromJAR(inz *zip.Reader) ([]byte, error) { if err != nil { return nil, err } - contents, err := ioutil.ReadAll(fileReader) + contents, err := io.ReadAll(fileReader) if err != nil { return nil, err } @@ -297,7 +296,7 @@ func (v *V001Entry) CreateFromArtifactProperties(ctx context.Context, props type return nil, fmt.Errorf("error opening JAR file: %w", err) } } - artifactBytes, err = ioutil.ReadAll(artifactReader) + artifactBytes, err = io.ReadAll(artifactReader) if err != nil { return nil, fmt.Errorf("error reading JAR file: %w", err) } diff --git a/pkg/types/jar/v0.0.1/entry_test.go b/pkg/types/jar/v0.0.1/entry_test.go index 42ff5337d..2743d6cec 100644 --- a/pkg/types/jar/v0.0.1/entry_test.go +++ b/pkg/types/jar/v0.0.1/entry_test.go @@ -18,7 +18,7 @@ package jar import ( "bytes" "context" - "io/ioutil" + "os" "reflect" "testing" @@ -49,7 +49,7 @@ func TestCrossFieldValidation(t *testing.T) { expectCanonicalizeSuccess bool } - jarBytes, _ := ioutil.ReadFile("../../../../tests/test.jar") + jarBytes, _ := os.ReadFile("../../../../tests/test.jar") testCases := []TestCase{ { diff --git a/pkg/types/rekord/v0.0.1/entry.go b/pkg/types/rekord/v0.0.1/entry.go index 95feb3ba4..0042521e5 100644 --- a/pkg/types/rekord/v0.0.1/entry.go +++ b/pkg/types/rekord/v0.0.1/entry.go @@ -24,7 +24,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strings" @@ -357,7 +356,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types return nil, fmt.Errorf("error opening artifact file: %w", err) } } - artifactBytes, err = ioutil.ReadAll(artifactReader) + artifactBytes, err = io.ReadAll(artifactReader) if err != nil { return nil, fmt.Errorf("error reading artifact file: %w", err) } @@ -380,7 +379,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if props.SignaturePath == nil { return nil, errors.New("a detached signature must be provided") } - sigBytes, err = ioutil.ReadFile(filepath.Clean(props.SignaturePath.Path)) + sigBytes, err = os.ReadFile(filepath.Clean(props.SignaturePath.Path)) if err != nil { return nil, fmt.Errorf("error reading signature file: %w", err) } @@ -395,7 +394,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one public key must be provided to verify detached signature") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/rekord/v0.0.1/entry_test.go b/pkg/types/rekord/v0.0.1/entry_test.go index 0e79731f7..682c31007 100644 --- a/pkg/types/rekord/v0.0.1/entry_test.go +++ b/pkg/types/rekord/v0.0.1/entry_test.go @@ -18,7 +18,7 @@ package rekord import ( "bytes" "context" - "io/ioutil" + "os" "reflect" "testing" @@ -50,9 +50,9 @@ func TestCrossFieldValidation(t *testing.T) { expectCanonicalizeSuccess bool } - sigBytes, _ := ioutil.ReadFile("../../../../tests/test_file.sig") - keyBytes, _ := ioutil.ReadFile("../../../../tests/test_public_key.key") - dataBytes, _ := ioutil.ReadFile("../../../../tests/test_file.txt") + sigBytes, _ := os.ReadFile("../../../../tests/test_file.sig") + keyBytes, _ := os.ReadFile("../../../../tests/test_public_key.key") + dataBytes, _ := os.ReadFile("../../../../tests/test_file.txt") testCases := []TestCase{ { diff --git a/pkg/types/rfc3161/v0.0.1/entry.go b/pkg/types/rfc3161/v0.0.1/entry.go index e946f9917..9ebfd8065 100644 --- a/pkg/types/rfc3161/v0.0.1/entry.go +++ b/pkg/types/rfc3161/v0.0.1/entry.go @@ -24,7 +24,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "os" "path/filepath" "github.com/sigstore/rekor/pkg/types/rfc3161" @@ -185,7 +185,7 @@ func (v V001Entry) CreateFromArtifactProperties(_ context.Context, props types.A if props.ArtifactPath.IsAbs() { return nil, errors.New("RFC3161 timestamps cannot be fetched over HTTP(S)") } - artifactBytes, err = ioutil.ReadFile(filepath.Clean(props.ArtifactPath.Path)) + artifactBytes, err = os.ReadFile(filepath.Clean(props.ArtifactPath.Path)) if err != nil { return nil, fmt.Errorf("error reading artifact file: %w", err) } diff --git a/pkg/types/rfc3161/v0.0.1/entry_test.go b/pkg/types/rfc3161/v0.0.1/entry_test.go index 9f39f5bca..fe9485574 100644 --- a/pkg/types/rfc3161/v0.0.1/entry_test.go +++ b/pkg/types/rfc3161/v0.0.1/entry_test.go @@ -20,9 +20,9 @@ import ( "context" "encoding/asn1" "errors" - "io/ioutil" "net/http" "net/http/httptest" + "os" "reflect" "strings" "testing" @@ -58,7 +58,7 @@ func TestCrossFieldValidation(t *testing.T) { expectValidationErrorMessage string } - tsrBytes, _ := ioutil.ReadFile("../../../../tests/test.tsr") + tsrBytes, _ := os.ReadFile("../../../../tests/test.tsr") testServer := httptest.NewServer(http.HandlerFunc( func(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/types/rpm/v0.0.1/entry.go b/pkg/types/rpm/v0.0.1/entry.go index 1523a4297..971fcbfe0 100644 --- a/pkg/types/rpm/v0.0.1/entry.go +++ b/pkg/types/rpm/v0.0.1/entry.go @@ -24,7 +24,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strconv" @@ -203,7 +202,7 @@ func (v *V001Entry) fetchExternalEntities(ctx context.Context) (*pgp.PublicKey, return closePipesOnError(types.ValidationError(err)) } // ReadPackageFile does not drain the entire reader so we need to discard the rest - if _, err = io.Copy(ioutil.Discard, rpmR); err != nil { + if _, err = io.Copy(io.Discard, rpmR); err != nil { return closePipesOnError(err) } @@ -333,7 +332,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types return nil, fmt.Errorf("error opening RPM file: %w", err) } } - artifactBytes, err = ioutil.ReadAll(artifactReader) + artifactBytes, err = io.ReadAll(artifactReader) if err != nil { return nil, fmt.Errorf("error reading RPM file: %w", err) } @@ -346,7 +345,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one public key must be provided to verify RPM signature") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading public key file: %w", err) } diff --git a/pkg/types/rpm/v0.0.1/entry_test.go b/pkg/types/rpm/v0.0.1/entry_test.go index 3e5087379..dddd142b1 100644 --- a/pkg/types/rpm/v0.0.1/entry_test.go +++ b/pkg/types/rpm/v0.0.1/entry_test.go @@ -18,7 +18,7 @@ package rpm import ( "bytes" "context" - "io/ioutil" + "os" "reflect" "testing" @@ -50,8 +50,8 @@ func TestCrossFieldValidation(t *testing.T) { expectCanonicalizeSuccess bool } - keyBytes, _ := ioutil.ReadFile("../../../../tests/test_rpm_public_key.key") - dataBytes, _ := ioutil.ReadFile("../../../../tests/test.rpm") + keyBytes, _ := os.ReadFile("../../../../tests/test_rpm_public_key.key") + dataBytes, _ := os.ReadFile("../../../../tests/test.rpm") testCases := []TestCase{ { diff --git a/pkg/types/tuf/tuf.go b/pkg/types/tuf/tuf.go index a021ffe61..b5bad0c6e 100644 --- a/pkg/types/tuf/tuf.go +++ b/pkg/types/tuf/tuf.go @@ -5,7 +5,7 @@ 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 + 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, diff --git a/pkg/types/tuf/v0.0.1/entry.go b/pkg/types/tuf/v0.0.1/entry.go index 8c3a9ff15..580893399 100644 --- a/pkg/types/tuf/v0.0.1/entry.go +++ b/pkg/types/tuf/v0.0.1/entry.go @@ -5,7 +5,7 @@ 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 + 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, @@ -24,7 +24,6 @@ import ( "errors" "fmt" "io" - "io/ioutil" "os" "path/filepath" "strconv" @@ -320,7 +319,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types return nil, fmt.Errorf("error opening RPM file: %w", err) } } - artifactBytes, err = ioutil.ReadAll(artifactReader) + artifactBytes, err = io.ReadAll(artifactReader) if err != nil { return nil, fmt.Errorf("error reading RPM file: %w", err) } @@ -337,7 +336,7 @@ func (v V001Entry) CreateFromArtifactProperties(ctx context.Context, props types if len(props.PublicKeyPaths) != 1 { return nil, errors.New("only one path to root file must be specified") } - keyBytes, err := ioutil.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) + keyBytes, err := os.ReadFile(filepath.Clean(props.PublicKeyPaths[0].Path)) if err != nil { return nil, fmt.Errorf("error reading root file: %w", err) } diff --git a/pkg/types/tuf/v0.0.1/entry_test.go b/pkg/types/tuf/v0.0.1/entry_test.go index f8d090f6a..dd5e57ccd 100644 --- a/pkg/types/tuf/v0.0.1/entry_test.go +++ b/pkg/types/tuf/v0.0.1/entry_test.go @@ -20,7 +20,7 @@ import ( "bytes" "context" "encoding/json" - "io/ioutil" + "os" "reflect" "testing" "time" @@ -67,9 +67,9 @@ func TestCrossFieldValidation(t *testing.T) { expectCanonicalizeSuccess bool } - keyBytes, _ := ioutil.ReadFile("../../../../tests/test_root.json") - dataBytes, _ := ioutil.ReadFile("../../../../tests/test_timestamp.json") - anyBytes, _ := ioutil.ReadFile("../../../../tests/test_any.json") + keyBytes, _ := os.ReadFile("../../../../tests/test_root.json") + dataBytes, _ := os.ReadFile("../../../../tests/test_timestamp.json") + anyBytes, _ := os.ReadFile("../../../../tests/test_any.json") keyContent := &data.Signed{} if err := json.Unmarshal(keyBytes, keyContent); err != nil { diff --git a/pkg/util/fetch.go b/pkg/util/fetch.go index f65f94aae..7f8e93fb0 100644 --- a/pkg/util/fetch.go +++ b/pkg/util/fetch.go @@ -20,7 +20,6 @@ import ( "context" "fmt" "io" - "io/ioutil" "net/http" ) @@ -44,7 +43,7 @@ func FileOrURLReadCloser(ctx context.Context, url string, content []byte) (io.Re dataReader = resp.Body } else { - dataReader = ioutil.NopCloser(bytes.NewReader(content)) + dataReader = io.NopCloser(bytes.NewReader(content)) } return dataReader, nil } diff --git a/pkg/util/signed_note.go b/pkg/util/signed_note.go index 344af188d..40e1f3853 100644 --- a/pkg/util/signed_note.go +++ b/pkg/util/signed_note.go @@ -134,10 +134,10 @@ func (s SignedNote) String() string { // // \u2014 name signature // -// * name is the string associated with the signer -// * signature is a base64 encoded string; the first 4 bytes of the decoded value is a -// hint to the public key; it is a big-endian encoded uint32 representing the first -// 4 bytes of the SHA256 hash of the public key +// - name is the string associated with the signer +// - signature is a base64 encoded string; the first 4 bytes of the decoded value is a +// hint to the public key; it is a big-endian encoded uint32 representing the first +// 4 bytes of the SHA256 hash of the public key func (s *SignedNote) UnmarshalText(data []byte) error { sigSplit := []byte("\n\n") // Must end with signature block preceded by blank line. diff --git a/release/cloudbuild.yaml b/release/cloudbuild.yaml index 1d0f219ae..9fb3460aa 100644 --- a/release/cloudbuild.yaml +++ b/release/cloudbuild.yaml @@ -32,16 +32,16 @@ steps: echo "Checking out ${_GIT_TAG}" git checkout ${_GIT_TAG} -- name: 'gcr.io/projectsigstore/cosign:v1.10.1@sha256:9377edd13ae515dcb97c15052e577a2cbce098f36b0361bdb2348e3bdd8fe536' +- name: 'gcr.io/projectsigstore/cosign:v1.11.1@sha256:f9fd5a287a67f4b955d08062a966df10f9a600b6b8583fd367bce3f1f000a429' dir: "go/src/sigstore/rekor" env: - COSIGN_EXPERIMENTAL=true - TUF_ROOT=/tmp args: - 'verify' - - 'ghcr.io/gythialy/golang-cross:v1.18.5-1@sha256:7dda2158ee68f0e4f53ca9bdf3971b2db01084dad4bdc775391e5f3bf40056a5' + - 'ghcr.io/gythialy/golang-cross:v1.19.0-0@sha256:904f22549b631c34c92fa696aa39144f8b5da3ee1dff095d4e3164fd50090767' -- name: ghcr.io/gythialy/golang-cross:v1.18.5-1@sha256:7dda2158ee68f0e4f53ca9bdf3971b2db01084dad4bdc775391e5f3bf40056a5 +- name: ghcr.io/gythialy/golang-cross:v1.19.0-0@sha256:904f22549b631c34c92fa696aa39144f8b5da3ee1dff095d4e3164fd50090767 entrypoint: /bin/sh dir: "go/src/sigstore/rekor" env: @@ -64,7 +64,7 @@ steps: gcloud auth configure-docker \ && make release -- name: ghcr.io/gythialy/golang-cross:v1.18.5-1@sha256:7dda2158ee68f0e4f53ca9bdf3971b2db01084dad4bdc775391e5f3bf40056a5 +- name: ghcr.io/gythialy/golang-cross:v1.19.0-0@sha256:904f22549b631c34c92fa696aa39144f8b5da3ee1dff095d4e3164fd50090767 entrypoint: 'bash' dir: "go/src/sigstore/rekor" env: diff --git a/release/ko-sign-release-images.sh b/release/ko-sign-release-images.sh index 59d82f24b..ca6b6f177 100755 --- a/release/ko-sign-release-images.sh +++ b/release/ko-sign-release-images.sh @@ -47,13 +47,13 @@ if [[ ! -f trillianSignerImagerefs ]]; then fi echo "Signing images with GCP KMS Key..." -cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat rekorServerImagerefs)" -cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat rekorCliImagerefs)" -cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat trillianServerImagerefs)" -cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat trillianSignerImagerefs)" +cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat rekorServerImagerefs) +cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat rekorCliImagerefs) +cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat trillianServerImagerefs) +cosign sign --force --key "gcpkms://projects/$PROJECT_ID/locations/$KEY_LOCATION/keyRings/$KEY_RING/cryptoKeys/$KEY_NAME/versions/$KEY_VERSION" -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat trillianSignerImagerefs) echo "Signing images with Keyless..." -cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat rekorServerImagerefs)" -cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat rekorCliImagerefs)" -cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat trillianServerImagerefs)" -cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" "$(cat trillianSignerImagerefs)" +cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat rekorServerImagerefs) +cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat rekorCliImagerefs) +cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat trillianServerImagerefs) +cosign sign --force -a GIT_HASH="$GIT_HASH" -a GIT_VERSION="$GIT_VERSION" $(cat trillianSignerImagerefs)