-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Add route-scoped ACL configuration"
This reverts commit 73f2d9d. We need to think a little about how to do this right, so revert the offending commit for now. Closes #283
- Loading branch information
Showing
7 changed files
with
84 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package lib | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
qt "github.com/frankban/quicktest" | ||
) | ||
|
||
func TestNewRemoteStoreNoAclProvided(t *testing.T) { | ||
c := qt.New(t) | ||
|
||
cfg := Config{ | ||
BucketName: "example.com", | ||
RegionName: "us-east-1", | ||
ACL: "", | ||
Silent: true, | ||
} | ||
|
||
s, err := newRemoteStore(cfg, newPrinter(ioutil.Discard)) | ||
c.Assert(err, qt.IsNil) | ||
|
||
c.Assert("private", qt.Equals, s.acl) | ||
} | ||
|
||
func TestNewRemoteStoreAclProvided(t *testing.T) { | ||
c := qt.New(t) | ||
|
||
cfg := Config{ | ||
BucketName: "example.com", | ||
RegionName: "us-east-1", | ||
ACL: "public-read", | ||
Silent: true, | ||
} | ||
|
||
s, err := newRemoteStore(cfg, newPrinter(ioutil.Discard)) | ||
c.Assert(err, qt.IsNil) | ||
|
||
c.Assert("public-read", qt.Equals, s.acl) | ||
} | ||
|
||
func TestNewRemoteStoreOtherCannedAclProvided(t *testing.T) { | ||
c := qt.New(t) | ||
|
||
cfg := Config{ | ||
BucketName: "example.com", | ||
RegionName: "us-east-1", | ||
ACL: "bucket-owner-full-control", | ||
Silent: true, | ||
} | ||
|
||
s, err := newRemoteStore(cfg, newPrinter(ioutil.Discard)) | ||
c.Assert(err, qt.IsNil) | ||
|
||
c.Assert("bucket-owner-full-control", qt.Equals, s.acl) | ||
} | ||
|
||
func TestNewRemoteStoreDeprecatedPublicReadACLFlaglProvided(t *testing.T) { | ||
c := qt.New(t) | ||
|
||
cfg := Config{ | ||
BucketName: "example.com", | ||
RegionName: "us-east-1", | ||
PublicReadACL: true, | ||
ACL: "", | ||
Silent: true, | ||
} | ||
|
||
s, err := newRemoteStore(cfg, newPrinter(ioutil.Discard)) | ||
c.Assert(err, qt.IsNil) | ||
|
||
c.Assert("public-read", qt.Equals, s.acl) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters