mirror of
https://github.com/versity/versitygw.git
synced 2026-09-29 11:15:36 +00:00
feat: Closes #441, Added access control integration tests, fixed some bugs in bucket policy and acl access checking flow
This commit is contained in:
@@ -537,6 +537,10 @@ type user struct {
|
||||
|
||||
func createUsers(s *S3Conf, users []user) error {
|
||||
for _, usr := range users {
|
||||
err := deleteUser(s, usr.access)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out, err := execCommand("admin", "-a", s.awsID, "-s", s.awsSecret, "-er", s.endpoint, "create-user", "-a", usr.access, "-s", usr.secret, "-r", usr.role)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -633,3 +637,11 @@ func getMalformedPolicyError(msg string) s3err.APIError {
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
}
|
||||
}
|
||||
|
||||
func getUserS3Client(usr user, cfg *S3Conf) *s3.Client {
|
||||
config := *cfg
|
||||
config.awsID = usr.access
|
||||
config.awsSecret = usr.secret
|
||||
|
||||
return s3.NewFromConfig(config.Config())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user