You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rethinking how shovels and federation connect: one endpoint model
#2718
Shovels and federation upstreams are both "the broker opens a connection
because a user configured a URI". Today the handling of that URI has grown
in several places:
Parameter validation, the shovel source/destination code and the federation link code each interpret the URI on their own (scheme, host, vhost path, credentials).
Some behaviour is implicit. A URI without a host means "this broker", and parts of a URI that are left out are filled in by defaults in different layers.
Permissions are checked when the parameter is created, not when the connection is made, so later changes to users or permissions are not reflected.
Shovels and federation don't share connection code, so a feature added to one doesn't apply to the other.
URIs are stored and returned as configured, including any password.
We would like to replace this with a single, explicit model and want feedback before we do, since parts of it change behaviour.
Proposal
1. One Endpoint type, used by both shovels and federation.
A URI is parsed once into one of three kinds, and anything else is rejected when the parameter is created:
Local: no host, credentials or port (amqp:///vhost). Means this broker.
Remote: a host with explicit credentials (amqp://user:pass@host/vhost).
HTTP: an http(s):// shovel destination.
Validation and the running connection use the same parsed endpoint, so they can't disagree.
2. Nothing implicit for remote endpoints.
A remote URI must say who it connects as. To reach this broker, use the local form; a remote URI is for other brokers.
3. Local endpoints act within clear limits.
Two options we are considering:
a) A local endpoint may only use the vhost the shovel or upstream belongs to. Crossing vhosts requires a remote URI with credentials.
b) The shovel or upstream remembers who created it and runs with that user's permissions, evaluated when it connects.
4. Connection rules are applied at connect time.
Address resolution, the blocklist and the rules above are enforced each time a connection is made, so they also cover existing parameters and config reloads.
5. Passwords are not returned when parameters are read.
The API and UI would show URIs without the password, as federation links already do in their status.
What would change for you
amqp://some-host/vhost without credentials would be rejected; add user:password@.
With 3a, local shovels between vhosts would need credentials. With 3b, a shovel stops working if its creator loses access.
Source URIs would be limited to amqp/amqps; destinations to amqp/amqps/http/https.
Tools that read a parameter and write it back would need to handle redacted passwords.
Questions
Do you run shovels or federation to another broker on the same host (for example localhost:5673)? Would an opt-in setting for that be enough?
Do you use local shovels between vhosts? Would 3a or 3b suit you better?
Do you rely on URIs without credentials, or on WebSocket URIs?
Does anything in your tooling depend on reading passwords back from GET /api/parameters?
What should happen to existing parameters that don't fit the new model on upgrade: refuse to start them with a clear error, or keep running them with a deprecation warning for a release?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Shovels and federation upstreams are both "the broker opens a connection
because a user configured a URI". Today the handling of that URI has grown
in several places:
We would like to replace this with a single, explicit model and want feedback before we do, since parts of it change behaviour.
Proposal
1. One
Endpointtype, used by both shovels and federation.A URI is parsed once into one of three kinds, and anything else is rejected when the parameter is created:
amqp:///vhost). Means this broker.amqp://user:pass@host/vhost).http(s)://shovel destination.Validation and the running connection use the same parsed endpoint, so they can't disagree.
2. Nothing implicit for remote endpoints.
A remote URI must say who it connects as. To reach this broker, use the local form; a remote URI is for other brokers.
3. Local endpoints act within clear limits.
Two options we are considering:
4. Connection rules are applied at connect time.
Address resolution, the blocklist and the rules above are enforced each time a connection is made, so they also cover existing parameters and config reloads.
5. Passwords are not returned when parameters are read.
The API and UI would show URIs without the password, as federation links already do in their status.
What would change for you
amqp://some-host/vhostwithout credentials would be rejected; adduser:password@.amqp/amqps; destinations toamqp/amqps/http/https.Questions
localhost:5673)? Would an opt-in setting for that be enough?GET /api/parameters?All reactions