catmaid / catpy

Python client for the CATMAID API
MIT License
4 stars 3 forks source link

Client: Improved authentication #2

Closed clbarnes closed 7 years ago

clbarnes commented 7 years ago

Previously, authorization had to be set at instantiation time and assumes the server requires HTTP authorization. Authorization can now be set on the fly, and the client can be used anonymously and/or without HTTP authorization.

There is also now requests' standard HTTP error handling.

aschampion commented 7 years ago

Would it be better to keep around the CatmaidAuthToken class (perhaps as CatmaidTokenAuth) since, while trivial, it's a somewhat useful part of the library if people want to build their own session object to interact with CATMAID in some custom way? Then set_api_token can just add that class to the _session.auth set.