apierror

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodNotAllowedCode    string = "METHOD_NOT_ALLOWED"
	MethodNotAllowedMessage string = "The resource requested does not support this HTTP verb"
	MethodNotAllowedStatus  int    = http.StatusMethodNotAllowed

	CouldNotParseBodyCode    string = "COULD_NOT_PARSE_BODY"
	CouldNotParseBodyMessage string = "The body of the request could not be parsed"
	CouldNotParseBodyStatus  int    = http.StatusBadRequest

	CouldNotReadBodyCode    string = "COULD_NOT_READ_BODY"
	CouldNotReadBodyMessage string = "The body of the request could not be read"
	CouldNotReadBodyStatus  int    = http.StatusInternalServerError

	InvalidUuidCode    string = "INVALID_UUID"
	InvalidUuidMessage string = "The supplied UUID is invalid"
	InvalidUuidStatus  int    = http.StatusBadRequest

	InvalidContentTypeCode    string = "INVALID_CONTENT_TYPE"
	InvalidContentTypeMessage string = "The content type supplied is not acceptable"
	InvalidContentTypeStatus  int    = http.StatusBadRequest
)
View Source
const (
	InvalidAuthCode    string = "INVALID_AUTH"
	InvalidAuthMessage string = "The authentication request failed"
	InvalidAuthStatus  int    = http.StatusUnauthorized

	InvalidAuthMethodCode    string = "INVALID_AUTH_METHOD"
	InvalidAuthMethodMessage string = "The supplied authentication method is not valid"
	InvalidAuthMethodStatus  int    = http.StatusBadRequest

	EnrollmentExpiredCode    string = "ENROLLMENT_EXPIRED"
	EnrollmentExpiredMessage string = "The window for this enrollment has expired"
	EnrollmentExpiredStatus  int    = http.StatusBadRequest

	CouldNotProcessCsrCode    string = "COULD_NOT_PROCESS_CSR"
	CouldNotProcessCsrMessage string = "The supplied csr could not be processed"
	CouldNotProcessCsrStatus  int    = http.StatusBadRequest

	EnrollmentCaNoLongValidCode    string = "ENROLLMENT_CA_NOT_VALID"
	EnrollmentCaNoLongValidMessage string = "The CA tied to the supplied token is no longer valid"
	EnrollmentCaNoLongValidStatus  int    = http.StatusBadRequest

	EnrollmentNoValidCasCode    string = "ENROLLMENT_NO_VALID_CAS"
	EnrollmentNoValidCasMessage string = "No CAs are valid for this request"
	EnrollmentNoValidCasStatus  int    = http.StatusBadRequest

	InvalidEnrollmentTokenCode    string = "INVALID_ENROLLMENT_TOKEN"
	InvalidEnrollmentTokenMessage string = "The supplied token is not valid"
	InvalidEnrollmentTokenStatus  int    = http.StatusBadRequest

	InvalidEnrollMethodCode    string = "INVALID_ENROLL_METHOD"
	InvalidEnrollMethodMessage string = "The supplied enrollment method is not valid"
	InvalidEnrollMethodStatus  int    = http.StatusBadRequest

	InvalidEnrollmentMissingCsrCode    string = "MISSING_OR_INVALID_CSR"
	InvalidEnrollmentMissingCsrMessage string = "The supplied enrollment request is missing or contains an invalid CSR"
	InvalidEnrollmentMissingCsrStatus  int    = http.StatusBadRequest

	NoEdgeRoutersAvailableCode    string = "NO_EDGE_ROUTERS_AVAILABLE"
	NoEdgeRoutersAvailableMessage string = "No edge routers are assigned and online to handle the requested connection"
	NoEdgeRoutersAvailableStatus  int    = http.StatusBadRequest

	CouldNotParseX509FromDerCode    string = "COULD_NOT_PARSE_x509_FROM_DER"
	CouldNotParseX509FromDerMessage string = "could not parse x509 from DER"
	CouldNotParseX509FromDerStatus  int    = http.StatusBadRequest

	CertFailedValidationCode    string = "CERT_FAILED_VALIDATION"
	CertFailedValidationMessage string = "certificate failed to validate against CA"
	CertFailedValidationStatus  int    = http.StatusBadRequest

	CertInUseCode    string = "CERT_IN_USE"
	CertInUseMessage string = "The certificate supplied is already associated with another identity"
	CertInUseStatus  int    = http.StatusConflict

	CaAlreadyVerifiedCode    string = "CA_ALREADY_VERIFIED"
	CaAlreadyVerifiedMessage string = "CA has already been verified"
	CaAlreadyVerifiedStatus  int    = http.StatusConflict

	ExpectedPemBlockCertificateCode           = "EXPECTED_PEM_CERTIFICATE"
	ExpectedPemBlockCertificateMessage string = "expected PEM block type 'CERTIFICATE'"
	ExpectedPemBlockCertificateStatus  int    = http.StatusBadRequest

	CouldNotParseDerBlockCode    string = "COULD_NOT_PARSE_DER_BLOCK"
	CouldNotParseDerBlockMessage string = "The certificate's DER block could not be parsed"
	CouldNotParseDerBlockStatus  int    = http.StatusBadRequest

	CouldNotParsePemCode    string = "COULD_NOT_PARSE_PEM_BLOCK"
	CouldNotParsePemMessage string = "The certificate's PEM block could not be parsed"
	CouldNotParsePemStatus  int    = http.StatusBadRequest

	InvalidCommonNameCode    string = "INVALID_COMMON_NAME"
	InvalidCommonNameMessage string = "The common name of the supplied certificate is invalid"
	InvalidCommonNameStatus  int    = http.StatusBadRequest

	FailedCertificateValidationCode    string = "CERTIFICATE_FAILED_VALIDATION"
	FailedCertificateValidationMessage string = "The supplied certificate failed to validate against the CA's certificate chain"
	FailedCertificateValidationStatus  int    = http.StatusBadRequest

	CertificateIsNotCaCode    string = "CERTIFICATE_IS_NOT_CA"
	CertificateIsNotCaMessage string = "Leading certificate is not a CA"
	CertificateIsNotCaStatus  int    = http.StatusBadRequest

	InvalidAuthenticatorPropertiesCode    string = "INVALID_AUTHENTICATOR_PROPERTIES"
	InvalidAuthenticatorPropertiesMessage string = "The properties supplied did not match the authenticator method"
	InvalidAuthenticatorPropertiesStatus  int    = http.StatusBadRequest

	AuthenticatorCanNotBeUpdatedCode    string = "CAN_NOT_UPDATE_AUTHENTICATOR"
	AuthenticatorCanNotBeUpdatedMessage string = "The authenticator cannot be updated in this fashion"
	AuthenticatorCanNotBeUpdatedStatus  int    = http.StatusConflict

	RouterCanNotBeUpdatedCode    string = "CAN_NOT_UPDATE_ROUTER"
	RouterCanNotBeUpdatedMessage string = "The router was not added via the Edge API and cannot be updated"
	RouterCanNotBeUpdatedStatus  int    = http.StatusConflict

	AuthenticatorMethodMaxCode    string = "MAX_AUTHENTICATOR_METHODS_REACHED"
	AuthenticatorMethodMaxMessage string = "The identity already has the maximum authenticators of the specified method"
	AuthenticatorMethodMaxStatus  int    = http.StatusConflict

	RateLimitedCode    string = "RATE_LIMITED"
	RateLimitedMessage string = "The requested operation is rate limited and the rate limit has been exceeded. Please try again later"
	RateLimitedStatus  int    = http.StatusTooManyRequests

	TimeoutCode    string = "TIMEOUT"
	TimeoutMessage string = "The requested operation took too much time to reply"
	TimeoutStatus  int    = http.StatusServiceUnavailable

	InvalidPostureCode    string = "INVALID_POSTURE"
	InvalidPostureMessage string = "Posture response data is missing or wrong"
	InvalidPostureStatus  int    = http.StatusConflict

	MfaExistsCode    string = "MFA_EXISTS"
	MfaExistsMessage string = "An MFA record already exists, try removing it"
	MfaExistsStatus  int    = http.StatusConflict

	MfaEnrollmentNotStartedCode    = "MFA_ENROLLMENT_NOT_STARTED"
	MfaEnrollmentNotStartedMessage = "MFA enrollment has not be started"
	MfaEnrollmentNotStartedStatus  = http.StatusNotFound

	/* #nosec */
	MfaInvalidTokenCode    string = "MFA_INVALID_TOKEN"
	MfaInvalidTokenMessage string = "An invalid token/code was provided"
	MfaInvalidTokenStatus  int    = http.StatusBadRequest

	MfaNotEnrolledCode    string = "MFA_NOT_ENROLLED"
	MfaNotEnrolledMessage string = "The current identity is not enrolled in MFA"
	MfaNotEnrolledStatus  int    = http.StatusConflict

	CouldNotDecodeProxiedCertCode    string = "COULD_NOT_PARSE_PROXY_CERT"
	CouldNotDecodeProxiedCertMessage string = "could not decode proxy client cert"
	CouldNotDecodeProxiedCertStatus  int    = http.StatusInternalServerError

	MissingCertClaimCode    string = "MISSING_CERT_CLAIM"
	MissingCertClaimMessage string = "The certificate is expected to contain and externalId, which was not found"
	MissingCertClaimStatus  int    = http.StatusBadRequest

	EdgeRouterFailedReEnrollmentCode        = "FAILED_ER_REENROLLMENT"
	EdgeRouterFailedReEnrollmentMessage     = "the edge router failed to be re-enrolled, see cause"
	EdgeRouterFailedReEnrollmentStatus  int = http.StatusInternalServerError

	InvalidClientCertCode    string = "INVALID_CLIENT_CERT"
	InvalidClientCertMessage string = "The provided client certificate is invalid"
	InvalidClientCertStatus  int    = http.StatusBadRequest

	InvalidCertificatePemCode    string = "INVALID_CERT_PEM"
	InvalidCertificatePemMessage string = "the supplied certificate PEM is either invalid or contains the incorrect number of certificates"
	InvalidCertificatePemStatus  int    = http.StatusBadRequest

	CanNotDeleteReferencedEntityCode    string = "CAN_NOT_DELETE_REFERENCED_ENTITY"
	CanNotDeleteReferencedEntityMessage string = "the entity cannot be deleted because it is referenced by another entity, see cause"
	CanNotDeleteReferencedEntityStatus  int    = http.StatusConflict

	ReferencedEntityNotFoundCode    string = "REFERENCED_ENTITY_NOT_FOUND"
	ReferencedEntityNotFoundMessage string = "REFERENCED_ENTITY_NOT_FOUND"
	ReferencedEntityNotFoundStatus  int    = http.StatusBadRequest

	EnrollmentExistsCode    string = "ENROLLMENT_EXISTS"
	EnrollmentExistsMessage string = "ENROLLMENT_EXISTS"
	EnrollmentExistsStatus  int    = http.StatusConflict

	ServerTooManyRequestsCode    string = "SERVER_TOO_MANY_REQUESTS"
	ServerTooManyRequestsMessage string = "Too many requests to alter state have been issued. Please slow your request rate or try again later."
	ServerTooManyRequestsStatus  int    = http.StatusTooManyRequests

	ServerNotRunningInHAModeCode    string = "SERVER_NOT_RUNNING_IN_HA_MODE"
	ServerNotRunningInHAModeMessage string = "The server is not running in HA mode. HA operations are not permitted"
	ServerNotRunningInHAModeStatus         = http.StatusBadRequest

	TransferLeadershipErrorCode    string = "TRANSFER_LEADERSHIP_ERROR"
	TransferLeadershipErrorMessage string = "Error while attempting to transfer leadership"
	TransferLeadershipErrorStatus         = http.StatusInternalServerError
)

