Documentation ¶
Index ¶
- Constants
- func Expired(w http.ResponseWriter)
- func InternalServerErrror(w http.ResponseWriter, err error)
- func Invalid(w http.ResponseWriter)
- func JSONResponse(w http.ResponseWriter, jdata interface{})
- func OK(w http.ResponseWriter)
- func SetLogger(l *logrus.Logger)
- func Unavailable(w http.ResponseWriter)
- func WriteCreds(w http.ResponseWriter, creds *storage.RoleCredentials)
- func WriteListProfileResponse(w http.ResponseWriter, lpr ListProfilesResponse)
- func WriteListProfilesResponse(w http.ResponseWriter, lpr []ListProfilesResponse)
- func WriteMessage(w http.ResponseWriter, msg string, statusCode int)
- type ECSClientRequest
- type ListProfilesResponse
- type Message
Constants ¶
View Source
const ( SLOT_ROUTE = "/slot" // put/get/delete PROFILE_ROUTE = "/profile" // get name of default creds DEFAULT_ROUTE = "/" // put/get/delete: default credentials CHARSET_JSON = "application/json; charset=utf-8" )
Variables ¶
This section is empty.
Functions ¶
func InternalServerErrror ¶
func InternalServerErrror(w http.ResponseWriter, err error)
InternalServerErrror returns an internal server error response
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, jdata interface{})
JSONResponse return a JSON blob as a result
func Unavailable ¶
func Unavailable(w http.ResponseWriter)
Unavailable returns a credentials unavailable response
func WriteCreds ¶
func WriteCreds(w http.ResponseWriter, creds *storage.RoleCredentials)
WriteCreds returns the JSON of the provided creds to the HTTP client https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html
func WriteListProfileResponse ¶
func WriteListProfileResponse(w http.ResponseWriter, lpr ListProfilesResponse)
func WriteListProfilesResponse ¶
func WriteListProfilesResponse(w http.ResponseWriter, lpr []ListProfilesResponse)
func WriteMessage ¶
func WriteMessage(w http.ResponseWriter, msg string, statusCode int)
WriteMessage returns a JSON message to the caller with the appropriate HTTP Status Code
Types ¶
type ECSClientRequest ¶
type ECSClientRequest struct { Creds *storage.RoleCredentials `json:"Creds"` ProfileName string `json:"ProfileName"` }
func ReadClientRequest ¶
func ReadClientRequest(r *http.Request) (*ECSClientRequest, error)
ReadClientRequest unmarshals the client's request into our ClientRequest struct used to load new credentials into the server
func (*ECSClientRequest) Validate ¶
func (cr *ECSClientRequest) Validate() error
type ListProfilesResponse ¶
type ListProfilesResponse struct { ProfileName string `json:"ProfileName" header:"ProfileName"` AccountIdPad string `json:"AccountId" header:"AccountIdPad"` RoleName string `json:"RoleName" header:"RoleName"` Expiration int64 `json:"Expiration" header:"Expiration"` Expires string `json:"Expires" header:"Expires"` }
func NewListProfileRepsonse ¶
func NewListProfileRepsonse(cr *ECSClientRequest) ListProfilesResponse
type Message ¶
Use format as defined here: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds
Source Files ¶
Click to show internal directories.
Click to hide internal directories.