secretsmanagererrors

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// X-Auth-Token error code.
	AuthErrorCode = "X-Auth-Token is unauthorized"
)

Variables

View Source
var (
	// Errors for Auth.
	ErrClientNoAuthOpts     = errors.New("CLIENT_NO_AUTH_METHOD")
	ErrAuthTokenUnathorized = errors.New("AUTH_TOKEN_UNAUTHORIZED")

	// Errors for Secrets Service.
	ErrEmptySecretName         = errors.New("EMPTY_SECRET_NAME")
	ErrEmptySecretValue        = errors.New("EMPTY_SECRET_DESC")
	ErrCannotMarshalSecretBody = errors.New("CANNOT_MARSHAL_SECRET")

	// Errors for Certificates Service.
	ErrEmptyCertificateID           = errors.New("EMPTY_CERT_ID")
	ErrEmptyCertificateName         = errors.New("EMPTY_CERT_NAME")
	ErrEmptyPEMCertificate          = errors.New("EMPTY_CERT_PEM_CERT")
	ErrEmptyPEMPrivateKey           = errors.New("EMPTY_CERT_PEM_PK")
	ErrCannotMarshalCertificateBody = errors.New("CANNOT_MARSHAL_CERT")

	// SDK Common Errors.
	ErrInternalAppError     = errors.New("INTERNAL_APP_ERROR")
	ErrCannotDoRequest      = errors.New("CANNOT_DO_REQUEST")
	ErrCannotFormatEndpoint = errors.New("CANNOT_FORMAT_ENDPOINT")
	ErrCannotReadBody       = errors.New("CANNOT_READ_RESPONSE_BODY")
	ErrCannotUnmarshalBody  = errors.New("CANNOT_UNMARSHAL_JSON")

	// Errors from Backend.
	ErrBadRequestStatusText    = errors.New("INCORRECT_REQUEST")
	ErrInternalErrorStatusText = errors.New("INTERNAL_SERVER_ERROR")
	ErrUnauthorizedStatusText  = errors.New("UNAUTHORIZED")
	ErrForbiddenStatusText     = errors.New("FORBIDDEN")
	ErrOverQuotasStatusText    = errors.New("OVER_QUOTAS")
	ErrNotFoundStatusText      = errors.New("NOT_FOUND")
	ErrConflictStatusText      = errors.New("CONFLICT")
	ErrTooManyRequestsText     = errors.New("TOO_MANY_REQUESTS")
	ErrMethodNotAllowed        = errors.New("NOT_ALLOWED")

	ErrUnknown = errors.New("UNKNOWN_ERROR")
)

Functions

func GetError

func GetError(errorString string) error

Types

type ErrResponse

type ErrResponse struct {
	HTTPStatusCode int    `json:"-"`
	ErrorText      string `json:"error_text,omitempty"`
	StatusText     string `json:"status_text"`
}

ErrResponse — represents error returned from Backend responsible for Secrets & Certs services.

type Error

type Error struct {
	Err  error
	Desc string
}

Error — an error returned by the Secrets Manager SDK to user.

func (Error) Error

func (e Error) Error() string

func (Error) Is

func (e Error) Is(err error) bool

Jump to

Keyboard shortcuts

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