base: Index | Files

package awssession

import ""

Package awssession provides a simple way to obtain AWS session.Session using GRAIL tickets.


Package Files

provider.go session.go

func NewWithTicket Uses

func NewWithTicket(ctx *context.T, ticketPath string, cfgs ...*aws.Config) (*session.Session, error)

NewWithTicket creates a AWS session using a GRAIL ticket. This is helper that uses inside a Provider with a timeout of 10 seconds. The region will be set to 'us-west-2' and can be overridden by passing an appropriate *aws.Config.

type Provider Uses

type Provider struct {
    // Ctx contains the Vanadium context used to make the call to ticket-server
    // in response to calls to Retrieve(). Canceling the context will cause the
    // calls to Retrieve() to fail and IsExpire() to always return true.
    Ctx *context.T

    // Timeout indicates what timeout to set for the Vanadium calls.
    Timeout time.Duration

    // Ticket contains the last GRAIL ticket retrieved by a call to Retrieve().
    Ticket ticket.Ticket

    // Expiration indicates when the AWS credentials will expire.
    Expiration time.Time

    // TicketPath indicates what Vanadium object name to use to retrieve the
    // ticket.
    TicketPath string

    // ExpiryWindow allows triggering a refresh before the AWS credentials
    // actually expire.
    ExpiryWindow time.Duration

Provider implements the aws/credentials.Provider interface using a GRAIL ticket.

func (*Provider) IsExpired Uses

func (p *Provider) IsExpired() bool

IsExpired implements the interface.

func (*Provider) Retrieve Uses

func (p *Provider) Retrieve() (credentials.Value, error)

Retrieve implements the interface.

Package awssession imports 8 packages (graph) and is imported by 1 packages. Updated 2019-01-08. Refresh now. Tools for package owners.