[GSK-2782] Allow GiskardClient to read api key from env #1809
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There exists an env var called
GSK_API_KEY
used to auto-provide the API key in the giskard worker CLI. It makes sense to reuse the name here.We may want to also delete it from the environment once it's loaded to prevent leaks as done in the CLI.
I'm worried though that it may destroy the env var in the kernel itself, which would need to be restarted to properly instantiate a new client (or if the user was to reload the same cell where the client gets created).
Todo
GiskardClient
.Testing Checklist
GSK_API_KEY
key
kwarg and connect to the hubdel os.environ['GSK_API_KEY']
) and attempt to re-instantiate clientRelated Issue
Type of Change
Checklist
CODE_OF_CONDUCT.md
document.CONTRIBUTING.md
guide.make codestyle
.