Skip to content

Commit

Permalink
Add default values for STORAGE_CLASS_SETTING and CANNED_ACL_SETTING f…
Browse files Browse the repository at this point in the history
…or S3

Signed-off-by: Bhumika Saini <[email protected]>
  • Loading branch information
Bhumika Saini committed Oct 4, 2023
1 parent 2be3691 commit 6eb1b37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ class S3Repository extends MeteredBlobStoreRepository {
* Sets the S3 storage class type for the backup files. Values may be standard, reduced_redundancy,
* standard_ia, onezone_ia and intelligent_tiering. Defaults to standard.
*/
static final Setting<String> STORAGE_CLASS_SETTING = Setting.simpleString("storage_class");
static final Setting<String> STORAGE_CLASS_SETTING = Setting.simpleString("storage_class", StorageClass.STANDARD.toString());

/**
* The S3 repository supports all S3 canned ACLs : private, public-read, public-read-write,
* authenticated-read, log-delivery-write, bucket-owner-read, bucket-owner-full-control. Defaults to private.
*/
static final Setting<String> CANNED_ACL_SETTING = Setting.simpleString("canned_acl");
static final Setting<String> CANNED_ACL_SETTING = Setting.simpleString("canned_acl", ObjectCannedACL.PRIVATE.toString());

static final Setting<String> CLIENT_NAME = new Setting<>("client", "default", Function.identity());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public void testRepositoryCredentialsOverrideSecureCredentials() {
final Settings.Builder repositorySettings = Settings.builder()
// repository settings for credentials override node secure settings
.put(S3Repository.ACCESS_KEY_SETTING.getKey(), "insecure_aws_key")
.put(S3Repository.SECRET_KEY_SETTING.getKey(), "insecure_aws_secret");
.put(S3Repository.SECRET_KEY_SETTING.getKey(), "insecure_aws_secret")
.put("storage_class", "standard");

final String clientName = randomFrom("default", "other", null);
if (clientName != null) {
Expand Down Expand Up @@ -150,6 +151,7 @@ public void testReinitSecureCredentials() {
final String clientName = randomFrom("default", "other");

final Settings.Builder repositorySettings = Settings.builder();
repositorySettings.put("storage_class", "standard");
final boolean hasInsecureSettings = randomBoolean();
if (hasInsecureSettings) {
// repository settings for credentials override node secure settings
Expand Down Expand Up @@ -241,6 +243,7 @@ public void testInsecureRepositoryCredentials() throws Exception {
Settings.builder()
.put(S3Repository.ACCESS_KEY_SETTING.getKey(), "insecure_aws_key")
.put(S3Repository.SECRET_KEY_SETTING.getKey(), "insecure_aws_secret")
.put("storage_class", "standard")
.build()
);

Expand Down

0 comments on commit 6eb1b37

Please sign in to comment.