s3api: fix AccessDenied by correctly propagating principal ARN in vended tokens (#8330)
* s3api: fix AccessDenied by correctly propagating principal ARN in vended tokens * s3api: update TestLoadS3ApiConfiguration to match standardized ARN format * s3api: address PR review comments (nil-safety and cleanup) * s3api: address second round of PR review comments (cleanups and naming conventions) * s3api: address third round of PR review comments (unify default account ID and duplicate log) * s3api: address fourth round of PR review comments (define defaultAccountID as constant)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package s3api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"reflect"
|
||||
"sync"
|
||||
@@ -294,7 +295,7 @@ func TestLoadS3ApiConfiguration(t *testing.T) {
|
||||
expectIdent: &Identity{
|
||||
Name: "notSpecifyAccountId",
|
||||
Account: &AccountAdmin,
|
||||
PrincipalArn: "arn:aws:iam::user/notSpecifyAccountId",
|
||||
PrincipalArn: fmt.Sprintf("arn:aws:iam::%s:user/notSpecifyAccountId", defaultAccountID),
|
||||
Actions: []Action{
|
||||
"Read",
|
||||
"Write",
|
||||
@@ -320,7 +321,7 @@ func TestLoadS3ApiConfiguration(t *testing.T) {
|
||||
expectIdent: &Identity{
|
||||
Name: "specifiedAccountID",
|
||||
Account: &specifiedAccount,
|
||||
PrincipalArn: "arn:aws:iam::user/specifiedAccountID",
|
||||
PrincipalArn: fmt.Sprintf("arn:aws:iam::%s:user/specifiedAccountID", defaultAccountID),
|
||||
Actions: []Action{
|
||||
"Read",
|
||||
"Write",
|
||||
@@ -338,7 +339,7 @@ func TestLoadS3ApiConfiguration(t *testing.T) {
|
||||
expectIdent: &Identity{
|
||||
Name: "anonymous",
|
||||
Account: &AccountAnonymous,
|
||||
PrincipalArn: "arn:aws:iam::user/anonymous",
|
||||
PrincipalArn: "*",
|
||||
Actions: []Action{
|
||||
"Read",
|
||||
"Write",
|
||||
|
||||
Reference in New Issue
Block a user