Whitelisting

25 views
Skip to first unread message

Nick Roth

unread,
Apr 29, 2015, 5:48:10 PM4/29/15
to cross...@googlegroups.com
I am working on a simple demo and am providing the user a checkbox "privateChannel", that they can select, which corresponds to:

session.publish('com.python.myfunction', [arg1], {}, {acknowledge: true,
    disclose_me: privateChannel}).then(
Enter code here...

So when they don't select the checkbox, then the backend python client, subscribed to the topic and receiving details as an argument, will receive an ID for who published the request. The python backend processes the request then passes the details.publisher through to the resulting publish call via the eligible argument.

I've verified everything to work exactly how I'd expect, except that no matter what is provided via the eligible argument, the published message goes to both of the two javascript clients I have connected. I either get None or the ID based on the setting on the client side, but eligible seems to not affect anything.

Is there another option I need to enable on the crossbar router for this to work?

Nick Roth

unread,
Apr 30, 2015, 10:51:09 AM4/30/15
to cross...@googlegroups.com
Ok, I found the issue, but I'm still a little confused.

One thing that would be nice is to provide some pointers on how to debug crossbar. The only thing I found was on stackoverflow here: http://stackoverflow.com/questions/27476238/debugging-crossbar-io-app-in-intellij/27544912#27544912

Using pycharm on windows, this is what I used. I added a new python debug config, then added the following settings:
Script: C:\tools\Miniconda\Scripts\crossbar-script.py
Script Parameters: -d start --cbdir C:\Path\to\my\project\.crossbar

Once I got that working, the thing that confused me is that adding a breakpoint in Broker's processPublish method only caught publish events that I didn't care about. The publish event from the ApplicationSession's publish method must involve the router in some way or another, but I couldn't find where.

The problem I had was that while I was using the SubscribeOptions for the subscription to get the id of the session, I wasn't using the PublishOptions for the publish call. Inside this publish call it specifically looks for the options keyword as being a PublishOptions type, otherwise the keywords aren't used. https://github.com/tavendo/AutobahnPython/blob/master/autobahn/wamp/protocol.py#L999

Once I fixed this, I got the behavior that I expected.

--
You received this message because you are subscribed to a topic in the Google Groups "Crossbar" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/crossbario/omHeSP0RmpA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to crossbario+...@googlegroups.com.
To post to this group, send email to cross...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/crossbario/1bc89262-8b6c-4b0b-9b31-f684944f9512%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages