signer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 17 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ActionType           = "Action"                     // ActionType represents the key for the action type in the request.
	ActionName           = "kafka-cluster:Connect"      // ActionName represents the specific action name for connecting to a Kafka cluster.
	SigningName          = "kafka-cluster"              // SigningName represents the signing name for the Kafka cluster.
	UserAgentKey         = "User-Agent"                 // UserAgentKey represents the key for the User-Agent parameter in the request.
	LibName              = "aws-msk-iam-sasl-signer-go" // LibName represents the name of the library.
	ExpiresQueryKey      = "X-Amz-Expires"              // ExpiresQueryKey represents the key for the expiration time in the query parameters.
	DefaultSessionName   = "MSKSASLDefaultSession"      // DefaultSessionName represents the default session name for assuming a role.
	DefaultExpirySeconds = 900                          // DefaultExpirySeconds represents the default expiration time in seconds.
)

Variables

View Source
var (
	AwsDebugCreds = false // AwsDebugCreds flag indicates whether credentials should be debugged
)

Functions

func GenerateAuthToken

func GenerateAuthToken(ctx context.Context, region string) (string, int64, error)

GenerateAuthToken generates base64 encoded signed url as auth token from default credentials. Loads the IAM credentials from default credentials provider chain.

func GenerateAuthTokenFromCredentialsProvider

func GenerateAuthTokenFromCredentialsProvider(
	ctx context.Context, region string, credentialsProvider aws.CredentialsProvider,
) (string, int64, error)

GenerateAuthTokenFromCredentialsProvider generates base64 encoded signed url as auth token by loading IAM credentials from an aws credentials provider

func GenerateAuthTokenFromProfile

func GenerateAuthTokenFromProfile(ctx context.Context, region string, awsProfile string) (string, int64, error)

GenerateAuthTokenFromProfile generates base64 encoded signed url as auth token by loading IAM credentials from an AWS named profile.

func GenerateAuthTokenFromRole

func GenerateAuthTokenFromRole(
	ctx context.Context, region string, roleArn string, stsSessionName string,
) (string, int64, error)

GenerateAuthTokenFromRole generates base64 encoded signed url as auth token by loading IAM credentials from an aws role Arn

Types

This section is empty.

Jump to

Keyboard shortcuts

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