logstash-input-salesforce 3.1.0 → 3.2.0

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: 488744b091efd01bf196c956adfcdb4f9cb78370879f190c4949e43b5b15cdfb
4
+ data.tar.gz: bc46434ce735858bafacf3786c12cd348f9d2029f0d1cc6385a4431e5d8d6017
5
5
  SHA512:
6
- metadata.gz: 01f2f0cc51b2db510684fb19d070ec057888a7e8b4a5026aa95a9d0beff079fa5173fa362e13693be9ed1d1132c659e762710954e2ea4ac4a2385099d7b54fb5
7
- data.tar.gz: 7936c9f1b66d2db85f7f363c7e0114af9d3adbcacf8aeca6ab74678db769c2f23a4bb313d0fe5bc9fbb3d912b43d11d8aaa8021c96876e59cbe0f80a2dfbe80c
6
+ metadata.gz: 519a269d82960688997a91a5acc2de68e6767fb93a4be13e32b93b6f10728574ce32e6b70276bd2488204a4c7bbca22df610e6bbf1b8c66d8fecba2636df09e3
7
+ data.tar.gz: dba249eb70ec2ebce2ca8b96b56401362194c4c3baa6afddef5352128cc16a58b1f5ce4ea34bbaecb7056d73e5f96b49f26c0b91e3e8c98e85ebbbaad4463e6c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
+ ## 3.2.0
2
+ - 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)
3
+
1
4
  ## 3.1.0
2
- - Added `sfdc_instance_url` configuration to connect to a specific url.
5
+ - Added `sfdc_instance_url` configuration to connect to a specific url. [#28](https://github.com/logstash-plugins/logstash-input-salesforce/pull/28)
3
6
  - Switch to restforce v5+ (for logstash 8.x compatibility)
4
7
 
5
8
  ## 3.0.7
data/docs/index.asciidoc CHANGED
@@ -85,6 +85,7 @@ This plugin supports the following configuration options plus the <<plugins-{typ
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
 
@@ -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
@@ -124,7 +130,11 @@ 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
@@ -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.0'
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
@@ -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" => "",
204
+ "username" => "",
205
+ "password" => "",
206
+ "security_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.0
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: 2021-12-07 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
@@ -182,6 +183,7 @@ 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