Skip to content

Commit bf92c6c

Browse files
committed
renamed other as client_cert in auth_mech
Signed-off-by: Sai Shree Pradhan <saishree.pradhan@databricks.com>
1 parent e4c05d1 commit bf92c6c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/databricks/sql/telemetry/models/enums.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ class AuthFlow(Enum):
77

88

99
class AuthMech(Enum):
10-
OTHER = "OTHER"
11-
PAT = "PAT"
12-
DATABRICKS_OAUTH = "DATABRICKS_OAUTH"
13-
EXTERNAL_AUTH = "EXTERNAL_AUTH"
10+
CLIENT_CERT = "CLIENT_CERT" # ssl certificate authentication
11+
PAT = "PAT" # Personal Access Token authentication
12+
DATABRICKS_OAUTH = "DATABRICKS_OAUTH" # Databricks-managed OAuth flow
13+
EXTERNAL_AUTH = "EXTERNAL_AUTH" # External identity provider (AWS, Azure, etc.)
1414

1515

1616
class DatabricksClientType(Enum):

src/databricks/sql/telemetry/telemetry_client.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def getDriverSystemConfiguration(cls) -> DriverSystemConfiguration:
5555
@staticmethod
5656
def get_auth_mechanism(auth_provider):
5757
"""Get the auth mechanism for the auth provider."""
58+
# AuthMech is an enum with the following values:
59+
# PAT, DATABRICKS_OAUTH, EXTERNAL_AUTH, CLIENT_CERT
60+
5861
if not auth_provider:
5962
return None
6063
if isinstance(auth_provider, AccessTokenAuthProvider):
@@ -65,11 +68,14 @@ def get_auth_mechanism(auth_provider):
6568
return (
6669
AuthMech.EXTERNAL_AUTH
6770
) # External identity provider (AWS, Azure, etc.)
68-
return AuthMech.OTHER # Custom or unknown authentication provider
71+
return AuthMech.CLIENT_CERT # Client certificate (ssl)
6972

7073
@staticmethod
7174
def get_auth_flow(auth_provider):
7275
"""Get the auth flow for the auth provider."""
76+
# AuthFlow is an enum with the following values:
77+
# TOKEN_PASSTHROUGH, BROWSER_BASED_AUTHENTICATION
78+
7379
if not auth_provider:
7480
return None
7581

@@ -78,7 +84,6 @@ def get_auth_flow(auth_provider):
7884
return (
7985
AuthFlow.TOKEN_PASSTHROUGH
8086
) # Has existing tokens, no user interaction needed
81-
8287
if hasattr(auth_provider, "oauth_manager"):
8388
return (
8489
AuthFlow.BROWSER_BASED_AUTHENTICATION

0 commit comments

Comments
 (0)