v1

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: GPL-3.0 Imports: 20 Imported by: 2 modules, 1 package

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

Index

Constants

This section is empty.

Variables

View Source
var ForbiddenExceptionMessage = "Forbidden"
View Source
var InternalServerExceptionMessage = "Internal Server Error"
View Source
var InvalidRequestExceptionMessage = "Bad Request"
View Source
var UnauthorizedExceptionMessage = "Unauthorized"

Functions

func AssumeRole

func AssumeRole(ctx *gin.Context)

func GetConsoleUrl

func GetConsoleUrl(ctx *gin.Context)

https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html#STSConsoleLink_programPython This required that you be using IAM user credentials. Perhaps fetching from Secrets Manager then assuming role?

func GetUserInfo added in v1.0.1

func GetUserInfo(ctx *gin.Context)

Types

type AccessType

type AccessType string
const (
	AccessTypeReadOnly AccessType = "ReadOnly"
	AccessTypeAdmin    AccessType = "Administrator"
)

type AssumeRoleInput

type AssumeRoleInput struct {
	RoleArn         string `json:"roleArn" binding:"required" form:"roleArn"`
	SessionDuration int32  `json:"sessionDuration" binding:"required,numeric,min=900,max=43200" form:"sessionDuration"`
}

type AssumeRoleOutput

type AssumeRoleOutput struct {
	XMLResponse
	AccessKeyId     string `json:"accessKeyid"`
	SecretAccessKey string `json:"secretAccessKey"`
	SessionToken    string `json:"sessionToken"`
	Expiration      time.Time
}

type Error

type Error struct {
	Message string `json:"message"`
}

type GetConsoleUrlInput

type GetConsoleUrlInput struct {
	AccountId  string     `json:"accountId" binding:"required,numeric,len=12" form:"accountId"`
	AccessType AccessType `json:"accessType" binding:"required" form:"accessType"`
	Duration   int        `json:"duration" binding:"required,numeric,min=900,max=43200" form:"duration"`
}

type GetConsoleUrlOutput

type GetConsoleUrlOutput struct {
	XMLResponse
	ConsoleUrl string `json:"consoleUrl"`
}

type GetUserInfoOutput added in v1.0.1

type GetUserInfoOutput struct {
	XMLResponse
	Username string   `json:"username" type:"string"`
	Groups   []string `json:"groups" type:"slice"`
}

type IamCredentials

type IamCredentials struct {
	AccessKeyId     string `json:"AccessKeyId" binding:"required"`
	SecretAccessKey string `json:"SecretAccessKey" binding:"required"`
}

type JSONError added in v1.0.1

type JSONError struct {
	Error interface{} `json:"error" xml:"-"`
}

type JSONResponse added in v1.0.1

type JSONResponse[T any] struct {
	Data T `json:"data" xml:"-"`
}

type RestError

type RestError struct {
	XMLName xml.Name `xml:"Error" json:"-"`
	// json:"-" omits the field from marshalling
	Status int `json:"-" xml:"-"`
	Error
}

func BadRequestError

func BadRequestError() *RestError

func ForbiddenError

func ForbiddenError() *RestError

func InternalServerError

func InternalServerError() *RestError

func UnauthorizedError

func UnauthorizedError() *RestError

type SignInTokenResponse

type SignInTokenResponse struct {
	SignInToken string `json:"SigninToken" binding:"required"`
}

type UrlCredentials

type UrlCredentials struct {
	SessionId    string `json:"sessionId" url:"sessionId"`
	SessionKey   string `json:"sessionKey" url:"sessionKey"`
	SessionToken string `json:"sessionToken" url:"sessionToken"`
}

type XMLResponse added in v1.0.1

type XMLResponse struct {
	XMLName xml.Name `xml:"Data" json:"-"`
}

Jump to

Keyboard shortcuts

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