mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/awsapi: fixes sign encoding (#3183)
* lib/awsapi: fixes sign encoding previously white spaces at filter were incorrectly encoded encoding tip was copied from aws signing lib For example, the space character must be encoded as %20 (not using '+', as some encoding schemes do) https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3171 * Update lib/awsapi/sign.go Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
This commit is contained in:
parent
dbf0ef5b38
commit
64c0133b88
2 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,7 @@ The following tip changes can be tested by building VictoriaMetrics components f
|
||||||
|
|
||||||
* BUGFIX: do not export stale metrics via [/federate api](https://docs.victoriametrics.com/#federation) after the staleness markers. Previously such metrics were exported with `NaN` values. this could break some setups. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3185).
|
* BUGFIX: do not export stale metrics via [/federate api](https://docs.victoriametrics.com/#federation) after the staleness markers. Previously such metrics were exported with `NaN` values. this could break some setups. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3185).
|
||||||
* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): properly handle request paths ending with `/` such as `/vmui/`. Previously `vmui` was dropping the traling `/`, which could prevent from using `vmui` via `vmauth`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1752).
|
* BUGFIX: [vmauth](https://docs.victoriametrics.com/vmauth.html): properly handle request paths ending with `/` such as `/vmui/`. Previously `vmui` was dropping the traling `/`, which could prevent from using `vmui` via `vmauth`. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1752).
|
||||||
|
* BUGFIX: [vmagent](https://docs.victoriametrics.com/vmagent.html): properly encode query params for aws signed requests, use `%20` instead of `+` as api requires. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3171).
|
||||||
|
|
||||||
|
|
||||||
## [v1.79.3](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.79.3)
|
## [v1.79.3](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.79.3)
|
||||||
|
|
|
@ -41,6 +41,9 @@ func signRequestWithTime(req *http.Request, service, region, payloadHash string,
|
||||||
datestamp := t.Format("20060102")
|
datestamp := t.Format("20060102")
|
||||||
canonicalURL := uri.Path
|
canonicalURL := uri.Path
|
||||||
canonicalQS := uri.Query().Encode()
|
canonicalQS := uri.Query().Encode()
|
||||||
|
// Replace "%20" with "+" according to AWS requirements.
|
||||||
|
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/3171
|
||||||
|
canonicalQS = strings.ReplaceAll(canonicalQS, "+", "%20")
|
||||||
|
|
||||||
canonicalHeaders := fmt.Sprintf("host:%s\nx-amz-date:%s\n", uri.Host, amzdate)
|
canonicalHeaders := fmt.Sprintf("host:%s\nx-amz-date:%s\n", uri.Host, amzdate)
|
||||||
signedHeaders := "host;x-amz-date"
|
signedHeaders := "host;x-amz-date"
|
||||||
|
|
Loading…
Reference in a new issue