asmauth

package
v0.0.0-...-a080504 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// ResourceName is the name of the ASM auth resource
	ResourceName = "asm-auth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ASMAuthResource

type ASMAuthResource struct {
	// contains filtered or unexported fields
}

ASMAuthResource represents private registry credentials as a task resource. These credentials are stored in AWS Secrets Manager

func NewASMAuthResource

func NewASMAuthResource(taskARN string,
	asmRequirements []*apicontainer.ASMAuthData,
	executionCredentialsID string,
	credentialsManager credentials.Manager,
	asmClientCreator factory.ClientCreator) *ASMAuthResource

NewASMAuthResource creates a new ASMAuthResource object

func (*ASMAuthResource) ApplyTransition

func (auth *ASMAuthResource) ApplyTransition(nextState resourcestatus.ResourceStatus) error

ApplyTransition calls the function required to move to the specified status

func (*ASMAuthResource) BuildContainerDependency

func (auth *ASMAuthResource) BuildContainerDependency(containerName string, satisfied apicontainerstatus.ContainerStatus,
	dependent resourcestatus.ResourceStatus)

func (*ASMAuthResource) Cleanup

func (auth *ASMAuthResource) Cleanup() error

Cleanup removes the asm auth resource created for the task

func (*ASMAuthResource) Create

func (auth *ASMAuthResource) Create() error

Create fetches credentials from ASM

func (*ASMAuthResource) DependOnTaskNetwork

func (auth *ASMAuthResource) DependOnTaskNetwork() bool

func (*ASMAuthResource) DesiredTerminal

func (auth *ASMAuthResource) DesiredTerminal() bool

DesiredTerminal returns true if the cgroup's desired status is REMOVED

func (*ASMAuthResource) GetASMDockerAuthConfig

func (auth *ASMAuthResource) GetASMDockerAuthConfig(secretID string) (types.AuthConfig, bool)

GetASMDockerAuthConfig retrieves the docker private registry auth data from the task

func (*ASMAuthResource) GetAppliedStatus

func (auth *ASMAuthResource) GetAppliedStatus() resourcestatus.ResourceStatus

GetAppliedStatus safely returns the currently applied status of the resource

func (*ASMAuthResource) GetContainerDependencies

func (auth *ASMAuthResource) GetContainerDependencies(dependent resourcestatus.ResourceStatus) []apicontainer.ContainerDependency

func (*ASMAuthResource) GetCreatedAt

func (auth *ASMAuthResource) GetCreatedAt() time.Time

GetCreatedAt sets the timestamp for resource's creation time

func (*ASMAuthResource) GetDesiredStatus

func (auth *ASMAuthResource) GetDesiredStatus() resourcestatus.ResourceStatus

GetDesiredStatus safely returns the desired status of the task

func (*ASMAuthResource) GetExecutionCredentialsID

func (auth *ASMAuthResource) GetExecutionCredentialsID() string

GetExecutionCredentialsID returns the execution role's credential ID

func (*ASMAuthResource) GetKnownStatus

func (auth *ASMAuthResource) GetKnownStatus() resourcestatus.ResourceStatus

GetKnownStatus safely returns the currently known status of the task

func (*ASMAuthResource) GetName

func (auth *ASMAuthResource) GetName() string

GetName safely returns the name of the resource

func (*ASMAuthResource) GetRequiredASMResources

func (auth *ASMAuthResource) GetRequiredASMResources() []*apicontainer.ASMAuthData

GetRequiredASMResources returns the list of ASMAuthData that has to be retrieved from AWS Secrets Manager

func (*ASMAuthResource) GetTerminalReason

func (auth *ASMAuthResource) GetTerminalReason() string

GetTerminalReason returns an error string to propagate up through to task state change messages

func (*ASMAuthResource) Initialize

func (auth *ASMAuthResource) Initialize(resourceFields *taskresource.ResourceFields,
	taskKnownStatus status.TaskStatus,
	taskDesiredStatus status.TaskStatus)

func (*ASMAuthResource) KnownCreated

func (auth *ASMAuthResource) KnownCreated() bool

KnownCreated returns true if the cgroup's known status is CREATED

func (*ASMAuthResource) MarshalJSON

func (auth *ASMAuthResource) MarshalJSON() ([]byte, error)

MarshalJSON serialises the ASMAuthResource struct to JSON

func (*ASMAuthResource) NextKnownState

func (auth *ASMAuthResource) NextKnownState() resourcestatus.ResourceStatus

NextKnownState returns the state that the resource should progress to based on its `KnownState`.

func (*ASMAuthResource) PutASMDockerAuthConfig

func (auth *ASMAuthResource) PutASMDockerAuthConfig(secretID string, authCfg types.AuthConfig)

Stores provided docker auth config against the provided secret ID.

func (*ASMAuthResource) SetAppliedStatus

func (auth *ASMAuthResource) SetAppliedStatus(status resourcestatus.ResourceStatus) bool

SetAppliedStatus sets the applied status of resource and returns whether the resource is already in a transition

func (*ASMAuthResource) SetCreatedAt

func (auth *ASMAuthResource) SetCreatedAt(createdAt time.Time)

SetCreatedAt sets the timestamp for resource's creation time

func (*ASMAuthResource) SetDesiredStatus

func (auth *ASMAuthResource) SetDesiredStatus(status resourcestatus.ResourceStatus)

SetDesiredStatus safely sets the desired status of the resource

func (*ASMAuthResource) SetKnownStatus

func (auth *ASMAuthResource) SetKnownStatus(status resourcestatus.ResourceStatus)

SetKnownStatus safely sets the currently known status of the resource

func (*ASMAuthResource) StatusString

func (auth *ASMAuthResource) StatusString(status resourcestatus.ResourceStatus) string

StatusString returns the string of the cgroup resource status

func (*ASMAuthResource) SteadyState

func (auth *ASMAuthResource) SteadyState() resourcestatus.ResourceStatus

SteadyState returns the transition state of the resource defined as "ready"

func (*ASMAuthResource) TerminalStatus

func (auth *ASMAuthResource) TerminalStatus() resourcestatus.ResourceStatus

TerminalStatus returns the last transition state of cgroup

func (*ASMAuthResource) UnmarshalJSON

func (auth *ASMAuthResource) UnmarshalJSON(b []byte) error

UnmarshalJSON deserialises the raw JSON to a ASMAuthResource struct

type ASMAuthStatus

type ASMAuthStatus resourcestatus.ResourceStatus
const (
	// is the zero state of a task resource
	ASMAuthStatusNone ASMAuthStatus = iota
	// represents a task resource which has been created
	ASMAuthStatusCreated
	// represents a task resource which has been cleaned up
	ASMAuthStatusRemoved
)

func (*ASMAuthStatus) MarshalJSON

func (as *ASMAuthStatus) MarshalJSON() ([]byte, error)

MarshalJSON overrides the logic for JSON-encoding the ResourceStatus type

func (ASMAuthStatus) String

func (as ASMAuthStatus) String() string

StatusString returns a human readable string representation of this object

func (*ASMAuthStatus) UnmarshalJSON

func (as *ASMAuthStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON overrides the logic for parsing the JSON-encoded ResourceStatus data

Jump to

Keyboard shortcuts

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