Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #200 from secrethub/feature/server-side-taken-serv…
Browse files Browse the repository at this point in the history
…ice-error

Add server errors for taken service accounts
  • Loading branch information
florisvdg authored Jul 6, 2020
2 parents 411544a + 9955b8f commit 18bbbcf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internals/api/server_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ var (
ErrNoAdminAccess = errHub.Code("no_admin_access").StatusError("Only accounts with Admin access can perform this action", http.StatusForbidden)
ErrMemberAlreadyExists = errHub.Code("member_already_exists").StatusError("The member already exists", http.StatusConflict)

// AWS IdP
ErrAWSRoleAlreadyTaken = errHub.Code("aws_role_taken").StatusError("a service account coupled to that IAM role already exists. Delete the existing service account or create a new one using a different IAM role.", http.StatusConflict)

// GCP IdP
ErrGCPServiceAccountAlreadyTaken = errHub.Code("gcp_service_account_taken").StatusError("a SecretHub service account coupled to that GCP Service Account email already exists. Delete the existing SecretHub service account or create a new one using a different GCP Service Account email.", http.StatusConflict)

// Account
ErrAccountNotFound = errHub.Code("account_not_found").StatusError("Account not found", http.StatusNotFound)
ErrUnknownSubjectType = errHub.Code("unknown_subject_type").Error("Unknown subject type") // no status error because it is an internal error
Expand Down

0 comments on commit 18bbbcf

Please sign in to comment.