Skip to content
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

{Auth} Clarify Identity class's boundary #31014

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/azure-cli-core/azure/cli/core/auth/identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@


class Identity: # pylint: disable=too-many-instance-attributes
"""Class to manage identities:
- user
- service principal
- TODO: managed identity
"""Manage user or service principal identities and authenticate with Microsoft identity platform.
"""

# MSAL token cache.
Expand Down Expand Up @@ -199,12 +196,6 @@ def login_with_service_principal(self, client_id, credential, scopes):
entry = sp_auth.get_entry_to_persist()
self._service_principal_store.save_entry(entry)

def login_with_managed_identity(self, scopes, identity_id=None): # pylint: disable=too-many-statements
raise NotImplementedError

def login_in_cloud_shell(self, scopes):
raise NotImplementedError

def logout_user(self, username):
# If username is an SP client ID, it is ignored
accounts = self._msal_app.get_accounts(username)
Expand Down Expand Up @@ -251,9 +242,6 @@ def get_service_principal_credential(self, client_id):
client_credential = ServicePrincipalAuth(entry).get_msal_client_credential()
return ServicePrincipalCredential(client_id, client_credential, **self._msal_app_kwargs)

def get_managed_identity_credential(self, client_id=None):
raise NotImplementedError


class ServicePrincipalAuth: # pylint: disable=too-many-instance-attributes
def __init__(self, entry):
Expand Down