From f2a1ab08850092f7aea9a5c8fbb34d45bd8e3ec0 Mon Sep 17 00:00:00 2001 From: Mythir Date: Fri, 6 Sep 2024 14:23:53 +0200 Subject: [PATCH] Add some docstrings --- qiskit_quantuminspire/api/authentication.py | 4 ++++ qiskit_quantuminspire/api/client.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/qiskit_quantuminspire/api/authentication.py b/qiskit_quantuminspire/api/authentication.py index 2ff05d2..cc29d1f 100644 --- a/qiskit_quantuminspire/api/authentication.py +++ b/qiskit_quantuminspire/api/authentication.py @@ -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() @@ -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] diff --git a/qiskit_quantuminspire/api/client.py b/qiskit_quantuminspire/api/client.py index 878b319..a19a033 100644 --- a/qiskit_quantuminspire/api/client.py +++ b/qiskit_quantuminspire/api/client.py @@ -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)