ecs

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

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 Expired

func Expired(w http.ResponseWriter)

Expired returns a credentials expired response

func InternalServerErrror

func InternalServerErrror(w http.ResponseWriter, err error)

InternalServerErrror returns an internal server error response

func Invalid

func Invalid(w http.ResponseWriter)

Invalid returns an invalid request response

func JSONResponse

func JSONResponse(w http.ResponseWriter, jdata interface{})

JSONResponse return a JSON blob as a result

func OK

func OK(w http.ResponseWriter)

OK returns an OK response

func SetLogger

func SetLogger(l *logrus.Logger)

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

func (ListProfilesResponse) GetHeader

func (lpr ListProfilesResponse) GetHeader(fieldName string) (string, error)

GetHeader is required for GenerateTable()

type Message

type Message struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

Use format as defined here: https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/credentials/endpointcreds

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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