Outsource Snowflake authentication for Cortex to snowflakeauth
#145
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.
This is a draft because I'm not actually sure this is a good idea yet and the API of
snowflakeauth
is still WIP.This commit drops all of the Snowflake-specific authentication logic in favour of using the new
snowflakeauth
package. This has a big advantage in that it works with Snowflake connections and credentials created by the Snowflake Python packages and their CLI.Calling
chat_cortex()
with no credentials makes our support for these files explicit:However, this is a breaking change in that (1) some environment variables that previously furnished credentials no longer do; and (2) the signature of
chat_cortex()
has changed. The reason to drop the environment variable support is that these specific environment variables are not used by Snowflake's Python tooling -- so I think this is the right choice.Existing unit tests do cover regressions in the Authorization headers we pass to Snowflake, though I did have to modify them a bit to account for the API changes.