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)
| 76 | // "x-amz-signature" : "<AWS SigV4 signature computed by the client>" |
| 77 | // } |
| 78 | func (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. |
| 89 | func (m *Mechanism) preSign(ctx context.Context) (map[string]string, error) { |