...

Package auth

import "github.com/aws/smithy-go/auth"
Overview
Index
Subdirectories

Overview ▾

Package auth defines protocol-agnostic authentication types for smithy clients.

Constants

HTTP auth schemes

const (
    SchemeIDHTTPBasic  = "smithy.api#httpBasicAuth"
    SchemeIDHTTPDigest = "smithy.api#httpDigestAuth"
    SchemeIDHTTPBearer = "smithy.api#httpBearerAuth"
    SchemeIDHTTPAPIKey = "smithy.api#httpApiKeyAuth"
)

AWS auth schemes

const (
    SchemeIDSigV4  = "aws.auth#sigv4"
    SchemeIDSigV4A = "aws.auth#sigv4a"
)

Anonymous

const (
    SchemeIDAnonymous = "smithy.api#noAuth"
)

func SetAuthOptions

func SetAuthOptions(p *smithy.Properties, options []*Option)

SetAuthOptions sets auth Options on Properties.

type AnonymousIdentity

AnonymousIdentity is a sentinel to indicate no identity.

type AnonymousIdentity struct{}

func (*AnonymousIdentity) Expiration

func (*AnonymousIdentity) Expiration() time.Time

Expiration returns the zero value for time, as anonymous identity never expires.

type AnonymousIdentityResolver

AnonymousIdentityResolver returns AnonymousIdentity.

type AnonymousIdentityResolver struct{}

func (*AnonymousIdentityResolver) GetIdentity

func (*AnonymousIdentityResolver) GetIdentity(_ context.Context, _ smithy.Properties) (Identity, error)

GetIdentity returns AnonymousIdentity.

type Identity

Identity contains information that identifies who the user making the request is.

type Identity interface {
    Expiration() time.Time
}

type IdentityResolver

IdentityResolver defines the interface through which an Identity is retrieved.

type IdentityResolver interface {
    GetIdentity(context.Context, smithy.Properties) (Identity, error)
}

type IdentityResolverOptions

IdentityResolverOptions defines the interface through which an entity can be queried to retrieve an IdentityResolver for a given auth scheme.

type IdentityResolverOptions interface {
    GetIdentityResolver(schemeID string) IdentityResolver
}

type Option

Option represents a possible authentication method for an operation.

type Option struct {
    SchemeID           string
    IdentityProperties smithy.Properties
    SignerProperties   smithy.Properties
}

func GetAuthOptions

func GetAuthOptions(p *smithy.Properties) ([]*Option, bool)

GetAuthOptions gets auth Options from Properties.

Subdirectories

Name Synopsis
..
bearer Package bearer provides middleware and utilities for authenticating API operation calls with a Bearer Token.