aws

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2024 License: BSD-3-Clause Imports: 14 Imported by: 24

Documentation

Overview

Package aws provides AWS_MSK_IAM sasl authentication as specified in the Java source.

The Java source can be found at https://github.com/aws/aws-msk-iam-auth.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ManagedStreamingIAM

func ManagedStreamingIAM(authFn func(context.Context) (Auth, error)) sasl.Mechanism

ManagedStreamingIAM returns a sasl mechanism that will call authFn whenever sasl authentication is needed. The returned Auth is used for a single session.

Types

type Auth

type Auth struct {
	// AccessKey is an AWS AccessKey.
	AccessKey string

	// AccessKey is an AWS SecretKey.
	SecretKey string

	// SessionToken, if non-empty, is a session / security token to use for
	// authentication.
	//
	// See the following link for more details:
	//
	//     https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html
	//
	SessionToken string

	// UserAgent is the user agent to for the client to use when connecting
	// to Kafka, overriding the default "franz-go/<runtime.Version()>/<hostname>".
	//
	// Setting a UserAgent allows authorizing based on the aws:UserAgent
	// condition key; see the following link for more details:
	//
	//     https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-useragent
	//
	UserAgent string
	// contains filtered or unexported fields
}

Auth contains an AWS AccessKey and SecretKey for authentication.

This client may add fields to this struct in the future if Kafka adds more capabilities to MSK IAM.

func (Auth) AsManagedStreamingIAMMechanism

func (a Auth) AsManagedStreamingIAMMechanism() sasl.Mechanism

AsManagedStreamingIAMMechanism returns a sasl mechanism that will use 'a' as credentials for all sasl sessions.

This is a shortcut for using the ManagedStreamingIAM function and is useful when you do not need to live-rotate credentials.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL