MCPcopy
hub / github.com/segmentio/kafka-go / buildSignedMap

Function buildSignedMap

sasl/aws_msk_iam_v2/msk_iam.go:139–155  ·  view source on GitHub ↗

buildSignedMap builds signed string map which will be used to authenticate with MSK.

(u *url.URL, header http.Header)

Source from the content-addressed store, hash-verified

137
138// buildSignedMap builds signed string map which will be used to authenticate with MSK.
139func buildSignedMap(u *url.URL, header http.Header) map[string]string {
140 signedMap := map[string]string{
141 signVersionKey: signVersion,
142 signHostKey: u.Host,
143 signUserAgentKey: signUserAgent,
144 signActionKey: signAction,
145 }
146 // The protocol requires lowercase keys.
147 for key, vals := range header {
148 signedMap[strings.ToLower(key)] = vals[0]
149 }
150 for key, vals := range u.Query() {
151 signedMap[strings.ToLower(key)] = vals[0]
152 }
153
154 return signedMap
155}
156
157// defaultExpiry set default expiration time if user doesn't define Mechanism.Expiry.
158func defaultExpiry(v time.Duration) time.Duration {

Callers 1

preSignMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected