Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc37cd01

Browse files
committed
refactoring
1 parent76df22e commitc37cd01

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

‎src/databricks/sql/auth/auth.py‎

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AuthType(Enum):
1414
DATABRICKS_OAUTH="databricks-oauth"
1515
AZURE_OAUTH="azure-oauth"
1616
# TODO: Token federation should be a feature that works with different auth types,
17-
# not an auth type itself. This will be refactored in a futurerelease.
17+
# not an auth type itself. This will be refactored in a futurechange.
1818
TOKEN_FEDERATION="token-federation"
1919
# other supported types (access_token) can be inferred
2020
# we can add more types as needed later
@@ -68,19 +68,10 @@ def get_auth_provider(cfg: ClientContext):
6868
)
6969
returnExternalAuthProvider(federation_provider)
7070

71-
# If access token is provided with token federation, create a SimpleCredentialsProvider
72-
elifcfg.auth_type==AuthType.TOKEN_FEDERATION.valueandcfg.access_token:
73-
fromdatabricks.sql.auth.token_federationimport (
74-
create_token_federation_provider,
75-
)
76-
77-
federation_provider=create_token_federation_provider(
78-
cfg.access_token,cfg.hostname,cfg.identity_federation_client_id
79-
)
80-
returnExternalAuthProvider(federation_provider)
81-
71+
# If not token federation, just use the credentials provider directly
8272
returnExternalAuthProvider(cfg.credentials_provider)
8373

74+
# If we don't have a credentials provider but have token federation auth type with access token
8475
ifcfg.auth_type==AuthType.TOKEN_FEDERATION.valueandcfg.access_token:
8576
# If only access_token is provided with token federation, use create_token_federation_provider
8677
fromdatabricks.sql.auth.token_federationimport (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp