credentials

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CredentialsIDQueryParameterName is the name of GET query parameter for the task ID.
	CredentialsIDQueryParameterName = "id"

	// CredentialsPath is the path to the credentials handler.
	CredentialsPath = V2CredentialsPath

	V1CredentialsPath = "/v1/credentials"
	V2CredentialsPath = "/v2/credentials"

	// ApplicationRoleType specifies the credentials that are to be used by the
	// task itself
	ApplicationRoleType = "TaskApplication"

	// ExecutionRoleType specifies the credentials used for non task application
	// uses
	ExecutionRoleType = "TaskExecution"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IAMRoleCredentials

type IAMRoleCredentials struct {
	CredentialsID   string `json:"-"`
	RoleArn         string `json:"RoleArn"`
	AccessKeyID     string `json:"AccessKeyId"`
	SecretAccessKey string `json:"SecretAccessKey"`
	SessionToken    string `json:"Token"`
	// Expiration is a string instead of a timestamp. This is to avoid any loss of context
	// while marshalling/unmarshalling this field in the agent. The agent just echo's
	// whatever is sent by the backend.
	Expiration string `json:"Expiration"`
	// RoleType distinguishes between TaskRole and ExecutionRole for the
	// credentials that are sent from the backend
	RoleType string `json:"-"`
}

IAMRoleCredentials is used to save credentials sent by ACS

func IAMRoleCredentialsFromACS

func IAMRoleCredentialsFromACS(roleCredentials *ecsacs.IAMRoleCredentials, roleType string) IAMRoleCredentials

IAMRoleCredentialsFromACS translates ecsacs.IAMRoleCredentials object to api.IAMRoleCredentials

func (*IAMRoleCredentials) GenerateCredentialsEndpointRelativeURI

func (roleCredentials *IAMRoleCredentials) GenerateCredentialsEndpointRelativeURI() string

GenerateCredentialsEndpointRelativeURI generates the relative URI for the credentials endpoint, for a given task id.

type Manager

type Manager interface {
	SetTaskCredentials(*TaskIAMRoleCredentials) error
	GetTaskCredentials(string) (TaskIAMRoleCredentials, bool)
	RemoveCredentials(string)
}

Manager is responsible for saving and retrieving credentials. A single instance of the credentials manager is created in the agent, and shared between the task engine, acs and credentials handlers

func NewManager

func NewManager() Manager

NewManager creates a new credentials manager object

type TaskIAMRoleCredentials

type TaskIAMRoleCredentials struct {
	ARN                string
	IAMRoleCredentials IAMRoleCredentials
	// contains filtered or unexported fields
}

TaskIAMRoleCredentials wraps the task arn and the credentials object for the same

func (*TaskIAMRoleCredentials) GetIAMRoleCredentials added in v1.16.0

func (role *TaskIAMRoleCredentials) GetIAMRoleCredentials() IAMRoleCredentials

GetIAMRoleCredentials returns the IAM role credentials in the task IAM role struct

Directories

Path Synopsis
Package mock_credentials is a generated GoMock package.
Package mock_credentials is a generated GoMock package.

Jump to

Keyboard shortcuts

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