logstash-input-salesforce 3.1.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 870cd242d68339c41cf0429f54d50a4b7cdf52100bf751605c121ad7d30fec65
4
- data.tar.gz: abb188afa3f9363a9b75d47bd104c24b6ad7c4f90770881ce4be41769eb61c77
3
+ metadata.gz: 991a872d0042a97aeb4f9d7d27d6cc25fad15a62771a8a6c6b7eae9d427d55a8
4
+ data.tar.gz: 525f6d7d6796b4670dcd47faabc7dbbbd641355b763626693e5be7edfc059107
5
5
  SHA512:
6
- metadata.gz: 01f2f0cc51b2db510684fb19d070ec057888a7e8b4a5026aa95a9d0beff079fa5173fa362e13693be9ed1d1132c659e762710954e2ea4ac4a2385099d7b54fb5
7
- data.tar.gz: 7936c9f1b66d2db85f7f363c7e0114af9d3adbcacf8aeca6ab74678db769c2f23a4bb313d0fe5bc9fbb3d912b43d11d8aaa8021c96876e59cbe0f80a2dfbe80c
6
+ metadata.gz: aca114e8b09b4895136cbd398d5134e7ef2adf85d1a2e067fe7a5986940f7ec1bdf27293b07da43c95db946b873bd8cbabd30d5e2c62550bb96775f9bd15d0a2
7
+ data.tar.gz: b5f752607e86f8b9873d3c8e45477dd24007d5f97cbbd3305645608fcf185d088a7f478f7175cd4f288495f6d61e184aa038a75e1f0919c19e6516756e6e17eb
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
+ ## 3.2.1
2
+ - Changes sensitive configs type to Password for better protection from leaks in debug logs. [#35](https://github.com/logstash-plugins/logstash-input-salesforce/pull/35)
3
+
4
+ ## 3.2.0
5
+ - Added `use_tooling_api` configuration to connect to the Salesforce Tooling API instead of the regular Rest API. [#26](https://github.com/logstash-plugins/logstash-input-salesforce/pull/26)
6
+
1
7
  ## 3.1.0
2
- - Added `sfdc_instance_url` configuration to connect to a specific url.
8
+ - Added `sfdc_instance_url` configuration to connect to a specific url. [#28](https://github.com/logstash-plugins/logstash-input-salesforce/pull/28)
3
9
  - Switch to restforce v5+ (for logstash 8.x compatibility)
4
10
 
5
11
  ## 3.0.7
data/docs/index.asciidoc CHANGED
@@ -76,15 +76,16 @@ This plugin supports the following configuration options plus the <<plugins-{typ
76
76
  |Setting |Input type|Required
77
77
  | <<plugins-{type}s-{plugin}-api_version>> |<<string,string>>|No
78
78
  | <<plugins-{type}s-{plugin}-client_id>> |<<string,string>>|Yes
79
- | <<plugins-{type}s-{plugin}-client_secret>> |<<string,string>>|Yes
80
- | <<plugins-{type}s-{plugin}-password>> |<<string,string>>|Yes
81
- | <<plugins-{type}s-{plugin}-security_token>> |<<string,string>>|Yes
79
+ | <<plugins-{type}s-{plugin}-client_secret>> |<<password,password>>|Yes
80
+ | <<plugins-{type}s-{plugin}-password>> |<<password,password>>|Yes
81
+ | <<plugins-{type}s-{plugin}-security_token>> |<<password,password>>|Yes
82
82
  | <<plugins-{type}s-{plugin}-sfdc_fields>> |<<array,array>>|No
83
83
  | <<plugins-{type}s-{plugin}-sfdc_filters>> |<<string,string>>|No
84
84
  | <<plugins-{type}s-{plugin}-sfdc_instance_url>> |<<string,string>>|No
85
85
  | <<plugins-{type}s-{plugin}-sfdc_object_name>> |<<string,string>>|Yes
86
86
  | <<plugins-{type}s-{plugin}-to_underscores>> |<<boolean,boolean>>|No
87
87
  | <<plugins-{type}s-{plugin}-use_test_sandbox>> |<<boolean,boolean>>|No
88
+ | <<plugins-{type}s-{plugin}-use_tooling_api>> |<<boolean,boolean>>|No
88
89
  | <<plugins-{type}s-{plugin}-username>> |<<string,string>>|Yes
89
90
  |=======================================================================
90
91
 
@@ -118,7 +119,7 @@ https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_create.htm
118
119
  ===== `client_secret`
119
120
 
120
121
  * This is a required setting.
121
- * Value type is <<string,string>>
122
+ * Value type is <<password,password>>
122
123
  * There is no default value for this setting.
123
124
 
124
125
  Consumer Secret from your oauth enabled connected app
@@ -127,7 +128,7 @@ Consumer Secret from your oauth enabled connected app
127
128
  ===== `password`
128
129
 
129
130
  * This is a required setting.
130
- * Value type is <<string,string>>
131
+ * Value type is <<password,password>>
131
132
  * There is no default value for this setting.
132
133
 
133
134
  The password used to login to sfdc
@@ -136,7 +137,7 @@ The password used to login to sfdc
136
137
  ===== `security_token`
137
138
 
138
139
  * This is a required setting.
139
- * Value type is <<string,string>>
140
+ * Value type is <<password,password>>
140
141
  * There is no default value for this setting.
141
142
 
142
143
  The security token for this account. For more information about
@@ -204,6 +205,18 @@ logging in through test.salesforce.com
204
205
  Use either this or the `sfdc_instance_url` configuration option
205
206
  but not both to configure the url to which the plugin connects to.
206
207
 
208
+ [id="plugins-{type}s-{plugin}-use_tooling_api"]
209
+ ===== `use_tooling_api`
210
+
211
+ * Value type is <<boolean,boolean>>
212
+ * Default value is `false`
213
+
214
+ Set this to true to connect to the sfdc tooling api instead of the regular
215
+ sfdc rest api. See
216
+ https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling
217
+ for details about the sfdc tooling api. Use cases for the sfdc tooling api
218
+ include reading apex unit test results, flow coverage results (e.g. coverage
219
+ of elements of sfdc flows) and security health check risks.
207
220
 
208
221
  [id="plugins-{type}s-{plugin}-username"]
209
222
  ===== `username`
@@ -49,6 +49,12 @@ class LogStash::Inputs::Salesforce < LogStash::Inputs::Base
49
49
  config_name "salesforce"
50
50
  default :codec, "plain" #not used
51
51
 
52
+ # Set this to true to connect via the Tooling API instead of the Rest API.
53
+ # This allows accessing information like Apex Unit Test Results,
54
+ # Flow Coverage Results, Security Health Check Risks, etc.
55
+ # See https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling
56
+ # for more details about the Tooling API
57
+ config :use_tooling_api, :validate => :boolean, :default => false
52
58
  # Set this to true to connect to a sandbox sfdc instance
53
59
  # logging in through test.salesforce.com
54
60
  config :use_test_sandbox, :validate => :boolean, :default => false
@@ -66,17 +72,17 @@ class LogStash::Inputs::Salesforce < LogStash::Inputs::Base
66
72
  # https://help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_create.htm
67
73
  config :client_id, :validate => :string, :required => true
68
74
  # Consumer Secret from your oauth enabled connected app
69
- config :client_secret, :validate => :string, :required => true
75
+ config :client_secret, :validate => :password, :required => true
70
76
  # A valid salesforce user name, usually your email address.
71
77
  # Used for authentication and will be the user all objects
72
78
  # are created or modified by
73
79
  config :username, :validate => :string, :required => true
74
80
  # The password used to login to sfdc
75
- config :password, :validate => :string, :required => true
81
+ config :password, :validate => :password, :required => true
76
82
  # The security token for this account. For more information about
77
83
  # generting a security token, see:
78
84
  # https://help.salesforce.com/apex/HTViewHelpDoc?id=user_security_token.htm
79
- config :security_token, :validate => :string, :required => true
85
+ config :security_token, :validate => :password, :required => true
80
86
  # The name of the salesforce object you are creating or updating
81
87
  config :sfdc_object_name, :validate => :string, :required => true
82
88
  # These are the field names to return in the Salesforce query
@@ -124,17 +130,21 @@ class LogStash::Inputs::Salesforce < LogStash::Inputs::Base
124
130
 
125
131
  private
126
132
  def client
127
- @client ||= Restforce.new client_options
133
+ if @use_tooling_api
134
+ @client ||= Restforce.tooling client_options
135
+ else
136
+ @client ||= Restforce.new client_options
137
+ end
128
138
  end
129
139
 
130
140
  private
131
141
  def client_options
132
142
  options = {
133
143
  :username => @username,
134
- :password => @password,
135
- :security_token => @security_token,
144
+ :password => @password.value,
145
+ :security_token => @security_token.value,
136
146
  :client_id => @client_id,
137
- :client_secret => @client_secret
147
+ :client_secret => @client_secret.value
138
148
  }
139
149
  # configure the endpoint to which restforce connects to for authentication
140
150
  if @sfdc_instance_url && @use_test_sandbox
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-salesforce'
3
- s.version = '3.1.0'
3
+ s.version = '3.2.1'
4
4
  s.licenses = ['Apache License (2.0)']
5
5
  s.summary = "Creates events based on a Salesforce SOQL query"
6
6
  s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -0,0 +1,162 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://login.salesforce.com/services/oauth2/token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: grant_type=password&client_id=xxxx&client_secret=xxxx&username=xxxx&password=xxxx
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Content-Type:
13
+ - application/x-www-form-urlencoded
14
+ Accept:
15
+ - '*/*'
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Thu, 27 Aug 2015 21:31:28 GMT
23
+ Set-Cookie:
24
+ - BrowserId=xxxx;Path=/;Domain=.salesforce.com;Expires=Mon, 26-Oct-2015 21:31:28 GMT
25
+ Expires:
26
+ - Thu, 01 Jan 1970 00:00:00 GMT
27
+ Pragma:
28
+ - no-cache
29
+ Cache-Control:
30
+ - no-cache, no-store
31
+ Content-Type:
32
+ - application/json;charset=UTF-8
33
+ Transfer-Encoding:
34
+ - chunked
35
+ body:
36
+ encoding: US-ASCII
37
+ string: '{"id":"https://login.salesforce.com/id/xxxx/xxxx","issued_at":"1440711088469","token_type":"Bearer","instance_url":"https://eu2.salesforce.com","signature":"xxxx","access_token":"xxxx"}'
38
+ http_version:
39
+ recorded_at: Thu, 27 Aug 2015 21:31:28 GMT
40
+ - request:
41
+ method: get
42
+ uri: https://eu2.salesforce.com/services/data/v52.0/tooling/sobjects/ApexTestRunResult/describe
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ''
46
+ headers:
47
+ User-Agent:
48
+ - Faraday v0.9.1
49
+ Authorization:
50
+ - OAuth xxxx
51
+ Accept-Encoding:
52
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
53
+ Accept:
54
+ - '*/*'
55
+ response:
56
+ status:
57
+ code: 200
58
+ message: OK
59
+ headers:
60
+ Date:
61
+ - Thu, 27 Aug 2015 21:31:29 GMT
62
+ Set-Cookie:
63
+ - BrowserId=xxxx;Path=/;Domain=.salesforce.com;Expires=Mon, 26-Oct-2015 21:31:29 GMT
64
+ Expires:
65
+ - Thu, 01 Jan 1970 00:00:00 GMT
66
+ Sforce-Limit-Info:
67
+ - api-usage=204568/451000
68
+ Org.eclipse.jetty.server.include.etag:
69
+ - f3049665
70
+ Last-Modified:
71
+ - Thu, 27 Aug 2015 18:14:47 GMT
72
+ Content-Type:
73
+ - application/json;charset=UTF-8
74
+ Etag:
75
+ - f304966-gzip"
76
+ Transfer-Encoding:
77
+ - chunked
78
+ body:
79
+ encoding: UTF-8
80
+ string: '{"actionOverrides":[],"activateable":false,"associateEntityType":null,"associateParentEntity":null,"childRelationships":[],"compactLayoutable":false,"createable":true,"custom":false,"customSetting":false,"deepCloneable":false,"defaultImplementation":null,
81
+ "deletable":true,"deprecatedAndHidden":false,"extendedBy":null,"extendsInterfaces":null,"feedEnabled":false,"fields":[{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,
82
+ "caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":false,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,
83
+ "displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":true,
84
+ "inlineHelpText":null,"label":"ApexTestRunResult ID","length":18,"mask":null,"maskType":null,"name":"Id","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,
85
+ "queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"id",
86
+ "unique":false,"updateable":false,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":true,"compoundFieldName":null,
87
+ "controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,
88
+ "extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Apex Job ID","length":18,"mask":null,
89
+ "maskType":null,"name":"AsyncApexJobId","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["AsyncApexJob"],
90
+ "relationshipName":"AsyncApexJob","relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"reference","unique":true,"updateable":true,
91
+ "writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":18,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,
92
+ "createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,
93
+ "filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"User ID","length":18,"mask":null,"maskType":null,"name":"UserId",
94
+ "nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":["User"],"relationshipName":"User","relationshipOrder":null,
95
+ "restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"tns:ID","sortable":true,"type":"reference","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,
96
+ "autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,
97
+ "defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,
98
+ "groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Name of the job","length":255,"mask":null,"maskType":null,"name":"JobName","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,
99
+ "picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,
100
+ "searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":false,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,
101
+ "calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":false,"defaultValueFormula":null,"defaultedOnCreate":true,"dependentPicklist":false,
102
+ "deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,
103
+ "htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"allTests","length":0,"mask":null,"maskType":null,"name":"IsAllTests","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],
104
+ "polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,
105
+ "soapType":"xsd:boolean","sortable":true,"type":"boolean","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,
106
+ "cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,
107
+ "displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,
108
+ "inlineHelpText":null,"label":"Client that kicked off the test run","length":255,"mask":null,"maskType":null,"name":"Source","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,
109
+ "precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,
110
+ "type":"string","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,
111
+ "compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,
112
+ "encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,
113
+ "label":"Start time of the test run","length":0,"mask":null,"maskType":null,"name":"StartTime","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,
114
+ "referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,
115
+ "updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,
116
+ "createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,
117
+ "filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":false,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"End time of the test run","length":0,"mask":null,"maskType":null,
118
+ "name":"EndTime","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,
119
+ "relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:dateTime","sortable":true,"type":"datetime","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,
120
+ "aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,
121
+ "defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":9,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,
122
+ "formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Time(ms) actually spent running tests","length":0,"mask":null,"maskType":null,"name":"TestTime","nameField":false,
123
+ "namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,
124
+ "restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:int","sortable":true,"type":"int","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,
125
+ "autoNumber":false,"byteLength":765,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,
126
+ "defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":0,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,
127
+ "groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Status of the test run","length":255,"mask":null,"maskType":null,"name":"Status","nameField":false,"namePointing":false,"nillable":false,
128
+ "permissionable":false,"picklistValues":[{"active":true,"defaultValue":false,"label":"Queued","validFor":null,"value":"Queued"},{"active":true,"defaultValue":false,"label":"Processing","validFor":null,"value":"Processing"},{"active":true,"defaultValue":false,
129
+ "label":"Aborted","validFor":null,"value":"Aborted"},{"active":true,"defaultValue":false,"label":"Completed","validFor":null,"value":"Completed"},{"active":true,"defaultValue":false,"label":"Failed","validFor":null,"value":"Failed"},{"active":true,
130
+ "defaultValue":false,"label":"Preparing","validFor":null,"value":"Preparing"},{"active":true,"defaultValue":false,"label":"Holding","validFor":null,"value":"Holding"}],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,
131
+ "referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":true,"scale":0,"searchPrefilterable":false,"soapType":"xsd:string","sortable":true,"type":"picklist","unique":false,
132
+ "updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,
133
+ "controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":9,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,
134
+ "extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Number of classes enqueued in this test run",
135
+ "length":0,"mask":null,"maskType":null,"name":"ClassesEnqueued","nameField":false,"namePointing":false,"nillable":false,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,
136
+ "referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:int","sortable":true,"type":"int","unique":false,"updateable":true,"writeRequiresMasterRead":false},
137
+ {"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,
138
+ "defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":9,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,
139
+ "formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Number of classes completed in this test run","length":0,"mask":null,"maskType":null,"name":"ClassesCompleted",
140
+ "nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,
141
+ "restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:int","sortable":true,"type":"int","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,
142
+ "autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,
143
+ "defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":9,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,
144
+ "groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Number of methods enqueued in this test run","length":0,"mask":null,"maskType":null,"name":"MethodsEnqueued","nameField":false,"namePointing":false,
145
+ "nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,
146
+ "restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:int","sortable":true,"type":"int","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,
147
+ "calculated":false,"calculatedFormula":null,"cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,
148
+ "deprecatedAndHidden":false,"digits":9,"displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,
149
+ "htmlFormatted":false,"idLookup":false,"inlineHelpText":null,"label":"Number of methods completed in this test run","length":0,"mask":null,"maskType":null,"name":"MethodsCompleted","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,
150
+ "picklistValues":[],"polymorphicForeignKey":false,"precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,
151
+ "searchPrefilterable":false,"soapType":"xsd:int","sortable":true,"type":"int","unique":false,"updateable":true,"writeRequiresMasterRead":false},{"aggregatable":true,"aiPredictionField":false,"autoNumber":false,"byteLength":0,"calculated":false,"calculatedFormula":null,
152
+ "cascadeDelete":false,"caseSensitive":false,"compoundFieldName":null,"controllerName":null,"createable":true,"custom":false,"defaultValue":null,"defaultValueFormula":null,"defaultedOnCreate":false,"dependentPicklist":false,"deprecatedAndHidden":false,"digits":9,
153
+ "displayLocationInDecimal":false,"encrypted":false,"externalId":false,"extraTypeInfo":null,"filterable":true,"filteredLookupInfo":null,"formulaTreatNullNumberAsZero":false,"groupable":true,"highScaleNumber":false,"htmlFormatted":false,"idLookup":false,
154
+ "inlineHelpText":null,"label":"Number of methods failed in this test run","length":0,"mask":null,"maskType":null,"name":"MethodsFailed","nameField":false,"namePointing":false,"nillable":true,"permissionable":false,"picklistValues":[],"polymorphicForeignKey":false,
155
+ "precision":0,"queryByDistance":false,"referenceTargetField":null,"referenceTo":[],"relationshipName":null,"relationshipOrder":null,"restrictedDelete":false,"restrictedPicklist":false,"scale":0,"searchPrefilterable":false,"soapType":"xsd:int","sortable":true,
156
+ "type":"int","unique":false,"updateable":true,"writeRequiresMasterRead":false}],"hasSubtypes":false,"implementedBy":null,"implementsInterfaces":null,"isInterface":false,"isSubtype":false,"keyPrefix":"05m","label":"Apex Test Run Result",
157
+ "labelPlural":"Apex Test Run Result","layoutable":false,"listviewable":null,"lookupLayoutable":null,"mergeable":false,"mruEnabled":false,"name":"ApexTestRunResult","namedLayoutInfos":[],"networkScopeFieldName":null,"queryable":true,"recordTypeInfos":[],
158
+ "replicateable":false,"retrieveable":true,"searchLayoutable":false,"searchable":false,"sobjectDescribeOption":"FULL","supportedScopes":[{"label":"All apex test run results","name":"everything"}],"triggerable":false,"undeletable":false,"updateable":true,
159
+ "urls":{"rowTemplate":"/services/data/v52.0/tooling/sobjects/ApexTestRunResult/{ID}","describe":"/services/data/v52.0/tooling/sobjects/ApexTestRunResult/describe","sobject":"/services/data/v52.0/tooling/sobjects/ApexTestRunResult"}}'
160
+ http_version:
161
+ recorded_at: Thu, 27 Aug 2015 21:31:30 GMT
162
+ recorded_with: VCR 2.9.3
@@ -8,10 +8,10 @@ RSpec.describe LogStash::Inputs::Salesforce do
8
8
  let(:options) do
9
9
  {
10
10
  "client_id" => "",
11
- "client_secret" => "",
11
+ "client_secret" => ::LogStash::Util::Password.new("secret-key"),
12
12
  "username" => "",
13
- "password" => "",
14
- "security_token" => "",
13
+ "password" => ::LogStash::Util::Password.new("secret-password"),
14
+ "security_token" => ::LogStash::Util::Password.new("secret-token"),
15
15
  "sfdc_object_name" => ""
16
16
  }
17
17
  end
@@ -35,10 +35,10 @@ RSpec.describe LogStash::Inputs::Salesforce do
35
35
  let(:options) do
36
36
  {
37
37
  "client_id" => "",
38
- "client_secret" => "",
38
+ "client_secret" => ::LogStash::Util::Password.new("secret-key"),
39
39
  "username" => "",
40
- "password" => "",
41
- "security_token" => "",
40
+ "password" => ::LogStash::Util::Password.new("secret-password"),
41
+ "security_token" => ::LogStash::Util::Password.new("secret-token"),
42
42
  "sfdc_object_name" => "Lead",
43
43
  "sfdc_fields" => ["Something"]
44
44
  }
@@ -67,10 +67,10 @@ RSpec.describe LogStash::Inputs::Salesforce do
67
67
  let(:options) do
68
68
  {
69
69
  "client_id" => "",
70
- "client_secret" => "",
70
+ "client_secret" => ::LogStash::Util::Password.new("secret-key"),
71
71
  "username" => "",
72
- "password" => "",
73
- "security_token" => "",
72
+ "password" => ::LogStash::Util::Password.new("secret-password"),
73
+ "security_token" => ::LogStash::Util::Password.new("secret-token"),
74
74
  "sfdc_object_name" => "Lead"
75
75
  }
76
76
  end
@@ -94,10 +94,10 @@ RSpec.describe LogStash::Inputs::Salesforce do
94
94
  let(:options) do
95
95
  {
96
96
  "client_id" => "",
97
- "client_secret" => "",
97
+ "client_secret" => ::LogStash::Util::Password.new("secret-key"),
98
98
  "username" => "",
99
- "password" => "",
100
- "security_token" => "",
99
+ "password" => ::LogStash::Util::Password.new("secret-password"),
100
+ "security_token" => ::LogStash::Util::Password.new("secret-token"),
101
101
  "sfdc_object_name" => "Lead",
102
102
  "sfdc_fields" => ["Id", "IsDeleted", "LastName", "FirstName", "Salutation"],
103
103
  "sfdc_filters" => "Email LIKE '%@elastic.co'"
@@ -137,10 +137,10 @@ RSpec.describe LogStash::Inputs::Salesforce do
137
137
  let(:options) do
138
138
  {
139
139
  "client_id" => "",
140
- "client_secret" => "",
140
+ "client_secret" => ::LogStash::Util::Password.new("secret-key"),
141
141
  "username" => "",
142
- "password" => "",
143
- "security_token" => "",
142
+ "password" => ::LogStash::Util::Password.new("secret-password"),
143
+ "security_token" => ::LogStash::Util::Password.new("secret-token"),
144
144
  "sfdc_instance_url" => "my-domain.my.salesforce.com",
145
145
  "sfdc_object_name" => "Lead"
146
146
  }
@@ -165,10 +165,10 @@ RSpec.describe LogStash::Inputs::Salesforce do
165
165
  let(:options) do
166
166
  {
167
167
  "client_id" => "",
168
- "client_secret" => "",
168
+ "client_secret" => ::LogStash::Util::Password.new("secret-key"),
169
169
  "username" => "",
170
- "password" => "",
171
- "security_token" => "",
170
+ "password" => ::LogStash::Util::Password.new("secret-password"),
171
+ "security_token" => ::LogStash::Util::Password.new("secret-token"),
172
172
  "sfdc_instance_url" => "my-domain.my.salesforce.com",
173
173
  "sfdc_object_name" => "Lead",
174
174
  "use_test_sandbox" => true
@@ -181,5 +181,41 @@ RSpec.describe LogStash::Inputs::Salesforce do
181
181
  end
182
182
  end
183
183
  end
184
+
185
+ context "use Tooling Api" do
186
+ VCR.configure do |config|
187
+ config.cassette_library_dir = File.join(File.dirname(__FILE__), '..', 'fixtures', 'vcr_cassettes')
188
+ config.hook_into :webmock
189
+ config.before_record do |i|
190
+ if i.response.body.encoding.to_s == 'ASCII-8BIT'
191
+ # required because sfdc doesn't send back the content encoding and it
192
+ # confuses the yaml parser
193
+ json_body = JSON.load(i.response.body.encode("ASCII-8BIT").force_encoding("utf-8"))
194
+ i.response.body = json_body.to_json
195
+ i.response.update_content_length_header
196
+ end
197
+ end
198
+ end
199
+ let(:options) do
200
+ {
201
+ "api_version" => "52.0",
202
+ "client_id" => "",
203
+ "client_secret" => ::LogStash::Util::Password.new("secret-key"),
204
+ "username" => "",
205
+ "password" => ::LogStash::Util::Password.new("secret-password"),
206
+ "security_token" => ::LogStash::Util::Password.new("secret-token"),
207
+ "use_tooling_api" => true,
208
+ "sfdc_object_name" => "ApexTestRunResult"
209
+ }
210
+ end
211
+ let(:input) { LogStash::Inputs::Salesforce.new(options) }
212
+ subject { input }
213
+ it "should use the Tooling Api Query resource path" do
214
+ VCR.use_cassette("describe_apex_test_run_result_object",:decode_compressed_response => true) do
215
+ subject.register
216
+ expect(subject.send(:client).send(:api_path, "query")).to eq('/services/data/v52.0/tooling/query')
217
+ end
218
+ end
219
+ end
184
220
  end
185
221
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-salesforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Russ Savage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-11 00:00:00.000000000 Z
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -151,6 +151,7 @@ files:
151
151
  - docs/index.asciidoc
152
152
  - lib/logstash/inputs/salesforce.rb
153
153
  - logstash-input-salesforce.gemspec
154
+ - spec/fixtures/vcr_cassettes/describe_apex_test_run_result_object.yml
154
155
  - spec/fixtures/vcr_cassettes/describe_lead_object.yml
155
156
  - spec/fixtures/vcr_cassettes/load_some_lead_objects.yml
156
157
  - spec/fixtures/vcr_cassettes/login_into_mydomain.yml
@@ -177,11 +178,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
178
  - !ruby/object:Gem::Version
178
179
  version: '0'
179
180
  requirements: []
180
- rubygems_version: 3.1.6
181
+ rubygems_version: 3.2.33
181
182
  signing_key:
182
183
  specification_version: 4
183
184
  summary: Creates events based on a Salesforce SOQL query
184
185
  test_files:
186
+ - spec/fixtures/vcr_cassettes/describe_apex_test_run_result_object.yml
185
187
  - spec/fixtures/vcr_cassettes/describe_lead_object.yml
186
188
  - spec/fixtures/vcr_cassettes/load_some_lead_objects.yml
187
189
  - spec/fixtures/vcr_cassettes/login_into_mydomain.yml