Skip to content

Commit

Permalink
Add some docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythir committed Sep 6, 2024
1 parent 5c46f2c commit f2a1ab0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qiskit_quantuminspire/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class AuthorisationError(Exception):


class IdentityProvider:
"""Class for interfacing with the IdentityProvider."""

def __init__(self, well_known_endpoint: str):
self._well_known_endpoint = well_known_endpoint
self._token_endpoint, self._device_endpoint = self._get_endpoints()
Expand All @@ -36,6 +38,8 @@ def refresh_access_token(self, client_id: str, refresh_token: str) -> dict[str,


class OauthDeviceSession:
"""Class for storing OAuth session information and refreshing tokens when needed."""

def __init__(self, host: Url, settings: ApiSettings, identity_provider: IdentityProvider):
self._api_settings = settings
_auth_settings = settings.auths[host]
Expand Down
3 changes: 3 additions & 0 deletions qiskit_quantuminspire/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@


class Configuration(compute_api_client.Configuration): # type: ignore[misc]
"""Original Configuration class in compute_api_client does not handle refreshing bearer tokens, so we need to add
some functionality."""

def __init__(self, host: str, oauth_session: OauthDeviceSession, **kwargs: Any):
self._oauth_session = oauth_session
super().__init__(host=host, **kwargs)
Expand Down

0 comments on commit f2a1ab0

Please sign in to comment.