earthdaily / earthdaily-python-client

EarthDaily python client
https://earthdaily.github.io/earthdaily-python-client/
MIT License
11 stars 4 forks source link

Add a ~/.earthdaily/credentials configuration file to store & load credentials #86

Open rle-earthdaily opened 5 days ago

rle-earthdaily commented 5 days ago

As an earthdaily package user, I'd like to store the EDS_AUTH_URL, EDS_CLIENT_ID and EDS_SECRET variables in a file outside of the repository, without having to manually resort to dotenv. I think we could use a similar mechanism to AWS' way of handling credentials (i.e. store credentials in ~/.aws/credentials on MacOs/linux and in %USERPROFILE%.aws\credentials on Windows) by defining a similar ~/.earthdaily/credentials file.

The package should try to read credentials in the following order:

This would provide a first step for named profiles that point to different credentials.

nkarasiak commented 4 days ago

Very nice idea @rle-earthdaily, it's way better than a dotenv file indeed. Usually default/suggested way to use it is to store in environment variables, but the same method as boto3/aws is really interested and I think easier to implement for users. So yeah let's go ! But let's be careful on breaking changes.