newrelic 3.3.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.travis.yml CHANGED
@@ -1,7 +1,5 @@
1
1
  language: node_js
2
2
  node_js:
3
- - "0.10"
4
- - "0.12"
5
3
  - "4"
6
4
  - "5"
7
5
  - "6"
@@ -18,14 +16,6 @@ env:
18
16
  - SUITE=versioned
19
17
  matrix:
20
18
  exclude:
21
- - node_js: "0.10"
22
- env: SUITE=security
23
- - node_js: "0.10"
24
- env: SUITE=lint
25
- - node_js: "0.12"
26
- env: SUITE=security
27
- - node_js: "0.12"
28
- env: SUITE=lint
29
19
  - node_js: "4"
30
20
  env: SUITE=security
31
21
  - node_js: "4"
@@ -3,6 +3,18 @@
3
3
  This guide is intended to help with upgrading major versions of the Node Agent.
4
4
  This information can also be found on [our documentation website][upgrade-doc].
5
5
 
6
+ ## Upgrading to Agent v4
7
+
8
+ ### Breaking Changes
9
+
10
+ **Upgraded https-proxy-agent from v0 to v2**: This dependency has been updated
11
+ due to a security issue in the version of `https-proxy-agent` the New Relic Node.js
12
+ agent used. `https-proxy` v2 is incompatible with node v0.10 and v0.12,
13
+ requiring deprecation of those versions for the agent. There is no required
14
+ action to migrate from v3 to v4 of New Relic's Node.js agent.
15
+
16
+ --------------------------------------------------------------------------------
17
+
6
18
  ## Upgrading to Agent v3
7
19
 
8
20
  ### Breaking Changes
package/NEWS.md CHANGED
@@ -1,3 +1,19 @@
1
+ ### 4.0.0 (2018-04-12):
2
+
3
+ * BREAKING: Updated the version of `https-proxy-agent` to v2.x - Dropped support for v0.10 and v0.12 of node.
4
+
5
+ The version of `https-proxy-agent` used in the agent has a known security
6
+ issue you can read about here: https://snyk.io/vuln/npm:https-proxy-agent:20180402
7
+ In order to resolve this issue, the dependency had to be updated to at least
8
+ v2.2.0, which only supported node versions >=4. The update to this dependency
9
+ forces the incompatibility of the agent with versions 0.10 and 0.12 of node.
10
+
11
+ In order to use use the Node.js agent, please upgrade node to version >=4, or you can
12
+ continue to use the agent on node versions 0.10 and 0.12 by pinning the agent
13
+ to v3.
14
+
15
+ You can read more about the issue here: https://docs.newrelic.com/docs/using-new-relic/new-relic-security/security-bulletins/security-bulletin-nr18-08
16
+
1
17
  ### 3.3.1 (2018-04-10):
2
18
 
3
19
  * Added a type check to attribute validation, restricting values to primitive types
package/index.js CHANGED
@@ -42,10 +42,10 @@ function initialize() {
42
42
  preAgentTime
43
43
  )
44
44
 
45
- // TODO: Update this check when Node v0.10 is deprecated.
46
- if (psemver.satisfies('<0.10.0')) {
45
+ // TODO: Update this check when Node v4 is deprecated.
46
+ if (psemver.satisfies('<4.0.0')) {
47
47
  message = "New Relic for Node.js requires a version of Node equal to or\n" +
48
- "greater than 0.10.0. Not starting!"
48
+ "greater than 4.0.0. Not starting!"
49
49
 
50
50
  logger.error(message)
51
51
  throw new Error(message)
@@ -633,7 +633,12 @@ module.exports = function initialize(agent, http, moduleName) {
633
633
  wrapRequest.bind(null, agent)
634
634
  )
635
635
 
636
- if (psemver.satisfies('>=8')) {
636
+ // Upon updating to https-proxy-agent v2, we are now using
637
+ // agent-base v4, which patches https.get to use https.request.
638
+ // https://github.com/TooTallNate/node-agent-base/commit/7de92df780e147d46185281d26a1b534b3aaa97e
639
+ // This means we need to skip instrumenting to avoid double
640
+ // instrumenting external requests.
641
+ if (moduleName !== 'https' && psemver.satisfies('>=8')) {
637
642
  shimmer.wrapMethod(
638
643
  http,
639
644
  'http',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "newrelic",
3
- "version": "3.3.1",
3
+ "version": "4.0.0",
4
4
  "author": "New Relic Node.js agent team <nodejs@newrelic.com>",
5
5
  "licenses": [
6
6
  {
@@ -96,7 +96,7 @@
96
96
  ],
97
97
  "homepage": "http://github.com/newrelic/node-newrelic",
98
98
  "engines": {
99
- "node": ">=0.10.0",
99
+ "node": ">=4.0.0",
100
100
  "npm": ">=2.0.0"
101
101
  },
102
102
  "directories": {
@@ -114,7 +114,7 @@
114
114
  "@newrelic/koa": "^1.0.0",
115
115
  "async": "^2.1.4",
116
116
  "concat-stream": "^1.5.0",
117
- "https-proxy-agent": "^0.3.6",
117
+ "https-proxy-agent": "^2.2.1",
118
118
  "json-stringify-safe": "^5.0.0",
119
119
  "readable-stream": "^2.1.4",
120
120
  "semver": "^5.3.0"