fix: sts to return appropriate errors (#9161)

This commit is contained in:
Harshavardhana
2020-03-18 17:25:45 -07:00
committed by GitHub
parent 5b9342d35c
commit 09d35d3b4c
5 changed files with 25 additions and 18 deletions
+5 -1
View File
@@ -108,7 +108,11 @@ func parseCredentialHeader(credElement string, region string, stype serviceType)
}
if credElements[2] != string(stype) {
return ch, ErrInvalidService
switch stype {
case serviceSTS:
return ch, ErrInvalidServiceSTS
}
return ch, ErrInvalidServiceS3
}
cred.scope.service = credElements[2]
if credElements[3] != "aws4_request" {