s3tables: implement granular authorization and refine error responses

- Remove mandatory ACTION_ADMIN at the router level
- Enforce granular permissions in bucket and namespace handlers
- Prioritize AccountID in ExtractPrincipalFromContext for ARN matching
- Distinguish between 404 (NoSuchBucket) and 500 (InternalError) in metadata lookups
- Clean up unused imports in s3api_tables.go
This commit is contained in:
Chris Lu
2026-01-28 11:31:38 -08:00
parent 580c2b4ad4
commit 04514071a7
4 changed files with 45 additions and 4 deletions

View File

@@ -174,6 +174,9 @@ func ExtractPrincipalFromContext(contextID string) string {
// Try to parse as ARN first
if strings.HasPrefix(contextID, "arn:") {
info := utils.ParsePrincipalARN(contextID)
if info.AccountID != "" {
return info.AccountID
}
if info.RoleName != "" {
return info.RoleName
}