middleware

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AWSContextKey contextkey

Functions

func RequireAWSCredentials

func RequireAWSCredentials() cli.BeforeFunc

RequireAWSCredentials attempts to load aws credentials, if they don't exist, iot returns a clio.CLIError This function will set the AWS config in context under the key cfaws.AWSConfigContextKey use cfaws.ConfigFromContextOrDefault(ctx) to retrieve the value

func SetAWSContextInContext

func SetAWSContextInContext(ctx context.Context, cfg AWSContext) context.Context

func ShouldShowHelp

func ShouldShowHelp(c *cli.Context) bool

func WithBeforeFuncs

func WithBeforeFuncs(cmd *cli.Command, funcs ...cli.BeforeFunc) *cli.Command

Types

type AWSContext

type AWSContext struct {
	Config aws.Config
}

func AWSContextFromContext

func AWSContextFromContext(ctx context.Context) (AWSContext, error)

AWSContextFromContext requires the RequireAWSCredentials middleware to have run it will include the config and the account id for the current credentials

func (*AWSContext) Account

func (c *AWSContext) Account(ctx context.Context) (string, error)

Account calls the STS API to determine the account ID the credentials are associated with.

Jump to

Keyboard shortcuts

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