Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-unauthorized-s3-error #1187

Merged
merged 1 commit into from
Jul 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion server/storage_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ func testS3Integration(svc *s3.Client, bucketName, urlEndpointResolver string) (
var statusCode int
customUrlEndpointErr := fmt.Sprintf("lookup %s.bucket.: no such host", bucketName)
if err != nil {
if strings.Contains(err.Error(), "Forbidden") {
if strings.Contains(err.Error(), "Unauthorized") {
err = fmt.Errorf("the provided AWS credentials are incorrect or you do not have the necessary permissions to access the bucket %s", bucketName)
statusCode = SHOWABLE_ERROR_STATUS_CODE
} else if strings.Contains(err.Error(), "Forbidden") {
err = errors.New("invalid access key or secret key")
statusCode = SHOWABLE_ERROR_STATUS_CODE
} else if strings.Contains(err.Error(), "404") {
Expand Down