Message 44393

Author
semarie
Date
2018-10-15.11:26:05
Message id
44393

Content

how the API should be designed ?

the more generic approch would be:
- a function to get a fresh session token (using URI + login + password)
- a function to get a xmlrpc.client.Transport configured to use a session token (using a session-token)
- a function to get a xmlrpc.client.SafeTransport configured to use a session token (using a session-token)
- next, set_xmlrpc() would have to be called with transport=mySessionTransport (no change)

eventually, the functions for Transport/SafeTransport could be mixed if we pass also the URI (to choose between the two). Or alternatively, using fallback method and fingerprint is also possible (to do the same as the tryton client), but I am unsure as it seems to me it is overkilled for proteus.

having distinct functions for "get a fresh token" and "get a Transport" would permit token reuse between script calls for example.

having "get a Transport" and "set_xmlrpc()" distinct functions would permit passing specific SSL context to configure the Transport.

it could be interesting to have two way to get a fresh session token:
- a function to get a fresh session token
- use `with` python-syntax and automatically get a fresh token on begining, and terminate the session on block exit (it will disallow session reuse)
History
Date User Action Args
2018-10-15 11:26:05semariesetmessageid: <1539595565.9.0.387902708184.issue7783@tryton.org>
2018-10-15 11:26:05semariesetrecipients: + ced
2018-10-15 11:26:05semarielinkissue7783 messages
2018-10-15 11:26:05semariecreate

Showing 10 items. Show all history (warning: this could be VERY long)