mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-17 12:46:59 +00:00
* fix(iam): return a valid user ARN from CreateUser and GetUser The terraform aws provider 6.41 reads a user back after creating it and blocks until GetUser returns a value that passes arn.IsARN. We only set UserName, so the ARN was empty and apply hung until the 2m timeout. Populate Arn (and Path) via a shared iam.NewUser helper in both the embedded and standalone IAM handlers. * fix(iam): use the userName parameter directly in NewUser Drop the redundant local copy; the value parameter is already function-local. * fix(iam): return full user objects with ARNs from GetGroup GetGroup listed members with only UserName set. Build them via the shared NewUser helper so group members carry a valid Arn and Path like the other user responses, in both the embedded and standalone IAM handlers.
42 lines
1.1 KiB
Go
42 lines
1.1 KiB
Go
package iam
|
|
|
|
// Character sets for credential generation
|
|
const (
|
|
CharsetUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
Charset = CharsetUpper + "abcdefghijklmnopqrstuvwxyz"
|
|
)
|
|
|
|
// Policy document version
|
|
const PolicyDocumentVersion = "2012-10-17"
|
|
|
|
// DefaultAccountID is the placeholder AWS account id used in generated ARNs,
|
|
// matching the value used throughout the S3 API.
|
|
const DefaultAccountID = "000000000000"
|
|
|
|
// Error message templates
|
|
const UserDoesNotExist = "the user with name %s cannot be found."
|
|
|
|
// Statement action constants - these map to IAM policy actions
|
|
const (
|
|
StatementActionAdmin = "*"
|
|
StatementActionWrite = "Put*"
|
|
StatementActionWriteAcp = "PutBucketAcl"
|
|
StatementActionRead = "Get*"
|
|
StatementActionReadAcp = "GetBucketAcl"
|
|
StatementActionList = "List*"
|
|
StatementActionTagging = "Tagging*"
|
|
StatementActionDelete = "DeleteBucket*"
|
|
)
|
|
|
|
// Access key lengths
|
|
const (
|
|
AccessKeyIdLength = 21
|
|
SecretAccessKeyLength = 42
|
|
)
|
|
|
|
// Access key status values (AWS IAM compatible)
|
|
const (
|
|
AccessKeyStatusActive = "Active"
|
|
AccessKeyStatusInactive = "Inactive"
|
|
)
|