-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the lease coordination table permissions #5097
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,23 +16,28 @@ | |||||
*/ | ||||||
public class AwsCredentialsOptions { | ||||||
private static final AwsCredentialsOptions DEFAULT_OPTIONS = new AwsCredentialsOptions(); | ||||||
private static final AwsCredentialsOptions DEFAULT_OPTIONS_WITH_DEFAULT_CREDS = | ||||||
AwsCredentialsOptions.builder().withUseDefaultCredentials(true).build(); | ||||||
private final String stsRoleArn; | ||||||
private final String stsExternalId; | ||||||
private final Region region; | ||||||
private final Map<String, String> stsHeaderOverrides; | ||||||
private final boolean useDefaultCredentials; | ||||||
|
||||||
private AwsCredentialsOptions(final Builder builder) { | ||||||
this.stsRoleArn = builder.stsRoleArn; | ||||||
this.stsExternalId = builder.stsExternalId; | ||||||
this.region = builder.region; | ||||||
this.stsHeaderOverrides = builder.stsHeaderOverrides != null ? new HashMap<>(builder.stsHeaderOverrides) : Collections.emptyMap(); | ||||||
this.useDefaultCredentials = builder.useDefaultCredentials; | ||||||
} | ||||||
|
||||||
private AwsCredentialsOptions() { | ||||||
this.stsRoleArn = null; | ||||||
this.stsExternalId = null; | ||||||
this.region = null; | ||||||
this.stsHeaderOverrides = Collections.emptyMap(); | ||||||
this.useDefaultCredentials = false; | ||||||
} | ||||||
|
||||||
/** | ||||||
|
@@ -49,6 +54,10 @@ public static AwsCredentialsOptions defaultOptions() { | |||||
return DEFAULT_OPTIONS; | ||||||
} | ||||||
|
||||||
public static AwsCredentialsOptions defaultOptionsWithDefaultCreds() { | ||||||
return DEFAULT_OPTIONS_WITH_DEFAULT_CREDS; | ||||||
} | ||||||
|
||||||
public String getStsRoleArn() { | ||||||
return stsRoleArn; | ||||||
} | ||||||
|
@@ -65,6 +74,10 @@ public Map<String, String> getStsHeaderOverrides() { | |||||
return stsHeaderOverrides; | ||||||
} | ||||||
|
||||||
public boolean isUseDefaultCredentials() { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have a concept of Lines 12 to 13 in 81e4058
So I think we should use a different name here. One idea: Thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @dlvenable for your input. I will make the change. |
||||||
return useDefaultCredentials; | ||||||
} | ||||||
|
||||||
/** | ||||||
* Builder class for {@link AwsCredentialsOptions}. | ||||||
*/ | ||||||
|
@@ -73,6 +86,7 @@ public static class Builder { | |||||
private String stsExternalId; | ||||||
private Region region; | ||||||
private Map<String, String> stsHeaderOverrides = Collections.emptyMap(); | ||||||
private boolean useDefaultCredentials = false; | ||||||
|
||||||
/** | ||||||
* Sets the STS role ARN to use. | ||||||
|
@@ -122,6 +136,17 @@ public Builder withStsHeaderOverrides(final Map<String, String> stsHeaderOverrid | |||||
return this; | ||||||
} | ||||||
|
||||||
/** | ||||||
* Configures whether to use default credentials. | ||||||
* | ||||||
* @param useDefaultCredentials | ||||||
* @return The {@link Builder} for continuing to build | ||||||
*/ | ||||||
public Builder withUseDefaultCredentials(final boolean useDefaultCredentials) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @dlvenable. I have made the name change. |
||||||
this.useDefaultCredentials = useDefaultCredentials; | ||||||
return this; | ||||||
} | ||||||
|
||||||
/** | ||||||
* Builds the {@link AwsCredentialsOptions}. | ||||||
* | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dlvenable. I have made the name change.