src

Go monorepo.
git clone git://code.dwrz.net/src
Log | Files | Refs

auth.go (1005B)


      1 package http
      2 
      3 import (
      4 	"context"
      5 
      6 	smithy "github.com/aws/smithy-go"
      7 	"github.com/aws/smithy-go/auth"
      8 	"github.com/aws/smithy-go/eventstream"
      9 )
     10 
     11 // AuthScheme defines an HTTP authentication scheme.
     12 type AuthScheme interface {
     13 	SchemeID() string
     14 	IdentityResolver(auth.IdentityResolverOptions) auth.IdentityResolver
     15 	Signer() Signer
     16 }
     17 
     18 // Signer defines the interface through which HTTP requests are supplemented
     19 // with an Identity.
     20 type Signer interface {
     21 	SignRequest(context.Context, *Request, auth.Identity, smithy.Properties) error
     22 }
     23 
     24 // EventStreamSigner is an optional interface that a [Signer] can implement to
     25 // support signing of event stream messages. If the resolved auth scheme's
     26 // signer implements this interface, the event stream middleware will use it to
     27 // wrap the outbound message stream with a signing layer.
     28 type EventStreamSigner interface {
     29 	NewMessageSigner(ctx context.Context, r *Request, identity auth.Identity, props smithy.Properties) (eventstream.MessageSigner, error)
     30 }