From 9194a6701d10dbdbea06440067aa7673a13abac6 Mon Sep 17 00:00:00 2001 From: Dave Bauman Date: Tue, 25 Sep 2018 17:51:36 -0400 Subject: [PATCH] Elasticsearch Data Source: Removed unneeded `"json": true` option, which breaks updated versions of the requests library. --- .editorconfig | 19 +++ CHANGELOG.md | 20 ++- .../services.commonConfigService.coffee | 2 +- .../dataSources.elasticsearch.coffee | 23 ++-- cyclotron-site/package-lock.json | 2 +- cyclotron-site/package.json | 2 +- cyclotron-svc/package-lock.json | 118 +++++++++++++++++- cyclotron-svc/package.json | 4 +- 8 files changed, 166 insertions(+), 24 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..8091ed6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +indent_size = 4 +max_line_length = off +trim_trailing_whitespace = false + +[*.json] +indent_size = 2 +max_line_length = off +trim_trailing_whitespace = false diff --git a/CHANGELOG.md b/CHANGELOG.md index 41f0ad2..1b150d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# 2.0.2 + +## Bug Fixes + + - Elasticsearch Data Source: Removed unneeded `"json": true` option breaking requests + +# 2.0.1 + +## Features + + - InfluxDB Data Source: Added additional properties for controlling the HTTP(S) request that gets generated. `options` gives full control of the request, while `insecureSsl` is a boolean shortcut for ignoring SSL validation + + - Elasticsearch Data Source: Added undocumented `options` property + # 2.0.0 ## Features @@ -133,7 +147,7 @@ - CloudWatch Data Source: Added new Data Source for retrieving data from Amazon CloudWatch - JSON Data Source: Added options for AWS signing, allowing use with AWS APIs that require Signature Version 4 - + - SSL/TLS: Proxy server initializes itself with a list of trusted root CAs. Added server option for manually providing CAs to trust when executing HTTPS requests - Highcharts upgraded to 4.2.7 @@ -271,7 +285,7 @@ ## Features - Table Widget: Added optional pagination--can automatically or manually specify the number of rows displayed per page. Improves performance when displaying large Data Sources. - + - Number Widget: Added Click event handler: can provide a JavaScript function that gets executed when the Number is clicked. - Dashboard Controls: Added an option to disable the UI controls completely @@ -313,7 +327,7 @@ ## Features - Persistent Parameters: added an option to persist the value of a parameter in the browser's storage. Any value changes are persisted automatically, and will be restored the next time the user opens the Dashboard - + - Search: added sort parameters to URL, paging for results - Browse Dashboards: added a new link to see the top liked dashboards; new search filter "is:liked" diff --git a/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee b/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee index d16823f..d4e7656 100644 --- a/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee +++ b/cyclotron-site/app/scripts/common/services/services.commonConfigService.coffee @@ -39,7 +39,7 @@ cyclotronServices.factory 'commonConfigService', -> exports = { - version: '2.0.1' + version: '2.0.2' logging: enableDebug: false diff --git a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.elasticsearch.coffee b/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.elasticsearch.coffee index 3d3beed..7d25302 100644 --- a/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.elasticsearch.coffee +++ b/cyclotron-site/app/scripts/dashboards/dataSources/dataSources.elasticsearch.coffee @@ -2,16 +2,16 @@ # Copyright (c) 2016-2018 the original author or authors. # # Licensed under the MIT License (the "License"); -# you may not use this file except in compliance with the License. +# you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.opensource.org/licenses/mit-license.php # -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, -# either express or implied. See the License for the specific -# language governing permissions and limitations under the License. +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +# either express or implied. See the License for the specific +# language governing permissions and limitations under the License. ### # @@ -20,7 +20,7 @@ # Queries the Elasticsearch API. # Implements a limited but useful subset of functionality and attempts to parse the results into Cyclotron's format. # For more control, the JSON Data Source should be used directly. -# +# # Always proxies requests through the Cyclotron service. # cyclotronDataSources.factory 'elasticsearchDataSource', ($q, $http, configService, dataSourceFactory, logService) -> @@ -36,9 +36,8 @@ cyclotronDataSources.factory 'elasticsearchDataSource', ($q, $http, configServic proxyBody = url: url.toString() method: 'POST' - json: true body: options.request - headers: + headers: 'Content-Type': 'application/json' if options.options? @@ -97,7 +96,7 @@ cyclotronDataSources.factory 'elasticsearchDataSource', ($q, $http, configServic if responseAdapter == 'auto' if response.aggregations? responseAdapter = 'aggregations' - else + else responseAdapter = 'hits' # Convert the Elasticsearch result based on the selected adapter @@ -132,7 +131,7 @@ cyclotronDataSources.factory 'elasticsearchDataSource', ($q, $http, configServic data = _.map result.body.responses, (response) -> processResponse response, responseAdapter, reject data = _.flatten data - else + else data = processResponse result.body, responseAdapter, reject if _.isNull data @@ -159,7 +158,7 @@ cyclotronDataSources.factory 'elasticsearchDataSource', ($q, $http, configServic # Do the request, wiring up success/failure handlers req = $http.post proxyUri, getProxyRequest(options) - + # Add callback handlers to promise req.success successCallback req.error errorCallback diff --git a/cyclotron-site/package-lock.json b/cyclotron-site/package-lock.json index b2c7bbc..c03fbe8 100644 --- a/cyclotron-site/package-lock.json +++ b/cyclotron-site/package-lock.json @@ -1,6 +1,6 @@ { "name": "cyclotron-site", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/cyclotron-site/package.json b/cyclotron-site/package.json index 537a4c5..92e8feb 100644 --- a/cyclotron-site/package.json +++ b/cyclotron-site/package.json @@ -1,7 +1,7 @@ { "name": "cyclotron-site", "description": "Cyclotron: website", - "version": "2.0.1", + "version": "2.0.2", "author": "Dave Bauman ", "license": "MIT", "private": true, diff --git a/cyclotron-svc/package-lock.json b/cyclotron-svc/package-lock.json index a10a62e..b776b32 100644 --- a/cyclotron-svc/package-lock.json +++ b/cyclotron-svc/package-lock.json @@ -1,6 +1,6 @@ { "name": "cyclotron-svc", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -230,9 +230,9 @@ "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "requires": { "delayed-stream": "~1.0.0" } @@ -588,6 +588,16 @@ "asynckit": "^0.4.0", "combined-stream": "1.0.6", "mime-types": "^2.1.12" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + } } }, "forwarded": { @@ -1599,10 +1609,110 @@ "request": "^2.47.0" }, "dependencies": { + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, "bluebird": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==" + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + } + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + } + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" } } }, diff --git a/cyclotron-svc/package.json b/cyclotron-svc/package.json index 6298578..ce5d531 100644 --- a/cyclotron-svc/package.json +++ b/cyclotron-svc/package.json @@ -1,7 +1,7 @@ { "name": "cyclotron-svc", "description": "Cyclotron: REST API", - "version": "2.0.1", + "version": "2.0.2", "author": "Dave Bauman ", "license": "MIT", "private": true, @@ -19,7 +19,7 @@ "start": "node app.js" }, "dependencies": { - "aws4": "^1.3.2", + "aws4": "^1.8.0", "bluebird": "2.3.6", "body-parser": "^1.18.3", "compression": "^1.7.3",