specific

Variables

This section is empty.

Functions

func GetJsonParseError

func GetJsonParseError(e error, body []byte) error

func NewAuthenticatorCannotBeUpdated

func NewAuthenticatorCannotBeUpdated() *errorz.ApiError

func NewAuthenticatorMethodMax

func NewAuthenticatorMethodMax() *errorz.ApiError

func NewBadRequestFieldError

func NewBadRequestFieldError(fieldError errorz.FieldError) *errorz.ApiError

func NewCaAlreadyVerified

func NewCaAlreadyVerified() *errorz.ApiError

func NewCanNotDeleteReferencedEntity

func NewCanNotDeleteReferencedEntity(localEntityType, remoteEntityType string, referencingEntityTypeIds []string, fieldName string) *errorz.ApiError

func NewCertFailedValidation

func NewCertFailedValidation() *errorz.ApiError

func NewCertInUse

func NewCertInUse() *errorz.ApiError

func NewCertificateIsNotCa

func NewCertificateIsNotCa() *errorz.ApiError

func NewCouldNotParseBody

func NewCouldNotParseBody(err error) *errorz.ApiError

func NewCouldNotParseDerBlock

func NewCouldNotParseDerBlock() *errorz.ApiError

func NewCouldNotParsePem

func NewCouldNotParsePem() *errorz.ApiError

