rascal 17.0.2 → 18.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/CHANGELOG.md +5 -0
- package/README.md +6 -3
- package/lib/config/configure.js +9 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 18.0.0
|
|
4
|
+
|
|
5
|
+
- Fixes https://github.com/onebeyond/rascal/issues/227 by requiring special characters to be URL encoded.
|
|
6
|
+
- Consolidated broker and management url configuration logic
|
|
7
|
+
|
|
3
8
|
## 17.0.2
|
|
4
9
|
|
|
5
10
|
- Update guidesmiths references to onebeyond.
|
package/README.md
CHANGED
|
@@ -47,9 +47,9 @@ Rascal extends the existing [RabbitMQ Concepts](https://www.rabbitmq.com/tutoria
|
|
|
47
47
|
|
|
48
48
|
A **publication** is a named configuration for publishing a message, including the destination queue or exchange, routing configuration, encryption profile and reliability guarantees, message options, etc. A **subscription** is a named configuration for consuming messages, including the source queue, encryption profile, content encoding, delivery options (e.g. acknowledgement handling and prefetch), etc. These must be [configured](#configuration) and supplied when creating the Rascal broker. After the broker has been created the subscriptions and publications can be retrieved from the broker and used to publish and consume messages.
|
|
49
49
|
|
|
50
|
-
### Breaking Changes
|
|
50
|
+
### Breaking Changes
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
Please refer to the [Change Log](https://github.com/onebeyond/rascal/blob/master/CHANGELOG.md)
|
|
53
53
|
|
|
54
54
|
### Special Note
|
|
55
55
|
|
|
@@ -318,6 +318,7 @@ The simplest way to specify a connection is with a url
|
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
```
|
|
321
|
+
As of Rascal v18.0.0 you must URL encode special characters appearing in the username, password and vhost, e.g. `amqp://guest:secr%23t@broker.example.com:5672/v1?heartbeat=10`
|
|
321
322
|
|
|
322
323
|
Alternatively you can specify the individual connection details
|
|
323
324
|
|
|
@@ -345,6 +346,8 @@ Alternatively you can specify the individual connection details
|
|
|
345
346
|
}
|
|
346
347
|
```
|
|
347
348
|
|
|
349
|
+
Special characters do not need to be encoded when specified in this form.
|
|
350
|
+
|
|
348
351
|
Any attributes you add to the "options" sub document will be converted to query parameters. Any attributes you add in the "socketOptions" sub document will be passed directly to amqplib's connect method (which hands them off to `net` or `tls`. Providing you merge your configuration with the default configuration `rascal.withDefaultConfig(config)` you need only specify the attributes you want to override
|
|
349
352
|
|
|
350
353
|
```json
|
|
@@ -459,7 +462,7 @@ The AMQP protocol doesn't support assertion or checking of vhosts, so Rascal use
|
|
|
459
462
|
}
|
|
460
463
|
```
|
|
461
464
|
|
|
462
|
-
Rascal uses [superagent](https://github.com/visionmedia/superagent) under the hood. URL configuration is supported.
|
|
465
|
+
Rascal uses [superagent](https://github.com/visionmedia/superagent) under the hood. URL configuration is also supported.
|
|
463
466
|
|
|
464
467
|
```json
|
|
465
468
|
{
|
package/lib/config/configure.js
CHANGED
|
@@ -91,7 +91,7 @@ module.exports = _.curry((rascalConfig, next) => {
|
|
|
91
91
|
} = new URL(connectionString);
|
|
92
92
|
const options = Array.from(searchParams).reduce((attributes, entry) => ({ ...attributes, [entry[0]]: entry[1] }), {});
|
|
93
93
|
return {
|
|
94
|
-
protocol, hostname, port, user, password, vhost, options,
|
|
94
|
+
protocol, hostname: decodeURIComponent(hostname), port, user: decodeURIComponent(user), password: decodeURIComponent(password), vhost: decodeURIComponent(vhost), options,
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -105,10 +105,14 @@ module.exports = _.curry((rascalConfig, next) => {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
function configureManagementConnection(vhostConfig, vhostName, connection) {
|
|
108
|
-
_.
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
connection.
|
|
108
|
+
connection.management = _.isString(connection.management) ? { url: connection.management } : connection.management;
|
|
109
|
+
const attributesFromUrl = parseConnectionUrl(connection.management.url);
|
|
110
|
+
const attributesFromConfig = getConnectionAttributes(connection.management);
|
|
111
|
+
const defaults = { user: connection.user, password: connection.password, hostname: connection.hostname };
|
|
112
|
+
|
|
113
|
+
const connectionAttributes = _.defaultsDeep({ options: null }, attributesFromUrl, attributesFromConfig, defaults);
|
|
114
|
+
setConnectionAttributes(connection.management, connectionAttributes);
|
|
115
|
+
setConnectionUrls(connection.management);
|
|
112
116
|
}
|
|
113
117
|
|
|
114
118
|
function setConnectionAttributes(connection, attributes, defaults) {
|
|
@@ -120,7 +124,6 @@ module.exports = _.curry((rascalConfig, next) => {
|
|
|
120
124
|
const auth = getAuth(connection.user, connection.password);
|
|
121
125
|
const pathname = connection.vhost === '/' ? '' : connection.vhost;
|
|
122
126
|
const query = connection.options;
|
|
123
|
-
|
|
124
127
|
connection.url = url.format({
|
|
125
128
|
slashes: true, ...connection, auth, pathname, query,
|
|
126
129
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rascal",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "A config driven wrapper for amqplib supporting multi-host connections, automatic error recovery, redelivery flood protection, transparent encryption / decryption, channel pooling and publication timeouts",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|