Skip to content
This repository has been archived by the owner on Apr 30, 2019. It is now read-only.

Support profile credentials #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Finally the `~/.m2/settings.xml` must be updated to include access and secret ke
Alternatively, the access and secret keys for the account can be provided using

* `AWS_ACCESS_KEY_ID` (or `AWS_ACCESS_KEY`) and `AWS_SECRET_KEY` (or `AWS_SECRET_ACCESS_KEY`) [environment variables][env-var]
* `AWS_PROFILE` [environment variable][profile-provider]
* `aws.accessKeyId` and `aws.secretKey` [system properties][sys-prop]
* The Amazon EC2 [Instance Metadata Service][instance-metadata]

Expand Down Expand Up @@ -167,6 +168,7 @@ aws s3api put-bucket-policy --bucket $BUCKET --policy "$POLICY"
[cli]: http://aws.amazon.com/documentation/cli/
[console]: https://console.aws.amazon.com/s3
[env-var]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/EnvironmentVariableCredentialsProvider.html
[profile-provider]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/profile/ProfileCredentialsProvider.html
[instance-metadata]: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/InstanceProfileCredentialsProvider.html
[policy-generator]: http://awspolicygen.s3.amazonaws.com/policygen.html
[s3]: http://aws.amazon.com/s3/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<description>Standard Maven wagon support for s3:// urls</description>

<properties>
<amazonaws.version>1.7.1</amazonaws.version>
<amazonaws.version>1.9.33</amazonaws.version>
<junit.version>4.11</junit.version>
<logback.version>1.1.1</logback.version>
<mockito.version>1.9.5</mockito.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
import com.amazonaws.auth.EnvironmentVariableCredentialsProvider;
import com.amazonaws.auth.InstanceProfileCredentialsProvider;
import com.amazonaws.auth.SystemPropertiesCredentialsProvider;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;

import org.apache.maven.wagon.authentication.AuthenticationInfo;

final class AuthenticationInfoAWSCredentialsProviderChain extends AWSCredentialsProviderChain {

AuthenticationInfoAWSCredentialsProviderChain(AuthenticationInfo authenticationInfo) {
super(new EnvironmentVariableCredentialsProvider(),
new SystemPropertiesCredentialsProvider(),
new ProfileCredentialsProvider(),
new InstanceProfileCredentialsProvider(),
new AuthenticationInfoAWSCredentialsProvider(authenticationInfo));
}
Expand Down