The auth logic for uploading via a service account token is different that you'd use when running the upload client locally.
A user account (username and password swapped for a token at identity api) lasts for 15 minutes max and has to be refreshed.
A service account does not require refreshing.
The auth headers for each are different.
This PR is to use env vars to allow both scenarios (service account when deployed, user account when running locally).
I also tweaked the logging flush to use env vars while I was in there (my initial steer to use a kwarg was wrong, sub modules will instantiate their own logger, we wont always have control of all instantiations).
I also added a PUT method to the base http client as we needed it for refreshing user tokens.
How to review
Sanity check. Correct my inevitable spelling errors.
What
The auth logic for uploading via a service account token is different that you'd use when running the upload client locally.
A user account (username and password swapped for a token at identity api) lasts for 15 minutes max and has to be refreshed. A service account does not require refreshing.
The auth headers for each are different.
This PR is to use env vars to allow both scenarios (service account when deployed, user account when running locally).
I also tweaked the logging flush to use env vars while I was in there (my initial steer to use a kwarg was wrong, sub modules will instantiate their own logger, we wont always have control of all instantiations).
I also added a
PUT
method to the base http client as we needed it for refreshing user tokens.How to review
Sanity check. Correct my inevitable spelling errors.
Who can review
Anyone,.