Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aravind-segu committed Feb 13, 2025
1 parent 1d2209e commit 037d295
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions databricks/sdk/credentials_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,14 @@ def __call__(self, cfg: 'Config') -> CredentialsProvider:


class ModelServingUserCredentials(CredentialsStrategy):
"""
This credential strategy is designed for authenticating the Databricks SDK in the model serving environment using user-specific rights.
In the model serving environment, the strategy retrieves a downscoped user token from the thread-local variable.
In any other environments, the class defaults to the DefaultCredentialStrategy.
To use this credential strategy, instantiate the WorkspaceClient with the ModelServingUserCredentials strategy as follows:
invokers_client = WorkspaceClient(credential_strategy = ModelServingUserCredentials())
"""

def __init__(self):
self.credential_type = ModelServingAuthProvider.USER_CREDENTIALS
Expand Down

0 comments on commit 037d295

Please sign in to comment.