creds

package
v0.0.60 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

https://github.com/youyo/awslogin/blob/master/awslogin.go

Index

Constants

View Source
const MAX_ACCESS_DURATION = 900 // Lambda functions should be able to do their job in min allowed time.
View Source
const MAX_SIGNIN_URL_DURATION = 3600
View Source
const MIN_SIGNIN_URL_DURATION = 901 // Will be reduced by one.

Signin URL duration in Seconds

View Source
const ORG_ACCT_SESSION = "OrgAcctAccess"
View Source
const REGION = "us-east-1"
View Source
const (
	// SigninBaseURL is request endpoint
	SigninBaseURL string = "https://signin.aws.amazon.com/federation"
)

Variables

This section is empty.

Functions

func AdjustDuration

func AdjustDuration(duration int64) int64

//////////////////

func BuildSigninTokenRequestURL

func BuildSigninTokenRequestURL(tempCreds *TemporaryCredentials, labDuration string) (requestUrl string)

//////////////////

func BuildSigninURL

func BuildSigninURL(signinToken string) (signinUrl string)

//////////////////

func CreateSigninUrl

func CreateSigninUrl(ctx context.Context, labDuration int64, labRoleArn string) (string, error)

//////////////////

func CreateUserAcctAccessCfg

func CreateUserAcctAccessCfg(ctx context.Context, labRoleArn string) *aws.Config

/////////////////////

func RequestSigninToken

func RequestSigninToken(requestUrl string) (signinToken string, err error)

//////////////////

Types

type SigninToken

type SigninToken struct {
	Token string `json:"SigninToken"`
}

type TemporaryCredentials

type TemporaryCredentials struct {
	SessionID      string `json:"sessionId"`
	SessionKey     string `json:"sessionKey"`
	SessionToken   string `json:"sessionToken"`
	SessionExpires int64  `json:"sessionExpires"`
}

func GetLabRoleTempCreds

func GetLabRoleTempCreds(ctx context.Context, labDuration int64, labRoleArn, sessionName string) (*TemporaryCredentials, error)

//////////////////

Jump to

Keyboard shortcuts

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