awssession

package
v0.0.1-really Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWithTicket

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.

Types

type Provider

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

func (p *Provider) IsExpired() bool

IsExpired implements the github.com/aws/aws-sdk-go/aws/credentials.Provider interface.

func (*Provider) Retrieve

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

Retrieve implements the github.com/aws/aws-sdk-go/aws/credentials.Provider interface.

Jump to

Keyboard shortcuts

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