-
Notifications
You must be signed in to change notification settings - Fork 118
Remove sync credentials #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -362,12 +362,7 @@ def __init__( | |
| and self.client_id is not None | ||
| and self.connection_string is None | ||
| ): | ||
| ( | ||
| self.credential, | ||
| self.sync_credential, | ||
| ) = self._get_credential_from_service_principal() | ||
| else: | ||
| self.sync_credential = None | ||
| self.credential = self._get_credential_from_service_principal() | ||
|
|
||
| # Solving issue in https://github.com/fsspec/adlfs/issues/270 | ||
| if ( | ||
|
|
@@ -377,10 +372,7 @@ def __init__( | |
| and self.account_key is None | ||
| and self.connection_string is None | ||
| ): | ||
| ( | ||
| self.credential, | ||
| self.sync_credential, | ||
| ) = self._get_default_azure_credential(**kwargs) | ||
| self.credential = self._get_default_azure_credential(**kwargs) | ||
|
|
||
| self.do_connect() | ||
| weakref.finalize(self, sync, self.loop, close_service_client, self) | ||
|
|
@@ -469,50 +461,34 @@ def _get_kwargs_from_urls(urlpath): | |
|
|
||
| def _get_credential_from_service_principal(self): | ||
| """ | ||
| Create a Credential for authentication. This can include a TokenCredential | ||
| client_id, client_secret and tenant_id | ||
| Create a Credential for authentication. | ||
|
|
||
| This can include a TokenCredential client_id, client_secret and tenant_id. | ||
|
|
||
| Returns | ||
| ------- | ||
| Tuple of (Async Credential, Sync Credential). | ||
| Async Credential | ||
| """ | ||
| from azure.identity import ClientSecretCredential | ||
| from azure.identity.aio import ( | ||
| ClientSecretCredential as AIOClientSecretCredential, | ||
| ) | ||
| from azure.identity.aio import ClientSecretCredential | ||
|
|
||
| async_credential = AIOClientSecretCredential( | ||
| return ClientSecretCredential( | ||
| tenant_id=self.tenant_id, | ||
| client_id=self.client_id, | ||
| client_secret=self.client_secret, | ||
| ) | ||
|
|
||
| sync_credential = ClientSecretCredential( | ||
| tenant_id=self.tenant_id, | ||
| client_id=self.client_id, | ||
| client_secret=self.client_secret, | ||
| ) | ||
|
|
||
| return (async_credential, sync_credential) | ||
|
|
||
| def _get_default_azure_credential(self, **kwargs): | ||
| """ | ||
| Create a Credential for authentication using DefaultAzureCredential | ||
| Create a Credential for authentication using DefaultAzureCredential. | ||
|
|
||
| Returns | ||
| ------- | ||
| Tuple of (Async Credential, Sync Credential). | ||
| Async Credential | ||
| """ | ||
|
|
||
| from azure.identity import DefaultAzureCredential | ||
| from azure.identity.aio import ( | ||
| DefaultAzureCredential as AIODefaultAzureCredential, | ||
| ) | ||
|
|
||
| async_credential = AIODefaultAzureCredential(**kwargs) | ||
| sync_credential = DefaultAzureCredential(**kwargs) | ||
| from azure.identity.aio import DefaultAzureCredential | ||
|
|
||
| return (async_credential, sync_credential) | ||
| return DefaultAzureCredential(**kwargs) | ||
|
|
||
| def do_connect(self): | ||
| """Connect to the BlobServiceClient, using user-specified connection details. | ||
|
|
@@ -2140,7 +2116,7 @@ def connect_client(self): | |
| f"https://{self.fs.account_name}.blob.core.windows.net" | ||
| ) | ||
|
|
||
| creds = [self.fs.sync_credential, self.fs.account_key, self.fs.credential] | ||
| creds = [self.fs.credential, self.fs.account_key] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not actionable but just calling this out... Technically this is a change of behavior as before if a
|
||
| if any(creds): | ||
| self.container_client = [ | ||
| _create_aio_blob_service_client( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a changelog entry noting that we removed the
sync_credentialproperty as it was unused and label it as**Breaking**similar to other entries?