Use of Databricks personal access tokens are generally discouraged nowadays, the preferred authentication method for Databricks is now OAuth -- either "user to machine", which uses the authorization code flow, or "machine to machine", which is a client credentials flow.
This commit adds support for both. In the process it also adds support for caching and refreshing these credentials correctly across multiple turns.
Unit tests are included for M2M and PAT credentials; U2M credentials are difficult to mock because they require an authorization code flow.
This change also unlocks our ability to use a Databricks service principal to run elmer's own integration tests.
Use of Databricks personal access tokens are generally discouraged nowadays, the preferred authentication method for Databricks is now OAuth -- either "user to machine", which uses the authorization code flow, or "machine to machine", which is a client credentials flow.
This commit adds support for both. In the process it also adds support for caching and refreshing these credentials correctly across multiple turns.
Unit tests are included for M2M and PAT credentials; U2M credentials are difficult to mock because they require an authorization code flow.
This change also unlocks our ability to use a Databricks service principal to run
elmer
's own integration tests.