craft_store.ubuntu_one_store_client module

Craft Store StoreClient.

class craft_store.ubuntu_one_store_client.UbuntuOneStoreClient(*, base_url, storage_base_url, auth_url, endpoints, application_name, user_agent, environment_auth=None, ephemeral=False)[source]

Bases: craft_store.base_client.BaseClient

Encapsulates API calls for the Snap Store or Charmhub with Ubuntu One.

Parameters
  • base_url (str) –

  • storage_base_url (str) –

  • auth_url (str) –

  • endpoints (Endpoints) –

  • application_name (str) –

  • user_agent (str) –

  • environment_auth (Optional[str]) –

  • ephemeral (bool) –

TOKEN_TYPE: str = 'u1-macaroon'
request(method, url, params=None, headers=None, **kwargs)[source]

Perform an authenticated request if auth_headers are True.

Parameters
  • method (str) – HTTP method used for the request.

  • url (str) – URL to request with method.

  • params (Optional[Dict[str, str]]) – Query parameters to be sent along with the request.

  • headers (Optional[Dict[str, str]]) – Headers to be sent along with the request.

Raises
Return type

Response

Returns

Response from the request.