func NewCouldNotParseX509FromDer

func NewCouldNotParseX509FromDer() *errorz.ApiError

func NewCouldNotProcessCsr

func NewCouldNotProcessCsr() *errorz.ApiError

func NewCouldNotReadBody

func NewCouldNotReadBody(err error) *errorz.ApiError

func NewEdgeRouterFailedReEnrollment

func NewEdgeRouterFailedReEnrollment(cause error) *errorz.ApiError

func NewEnrollmentCaNoLongValid

func NewEnrollmentCaNoLongValid() *errorz.ApiError

func NewEnrollmentExists

func NewEnrollmentExists(enrollmentMethod string) *errorz.ApiError

func NewEnrollmentExpired

func NewEnrollmentExpired() *errorz.ApiError

func NewEnrollmentNoValidCas

func NewEnrollmentNoValidCas() *errorz.ApiError

func NewExpectedPemBlockCertificate

func NewExpectedPemBlockCertificate() *errorz.ApiError

func NewFabricRouterCannotBeUpdate

func NewFabricRouterCannotBeUpdate() *errorz.ApiError

func NewFailedCertificateValidation

func NewFailedCertificateValidation() *errorz.ApiError

func NewInvalidAuth

func NewInvalidAuth() *errorz.ApiError

func NewInvalidAuthMethod

