v1

package
v0.0.0-...-b702281 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// ErrNoIDInRequest is the error code indicating that no ID was specified
	ErrNoIDInRequest = "NoIdInRequest"

	// ErrInvalidIDInRequest is the error code indicating that the ID was invalid
	ErrInvalidIDInRequest = "InvalidIdInRequest"

	// ErrNoCredentialsAssociated is the error code indicating no credentials are
	// associated with the specified ID
	ErrNoCredentialsAssociated = "NoCredentialsAssociated"

	// ErrCredentialsUninitialized is the error code indicating that credentials were
	// not properly initialized.  This may happen immediately after the agent is
	// started, before it has completed state reconciliation.
	ErrCredentialsUninitialized = "CredentialsUninitialized"

	// ErrInternalServer is the error indicating something generic went wrong
	ErrInternalServer = "InternalServerError"

	// CredentialsPath specifies the relative URI path for serving task IAM credentials
	CredentialsPath = credentials.V1CredentialsPath
)

Variables

This section is empty.

Functions

func CredentialsHandler

func CredentialsHandler(
	credentialsManager credentials.Manager,
	auditLogger auditinterface.AuditLogger,
) func(http.ResponseWriter, *http.Request)

CredentialsHandler creates response for the 'v1/credentials' API. It returns a JSON response containing credentials when found. The HTTP status code of 400 is returned otherwise.

func CredentialsHandlerImpl

func CredentialsHandlerImpl(
	w http.ResponseWriter,
	r *http.Request,
	auditLogger auditinterface.AuditLogger,
	credentialsManager credentials.Manager,
	credentialsID string,
	errPrefix string,
)

CredentialsHandlerImpl is the major logic in CredentialsHandler, abstract this out because v2.CredentialsHandler also uses the same logic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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