can somewhat be used as a check if the entered password and username combination is valid by monitoring the return of the function but for token authentication the function can not be used right now.
So either a new function e.g. checkAuth() could be added to give a clear entry point for other developers. testServer() also could be expanded to contain this authentication check. The third option could be to adjust requestToken() in a way that it also works with tokens as authentication. The last one feels a bit ugly as one would then request the token he already entered again but probably would be the less invasive change in the API.
opinions? If any option is preferred I could implement it then in the next days.
Hi again,
while working on a project using this package I discovered a shortcoming at least when using the token authentication mode but maybe the implementation for password based authentication could be improved as well. Right now there is no straight authentication check. https://github.com/inventree/inventree-python/blob/18d7dddf9dd9d773d432ae6eea7613db213f0bd0/inventree/api.py#L204
can somewhat be used as a check if the entered password and username combination is valid by monitoring the return of the function but for token authentication the function can not be used right now.
So either a new function e.g.
checkAuth()
could be added to give a clear entry point for other developers.testServer()
also could be expanded to contain this authentication check. The third option could be to adjustrequestToken()
in a way that it also works with tokens as authentication. The last one feels a bit ugly as one would then request the token he already entered again but probably would be the less invasive change in the API.opinions? If any option is preferred I could implement it then in the next days.