func NewInvalidAuthMethod() *errorz.ApiError

func NewInvalidAuthenticatorProperties

func NewInvalidAuthenticatorProperties() *errorz.ApiError

func NewInvalidCertificatePem

func NewInvalidCertificatePem() *errorz.ApiError

func NewInvalidClientCertificate

func NewInvalidClientCertificate() *errorz.ApiError

func NewInvalidCommonName

func NewInvalidCommonName() *errorz.ApiError

func NewInvalidContentType

func NewInvalidContentType(contentType string) *errorz.ApiError

func NewInvalidEnrollMethod

func NewInvalidEnrollMethod() *errorz.ApiError

func NewInvalidEnrollmentMissingCsr

func NewInvalidEnrollmentMissingCsr(cause error) *errorz.ApiError

func NewInvalidEnrollmentToken

func NewInvalidEnrollmentToken() *errorz.ApiError

func NewInvalidMfaTokenError

func NewInvalidMfaTokenError() *errorz.ApiError

func NewInvalidPosture

func NewInvalidPosture(cause error) *errorz.ApiError

func NewInvalidUuid

func NewInvalidUuid(val string) *errorz.ApiError

func NewMethodNotAllowed

func NewMethodNotAllowed() *errorz.ApiError

func NewMfaEnrollmentNotStarted added in v0.34.0

func NewMfaEnrollmentNotStarted() *errorz.ApiError

func NewMfaExistsError

func NewMfaExistsError() *errorz.ApiError

func NewMfaNotEnrolledError

func NewMfaNotEnrolledError() *errorz.ApiError

func NewMissingCertClaim

func NewMissingCertClaim() *errorz.ApiError

func NewNoEdgeRoutersAvailable

func NewNoEdgeRoutersAvailable() *errorz.ApiError

func NewNotRunningInHAModeError added in v0.31.3

func NewNotRunningInHAModeError() *errorz.ApiError

func NewRateLimited

func NewRateLimited() *errorz.ApiError

func NewTimeoutError

func NewTimeoutError() *errorz.ApiError

func NewTooManyUpdatesError added in v0.31.0

func NewTooManyUpdatesError() *errorz.ApiError

Types

type BodyParseSyntaxError

type BodyParseSyntaxError struct {
	Near   string `json:"near"`
	Offset int64  `json:"totalOffset"`
	Line   int64  `json:"line"`
}

func NewBodyParseSyntaxError

func NewBodyParseSyntaxError(e *json.SyntaxError, body string) *BodyParseSyntaxError

func (BodyParseSyntaxError) Error

func (e BodyParseSyntaxError) Error() string

type BodyParseTypeError

type BodyParseTypeError struct {
	Near            string `json:"near"`
	ExpectedType    string `json:"expectedType"`
	EncounteredType string `json:"encounteredType"`
	Offset          int64  `json:"totalOffset"`
	Line            int64  `json:"line"`
}

func NewBodyParseTypeError

func NewBodyParseTypeError(e *json.UnmarshalTypeError, body string) *BodyParseTypeError

func (BodyParseTypeError) Error

func (e BodyParseTypeError) Error() string

type GenericCauseError

type GenericCauseError struct {
	Message string
	DataMap map[string]interface{}
}

func (*GenericCauseError) Error

func (e *GenericCauseError) Error() string

func (*GenericCauseError) MarshalJSON

func (e *GenericCauseError) MarshalJSON() ([]byte, error)

type ValidationError

type ValidationError struct {
	Field   string                 `json:"field"`
	Type    string                 `json:"type"`
	Value   interface{}            `json:"value"`
	Message string                 `json:"message"`
	Details map[string]interface{} `json:"details"`
}

func NewValidationError

func NewValidationError(err gojsonschema.ResultError) *ValidationError

func (ValidationError) Error

func (e ValidationError) Error() string

type ValidationErrors

type ValidationErrors struct {
	Errors []*ValidationError
}

func NewValidationErrors

func NewValidationErrors(result *gojsonschema.Result) *ValidationErrors

func (ValidationErrors) Error

func (e ValidationErrors) Error() string

func (ValidationErrors) MarshalJSON

func (e ValidationErrors) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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