More details about the example above.
The details.caller: is possibly a session ID, but, it is not the session id of the session caller. I have found that if I start many new sessions, the details.caller stays the same until I restart the router.
I dug into this a bit further, it is ultimately related to my ability to ‘authorize’. I looked at the example authorization application in the Autobahn source tree. It shows a Router being subclassed and overriding the ‘authorize’ method. That method implements this:
def authorize(self, session, uri, action):
Authorization hook: check if the given ``session`` is authorized to perform
the given ``action`` on the given ``uri``.
:param session: Application session on which the action is to be authorized.
:type session: A provider of :class:`autobahn.wamp.interfaces.ISession`.
:param uri: The URI on which the session wants to perform the action.
:type uri: str
:param action: The action the session wants to perform. One of
``IRouter.ACTION_PUBLISH`` or ``IRouter.ACTION_SUBSCRIBE``.
:type action: int
I think this means that the ‘session’ being passed to the authorize method is the session to check to see if it is authorized to to the operation. However, I checked here, the session is not changing. Even though I start up different applications and make a call over and over (many different session) when I print out the ‘session’ being passed to this routine the session is not changing.
I thought maybe it was the 9.3.3-3 code, so I went back to 9.2, that didn’t help.
The uri and action being passed to myrouter is correct, that is, I am starting a new session, and calling sys.db.query, which is being authorized with self, session, uri, action. uri is sys.db.query, and action is 1 (call). The session ID comes through each time, but, it is NOT the session of the caller. What am I missing ?
On Thursday, November 27, 2014 9:14:55 AM UTC-6, Greg Fausak wrote:
I have registered a callback:
reg = yield self.register(list_data, ‘adm.session.list’, options = RegisterOptions(details_arg = ‘details’))
Then, when I call the ‘adm.session.list’ topic:
rv = yield self.call(‘adm.session.list’, options = CallOptions(timeout=2000,discloseMe = True))
In my list_data function I am not getting most of the Caller settings:
I am getting the session id. The user is authenticated. Version 0.9.3-3.