juju api and authenticated request

Kapil Thangavelu kapil.thangavelu at canonical.com
Tue Feb 11 20:22:22 UTC 2014


hybi-13 is the rfc version. the library jujuclient is using also has a
python3 variant.


On Mon, Feb 10, 2014 at 8:02 PM, Adam Stokes <adam.stokes at ubuntu.com> wrote:

> I tried a python3 variant that uses ws4py which is RFC 6455 compliant
> and can not seem to get the login to work:
>
> # OUtput
> connection opened
>
> {'RequestId': 1, 'Response': {}}
>
>
> # Code
> #!/usr/bin/python3
>
>
> from ws4py.client.threadedclient import WebSocketClient
> from pprint import pprint
> import json
>
> params = {}
> params['Type'] = "Admin"
> params['Request'] = 'Login'
> params['RequestId'] = 1
> params['Params'] = { 'AuthTag' : 'user-admin', 'Password':
> 'f0d44f279b47cc8b5f7ea291f5e3b30a'}
>
> class DummyClient(WebSocketClient):
>     def opened(self):
>         print("connection opened")
>         self.send(json.dumps(params))
>
>     def closed(self, code, reason):
>         print ("Closed down", code, reason)
>
>     def received_message(self, m):
>         pprint(json.loads(m.data.decode('utf-8')))
>         return m
>
> if __name__ == '__main__':
>     try:
>         ws = DummyClient('wss://192.168.122.16:17070/',
> protocols=['https-only'])
>         ws.connect()
> #        info = {'Type': 'Client',
> #                'Request': 'EnvironmentInfo'}
> #        ws.send(json.dumps(info))
>     except KeyboardInterrupt:
>         ws.close()
>
>
> The library that Kapil uses in the jujuclient only supports hybi-13.
> So I'm curious if juju supports anything beyond that?
>
> --
> [ Adam Stokes ]
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20140211/9b43d307/attachment.html>


More information about the Juju mailing list