func()

in sigv4/sigv4.go [84:104]


func (p signingAuthenticator) Challenge(req []byte) ([]byte, gocql.Authenticator, error) {
	nonce, err := internal.ExtractNonce(req)
	if err != nil {
		return nil, nil, err
	}

	// init the time if not provided.
	var t time.Time = p.currentTime
	if t.IsZero() {
		t = time.Now().UTC()
	}

	signedResponse := internal.BuildSignedResponse(p.region, nonce, p.accessKeyId,
		p.secretAccessKey, p.sessionToken, t)

	// copy this to a sepearte byte array to prevent some slicing corruption with how the framer object works
	resp := make([]byte, len(signedResponse))
	copy(resp, []byte(signedResponse))

	return resp, nil, nil
}