I am writing a GPS location sharing app and I am using Crossbar on the server side and Autobahn on the client side to deliver position updates via WAMP messages.
When the user moves, their location is shared by a WAMP message being published.
I’ve written custom authentication and authorization services that authenticate the websocket connections per-user, and an authorization service that determines if said user is on the tracked user’s friends list before allowing the subscription request.
The major issue I have here is that if the user being tracked removes the other user from their friends list, the existing subscription stays where it is, and the subscribed user continues to receive position updates.
So, there’s a few ways this could be fixed. I’m not averse to implementing this functionality in Crossbar itself if I need to, especially if someone tells me where I should look.
Is there a way to remove an existing subscription programatically?
Is there a way to clear the authorization cache so all existing authorizations are re-checked - providing they would be?
If this doesn’t occur, is there a way to drop all the connections for a certain user so that user reconnects and re-subscribes to all the subscriptions?
I’m sure this is a problem for a number of use cases other than my own, so I’d be interested to know how others have solved it.
I haven’t found any answers in the docs, haven’t seen anything promising reading the source code, and searching this list for anything containing “unsubscribe” turns up nearly every message thanks to the footer…
Thanks in advance.