Documentation ¶
Index ¶
- Constants
- Variables
- func DumpRequest(r *http.Request) string
- func DumpResponse(r *http.Response) string
- func HideSecureHeaders(dump []byte) []byte
- func IsAWSError(err error, code string) bool
- type Account
- func (a *Account) ARN() string
- func (a *Account) Alias() string
- func (a *Account) Aliases() []string
- func (a *Account) DisabledRegions() []string
- func (a *Account) ID() string
- func (a *Account) Regions() []string
- func (a *Account) ResourceTypeToServiceType(regionName, resourceType string) string
- func (a *Account) UserID() string
- type Credentials
- func (c *Credentials) HasAwsCredentials() bool
- func (c *Credentials) HasKeys() bool
- func (c *Credentials) HasProfile() bool
- func (c *Credentials) NewConfig(ctx context.Context, region, serviceType string) (*aws.Config, error)
- func (c *Credentials) NewSession(region, serviceType string) (*session.Session, error)
- func (c *Credentials) Validate() error
- type SkipGlobal
Constants ¶
const Default = "default"
Default is a generic constant for the word default
const ErrCodeInvalidAction = "InvalidAction"
const ErrCodeOperationNotPermitted = "OperationNotPermitted"
const (
GlobalRegionID = "global"
)
const StateDeleted = "deleted"
StateDeleted is a generic constant for the word deleted for state
const StateDeleting = "deleting"
StateDeleting is a generic constant for the word deleting for state
const StateRejected = "rejected"
StateRejected is a generic constant for the word rejected for state
Variables ¶
var ( // DefaultRegionID The default region. Can be customized for non AWS implementations DefaultRegionID = "us-east-1" // DefaultAWSPartitionID The default aws partition. Can be customized for non AWS implementations DefaultAWSPartitionID = "aws" )
var (
RESecretHeader = regexp.MustCompile(`(?m:^([^:]*(Auth|Security)[^:]*):.*$)`)
)
Functions ¶
func DumpRequest ¶
func DumpResponse ¶
func HideSecureHeaders ¶
func IsAWSError ¶
Types ¶
type Account ¶
type Account struct { *Credentials // contains filtered or unexported fields }
func NewAccount ¶
func NewAccount(creds *Credentials, endpoints config.CustomEndpoints) (*Account, error)
func (*Account) DisabledRegions ¶
DisabledRegions returns the list of regions that are disabled for the account
func (*Account) ResourceTypeToServiceType ¶
type Credentials ¶
type Credentials struct { Profile string AccessKeyID string SecretAccessKey string SessionToken string AssumeRoleArn string ExternalID string RoleSessionName string Credentials *credentials.Credentials CustomEndpoints config.CustomEndpoints // contains filtered or unexported fields }
func (*Credentials) HasAwsCredentials ¶
func (c *Credentials) HasAwsCredentials() bool
func (*Credentials) HasKeys ¶
func (c *Credentials) HasKeys() bool
func (*Credentials) HasProfile ¶
func (c *Credentials) HasProfile() bool
func (*Credentials) NewSession ¶
func (c *Credentials) NewSession(region, serviceType string) (*session.Session, error)
func (*Credentials) Validate ¶
func (c *Credentials) Validate() error
type SkipGlobal ¶ added in v3.35.0
type SkipGlobal struct{}
SkipGlobal returns ErrSkipRequest when operating in the global pseudo-region.
FUTURE: define mechanism for allowing specific resources, such as those in IAM, to override this skip.
The simplest way to do this would be to remove this middleware through functional options on relevant operations. e.g.:
func isGlobalResource(o *iam.Options) { o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { stack.Initialize.Remove(config.SkipGlobal{}.ID()) }) } // per-operation out, err := svc.ListRoles(context.Background(), nil, isGlobalResource) // on a client, if you know you're only operating in the context of global resources svc := iam.NewFromConfig(cfg, isGlobalResource)
You could also define some kind of "is global resource" Context flag, which SkipGlobal could react to. That may be preferrable to having SkipGlobal be exported from this package.
func (SkipGlobal) HandleInitialize ¶ added in v3.35.0
func (SkipGlobal) HandleInitialize( ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, ) ( out middleware.InitializeOutput, md middleware.Metadata, err error, )
func (SkipGlobal) ID ¶ added in v3.35.0
func (SkipGlobal) ID() string