Skip to content

Commit 037d295

Browse files
committed
Add comments
1 parent 1d2209e commit 037d295

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

databricks/sdk/credentials_provider.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,14 @@ def __call__(self, cfg: 'Config') -> CredentialsProvider:
866866

867867

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

870878
def __init__(self):
871879
self.credential_type = ModelServingAuthProvider.USER_CREDENTIALS

0 commit comments

Comments
 (0)