diff --git a/go.mod b/go.mod index dbfac00..ec86762 100644 --- a/go.mod +++ b/go.mod @@ -6,9 +6,9 @@ require ( code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 github.com/circonus-labs/circonus-gometrics/v3 v3.4.7 - github.com/circonus-labs/go-apiclient v0.7.23 + github.com/circonus-labs/go-apiclient v0.7.24 github.com/google/uuid v1.3.1 - github.com/hashicorp/go-retryablehttp v0.7.2 + github.com/hashicorp/go-retryablehttp v0.7.5 github.com/hashicorp/go-version v1.6.0 github.com/klauspost/compress v1.17.0 github.com/pelletier/go-toml v1.9.5 diff --git a/go.sum b/go.sum index c70472e..83e665d 100644 --- a/go.sum +++ b/go.sum @@ -823,8 +823,8 @@ github.com/circonus-labs/circonus-gometrics/v3 v3.4.7 h1:r7YBLIgiTT5Q4yNKSouP68M github.com/circonus-labs/circonus-gometrics/v3 v3.4.7/go.mod h1:57gznrTyBxQCsGYC/+3BN9POyrkEm4F3KsBTVQ5EQJk= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/circonus-labs/go-apiclient v0.7.15/go.mod h1:RFgkvdYEkimzgu3V2vVYlS1bitjOz1SF6uw109ieNeY= -github.com/circonus-labs/go-apiclient v0.7.23 h1:Bk+l9qLUHPGYND8z8Zxw3+d913ZIybD4CH1y5xSdtCk= -github.com/circonus-labs/go-apiclient v0.7.23/go.mod h1:arbbVvv/xFMvD1eSJqkS+Je1sN/JCpHtiL2GV6oA1Mg= +github.com/circonus-labs/go-apiclient v0.7.24 h1:ouJ/Dd/mlKOpG2ZRkuAvBBCn/YRQq4762MOnwIGdYQ8= +github.com/circonus-labs/go-apiclient v0.7.24/go.mod h1:M284FyvP8iLy5SPxLxy5yrOxEjK8RSgRPKhcc6WFDA4= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -1081,8 +1081,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-retryablehttp v0.6.8/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY= -github.com/hashicorp/go-retryablehttp v0.7.2 h1:AcYqCvkpalPnPF2pn0KamgwamS42TqUDDYFRKq/RAd0= -github.com/hashicorp/go-retryablehttp v0.7.2/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= +github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= diff --git a/vendor/github.com/circonus-labs/go-apiclient/.gitignore b/vendor/github.com/circonus-labs/go-apiclient/.gitignore index cc5baf9..6d3e060 100644 --- a/vendor/github.com/circonus-labs/go-apiclient/.gitignore +++ b/vendor/github.com/circonus-labs/go-apiclient/.gitignore @@ -1,9 +1,25 @@ +# MacOS .DS_Store -env.sh -NOTES.md -.vscode/ +# Vagrant +.vagrant*/ -vendor/ +# Binaries for programs and plugins +*.exe +*.dll +*.so +*.dylib -examples/go.* +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool +*.out + +# vendored packages +vendor*/ + +# goreleaser +dist/ + +.envrc \ No newline at end of file diff --git a/vendor/github.com/circonus-labs/go-apiclient/.goreleaser.yml b/vendor/github.com/circonus-labs/go-apiclient/.goreleaser.yml new file mode 100644 index 0000000..701c268 --- /dev/null +++ b/vendor/github.com/circonus-labs/go-apiclient/.goreleaser.yml @@ -0,0 +1,58 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 1 + +project_name: go-apiclient + +before: + hooks: + - go mod tidy + - golangci-lint run + - cmd: golangci-lint run + env: + - GOOS=linux + - govulncheck ./... + +builds: + - skip: true + +release: + github: + owner: circonus-labs + name: go-apiclient + + draft: false + prerelease: auto + +changelog: + use: git + sort: desc + abbrev: 0 + groups: + - title: Features + regexp: "^.*feat[(\\w)]*:+.*$" + order: 0 + - title: 'Bug fixes' + regexp: "^.*fix[(\\w)]*:+.*$" + order: 1 + - title: 'Dependencies' + regexp: "^.*build(deps):+.*$" + order: 2 + - title: Others + order: 999 + filters: + exclude: + - '^docs:' + - typo + +checksum: + name_template: "{{.ProjectName}}_checksums.txt" + +sboms: + - artifacts: any + args: ["../go.mod", "--output", "cyclonedx-json@1.5={{.ProjectName}}_{{.Version}}.sbom"] + env: + - SYFT_GOLANG_SEARCH_LOCAL_MOD_CACHE_LICENSES=true + - SYFT_GOLANG_SEARCH_REMOTE_LICENSES=true + diff --git a/vendor/github.com/circonus-labs/go-apiclient/CHANGELOG.md b/vendor/github.com/circonus-labs/go-apiclient/CHANGELOG.md index f81b6a9..a46c232 100644 --- a/vendor/github.com/circonus-labs/go-apiclient/CHANGELOG.md +++ b/vendor/github.com/circonus-labs/go-apiclient/CHANGELOG.md @@ -1,23 +1,35 @@ -# v0.7.22 +# unreleased + +## v0.7.24 + +* build: add goreleaser config (with sbom generation) +* chore: use latest lint in workflow +* chore: update .gitignore + +## v0.7.23 + +* feat: prepare to switch C3DataURL to be writeable + +## v0.7.22 * feat: add `Cache-Control: no-store` to prevent caching of list responses -# v0.7.21 +## v0.7.21 * feat: add `_c3_data_url` support to account endpoint -# v0.7.20 +## v0.7.20 * upd: Changes the type of some of the fields of the Graph type to interface{}. These fields can be set to nil, an empty string "", or a string containing a number that will parse to a float. This is needed to support special rules for setting these fields to null via the API /graph endpoint. -# v0.7.19 +## v0.7.19 * feat: add support for `_account_uuid` attribute to account -# v0.7.18 +## v0.7.18 * feat: clean tags - remove blanks and duplicates, lowercase, and sort * fix: debug messages @@ -28,56 +40,56 @@ setting these fields to null via the API /graph endpoint. * feat(deps): bump go-retryablehttp from 0.7.0 to 0.7.1 * chore: Merge remote-tracking branch 'upstream/master' -# v0.7.17 +## v0.7.17 * upd: Implements a new DisableRetries configuration setting to allow the retry functionality to be disabled when needed. -# v0.7.16 +## v0.7.16 * upd: Adds the `default_dashboard_uuid` and `default_dashboard_type` optional fields to the Account type. And, removes the `account_default` field from the Dashboard type. This is to reflect the changes made to the dashboard defaulting process in the Circonus API. -# v0.7.15 +## v0.7.15 * fix: do not allow blank tags through on check bundle creation -# v0.7.14 +## v0.7.14 * add: `MaxRetries`, `MinRetryDelay`, and `MaxRetryDelay` settings -# v0.7.13 +## v0.7.13 * upd: dependencies -# v0.7.12 +## v0.7.12 * fix: lint issues * add: lint config and workflow * upd: squelch empty data debug msg -# v0.7.11 +## v0.7.11 * add: new `user_json` field support to rule_set * upd: make timeout/retry tests optional (env var) -# v0.7.10 +## v0.7.10 * upd: add 429 rate limit tests * upd: dependency retryablehttp, to use Retry-After header on 429s * upd: increase exp backoff range 1-60 -# v0.7.9 +## v0.7.9 * add: additional SMTP check attributes to support proxies -# v0.7.8 +## v0.7.8 * add: `lookup_key` to rule_set -# v0.7.7 +## v0.7.7 * fix: lint simplifications in tests * upd: dependency @@ -86,94 +98,94 @@ process in the Circonus API. * upd: remove RuleSet.Derive (deprecated) * upd: remove Tags and Units from metrics (deprecated) -# v0.7.6 +## v0.7.6 * fix: skip backoff for HTTP/400 * fix: change `Dashboard.Settings.ShowValue` to `*bool` to facilitate intentional `false` not being omitted -# v0.7.5 +## v0.7.5 * fix: break, return error on 404 result with exponential backoff -# v0.7.4 +## v0.7.4 * fix: `metric_type` field on dashboard state widget -# v0.7.3 +## v0.7.3 * add: state widget to dashboard -# v0.7.2 +## v0.7.2 * fix: `/rule_set_group` formulas, raise_severity api bug; mixed types - POST takes an int and returns a string. GET returns an int -# v0.7.1 +## v0.7.1 * fix: typo in rule_set_group matching_severities -# v0.7.0 +## v0.7.0 * fix: forecast gauge `flip` required, remove omitempty * upd: range hi/low switched from `int` to `*int` so that 0 can be used, but common setting attribute still omitted for widgets which do not support the range settings -# v0.6.9 +## v0.6.9 * fix: contact_group.`alert_formats`, individual fields should be omitted if not set (was `string|null`, now `string|omit`) * add: contact_group.`always_send_clear` attribute, bool * add: contact_group.`group_type` attribute, string -# v0.6.8 +## v0.6.8 * upd: force logging of json being sent to api -# v0.6.7 +## v0.6.7 * add: new rule_set attributes `_host`, `filter`, `metric_pattern`, and `name`. * upd: go1.13 -# v0.6.6 +## v0.6.6 -* fix: typo on struct attr 'omitempt' +* fix: typo on struct attr 'omitempty' -# v0.6.5 +## v0.6.5 * upd: dependencies * upd: stricter linting * add: `_reverse_urls` attribute to check object -# v0.6.4 +## v0.6.4 * fix: graph.datapoint.alpha - doc:floating point number, api:string -# v0.6.3 +## v0.6.3 * upd: remove tests for invalid cids * fix: validate cids on prefix only to compensate for breaking change to rule_set cid in public v2 api -# v0.6.2 +## v0.6.2 * upd: dependencies (retryablehttp) -# v0.6.1 +## v0.6.1 * add: full overlay test suite to `examples/graph/overlays` * fix: incorrect attribute types in graph overlays (docs vs what api actually returns) -# v0.6.0 +## v0.6.0 * fix: graph structures incorrectly represented nesting of overlay sets -# v0.5.4 +## v0.5.4 * add: `search` (`*string`) attribute to graph datapoint * upd: `cluster_ip` (`*string`) can be string OR null * add: `cluster_ip` attribute to broker details -# v0.5.3 +## v0.5.3 * upd: use std log for retryablehttp until dependency releases Logger interface -# v0.5.2 +## v0.5.2 * upd: support any logging package with a `Printf` method via `Logger` interface rather than forcing `log.Logger` from standard log package * upd: remove explicit log level classifications from logging messages @@ -184,10 +196,10 @@ process in the Circonus API. * fix: remove `NewAlert` - not applicable, alerts are not created via the API * add: ensure all `Delete*ByCID` methods have CID corrections so short CIDs can be passed -# v0.5.1 +## v0.5.1 * upd: retryablehttp to start using versions that are now available instead of tracking master -# v0.5.0 +## v0.5.0 -* Initial - promoted from github.com/circonus-labs/circonus-gometrics/api to an independant package +* Initial - promoted from github.com/circonus-labs/circonus-gometrics/api to an independent package diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md new file mode 100644 index 0000000..7a17b9f --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CHANGELOG.md @@ -0,0 +1,15 @@ +## 0.7.5 (Nov 8, 2023) + +BUG FIXES + +- client: fixes an issue where the request body is not preserved on temporary redirects or re-established HTTP/2 connections [GH-207] + +## 0.7.4 (Jun 6, 2023) + +BUG FIXES + +- client: fixing an issue where the Content-Type header wouldn't be sent with an empty payload when using HTTP/2 [GH-194] + +## 0.7.3 (May 15, 2023) + +Initial release diff --git a/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS new file mode 100644 index 0000000..f8389c9 --- /dev/null +++ b/vendor/github.com/hashicorp/go-retryablehttp/CODEOWNERS @@ -0,0 +1 @@ +* @hashicorp/release-engineering \ No newline at end of file diff --git a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE index e87a115..f4f97ee 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/LICENSE +++ b/vendor/github.com/hashicorp/go-retryablehttp/LICENSE @@ -1,3 +1,5 @@ +Copyright (c) 2015 HashiCorp, Inc. + Mozilla Public License, version 2.0 1. Definitions diff --git a/vendor/github.com/hashicorp/go-retryablehttp/client.go b/vendor/github.com/hashicorp/go-retryablehttp/client.go index f40d241..c9edbd0 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/client.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/client.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + // Package retryablehttp provides a familiar HTTP client interface with // automatic retries and exponential backoff. It is a thin wrapper over the // standard net/http client library and exposes nearly the same public API. @@ -157,6 +160,20 @@ func (r *Request) SetBody(rawBody interface{}) error { } r.body = bodyReader r.ContentLength = contentLength + if bodyReader != nil { + r.GetBody = func() (io.ReadCloser, error) { + body, err := bodyReader() + if err != nil { + return nil, err + } + if rc, ok := body.(io.ReadCloser); ok { + return rc, nil + } + return io.NopCloser(body), nil + } + } else { + r.GetBody = func() (io.ReadCloser, error) { return http.NoBody, nil } + } return nil } @@ -257,10 +274,17 @@ func getBodyReaderAndContentLength(rawBody interface{}) (ReaderFunc, int64, erro if err != nil { return nil, 0, err } - bodyReader = func() (io.Reader, error) { - return bytes.NewReader(buf), nil + if len(buf) == 0 { + bodyReader = func() (io.Reader, error) { + return http.NoBody, nil + } + contentLength = 0 + } else { + bodyReader = func() (io.Reader, error) { + return bytes.NewReader(buf), nil + } + contentLength = int64(len(buf)) } - contentLength = int64(len(buf)) // No body provided, nothing to do case nil: @@ -292,18 +316,19 @@ func NewRequest(method, url string, rawBody interface{}) (*Request, error) { // The context controls the entire lifetime of a request and its response: // obtaining a connection, sending the request, and reading the response headers and body. func NewRequestWithContext(ctx context.Context, method, url string, rawBody interface{}) (*Request, error) { - bodyReader, contentLength, err := getBodyReaderAndContentLength(rawBody) + httpReq, err := http.NewRequestWithContext(ctx, method, url, nil) if err != nil { return nil, err } - httpReq, err := http.NewRequestWithContext(ctx, method, url, nil) - if err != nil { + req := &Request{ + Request: httpReq, + } + if err := req.SetBody(rawBody); err != nil { return nil, err } - httpReq.ContentLength = contentLength - return &Request{body: bodyReader, Request: httpReq}, nil + return req, nil } // Logger interface allows to use other loggers than diff --git a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go index 8f3ee35..8c407ad 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/roundtripper.go @@ -1,3 +1,6 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + package retryablehttp import ( diff --git a/vendor/modules.txt b/vendor/modules.txt index 8bba29d..b401b9b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -14,7 +14,7 @@ github.com/alecthomas/units ## explicit; go 1.14 github.com/circonus-labs/circonus-gometrics/v3 github.com/circonus-labs/circonus-gometrics/v3/checkmgr -# github.com/circonus-labs/go-apiclient v0.7.23 +# github.com/circonus-labs/go-apiclient v0.7.24 ## explicit; go 1.17 github.com/circonus-labs/go-apiclient github.com/circonus-labs/go-apiclient/config @@ -74,7 +74,7 @@ github.com/google/uuid # github.com/hashicorp/go-cleanhttp v0.5.2 ## explicit; go 1.13 github.com/hashicorp/go-cleanhttp -# github.com/hashicorp/go-retryablehttp v0.7.2 +# github.com/hashicorp/go-retryablehttp v0.7.5 ## explicit; go 1.13 github.com/hashicorp/go-retryablehttp # github.com/hashicorp/go-version v1.6.0