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 OpenSecurityFile(mode ECSFileMode) (*os.File, error)
- func SecurityFilePath(mode ECSFileMode) string
- 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)
- func WriteSecurityConfig(f *os.File, privateKey, certChain, bearerToken string) error
- type ECSClientRequest
- type ECSFileMode
- type ECSSecurity
- type ListProfilesResponse
- type Message
Constants ¶
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" )
const ( CONTAINER_MOUNT_POINT = "/app/.aws-sso/mnt" CONTAINER_NAMED_FILE = "/app/.aws-sso/mnt/docker-ecs" HOST_MOUNT_POINT_FMT = "%s/.aws-sso/mnt" HOST_NAMED_FILE_FMT = "%s/.aws-sso/mnt/docker-ecs" )
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 OpenSecurityFile ¶ added in v1.17.0
func OpenSecurityFile(mode ECSFileMode) (*os.File, error)
OpenSecurityFile opens the security file for reading (FILE_READ) or writing (FILE_WRITE)
func SecurityFilePath ¶ added in v1.17.0
func SecurityFilePath(mode ECSFileMode) string
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 ECSFileMode ¶ added in v1.17.0
type ECSFileMode int
const ( READ_ONLY ECSFileMode = ECSFileMode(os.O_RDONLY) WRITE_ONLY ECSFileMode = ECSFileMode(os.O_WRONLY | os.O_CREATE | os.O_TRUNC) )
type ECSSecurity ¶ added in v1.17.0
type ECSSecurity struct {
PrivateKey string `json:"privateKey"`
CertChain string `json:"certChain"`
BearerToken string `json:"bearerToken"`
}
func ReadSecurityConfig ¶ added in v1.17.0
func ReadSecurityConfig(f *os.File) (*ECSSecurity, error)
ReadSecurityConfig reads the security configuration from a regular file and then deletes it.
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