🏆 Enhancements - modifies Client to suit the global context scenario, removes entity parameter from get, adds auth logic, preventing users from sending requests until access_token is set
🏠 Internal - Forces interface functions to be uncallable until the token is set
Purpose
Explore more options with Client, letting it integrate global context, as well as smaller session context
Why?
Preventing API being called with invalid tokens
Feedback required over
A quick pair of :eyes: on the code
Discussion on the technical approach
Feedback required when
Whenever is fine
Mentions
@cbeddow does the auth() functionality do enough for now? It simply checks for the functions in mapillary.py if they are called without the token being set first, if that is the case, an exception is thrown, else, it allows the request to go on further. A demo is below
>>> import mapillary as mly
>>> mly.greetings('saif')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/saif/MLH/mapillary-python-sdk/mapillary/models/auth.py", line 27, in wrapper
raise AuthError("Function called without setting the access token")
models.exceptions.AuthError: AuthError: An exception occured, "Function called without setting the access token"
@OmarMuhammedAli what do you think of the changes in Client? I think we did not really need the distinguish in entity vs tile, a header approach generally is more secure, I think.
[Request Mechanism] Client & Auth Changes, Resolves Extended Req#1 Changes
Pull Request Type
🏆 Enhancements - modifies
Client
to suit the global context scenario, removesentity
parameter fromget
, addsauth
logic, preventing users from sending requests until access_token is set🏠 Internal - Forces interface functions to be uncallable until the token is set
Purpose
Explore more options with
Client
, letting it integrate global context, as well as smaller session contextWhy?
Preventing API being called with invalid tokens
Feedback required over
Feedback required when
Whenever is fine
Mentions
auth()
functionality do enough for now? It simply checks for the functions inmapillary.py
if they are called without the token being set first, if that is the case, an exception is thrown, else, it allows the request to go on further. A demo is belowClient
? I think we did not really need the distinguish inentity
vstile
, a header approach generally is more secure, I think.