embulk-input-s3 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02cd2ac88b83d92846715d194928f38a32693ebe
4
- data.tar.gz: 145815003f894fc2a2a224266e00908dae89cf79
3
+ metadata.gz: 53fcce53ef48e0de5334962d731a1c3ea66dbb37
4
+ data.tar.gz: 2233d5ce4ab1058212e37992b0a32547482a50cb
5
5
  SHA512:
6
- metadata.gz: e9d81495964337639a2a6e7de2ce9ca3c3e5b39ca869ff1873e5ed119de95ac8ae778fe3450d85068dcd7b773bbfd8345835b46ab226ad73f1117c2fb614c0bc
7
- data.tar.gz: 5f50eb790d085fb427a23e3819bdada69bb0cafba84e6e4175a8a317e7cf7e37e0a675866a87b893600c6ccfeb59654662e452c56d93a556d5559319c2760543
6
+ metadata.gz: 746680b6afad3a6e302b98ba1e109dc7c2e3899800367a1dd6a08c6372ea79ab31c0ea46be8a5ba7c22421ee9662014c8fd5a8a1f603e83f42dfc69fbba4d623
7
+ data.tar.gz: f65c944bb757863135e156472b5d14ef29fce1819970e489f6dfed96b1aed291df8f4be56cd537257f5eade64cb4108f45b65cd8a5c91df2a67c5c7989edb8ca
Binary file
@@ -13,6 +13,7 @@ import org.slf4j.Logger;
13
13
  import com.amazonaws.auth.AWSCredentials;
14
14
  import com.amazonaws.auth.AWSCredentialsProvider;
15
15
  import com.amazonaws.auth.BasicAWSCredentials;
16
+ import com.amazonaws.auth.AnonymousAWSCredentials;
16
17
  import com.amazonaws.services.s3.AmazonS3Client;
17
18
  import com.amazonaws.services.s3.model.ListObjectsRequest;
18
19
  import com.amazonaws.services.s3.model.S3ObjectSummary;
@@ -56,10 +57,12 @@ public abstract class AbstractS3FileInputPlugin
56
57
  public Optional<String> getLastPath();
57
58
 
58
59
  @Config("access_key_id")
59
- public String getAccessKeyId();
60
+ @ConfigDefault("null")
61
+ public Optional<String> getAccessKeyId();
60
62
 
61
63
  @Config("secret_access_key")
62
- public String getSecretAccessKey();
64
+ @ConfigDefault("null")
65
+ public Optional<String> getSecretAccessKey();
63
66
 
64
67
  // TODO timeout, ssl, etc
65
68
 
@@ -131,8 +134,14 @@ public abstract class AbstractS3FileInputPlugin
131
134
 
132
135
  protected AWSCredentialsProvider getCredentialsProvider(PluginTask task)
133
136
  {
134
- final AWSCredentials cred = new BasicAWSCredentials(
135
- task.getAccessKeyId(), task.getSecretAccessKey());
137
+ final AWSCredentials cred;
138
+ if (task.getAccessKeyId().isPresent()) {
139
+ cred = new BasicAWSCredentials(
140
+ task.getAccessKeyId().get(),
141
+ task.getSecretAccessKey().get());
142
+ } else {
143
+ cred = new AnonymousAWSCredentials();
144
+ }
136
145
  return new AWSCredentialsProvider() {
137
146
  public AWSCredentials getCredentials()
138
147
  {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-input-s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -55,7 +55,7 @@ files:
55
55
  - classpath/aws-java-sdk-s3-1.9.22.jar
56
56
  - classpath/commons-codec-1.6.jar
57
57
  - classpath/commons-logging-1.1.3.jar
58
- - classpath/embulk-input-s3-0.2.0.jar
58
+ - classpath/embulk-input-s3-0.2.1.jar
59
59
  - classpath/httpclient-4.3.4.jar
60
60
  - classpath/httpcore-4.3.2.jar
61
61
  - classpath/joda-time-2.8.1.jar
Binary file