Documentation
¶
Index ¶
- Variables
- func AssumeRole(ctx *gin.Context)
- func GetConsoleUrl(ctx *gin.Context)
- func GetUserInfo(ctx *gin.Context)
- type AccessType
- type AssumeRoleInput
- type AssumeRoleOutput
- type Error
- type GetConsoleUrlInput
- type GetConsoleUrlOutput
- type GetUserInfoOutput
- type IamCredentials
- type JSONError
- type JSONResponse
- type RestError
- type SignInTokenResponse
- type UrlCredentials
- type XMLResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var AccessTypes = [2]string{string(AccessTypeAdmin), string(AccessTypeReadOnly)}
View Source
var ForbiddenExceptionMessage = "Forbidden"
View Source
var InternalServerExceptionMessage = "Internal Server Error"
View Source
var InvalidRequestExceptionMessage = "Bad Request"
Functions ¶
func AssumeRole ¶
func GetConsoleUrl ¶
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
Types ¶
type AccessType ¶
type AccessType string
const ( AccessTypeReadOnly AccessType = "ReadOnly" AccessTypeAdmin AccessType = "Administrator" )
type AssumeRoleInput ¶
type AssumeRoleOutput ¶
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 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 XMLResponse ¶ added in v1.0.1
Click to show internal directories.
Click to hide internal directories.