-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cache the access token in the system environement #6
Comments
We could also store the login credentials as a system variable (hashed i suppose!), as this is what rgbif actually does in the backend. Then we could keep calling get_access_token() as a helper in functions without the need to keep prompting the user all the time. What do you think @SanderDevisscher ?
On second thought, the access token itself is probably safer, in case users reuse their password somewhere. Ideally we'd want to use something like keyring for the authentication credentials. Something for the future perhaps. |
I have no clear preference. I personally would go with the easiest method to use/implement for now and look into more secure options in the future. |
I have checked if access tokes eventually get invalidated on the iAsset side without a request to do so (logout api post request), and it seems this is indeed the case. So you can't just keep using the same access token forever, good. |
related but not a fix is to add password as a function parameter of |
I think we're best off caching the access_token itself, rather than the password. This will mean that users will probably need to login once in a while, which is not a bad thing. We can write |
1 question though I'm looking into automating retrieval of vespawatch nests using github actions and I was just wondering if this will work if we cache the token instead of being able to provide a password as environment variable. |
This is an important design decision to keep in mind, can you make an issue for further discussion? If we retrieve personal information via the API, we might need to make sure no data is stored unencrypted on the runner or in artefacts, and we might be obliged to process data in the EU only. I'm not sure on the specifics but we need to thread lightly. We are capable of using our own custom runners via AWS in a EU region, but it'll take a bit of doing and have a slight cost. |
I think we should probably allow passing the credentials as environmental variables. With this in mind I still think it could be useful to cache the token for a bit. It's unclear how long a token remains valid. Any ideas? I'll send an email to support |
System tokens are valid for 24h |
Maybe store the access token for a bit, similar to etn and rgbif
The text was updated successfully, but these errors were encountered: