logstash-input-google_pubsub 1.2.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +19 -16
  4. data/docs/index.asciidoc +3 -2
  5. data/lib/logstash/inputs/google_pubsub.rb +20 -3
  6. data/lib/logstash-input-google_pubsub_jars.rb +47 -47
  7. data/spec/inputs/google_pubsub_spec.rb +8 -0
  8. data/spec/inputs/test.json +14 -0
  9. data/vendor/jar-dependencies/com/google/api/api-common/2.15.0/api-common-2.15.0.jar +0 -0
  10. data/vendor/jar-dependencies/com/google/api/gax/2.32.0/gax-2.32.0.jar +0 -0
  11. data/vendor/jar-dependencies/com/google/api/gax-grpc/2.32.0/gax-grpc-2.32.0.jar +0 -0
  12. data/vendor/jar-dependencies/com/google/api/gax-httpjson/2.32.0/gax-httpjson-2.32.0.jar +0 -0
  13. data/vendor/jar-dependencies/com/google/api/grpc/proto-google-cloud-pubsub-v1/1.106.1/proto-google-cloud-pubsub-v1-1.106.1.jar +0 -0
  14. data/vendor/jar-dependencies/com/google/api/grpc/proto-google-common-protos/2.23.0/proto-google-common-protos-2.23.0.jar +0 -0
  15. data/vendor/jar-dependencies/com/google/api/grpc/proto-google-iam-v1/1.18.0/proto-google-iam-v1-1.18.0.jar +0 -0
  16. data/vendor/jar-dependencies/com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0.jar +0 -0
  17. data/vendor/jar-dependencies/com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0.jar +0 -0
  18. data/vendor/jar-dependencies/com/google/auto/value/auto-value-annotations/1.10.2/auto-value-annotations-1.10.2.jar +0 -0
  19. data/vendor/jar-dependencies/com/google/cloud/google-cloud-pubsub/1.124.1/google-cloud-pubsub-1.124.1.jar +0 -0
  20. data/vendor/jar-dependencies/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar +0 -0
  21. data/vendor/jar-dependencies/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar +0 -0
  22. data/vendor/jar-dependencies/com/google/guava/guava/32.1.2-jre/guava-32.1.2-jre.jar +0 -0
  23. data/vendor/jar-dependencies/com/google/http-client/google-http-client/{1.42.2/google-http-client-1.42.2.jar → 1.43.3/google-http-client-1.43.3.jar} +0 -0
  24. data/vendor/jar-dependencies/com/google/http-client/google-http-client-gson/1.43.3/google-http-client-gson-1.43.3.jar +0 -0
  25. data/vendor/jar-dependencies/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar +0 -0
  26. data/vendor/jar-dependencies/com/google/protobuf/protobuf-java/3.23.2/protobuf-java-3.23.2.jar +0 -0
  27. data/vendor/jar-dependencies/com/google/protobuf/protobuf-java-util/3.23.2/protobuf-java-util-3.23.2.jar +0 -0
  28. data/vendor/jar-dependencies/com/google/re2j/re2j/{1.6/re2j-1.6.jar → 1.7/re2j-1.7.jar} +0 -0
  29. data/vendor/jar-dependencies/io/grpc/grpc-alts/1.56.1/grpc-alts-1.56.1.jar +0 -0
  30. data/vendor/jar-dependencies/io/grpc/grpc-api/{1.48.0/grpc-api-1.48.0.jar → 1.56.1/grpc-api-1.56.1.jar} +0 -0
  31. data/vendor/jar-dependencies/io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1.jar +0 -0
  32. data/vendor/jar-dependencies/io/grpc/grpc-context/1.56.1/grpc-context-1.56.1.jar +0 -0
  33. data/vendor/jar-dependencies/io/grpc/grpc-core/1.56.1/grpc-core-1.56.1.jar +0 -0
  34. data/vendor/jar-dependencies/io/grpc/grpc-googleapis/1.56.1/grpc-googleapis-1.56.1.jar +0 -0
  35. data/vendor/jar-dependencies/io/grpc/grpc-grpclb/1.56.1/grpc-grpclb-1.56.1.jar +0 -0
  36. data/vendor/jar-dependencies/io/grpc/grpc-netty-shaded/{1.48.0/grpc-netty-shaded-1.48.0.jar → 1.56.1/grpc-netty-shaded-1.56.1.jar} +0 -0
  37. data/vendor/jar-dependencies/io/grpc/grpc-protobuf/{1.48.0/grpc-protobuf-1.48.0.jar → 1.56.1/grpc-protobuf-1.56.1.jar} +0 -0
  38. data/vendor/jar-dependencies/io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1.jar +0 -0
  39. data/vendor/jar-dependencies/io/grpc/grpc-services/1.56.1/grpc-services-1.56.1.jar +0 -0
  40. data/vendor/jar-dependencies/io/grpc/grpc-stub/{1.48.0/grpc-stub-1.48.0.jar → 1.56.1/grpc-stub-1.56.1.jar} +0 -0
  41. data/vendor/jar-dependencies/io/grpc/grpc-xds/{1.48.0/grpc-xds-1.48.0.jar → 1.56.1/grpc-xds-1.56.1.jar} +0 -0
  42. data/vendor/jar-dependencies/io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0.jar +0 -0
  43. data/vendor/jar-dependencies/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar +0 -0
  44. data/vendor/jar-dependencies/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar +0 -0
  45. data/vendor/jar-dependencies/org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar +0 -0
  46. data/vendor/jar-dependencies/org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23.jar +0 -0
  47. data/vendor/jar-dependencies/org/logstash/inputs/plugin/1.4.0/plugin-1.4.0.jar +0 -0
  48. data/vendor/jar-dependencies/org/threeten/threetenbp/{1.6.0/threetenbp-1.6.0.jar → 1.6.8/threetenbp-1.6.8.jar} +0 -0
  49. metadata +51 -49
  50. data/vendor/jar-dependencies/com/google/api/api-common/2.2.1/api-common-2.2.1.jar +0 -0
  51. data/vendor/jar-dependencies/com/google/api/gax/2.18.7/gax-2.18.7.jar +0 -0
  52. data/vendor/jar-dependencies/com/google/api/gax-grpc/2.18.7/gax-grpc-2.18.7.jar +0 -0
  53. data/vendor/jar-dependencies/com/google/api/gax-httpjson/0.103.7/gax-httpjson-0.103.7.jar +0 -0
  54. data/vendor/jar-dependencies/com/google/api/grpc/proto-google-cloud-pubsub-v1/1.102.13/proto-google-cloud-pubsub-v1-1.102.13.jar +0 -0
  55. data/vendor/jar-dependencies/com/google/api/grpc/proto-google-common-protos/2.9.2/proto-google-common-protos-2.9.2.jar +0 -0
  56. data/vendor/jar-dependencies/com/google/api/grpc/proto-google-iam-v1/1.5.2/proto-google-iam-v1-1.5.2.jar +0 -0
  57. data/vendor/jar-dependencies/com/google/auth/google-auth-library-credentials/1.8.1/google-auth-library-credentials-1.8.1.jar +0 -0
  58. data/vendor/jar-dependencies/com/google/auth/google-auth-library-oauth2-http/1.8.1/google-auth-library-oauth2-http-1.8.1.jar +0 -0
  59. data/vendor/jar-dependencies/com/google/auto/value/auto-value-annotations/1.9/auto-value-annotations-1.9.jar +0 -0
  60. data/vendor/jar-dependencies/com/google/cloud/google-cloud-pubsub/1.120.13/google-cloud-pubsub-1.120.13.jar +0 -0
  61. data/vendor/jar-dependencies/com/google/code/gson/gson/2.9.1/gson-2.9.1.jar +0 -0
  62. data/vendor/jar-dependencies/com/google/errorprone/error_prone_annotations/2.14.0/error_prone_annotations-2.14.0.jar +0 -0
  63. data/vendor/jar-dependencies/com/google/guava/guava/31.1-jre/guava-31.1-jre.jar +0 -0
  64. data/vendor/jar-dependencies/com/google/http-client/google-http-client-gson/1.42.2/google-http-client-gson-1.42.2.jar +0 -0
  65. data/vendor/jar-dependencies/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar +0 -0
  66. data/vendor/jar-dependencies/com/google/protobuf/protobuf-java/3.21.4/protobuf-java-3.21.4.jar +0 -0
  67. data/vendor/jar-dependencies/com/google/protobuf/protobuf-java-util/3.21.4/protobuf-java-util-3.21.4.jar +0 -0
  68. data/vendor/jar-dependencies/io/grpc/grpc-alts/1.48.0/grpc-alts-1.48.0.jar +0 -0
  69. data/vendor/jar-dependencies/io/grpc/grpc-auth/1.48.0/grpc-auth-1.48.0.jar +0 -0
  70. data/vendor/jar-dependencies/io/grpc/grpc-context/1.48.0/grpc-context-1.48.0.jar +0 -0
  71. data/vendor/jar-dependencies/io/grpc/grpc-core/1.48.0/grpc-core-1.48.0.jar +0 -0
  72. data/vendor/jar-dependencies/io/grpc/grpc-googleapis/1.48.0/grpc-googleapis-1.48.0.jar +0 -0
  73. data/vendor/jar-dependencies/io/grpc/grpc-grpclb/1.48.0/grpc-grpclb-1.48.0.jar +0 -0
  74. data/vendor/jar-dependencies/io/grpc/grpc-protobuf-lite/1.48.0/grpc-protobuf-lite-1.48.0.jar +0 -0
  75. data/vendor/jar-dependencies/io/grpc/grpc-services/1.48.0/grpc-services-1.48.0.jar +0 -0
  76. data/vendor/jar-dependencies/io/perfmark/perfmark-api/0.25.0/perfmark-api-0.25.0.jar +0 -0
  77. data/vendor/jar-dependencies/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar +0 -0
  78. data/vendor/jar-dependencies/org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar +0 -0
  79. data/vendor/jar-dependencies/org/checkerframework/checker-qual/3.23.0/checker-qual-3.23.0.jar +0 -0
  80. data/vendor/jar-dependencies/org/codehaus/mojo/animal-sniffer-annotations/1.21/animal-sniffer-annotations-1.21.jar +0 -0
  81. data/vendor/jar-dependencies/org/logstash/inputs/plugin/1.2.2/plugin-1.2.2.jar +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc1279ce3f75158f4a960136826fc80a0a936ab358ca1d05b5d673eaaf05ce10
