Skip to content

Commit fd0e4db

Browse files
committed
Add comments
1 parent c22c7bb commit fd0e4db

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
@@ -872,6 +872,14 @@ def __call__(self, cfg: 'Config') -> CredentialsProvider:
872872

873873

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

876884
def __init__(self):
877885
self.credential_type = ModelServingAuthProvider.USER_CREDENTIALS

0 commit comments

Comments
 (0)