@castleio/sdk 1.0.1 → 1.1.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/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Castle SDK for Node
2
2
 
3
- **[Castle](https://castle.io) analyzes device, location, and interaction patterns in your web and mobile apps and lets you stop account takeover attacks in real-time..**
3
+ **[Castle](https://castle.io) analyzes user behavior in web and mobile apps to stop fraud before it happens.**
4
4
 
5
- ## Documentation
5
+ ## Usage
6
6
 
7
- [Official Castle docs](https://castle.io/docs)
7
+ See the [documentation](https://docs.castle.io) for how to use this SDK with the Castle APIs
8
8
 
9
9
  ## Installation
10
10
 
@@ -40,7 +40,7 @@ const castle = new Castle({ apiSecret: 'YOUR SECRET HERE' });
40
40
  | ----------------- | ----------- |
41
41
  | apiSecret | `string` - This can be found in the Castle dashboard. |
42
42
  | baseUrl | `string` - Base Castle API url. |
43
- | timeout | `number` - Time before returning the failover strategy. Default value is 500. |
43
+ | timeout | `number` - Time before returning the failover strategy. Default value is 1000. |
44
44
  | allowlisted | `string[]` - An array of strings matching the headers you want to pass fully to the service. We highly recommend using the DEFAULT_ALLOWLIST constant. |
45
45
  | denylisted | `string[]` - An array of of strings matching the headers you do not want to pass fully to the service. |
46
46
  | failoverStrategy | `FailoverStrategy` - If the request to our service would for some reason time out, this is where you select the automatic response from `authenticate`. Options are `FailoverStrategy.allow`, `FailoverStrategy.deny`, `FailoverStrategy.challenge`. |
@@ -51,123 +51,3 @@ const castle = new Castle({ apiSecret: 'YOUR SECRET HERE' });
51
51
  | trustProxyChain | `boolean` - False by default, defines if trusting all of the proxy IPs in X-Forwarded-For is enabled. |
52
52
  | trustedProxyDepth | `number` - Number of trusted proxies used in the chain. |
53
53
 
54
- ## Actions
55
-
56
- The `castle` instance exposes two methods, `track` and `authenticate`. In order to provide the information required in both these methods, you'll need access to the logged in user information (if that is available at that stage in the user flow), as well as request information. In node connect/express, the user is often found in the `session` object, or directly on the `request` object in the `user` property, if you are using passport.
57
-
58
- ### track
59
-
60
- This is the asynchronous version of the castle integration. This is for events where you don't require a response.
61
-
62
- ```js
63
-
64
- castle.track({
65
- event: '$profile_update.failed',
66
- user_id: user.id,
67
- user_traits: {
68
- email: user.email,
69
- registered_at: user.registered_at,
70
- },
71
- context: {
72
- ip: request.ip,
73
- client_id: request.cookies['__cid'],
74
- headers: request.headers,
75
- },
76
- });
77
- ```
78
-
79
- ### authenticate
80
-
81
- This is the synchronous version of the castle integration. This is for events where you require a response. It is used in the same way as `track`, except that you have the option of waiting for a response.
82
-
83
- ```js
84
- let response;
85
- try {
86
- response = await castle.authenticate({
87
- event: '$login.succeeded',
88
- user_id: user.id,
89
- user_traits: {
90
- email: user.email,
91
- registered_at: user.registered_at,
92
- },
93
- context: {
94
- ip: request.ip,
95
- client_id: request.cookies['__cid'],
96
- headers: request.headers,
97
- },
98
- });
99
- } catch (e) {
100
- console.error(e);
101
- }
102
-
103
- console.log(response); // { "action": "allow", "user_id": 123, "device_token": "eyj...." }
104
- ```
105
-
106
- ####
107
-
108
- Response format
109
-
110
- | Response key | value |
111
- | --------------- | --------------------------------------------------------------------------------------------------- |
112
- | action | `string` - The recommended action for the given event. Options: `allow`, `challenge`, `deny`. |
113
- | user_id | `string` - The `user_id` of the end user. |
114
- | policy | `object` - object containing risk policy information, such as `id`,`revision_id`, `name` |
115
- | signals | `object` - object containing hash with signals names |
116
- | device_token | `string` - Our token for the device that generated the event. |
117
- | failover | `boolean` - An optional property indicating the request failed and the response is a failover. |
118
- | failover_reason | `string` - A message indicating why the request failed. |
119
-
120
- ### All config options for `track` and `authenticate`
121
-
122
- | Config option | Explanation |
123
- | ------------- | ----------- |
124
- | event | `string` - The event generated by the user |
125
- | user_id | `string` - The `user_id` of the end user. |
126
- | user_traits | `object` - An optional, recommended, object containing user information, such as `email` and `registered_at`. |
127
- | properties | `object` - An optional object containing custom information. |
128
- | created_at | `string` - An optional ISO date string indicating when the event occurred, in cases where this might be different from the time when the request is made. |
129
- | device_token | `string` - The optional device token, used for mitigating or escalating. |
130
- | context | `object` - The request context information. |
131
-
132
- ## Device management
133
-
134
- This SDK allows issuing requests to [Castle's Device Management Endpoints](https://docs.castle.io/device_management_tool/). Use these endpoints for admin-level management of end-user devices (i.e., for an internal dashboard).
135
-
136
- Fetching device data, approving a device, reporting a device requires a valid `device_token`.
137
-
138
- ```js
139
- // Get device data
140
- castle.getDevice({ device_token })
141
- // Approve a device
142
- castle.approveDevice({ device_token })
143
- // Report a device
144
- castle.reportDevice({ device_token })
145
- ```
146
-
147
- Fetching available devices that belong to a given user requires a valid `user_id`.
148
-
149
- ```js
150
- // Get user's devices data
151
- castle.getDevicesForUser({ user_id })
152
- ```
153
-
154
- ## Payload
155
-
156
- To generate the payload, use the following command:
157
- ```js
158
- const payload = PayloadPrepareService.call(
159
- {
160
- event: '$login.succeeded',
161
- user_id: user.id,
162
- properties: {
163
- key: 'value'
164
- },
165
- user_traits: {
166
- key: 'value'
167
- }
168
- },
169
- request,
170
- castle.configuration
171
- )
172
- castle.track(payload)
173
- ```
package/dist/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/package",
3
3
  "name": "@castleio/sdk",
4
4
  "description": "Castle SDK for Node",
5
- "version": "1.0.1",
5
+ "version": "1.1.0",
6
6
  "main": "dist/index.js",
7
7
  "repository": "git@github.com:castle/castle-node.git",
8
8
  "author": {
@@ -2,16 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CommandGenerateService = void 0;
4
4
  const core_module_1 = require("../../core/core.module");
5
+ const combineURLs = (baseURL, relativeURL) => {
6
+ return baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '');
7
+ };
5
8
  exports.CommandGenerateService = {
6
9
  call: (controller, path, options, method, configuration) => {
7
10
  return {
8
- requestUrl: new URL(path, configuration.baseUrl),
9
- requestOptions: {
10
- signal: controller.signal,
11
- method,
12
- headers: core_module_1.CoreGenerateDefaultHeadersService.call(configuration),
13
- body: core_module_1.CoreGenerateRequestBody.call(options, configuration),
14
- },
11
+ requestUrl: new URL(combineURLs(configuration.baseUrl.toString(), path)),
12
+ requestOptions: Object.assign({ signal: controller.signal, method, headers: core_module_1.CoreGenerateDefaultHeadersService.call(configuration) }, (method !== 'GET' && { body: core_module_1.CoreGenerateRequestBody.call(options, configuration) })),
15
13
  };
16
14
  },
17
15
  };
@@ -1 +1 @@
1
- {"version":3,"file":"command-generate.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-generate.service.ts"],"names":[],"mappings":";;;AACA,wDAGgC;AAGnB,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,CACJ,UAAU,EACV,IAAY,EACZ,OAAgB,EAChB,MAAc,EACd,aAA4B,EAC5B,EAAE;QACF,OAAO;YACL,UAAU,EAAE,IAAI,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC;YAChD,cAAc,EAAE;gBACd,MAAM,EAAE,UAAU,CAAC,MAAM;gBACzB,MAAM;gBACN,OAAO,EAAE,+CAAiC,CAAC,IAAI,CAAC,aAAa,CAAC;gBAC9D,IAAI,EAAE,qCAAuB,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC;aAC3D;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"command-generate.service.js","sourceRoot":"","sources":["../../../../src/command/services/command-generate.service.ts"],"names":[],"mappings":";;;AACA,wDAGgC;AAGhC,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;IAC3C,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC7E,CAAC,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,IAAI,EAAE,CACJ,UAAU,EACV,IAAY,EACZ,OAAgB,EAChB,MAAc,EACd,aAA4B,EAC5B,EAAE;QACF,OAAO;YACL,UAAU,EAAE,IAAI,GAAG,CAAC,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;YACxE,cAAc,kBACZ,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,MAAM,EACN,OAAO,EAAE,+CAAiC,CAAC,IAAI,CAAC,aAAa,CAAC,IAC3D,CAAC,MAAM,KAAK,KAAK,IAAI,EAAE,IAAI,EAAE,qCAAuB,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,CAAC,CACxF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -20,6 +20,9 @@ const RESPONSE_ERRORS = {
20
20
  '419': errors_1.UserUnauthorizedError,
21
21
  '422': errors_1.InvalidParametersError,
22
22
  };
23
+ const RESPONSE_SUB_ERRORS = {
24
+ 'invalid_request_token': errors_1.InvalidRequestTokenError
25
+ };
23
26
  const getBody = (response) => __awaiter(void 0, void 0, void 0, function* () {
24
27
  if (response.cachedBody) {
25
28
  return response.cachedBody;
@@ -48,7 +51,7 @@ exports.CoreProcessResponseService = {
48
51
  if (response.status >= 500 && response.status <= 599) {
49
52
  throw new errors_1.InternalServerError(`Castle: Responded with ${response.status} code`);
50
53
  }
51
- const err = RESPONSE_ERRORS[response.status.toString()];
54
+ const err = RESPONSE_SUB_ERRORS[body.type] || RESPONSE_ERRORS[response.status.toString()];
52
55
  throw new err(`Castle: Responded with ${response.status} code`);
53
56
  }),
54
57
  };
@@ -1 +1 @@
1
- {"version":3,"file":"core-process-response.service.js","sourceRoot":"","sources":["../../../../src/core/services/core-process-response.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCASsB;AACtB,8DAA2D;AAE3D,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE,wBAAe;IACtB,KAAK,EAAE,0BAAiB;IACxB,KAAK,EAAE,uBAAc;IACrB,KAAK,EAAE,sBAAa;IACpB,KAAK,E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,MAAM,IAAI,GAAG,CAAC,0BAA0B,QAAQ,CAAC,MAAM,OAAO,CAAC,CAAC;IAClE,CAAC,CAAA;CACF,CAAC"}
1
+ {"version":3,"file":"core-process-response.service.js","sourceRoot":"","sources":["../../../../src/core/services/core-process-response.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAUsB;AACtB,8DAA2D;AAE3D,MAAM,eAAe,GAAG;IACtB,KAAK,EAAE,wBAAe;IACtB,KAAK,EAAE,0BAAiB;IACxB,KAAK,EAAE,uBAAc;IACrB,KAAK,EAAE,sBAAa;IACpB,KAAK,EAAE,8BAAqB;IAC5B,KAAK,EAAE,+BAAsB;CAC9B,CAAC;AAEF,MAAM,mBAAmB,GAAG;IAC1B,uBAAuB,EAAE,iCAAwB;CAClD,CAAC;AAMF,MAAM,OAAO,GAAG,CAAO,QAAa,EAAE,EAAE;IACtC,IAAI,QAAQ,CAAC,UAAU,EAAE;QACvB,OAAO,QAAQ,CAAC,UAAU,CAAC;KAC5B;IAED,IAAI;QACF,MAAM,iBAAiB,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAChD,IAAI,iBAAiB,EAAE;YACrB,QAAQ,CAAC,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;SAC3D;aAAM;YACL,QAAQ,CAAC,UAAU,GAAG,EAAE,CAAC;SAC1B;KACF;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,IAAI,iBAAQ,CAAC,iCAAiC,CAAC,CAAC;KACvD;IAED,OAAO,QAAQ,CAAC,UAAU,CAAC;AAC7B,CAAC,CAAA,CAAC;AAEW,QAAA,0BAA0B,GAAG;IACxC,IAAI,EAAE,CAAO,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE;QAC3D,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;QAErC,6BAAa,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;QAE3E,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;YACpD,OAAO,IAAI,CAAC;SACb;QAED,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;YACpD,MAAM,IAAI,4BAAmB,CAC3B,0BAA0B,QAAQ,CAAC,MAAM,OAAO,CACjD,CAAC;SACH;QAKD,MAAM,GAAG,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAE1F,MAAM,IAAI,GAAG,CAAC,0BAA0B,QAAQ,CAAC,MAAM,OAAO,CAAC,CAAC;IAClE,CAAC,CAAA;CACF,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ImpersonationFailed = exports.InternalServerError = exports.InvalidParametersError = exports.UserUnauthorizedError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadRequestError = exports.APIError = exports.ConfigurationError = void 0;
3
+ exports.ImpersonationFailed = exports.InternalServerError = exports.InvalidRequestTokenError = exports.InvalidParametersError = exports.UserUnauthorizedError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadRequestError = exports.APIError = exports.ConfigurationError = void 0;
4
4
  class ConfigurationError extends Error {
5
5
  constructor(message) {
6
6
  super(message);
@@ -57,6 +57,13 @@ class InvalidParametersError extends APIError {
57
57
  }
58
58
  }
59
59
  exports.InvalidParametersError = InvalidParametersError;
60
+ class InvalidRequestTokenError extends InvalidParametersError {
61
+ constructor(message) {
62
+ super(message);
63
+ this.name = 'InvalidRequestTokenError';
64
+ }
65
+ }
66
+ exports.InvalidRequestTokenError = InvalidRequestTokenError;
60
67
  class InternalServerError extends APIError {
61
68
  constructor(message) {
62
69
  super(message);
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AALD,gDAKC;AAED,MAAa,QAAS,SAAQ,KAAK;IACjC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AALD,4BAKC;AAGD,MAAa,eAAgB,SAAQ,QAAQ;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AALD,0CAKC;AAGD,MAAa,iBAAkB,SAAQ,QAAQ;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF;AALD,8CAKC;AAGD,MAAa,cAAe,SAAQ,QAAQ;IAC1C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC;AAGD,MAAa,aAAc,SAAQ,QAAQ;IACzC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AALD,sCAKC;AAGD,MAAa,qBAAsB,SAAQ,QAAQ;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,C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e,SAAQ,QAAQ;IAC1C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AALD,wCAKC;AAGD,MAAa,aAAc,SAAQ,QAAQ;IACzC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AALD,sCAKC;AAGD,MAAa,qBAAsB,SAAQ,QAAQ;IACjD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AALD,sDAKC;AAGD,MAAa,sBAAuB,SAAQ,QAAQ;IAClD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AALD,wDAKC;AAGD,MAAa,wBAAyB,SAAQ,sBAAsB;IAClE,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AALD,4DAKC;AAGD,MAAa,mBAAoB,SAAQ,QAAQ;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC;AAGD,MAAa,mBAAoB,SAAQ,QAAQ;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF;AALD,kDAKC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "http://json.schemastore.org/package",
3
3
  "name": "@castleio/sdk",
4
4
  "description": "Castle SDK for Node",
5
- "version": "1.0.1",
5
+ "version": "1.1.0",
6
6
  "main": "dist/index.js",
7
7
  "repository": "git@github.com:castle/castle-node.git",
8
8
  "author": {
package/CHANGELOG.md DELETED
@@ -1,72 +0,0 @@
1
- # Changelog
2
-
3
- ## 1.0.1
4
-
5
- **Enhancements:**
6
-
7
- - [#117](https://github.com/castle/castle-node/pull/117)
8
- * typings improvements
9
-
10
- ## 1.0.0
11
- **BREAKING CHANGES:**
12
- - remove `identify` and `review` commands - they are no longer supported
13
-
14
- - renamed setUseWhitelist with setUseAllowlist
15
-
16
- - added better support for configuration, replaced apiUrl with baseUrl option
17
- * [#97](https://github.com/castle/castle-node/pull/97)
18
-
19
- - replace logLevel with logger in the config
20
- * [#97](https://github.com/castle/castle-node/pull/111)
21
-
22
- - dropped EVENTS const with list of events
23
- * [#97](https://github.com/castle/castle-node/pull/114)
24
- **Enhancements:**
25
- - restructuring the codebase
26
- * [#89](https://github.com/castle/castle-node/pull/89)
27
- * [#90](https://github.com/castle/castle-node/pull/90)
28
- * [#91](https://github.com/castle/castle-node/pull/91)
29
- * [#100](https://github.com/castle/castle-node/pull/100)
30
- * [#101](https://github.com/castle/castle-node/pull/101)
31
- * [#102](https://github.com/castle/castle-node/pull/102)
32
- * [#110](https://github.com/castle/castle-node/pull/110)
33
- * [#110](https://github.com/castle/castle-node/pull/113)
34
-
35
- - added failover and timeout support
36
- * [#93](https://github.com/castle/castle-node/pull/93)
37
-
38
- - added ability to set ip headers and proxies
39
- * [#96](https://github.com/castle/castle-node/pull/96)
40
-
41
- - added request context builder
42
- * [#100](https://github.com/castle/castle-node/pull/100)
43
-
44
- - added request context builder
45
- * [#100](https://github.com/castle/castle-node/pull/100)
46
-
47
- - added device endpoints
48
- * [#106](https://github.com/castle/castle-node/pull/106)
49
- * [#107](https://github.com/castle/castle-node/pull/107)
50
- * [#108](https://github.com/castle/castle-node/pull/108)
51
- * [#109](https://github.com/castle/castle-node/pull/109)
52
-
53
- - added risk, filter, log endpoints
54
- * [#112](https://github.com/castle/castle-node/pull/112)
55
- ## 0.5.0
56
-
57
- **Enhancements:**
58
-
59
- - [#87](https://github.com/castle/castle-node/pull/87) added risk policy information to the authenticate response
60
-
61
-
62
- ## 0.4.7
63
- **BREAKING CHANGES:**
64
-
65
- - [#42](https://github.com/castle/castle-node//pull/42)
66
- * remove `identify` and `review` commands - they are no longer supported
67
- * renamed setUseWhitelist with setUseAllowlist
68
-
69
- **Enhancements:**
70
-
71
- - Re-publish to fix broken build
72
-