4
- data.tar.gz: dfa594834563c91e1a482ab8ad5bcb4c64702a99dc2678751d1070bb21285858
3
+ metadata.gz: 9b4696d6b9d4edf149cfe2e20e95f1e60fe325abfef7b270d75ffc5abfb35b6c
4
+ data.tar.gz: 2aea3006b94752de7e74d2e514ec47d4ce26849f950f80d359c59bbdaef6ad4b
5
5
  SHA512:
6
- metadata.gz: 18ab4cc3cfd54e55a32fe89d4e0847d027ab1e7eeb7a5f9dbf3abd0591597a9b4cf56f2da5fec71a43f3a08e1458169de0301bab6d1cff04a9b6ecfbe08c88a7
7
- data.tar.gz: 4a274d96d6f67f9555755c7465b9c9d97586d789f29a37853f5a782ff2e0698c760828036c3eabc002abbd322889fedb994b77cf9cbfa8bee0412117b4c6c7a5
6
+ metadata.gz: 26183a428dc24b48bec30ab50181422b38805ebe9723527a9a9543a587f75b99318ac25f97d885d52f1528e148d492e868e7a79798941817ce6bb26ce4ca6368
7
+ data.tar.gz: a05ce16d125d82202bdd1fb10e4ff452ce519aebace71390dd5d534db343b62f6e06b2bb313e83d81b300f622efb6a9650e171fa2e48de9d658532913db4a0e5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 1.4.0
2
+ - Added optional field json_key_file_content to get Service Account JSON key as an String input. [#68](https://github.com/logstash-plugins/logstash-input-google_pubsub/pull/68)
3
+
4
+ ## 1.3.0
5
+ - Updated plugins dependencies [#62](https://github.com/logstash-plugins/logstash-input-google_pubsub/pull/62)
6
+
1
7
  ## 1.2.2
2
8
  - Updated dependencies forcing this plugin to be compatible only with Logstash >= 8.2.0 [#58](https://github.com/logstash-plugins/logstash-input-google_pubsub/pull/58)
3
9
 
data/README.md CHANGED
@@ -49,7 +49,9 @@ You have two options for authentication depending on where you run Logstash.
49
49
 
50
50
  1. If you are running Logstash outside of Google Cloud Platform, then you will
51
51
  need to create a Google Cloud Platform Service Account and specify the full
52
- path to the JSON private key file in your config. You must assign sufficient
52
+ path to the JSON private key file in your config in `json_key_file` setting.
53
+ If you don't want to upload the file and use its content as a string, then add the content
54
+ of JSON private key in `json_key_file_content` setting. You must assign sufficient
53
55
  roles to the Service Account to create a subscription and to pull messages
54
56
  from the subscription. Learn more about GCP Service Accounts and IAM roles
55
57
  here:
@@ -58,7 +60,7 @@ here:
58
60
  - Creating Service Accounts [overview](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
59
61
  - Granting Roles [overview](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts)
60
62
 
61
- 1. If you are running Logstash on a Google Compute Engine instance, you may opt
63
+ 2. If you are running Logstash on a Google Compute Engine instance, you may opt
62
64
  to use Application Default Credentials. In this case, you will not need to
63
65
  specify a JSON private key file in your config.
64
66
 
@@ -120,19 +122,30 @@ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/log
120
122
 
121
123
  ## Developing
122
124
 
123
- ### 1. Plugin Developement and Testing
125
+ ### 1. Plugin Development and Testing
124
126
 
125
127
  #### Code
128
+
126
129
  - To get started, you'll need JRuby with the Bundler gem installed.
130
+ - You'll also need a Logstash installation to build the plugin against.
127
131
 
128
132
  - Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
129
133
 
130
- - Install dependencies
134
+ - `export LOGSTASH_SOURCE=1` and point `LOGSTASH_PATH` to a local Logstash
135
+ e.g. `export LOGSTASH_PATH=/opt/local/logstash-8.7.0`
136
+
137
+ - Install Ruby dependencies
131
138
  ```sh
132
139
  bundle install
133
- rake install_jars
134
140
  ```
135
141
 
142
+ - Install Java dependencies - regenerates the *lib/logstash-input-google_pubsub_jars.rb*
143
+ script used to load the .jar dependencies when the plugin starts.
144
+ ```sh
145
+ ./gradlew vendor
146
+ ```
147
+ NOTE: This step is necessary whenever **build.gradle** is updated.
148
+
136
149
  #### Test
137
150
 
138
151
  - Update your dependencies
@@ -141,7 +154,7 @@ rake install_jars
141
154
  bundle install
142
155
  ```
143
156
 
144
- - Run tests
157
+ - Run Ruby tests
145
158
 
146
159
  ```sh
147
160
  bundle exec rspec
@@ -157,12 +170,7 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
157
170
  ```
158
171
  - Install plugin
159
172
  ```sh
160
- # Logstash 2.3 and higher
161
173
  bin/logstash-plugin install --no-verify
162
-
163
- # Prior to Logstash 2.3
164
- bin/plugin install --no-verify
165
-
166
174
  ```
167
175
  - Run Logstash with your plugin
168
176
  ```sh
@@ -180,12 +188,7 @@ gem build logstash-filter-awesome.gemspec
180
188
  ```
181
189
  - Install the plugin from the Logstash home
182
190
  ```sh
183
- # Logstash 2.3 and higher
184
191
  bin/logstash-plugin install --no-verify
185
-
186
- # Prior to Logstash 2.3
187
- bin/plugin install --no-verify
188
-
189
192
  ```
190
193
  - Start Logstash and proceed to test the plugin
191
194
 
data/docs/index.asciidoc CHANGED
@@ -79,8 +79,9 @@ plugin will return the raw text in as `raw_message` in the logstash `event`.
79
79
  You have two options for authentication depending on where you run Logstash.
80
80
 
81
81
  1. If you are running Logstash outside of Google Cloud Platform, then you will
82
- need to create a Google Cloud Platform Service Account and specify the full
83
- path to the JSON private key file in your config. You must assign sufficient
82
+ path to the JSON private key file in your config in `json_key_file` setting.
83
+ If you don't want to upload the file and use its content as a string, then add the content
84
+ of JSON private key in `json_key_file_content` setting. You must assign sufficient
84
85
  roles to the Service Account to create a subscription and to pull messages
85
86
  from the subscription. Learn more about GCP Service Accounts and IAM roles
86
87
  here:
@@ -200,10 +200,18 @@ class LogStash::Inputs::GooglePubSub < LogStash::Inputs::Base
200
200
  config :subscription, :validate => :string, :required => true
201
201
  config :max_messages, :validate => :number, :required => true, :default => 5
202
202
 
203
- # If logstash is running within Google Compute Engine, the plugin will use
204
- # GCE's Application Default Credentials. Outside of GCE, you will need to
205
- # specify a Service Account JSON key file.
203
+ # If Logstash is running within Google Compute Engine (GCE), the plugin will use
204
+ # GCE's Application Default Credentials. When running outside of GCE, you must
205
+ # provide a Service Account JSON key. This can be done in one of two ways:
206
+ #
207
+ # 1. Specify the file path to the JSON key file using the `json_key_file` option.
208
+ # 2. Provide the JSON key as a base64-encoded string using the `json_key_file_content` option.
209
+ #
210
+ # Both `json_key_file` and `json_key_file_content` are optional, but you must
211
+ # specify one of them if Logstash is running outside of GCE. It is invalid to
212
+ # provide both options simultaneously.
206
213
  config :json_key_file, :validate => :path, :required => false
214
+ config :json_key_file_content, :validate => :string, :required => false
207
215
 
208
216
  # If set true, will include the full message data in the `[@metadata][pubsub_message]` field.
209
217
  config :include_metadata, :validate => :boolean, :required => false, :default => false
@@ -221,11 +229,20 @@ class LogStash::Inputs::GooglePubSub < LogStash::Inputs::Base
221
229
  @logger.debug("Registering Google PubSub Input: project_id=#{@project_id}, topic=#{@topic}, subscription=#{@subscription}")
222
230
  @subscription_id = "projects/#{@project_id}/subscriptions/#{@subscription}"
223
231
 
232
+ if json_key_file && json_key_file_content
233
+ raise LogStash::ConfigurationError, "Specify either 'json_key_file' or 'json_key_file_content', defining both simultanously is not permitted."
234
+ end
235
+
224
236
  if @json_key_file
225
237
  @credentialsProvider = FixedCredentialsProvider.create(
226
238
  ServiceAccountCredentials.fromStream(java.io.FileInputStream.new(@json_key_file))
227
239
  )
240
+ elsif @json_key_file_content
241
+ @credentialsProvider = FixedCredentialsProvider.create(
242
+ ServiceAccountCredentials.fromStream(java.io.ByteArrayInputStream.new((@json_key_file_content).to_java_bytes))
243
+ )
228
244
  end
245
+
229
246
  @topic_name = ProjectTopicName.of(@project_id, @topic)
230
247
  @subscription_name = ProjectSubscriptionName.of(@project_id, @subscription)
231
248
  end
@@ -1,54 +1,54 @@
1
1
  # AUTOGENERATED BY THE GRADLE SCRIPT. DO NOT EDIT.
2
2
 
3
3
  require 'jar_dependencies'
4
- require_jar('com.google.cloud', 'google-cloud-pubsub', '1.120.13')
5
- require_jar('io.grpc', 'grpc-api', '1.48.0')
6
- require_jar('io.grpc', 'grpc-context', '1.48.0')
7
- require_jar('io.grpc', 'grpc-stub', '1.48.0')
8
- require_jar('io.grpc', 'grpc-protobuf', '1.48.0')
9
- require_jar('io.grpc', 'grpc-protobuf-lite', '1.48.0')
10
- require_jar('com.google.api', 'api-common', '2.2.1')
11
- require_jar('javax.annotation', 'javax.annotation-api', '1.3.2')
12
- require_jar('com.google.protobuf', 'protobuf-java', '3.21.4')
13
- require_jar('com.google.api.grpc', 'proto-google-common-protos', '2.9.2')
14
- require_jar('com.google.auth', 'google-auth-library-oauth2-http', '1.8.1')
15
- require_jar('com.google.auth', 'google-auth-library-credentials', '1.8.1')
16
- require_jar('com.google.http-client', 'google-http-client-gson', '1.42.2')
17
- require_jar('com.google.api.grpc', 'proto-google-cloud-pubsub-v1', '1.102.13')
18
- require_jar('com.google.auto.value', 'auto-value-annotations', '1.9')
4
+ require_jar('com.google.cloud', 'google-cloud-pubsub', '1.124.1')
5
+ require_jar('com.google.android', 'annotations', '4.1.1.4')
6
+ require_jar('com.google.api.grpc', 'proto-google-cloud-pubsub-v1', '1.106.1')
7
+ require_jar('com.google.api.grpc', 'proto-google-common-protos', '2.23.0')
8
+ require_jar('com.google.api.grpc', 'proto-google-iam-v1', '1.18.0')
9
+ require_jar('com.google.api', 'api-common', '2.15.0')
10
+ require_jar('com.google.api', 'gax-grpc', '2.32.0')
11
+ require_jar('com.google.api', 'gax-httpjson', '2.32.0')
12
+ require_jar('com.google.api', 'gax', '2.32.0')
13
+ require_jar('com.google.auth', 'google-auth-library-credentials', '1.19.0')
14
+ require_jar('com.google.auth', 'google-auth-library-oauth2-http', '1.19.0')
15
+ require_jar('com.google.auto.value', 'auto-value-annotations', '1.10.2')
16
+ require_jar('com.google.code.findbugs', 'jsr305', '3.0.2')
17
+ require_jar('com.google.code.gson', 'gson', '2.10.1')
18
+ require_jar('com.google.errorprone', 'error_prone_annotations', '2.18.0')
19
19
  require_jar('com.google.guava', 'failureaccess', '1.0.1')
20
+ require_jar('com.google.guava', 'guava', '32.1.2-jre')
20
21
  require_jar('com.google.guava', 'listenablefuture', '9999.0-empty-to-avoid-conflict-with-guava')
21
- require_jar('com.google.code.findbugs', 'jsr305', '3.0.2')
22
- require_jar('org.checkerframework', 'checker-qual', '3.23.0')
23
- require_jar('com.google.errorprone', 'error_prone_annotations', '2.14.0')
24
- require_jar('com.google.j2objc', 'j2objc-annotations', '1.3')
25
- require_jar('com.google.api.grpc', 'proto-google-iam-v1', '1.5.2')
26
- require_jar('com.google.guava', 'guava', '31.1-jre')
27
- require_jar('com.google.api', 'gax', '2.18.7')
28
- require_jar('com.google.api', 'gax-grpc', '2.18.7')
29
- require_jar('io.grpc', 'grpc-alts', '1.48.0')
30
- require_jar('io.grpc', 'grpc-grpclb', '1.48.0')
31
- require_jar('org.conscrypt', 'conscrypt-openjdk-uber', '2.5.2')
32
- require_jar('io.grpc', 'grpc-auth', '1.48.0')
33
- require_jar('io.grpc', 'grpc-netty-shaded', '1.48.0')
34
- require_jar('io.grpc', 'grpc-googleapis', '1.48.0')
35
- require_jar('io.grpc', 'grpc-xds', '1.48.0')
36
- require_jar('io.grpc', 'grpc-services', '1.48.0')
37
- require_jar('com.google.re2j', 're2j', '1.6')
38
- require_jar('io.opencensus', 'opencensus-proto', '0.2.0')
39
- require_jar('com.google.api', 'gax-httpjson', '0.103.7')
40
- require_jar('com.google.code.gson', 'gson', '2.9.1')
41
- require_jar('com.google.protobuf', 'protobuf-java-util', '3.21.4')
42
- require_jar('org.threeten', 'threetenbp', '1.6.0')
43
- require_jar('io.opencensus', 'opencensus-api', '0.31.1')
44
- require_jar('io.grpc', 'grpc-core', '1.48.0')
45
- require_jar('com.google.android', 'annotations', '4.1.1.4')
46
- require_jar('org.codehaus.mojo', 'animal-sniffer-annotations', '1.21')
47
- require_jar('io.perfmark', 'perfmark-api', '0.25.0')
48
- require_jar('com.google.http-client', 'google-http-client', '1.42.2')
49
- require_jar('org.apache.httpcomponents', 'httpclient', '4.5.13')
50
- require_jar('commons-logging', 'commons-logging', '1.2')
22
+ require_jar('com.google.http-client', 'google-http-client-gson', '1.43.3')
23
+ require_jar('com.google.http-client', 'google-http-client', '1.43.3')
24
+ require_jar('com.google.j2objc', 'j2objc-annotations', '2.8')
25
+ require_jar('com.google.protobuf', 'protobuf-java-util', '3.23.2')
26
+ require_jar('com.google.protobuf', 'protobuf-java', '3.23.2')
27
+ require_jar('com.google.re2j', 're2j', '1.7')
51
28
  require_jar('commons-codec', 'commons-codec', '1.15')
52
- require_jar('org.apache.httpcomponents', 'httpcore', '4.4.15')
29
+ require_jar('commons-logging', 'commons-logging', '1.2')
30
+ require_jar('io.grpc', 'grpc-alts', '1.56.1')
31
+ require_jar('io.grpc', 'grpc-api', '1.56.1')
32
+ require_jar('io.grpc', 'grpc-auth', '1.56.1')
33
+ require_jar('io.grpc', 'grpc-context', '1.56.1')
34
+ require_jar('io.grpc', 'grpc-core', '1.56.1')
35
+ require_jar('io.grpc', 'grpc-googleapis', '1.56.1')
36
+ require_jar('io.grpc', 'grpc-grpclb', '1.56.1')
37
+ require_jar('io.grpc', 'grpc-netty-shaded', '1.56.1')
38
+ require_jar('io.grpc', 'grpc-protobuf-lite', '1.56.1')
39
+ require_jar('io.grpc', 'grpc-protobuf', '1.56.1')
40
+ require_jar('io.grpc', 'grpc-services', '1.56.1')
41
+ require_jar('io.grpc', 'grpc-stub', '1.56.1')
42
+ require_jar('io.grpc', 'grpc-xds', '1.56.1')
43
+ require_jar('io.opencensus', 'opencensus-api', '0.31.1')
53
44
  require_jar('io.opencensus', 'opencensus-contrib-http-util', '0.31.1')
54
- require_jar('org.logstash.inputs', 'plugin', '1.2.2')
45
+ require_jar('io.opencensus', 'opencensus-proto', '0.2.0')
46
+ require_jar('io.perfmark', 'perfmark-api', '0.26.0')
47
+ require_jar('javax.annotation', 'javax.annotation-api', '1.3.2')
48
+ require_jar('org.apache.httpcomponents', 'httpclient', '4.5.14')
49
+ require_jar('org.apache.httpcomponents', 'httpcore', '4.4.16')
50
+ require_jar('org.checkerframework', 'checker-qual', '3.33.0')
51
+ require_jar('org.codehaus.mojo', 'animal-sniffer-annotations', '1.23')
52
+ require_jar('org.conscrypt', 'conscrypt-openjdk-uber', '2.5.2')
53
+ require_jar('org.threeten', 'threetenbp', '1.6.8')
54
+ require_jar('org.logstash.inputs', 'plugin', '1.4.0')
@@ -34,4 +34,12 @@ describe LogStash::Inputs::GooglePubSub do
34
34
  plugin = LogStash::Inputs::GooglePubSub.new(bad3)
35
35
  }.to raise_error(LogStash::ConfigurationError)
36
36
  end
37
+
38
+ let(:file_and_content_config_settings) { { 'project_id' => 'myproj', 'subscription' => 'foo', 'topic' => 'bar', 'json_key_file' => 'spec/inputs/test.json', 'json_key_file_content' => '{}' } }
39
+ it "raise a configuration error if both 'json_key_file' and 'json_key_file_content' are present" do
40
+ expect {
41
+ plugin = LogStash::Inputs::GooglePubSub.new(file_and_content_config_settings)
42
+ plugin.register()
43
+ }.to raise_error(LogStash::ConfigurationError)
44
+ end
37
45
  end
@@ -0,0 +1,14 @@
1
+ {
2
+ "type": "service_account",
3
+ "project_id": "test-project-id",
4
+ "private_key_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
5
+ "private_key": "-----BEGIN PRIVATE KEY-----\nxxxxxxxxxxx\n-----END PRIVATE KEY-----\n",
6
+ "client_email": "test-username@test-project-id.iam.gserviceaccount.com",
7
+ "client_id": "111111111111111111111",
8
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
9
+ "token_uri": "https://oauth2.googleapis.com/token",
10
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11
+ "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/apachesolrgcp-pubsub%40charged-mind-281913.iam.gserviceaccount.com",
12
+ "universe_domain": "googleapis.com"
13
+ }
14
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-google_pubsub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Johnson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-13 00:00:00.000000000 Z
11
+ date: 2024-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -17,8 +17,8 @@ dependencies:
17
17
  - !ruby/object:Gem::Version
18
18
  version: 8.2.0
19
19
  name: logstash-core
20
- prerelease: false
21
20
  type: :runtime
21
+ prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
@@ -34,8 +34,8 @@ dependencies:
34
34
  - !ruby/object:Gem::Version
35
35
  version: '2.99'
36
36
  name: logstash-core-plugin-api
37
- prerelease: false
38
37
  type: :runtime
38
+ prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - ">="
@@ -51,8 +51,8 @@ dependencies:
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  name: logstash-codec-plain
54
- prerelease: false
55
54
  type: :runtime
55
+ prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
@@ -65,8 +65,8 @@ dependencies:
65
65
  - !ruby/object:Gem::Version
66
66
  version: 0.0.22
67
67
  name: stud
68
- prerelease: false
69
68
  type: :runtime
69
+ prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
@@ -79,8 +79,8 @@ dependencies:
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  name: logstash-devutils
82
- prerelease: false
83
82
  type: :development
83
+ prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
@@ -93,8 +93,8 @@ dependencies:
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0.4'
95
95
  name: jar-dependencies
96
- prerelease: false
97
96
  type: :development
97
+ prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
@@ -120,57 +120,58 @@ files:
120
120
  - lib/logstash/inputs/google_pubsub.rb
121
121
  - logstash-input-google_pubsub.gemspec
122
122
  - spec/inputs/google_pubsub_spec.rb
123
+ - spec/inputs/test.json
123
124
  - vendor/jar-dependencies/com/google/android/annotations/4.1.1.4/annotations-4.1.1.4.jar
124
- - vendor/jar-dependencies/com/google/api/api-common/2.2.1/api-common-2.2.1.jar
125
- - vendor/jar-dependencies/com/google/api/gax-grpc/2.18.7/gax-grpc-2.18.7.jar
126
- - vendor/jar-dependencies/com/google/api/gax-httpjson/0.103.7/gax-httpjson-0.103.7.jar
127
- - vendor/jar-dependencies/com/google/api/gax/2.18.7/gax-2.18.7.jar
128
- - vendor/jar-dependencies/com/google/api/grpc/proto-google-cloud-pubsub-v1/1.102.13/proto-google-cloud-pubsub-v1-1.102.13.jar
129
- - vendor/jar-dependencies/com/google/api/grpc/proto-google-common-protos/2.9.2/proto-google-common-protos-2.9.2.jar
130
- - vendor/jar-dependencies/com/google/api/grpc/proto-google-iam-v1/1.5.2/proto-google-iam-v1-1.5.2.jar
131
- - vendor/jar-dependencies/com/google/auth/google-auth-library-credentials/1.8.1/google-auth-library-credentials-1.8.1.jar
132
- - vendor/jar-dependencies/com/google/auth/google-auth-library-oauth2-http/1.8.1/google-auth-library-oauth2-http-1.8.1.jar
133
- - vendor/jar-dependencies/com/google/auto/value/auto-value-annotations/1.9/auto-value-annotations-1.9.jar
134
- - vendor/jar-dependencies/com/google/cloud/google-cloud-pubsub/1.120.13/google-cloud-pubsub-1.120.13.jar
125
+ - vendor/jar-dependencies/com/google/api/api-common/2.15.0/api-common-2.15.0.jar
126
+ - vendor/jar-dependencies/com/google/api/gax-grpc/2.32.0/gax-grpc-2.32.0.jar
127
+ - vendor/jar-dependencies/com/google/api/gax-httpjson/2.32.0/gax-httpjson-2.32.0.jar
128
+ - vendor/jar-dependencies/com/google/api/gax/2.32.0/gax-2.32.0.jar
129
+ - vendor/jar-dependencies/com/google/api/grpc/proto-google-cloud-pubsub-v1/1.106.1/proto-google-cloud-pubsub-v1-1.106.1.jar
130
+ - vendor/jar-dependencies/com/google/api/grpc/proto-google-common-protos/2.23.0/proto-google-common-protos-2.23.0.jar
131
+ - vendor/jar-dependencies/com/google/api/grpc/proto-google-iam-v1/1.18.0/proto-google-iam-v1-1.18.0.jar
132
+ - vendor/jar-dependencies/com/google/auth/google-auth-library-credentials/1.19.0/google-auth-library-credentials-1.19.0.jar
133
+ - vendor/jar-dependencies/com/google/auth/google-auth-library-oauth2-http/1.19.0/google-auth-library-oauth2-http-1.19.0.jar
134
+ - vendor/jar-dependencies/com/google/auto/value/auto-value-annotations/1.10.2/auto-value-annotations-1.10.2.jar
135
+ - vendor/jar-dependencies/com/google/cloud/google-cloud-pubsub/1.124.1/google-cloud-pubsub-1.124.1.jar
135
136
  - vendor/jar-dependencies/com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
136
- - vendor/jar-dependencies/com/google/code/gson/gson/2.9.1/gson-2.9.1.jar
137
- - vendor/jar-dependencies/com/google/errorprone/error_prone_annotations/2.14.0/error_prone_annotations-2.14.0.jar
137
+ - vendor/jar-dependencies/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar
138
+ - vendor/jar-dependencies/com/google/errorprone/error_prone_annotations/2.18.0/error_prone_annotations-2.18.0.jar
138
139
  - vendor/jar-dependencies/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar
139
- - vendor/jar-dependencies/com/google/guava/guava/31.1-jre/guava-31.1-jre.jar
140
+ - vendor/jar-dependencies/com/google/guava/guava/32.1.2-jre/guava-32.1.2-jre.jar
140
141
  - vendor/jar-dependencies/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
141
- - vendor/jar-dependencies/com/google/http-client/google-http-client-gson/1.42.2/google-http-client-gson-1.42.2.jar
142
- - vendor/jar-dependencies/com/google/http-client/google-http-client/1.42.2/google-http-client-1.42.2.jar
143
- - vendor/jar-dependencies/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar
144
- - vendor/jar-dependencies/com/google/protobuf/protobuf-java-util/3.21.4/protobuf-java-util-3.21.4.jar
145
- - vendor/jar-dependencies/com/google/protobuf/protobuf-java/3.21.4/protobuf-java-3.21.4.jar
146
- - vendor/jar-dependencies/com/google/re2j/re2j/1.6/re2j-1.6.jar
142
+ - vendor/jar-dependencies/com/google/http-client/google-http-client-gson/1.43.3/google-http-client-gson-1.43.3.jar
143
+ - vendor/jar-dependencies/com/google/http-client/google-http-client/1.43.3/google-http-client-1.43.3.jar
144
+ - vendor/jar-dependencies/com/google/j2objc/j2objc-annotations/2.8/j2objc-annotations-2.8.jar
145
+ - vendor/jar-dependencies/com/google/protobuf/protobuf-java-util/3.23.2/protobuf-java-util-3.23.2.jar
146
+ - vendor/jar-dependencies/com/google/protobuf/protobuf-java/3.23.2/protobuf-java-3.23.2.jar
147
+ - vendor/jar-dependencies/com/google/re2j/re2j/1.7/re2j-1.7.jar
147
148
  - vendor/jar-dependencies/commons-codec/commons-codec/1.15/commons-codec-1.15.jar
148
149
  - vendor/jar-dependencies/commons-logging/commons-logging/1.2/commons-logging-1.2.jar
149
- - vendor/jar-dependencies/io/grpc/grpc-alts/1.48.0/grpc-alts-1.48.0.jar
150
- - vendor/jar-dependencies/io/grpc/grpc-api/1.48.0/grpc-api-1.48.0.jar
151
- - vendor/jar-dependencies/io/grpc/grpc-auth/1.48.0/grpc-auth-1.48.0.jar
152
- - vendor/jar-dependencies/io/grpc/grpc-context/1.48.0/grpc-context-1.48.0.jar
153
- - vendor/jar-dependencies/io/grpc/grpc-core/1.48.0/grpc-core-1.48.0.jar
154
- - vendor/jar-dependencies/io/grpc/grpc-googleapis/1.48.0/grpc-googleapis-1.48.0.jar
155
- - vendor/jar-dependencies/io/grpc/grpc-grpclb/1.48.0/grpc-grpclb-1.48.0.jar
156
- - vendor/jar-dependencies/io/grpc/grpc-netty-shaded/1.48.0/grpc-netty-shaded-1.48.0.jar
157
- - vendor/jar-dependencies/io/grpc/grpc-protobuf-lite/1.48.0/grpc-protobuf-lite-1.48.0.jar
158
- - vendor/jar-dependencies/io/grpc/grpc-protobuf/1.48.0/grpc-protobuf-1.48.0.jar
159
- - vendor/jar-dependencies/io/grpc/grpc-services/1.48.0/grpc-services-1.48.0.jar
160
- - vendor/jar-dependencies/io/grpc/grpc-stub/1.48.0/grpc-stub-1.48.0.jar
161
- - vendor/jar-dependencies/io/grpc/grpc-xds/1.48.0/grpc-xds-1.48.0.jar
150
+ - vendor/jar-dependencies/io/grpc/grpc-alts/1.56.1/grpc-alts-1.56.1.jar
151
+ - vendor/jar-dependencies/io/grpc/grpc-api/1.56.1/grpc-api-1.56.1.jar
152
+ - vendor/jar-dependencies/io/grpc/grpc-auth/1.56.1/grpc-auth-1.56.1.jar
153
+ - vendor/jar-dependencies/io/grpc/grpc-context/1.56.1/grpc-context-1.56.1.jar
154
+ - vendor/jar-dependencies/io/grpc/grpc-core/1.56.1/grpc-core-1.56.1.jar
155
+ - vendor/jar-dependencies/io/grpc/grpc-googleapis/1.56.1/grpc-googleapis-1.56.1.jar
156
+ - vendor/jar-dependencies/io/grpc/grpc-grpclb/1.56.1/grpc-grpclb-1.56.1.jar
157
+ - vendor/jar-dependencies/io/grpc/grpc-netty-shaded/1.56.1/grpc-netty-shaded-1.56.1.jar
158
+ - vendor/jar-dependencies/io/grpc/grpc-protobuf-lite/1.56.1/grpc-protobuf-lite-1.56.1.jar
159
+ - vendor/jar-dependencies/io/grpc/grpc-protobuf/1.56.1/grpc-protobuf-1.56.1.jar
160
+ - vendor/jar-dependencies/io/grpc/grpc-services/1.56.1/grpc-services-1.56.1.jar
161
+ - vendor/jar-dependencies/io/grpc/grpc-stub/1.56.1/grpc-stub-1.56.1.jar
162
+ - vendor/jar-dependencies/io/grpc/grpc-xds/1.56.1/grpc-xds-1.56.1.jar
162
163
  - vendor/jar-dependencies/io/opencensus/opencensus-api/0.31.1/opencensus-api-0.31.1.jar
163
164
  - vendor/jar-dependencies/io/opencensus/opencensus-contrib-http-util/0.31.1/opencensus-contrib-http-util-0.31.1.jar
164
165
  - vendor/jar-dependencies/io/opencensus/opencensus-proto/0.2.0/opencensus-proto-0.2.0.jar
165
- - vendor/jar-dependencies/io/perfmark/perfmark-api/0.25.0/perfmark-api-0.25.0.jar
166
+ - vendor/jar-dependencies/io/perfmark/perfmark-api/0.26.0/perfmark-api-0.26.0.jar
166
167
  - vendor/jar-dependencies/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar
167
- - vendor/jar-dependencies/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
168
- - vendor/jar-dependencies/org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar
169
- - vendor/jar-dependencies/org/checkerframework/checker-qual/3.23.0/checker-qual-3.23.0.jar
170
- - vendor/jar-dependencies/org/codehaus/mojo/animal-sniffer-annotations/1.21/animal-sniffer-annotations-1.21.jar
168
+ - vendor/jar-dependencies/org/apache/httpcomponents/httpclient/4.5.14/httpclient-4.5.14.jar
169
+ - vendor/jar-dependencies/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar
170
+ - vendor/jar-dependencies/org/checkerframework/checker-qual/3.33.0/checker-qual-3.33.0.jar
171
+ - vendor/jar-dependencies/org/codehaus/mojo/animal-sniffer-annotations/1.23/animal-sniffer-annotations-1.23.jar
171
172
  - vendor/jar-dependencies/org/conscrypt/conscrypt-openjdk-uber/2.5.2/conscrypt-openjdk-uber-2.5.2.jar
172
- - vendor/jar-dependencies/org/logstash/inputs/plugin/1.2.2/plugin-1.2.2.jar
173
- - vendor/jar-dependencies/org/threeten/threetenbp/1.6.0/threetenbp-1.6.0.jar
173
+ - vendor/jar-dependencies/org/logstash/inputs/plugin/1.4.0/plugin-1.4.0.jar
174
+ - vendor/jar-dependencies/org/threeten/threetenbp/1.6.8/threetenbp-1.6.8.jar
174
175
  homepage: https://cloud.google.com/pubsub/overview
175
176
  licenses:
176
177
  - Apache-2.0
@@ -199,9 +200,10 @@ requirements:
199
200
  - jar 'com.google.guava:guava', '20.0'
200
201
  - jar 'com.google.api:api-common', '1.2.0'
201
202
  - jar 'com.google.auth:google-auth-library-oauth2-http', '0.9.0'
202
- rubygems_version: 3.1.6
203
+ rubygems_version: 3.3.26
203
204
  signing_key:
204
205
  specification_version: 4
205
206
  summary: Consume events from a Google Cloud PubSub service
206
207
  test_files:
207
208
  - spec/inputs/google_pubsub_spec.rb
209
+ - spec/inputs/test.json