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

Method Start

sasl/aws_msk_iam_v2/msk_iam.go:78–86  ·  view source on GitHub ↗

Start produces the authentication values required for AWS_MSK_IAM. It produces the following json as a byte array, making use of the aws-sdk to produce the signed output. { "version" : "2020_10_22", "host" : "<broker host>", "user-agent": "<user agent string from the client>", "action"

(ctx context.Context)

Source from the content-addressed store, hash-verified

76// "x-amz-signature" : "<AWS SigV4 signature computed by the client>"
77// }
78func (m *Mechanism) Start(ctx context.Context) (sess sasl.StateMachine, ir []byte, err error) {
79 signedMap, err := m.preSign(ctx)
80 if err != nil {
81 return nil, nil, err
82 }
83
84 signedJson, err := json.Marshal(signedMap)
85 return m, signedJson, err
86}
87
88// preSign produces the authentication values required for AWS_MSK_IAM.
89func (m *Mechanism) preSign(ctx context.Context) (map[string]string, error) {

Callers 1

TestAwsMskIamMechanismFunction · 0.95

Implementers 4

mechanismsasl/scram/scram.go
Mechanismsasl/aws_msk_iam_v2/msk_iam.go
Mechanismsasl/aws_msk_iam/msk_iam.go
Mechanismsasl/plain/plain.go

Calls 2

preSignMethod · 0.95
MarshalMethod · 0.80

Tested by 1

TestAwsMskIamMechanismFunction · 0.76