Dwave-cloud-client

Latest version: v0.11.4

Safety actively analyzes 621420 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 13

0.11.4

New Features

- Add `revoke_token` method to `dwave.cloud.auth.flow.AuthFlow` to enable revocation of OAuth 2.0 refresh/access tokens. See [\600](https://github.com/dwavesystems/dwave-cloud-client/issues/600).

- Add `dwave auth revoke` CLI command to enable revocation of OAuth 2.0 refresh/access tokens from command line. See [\600](https://github.com/dwavesystems/dwave-cloud-client/issues/600).

Bug Fixes

- Set correct lower bounds for requests/urllib3, and preemptively set upper bounds on other dependencies to prevent future breaks. See [\612](https://github.com/dwavesystems/dwave-cloud-client/pull/612).

0.11.3

Bug Fixes

- Use fixed authorization success URL, without any authorization query parameters appended (to minimize exposure), as they are not needed on the authorization server's success page.

<!-- -->

- Improve CSRF protection on localhost redirect URI during authorization code exchange. Previously, `state` was verified only if supplied. Now it's mandatory. Please note this is an additional CSRF protection on top of the PKCE, just in case PKCE is not supported (or properly implemented) server-side.

<!-- -->

- Fix PKCE support in `dwave.cloud.auth.flow.AuthFlow` by properly including `code_verifier` in fetch token (code exchange) requests. See [\605](https://github.com/dwavesystems/dwave-cloud-client/issues/605).

<!-- -->

- Remove circular references in `dwave.cloud.computation.Future` to enable easier garbage collection and lower memory footprint. See [\601](https://github.com/dwavesystems/dwave-cloud-client/issues/601).

<!-- -->

- Use a consistent `User-Agent` value for all API and non-API requests made by `Client`, `api.Client` and `auth.flow` client.

<!-- -->

- Speed-up `User-Agent` string construction significantly (10ms to 5us).

0.11.2

New Features

- Add Python 3.12 support.

- Add `dwave.cloud.utils.get_distribution` as a replacement for `pkg_resources.get_distribution` unavailable in Python 3.12.

0.11.1

New Features

- Add optional Leap authorization step to `dwave setup` CLI. During setup, we now install optional contributed packages, authorize Ocean to access Leap (`--auth` and `--oob` flags), and finally create the configuration file, optionally retrieving SAPI token from Leap API (if authorized) for the currently active Leap project, or project specified with `--project` option. See [\591](https://github.com/dwavesystems/dwave-cloud-client/issues/591).

<!-- -->

- Add `--skip-valid` option to `dwave auth login` CLI. When used, authorization flow will be skipped if Leap access token is valid or if it can be refreshed.

<!-- -->

- Prefer QPU solvers in `dwave ping`, unless overridden by user/config. See [\592](https://github.com/dwavesystems/dwave-cloud-client/issues/592)

<!-- -->

- Redirect user back to a Leap info page when auth redirect flow successfully completes. Similarly, redirect user to a Leap error page in case of an auth error.

0.11.0

New Features

- Add Leap authorization-related group of CLI commands under `dwave auth`: `login`, `get <token-type>`, `refresh`. See [\565](https://github.com/dwavesystems/dwave-cloud-client/issues/565).

<!-- -->

- Add Leap project CLI commands under new `dwave leap project` group: `ls`, `token`.

<!-- -->

- Add `--auto` option to `dwave config create` to attempt SAPI token fetch from Leap API on configuration file create (if access already authorized with `dwave auth login`).

<!-- -->

- For OAuth 2.0 Authorization Code exchange flow, add support for both the redirect flow and the out-of-band flow. See [\564](https://github.com/dwavesystems/dwave-cloud-client/issues/564).

<!-- -->

- Add a general-purpose, multi-threaded, WSGI application server, `dwave.cloud.auth.server.BackgroundAppServer`. This server can handle redirect URIs in the OAuth2 authorization code flow. See [\563](https://github.com/dwavesystems/dwave-cloud-client/issues/563).

<!-- -->

- Add `dwave.cloud.auth.server.SingleRequestAppServer` based on `dwave.cloud.auth.server.BackgroundAppServer` to specifically handle only one (valid) request to the OAuth redirect URI (and self-terminate after that).

<!-- -->

- Add `dwave.cloud.auth.creds.Credentials`, an on-disk credentials store. See [\562](https://github.com/dwavesystems/dwave-cloud-client/issues/562).

<!-- -->

- Add configuration options for defining Leap API endpoint: `leap_api_endpoint` option in configuration file or as keyword argument, and `DWAVE_LEAP_API_ENDPOINT` environment variable. See [\569](https://github.com/dwavesystems/dwave-cloud-client/issues/569).

<!-- -->

- Add a configuration option for setting Leap OAuth 2.0 Ocean client id, `leap_client_id`. Primarily used for testing.

<!-- -->

- Add OAuth 2.0 Authorization Code exchange flow to enable users to authorize Ocean SDK to access Leap API on their behalf. See [\564](https://github.com/dwavesystems/dwave-cloud-client/issues/564).

<!-- -->

- Add wall time and QPU timing to `dwave sample` output. See [\570](https://github.com/dwavesystems/dwave-cloud-client/issues/570).

<!-- -->

- Add a per-call cached value maximum age (`maxage_`) for functions decorated with `cached`.

<!-- -->

- Allow specifying cache key explicitly, instead of using all arguments of a function decorated with `cached`.

<!-- -->

- Add cache bypass control via `disable()` and `enable()` on the decorated function.

<!-- -->

- Add `cached.disabled` context manager (and a function decorator) that temporarily disables cache within the context (i.e. the decorated function). See [\503](https://github.com/dwavesystems/dwave-cloud-client/issues/503).

<!-- -->

- Add `leap_api_endpoint` and `solver_api_endpoint` properties to `dwave.cloud.api.models.Region`.

<!-- -->

- Move `dwave.cloud.Client.get_regions` to `dwave.cloud.regions.get_regions` in a new `regions` submodule, and refactor for flexibility of use and better caching control. See [\577](https://github.com/dwavesystems/dwave-cloud-client/issues/577).

<!-- -->

- Add endpoints-from-region resolver, `dwave.cloud.regions.resolve_endpoints`. Previously, similar resolver was part of the `Client` class.

<!-- -->

- Add `--clique-size`/`--size`/`-k` options to `dwave sample` CLI command to help specify problem size (clique size) for random problems generated for unstructured solvers.

<!-- -->

- Add Pydantic-based data model for cloud-client configuration, `dwave.cloud.config.models.ClientConfig`.

<!-- -->

- Consolidate client runtime configuration options under `Client.config`, a data model defined with `dwave.cloud.config.models.ClientConfig` and decouple config parsing from `dwave.cloud.Client` construction. See [\504](https://github.com/dwavesystems/dwave-cloud-client/issues/504).

<!-- -->

- Add `from_config()` family of factories to `dwave.cloud.api.client.DWaveAPIClient` and subclasses for SolverAPI, MetadataAPI and LeapAPI. `from_config()` dispatches to `from_config_model()` or `from_config_file()`, depending on arguments. See [\572](https://github.com/dwavesystems/dwave-cloud-client/issues/572).

<!-- -->

- Use full client config for Metadata API access during region/endpoint resolution on `dwave.cloud.Client` construction. See [\505](https://github.com/dwavesystems/dwave-cloud-client/issues/505).

<!-- -->

- Add support for specifying connection read timeout separately from connect timeout. Previously, both read and connect timeouts were set to the same value, specified with the `request_timeout` configuration parameter. We now accept a `(read, connect)` tuple for the `request_timeout` parameter. See [\440](https://github.com/dwavesystems/dwave-cloud-client/issues/440).

<!-- -->

- Add `--project` option to `dwave config create`, to be used in conjunction with `--auto`/`--auto-token`.

When project is not specified, the configuration file is initialized with a SAPI token for the currently active Leap project.

Project can be specified via project name, code or ID.

<!-- -->

- Upgrade `dwave.cloud.api.models.*` to use Pydantic v2. See [\555](https://github.com/dwavesystems/dwave-cloud-client/issues/555).

Upgrade Notes

- Upgrade your python to 3.8+. We no longer support python 3.7 and below.

<!-- -->

- Method `from_client_config()` is removed from `dwave.cloud.api.resources.ResourceBase`, (affecting instantiation of its subclasses), in favor of a new method `from_config_model()` (or alternatively, a more general `from_config()`). Previously an instance of either `dwave.cloud.Client` or `dwave.cloud.api.DWaveAPIClient` was required, and now it's possible to use just the configuration, a `dwave.cloud.config.models.ClientConfig` object.

To upgrade, replace `{ResourceBase}.from_client_config(cloud_client)` with `{ResourceBase}.from_config_model(client.config)`, and `{ResourceBase}.from_client_config(dwave_api_client)` with `{ResourceBase}(dwave_api_client)`.

<!-- -->

- `dwave.cloud.utils.cached` parameter `cache` has been renamed to `store`.

<!-- -->

- API models now coerce Numpy types to Python types on validation (model instantiation), instead of holding `typing.Any` until serialization.

<!-- -->

- Disk cache serialization changed from Python pickle to JSON. Currently, disk cache is used only for the list of Leap regions fetched from the Metadata API on `dwave.cloud.Client` instantiation. Upgrade should be seamless, as a new on-disk cache database file is created for each dwave-cloud-client version.

Deprecation Notes

- Client method `get_regions` is deprecated in favor of `dwave.cloud.regions.get_regions`.

<!-- -->

- Individual config options exposed as `dwave.cloud.Client` attributes are deprecated since `dwave-cloud-client==0.11.0` and will be removed in `dwave-cloud-client==0.12.0`. Use `Client.config` data model instead.

Bug Fixes

- Fix `cached` instances isolation when using a shared storage (e.g. disk cache), via `bucket` argument (cache key prefix).

<!-- -->

- Fix random problem sampling on hybrid solvers via `dwave sample` CLI. See [\557](https://github.com/dwavesystems/dwave-cloud-client/issues/557).

<!-- -->

- Fix region/endpoint resolution during `dwave.cloud.Client` construction when insecure connection is required (config: `permissive_ssl = On`) and/or a proxy is used (config: `proxy = socks5://...`). Previously client construction would fail completely. See [\507](https://github.com/dwavesystems/dwave-cloud-client/issues/507).

<!-- -->

- Correctly set backoff\_max time for retried requests when `urllib3>=2.0` is used. See [\566](https://github.com/dwavesystems/dwave-cloud-client/issues/566).

0.11.0.dev0

See [0.11.0](https://github.com/dwavesystems/dwave-cloud-client/releases/tag/0.11.0).

Page 1 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.