Esipy

Latest version: v1.2.3

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

Scan your dependencies

Page 1 of 5

1.2.0

* Fix caches to add timeout everywhere and prevent unlimited growth of cache / need to manual cleanup. (Fix 57)
* Add no_etag_body to EsiClient.__init__() (see docs) to set the HTTP 304 behavior standard (Fix: 53). This means:
* status_code = 304
* response body = empty (res.data = None and res.raw = '')
* Add catch to Exception to prevent crashes from HTTP 504 html response from load balancer (should only happen in this case). (Fix: 49)
* Auto retry when EsiApp is not able to get the swagger.json file (max 3 times) to avoid unnecessary HTTP errors. (Fix 51)

1.0.0

**First and foremost, keep in mind that using SSO v2 is a permanent move. If you want to keep using SSO v1, consider using only EsiPy 0.5.x**

Warnings
* From this version EsiPy will only use SSOv2 (JWT). If you don't want to migrate to JWT tokens, you should keep using version 0.5.x, as migration to the new SSO is a permanent move.
* JWT tokens are really bigger than SSOv1 token, so keep this in mind when migrating if you store these tokens in databases.

Breaking Changes
* The following parameters have been removed from `EsiSecurity.__init__()`: `app`, `esi_url`, `sso_url`, `esi_datasource`.
* `EsiSecurity.__init__()` does not construct URLs from either given URL or swagger spec, but makes a request to SSO endpoint discovery.
* `EsiSecurity.__get_token_auth_header()` has been removed.
* `EsiSecurity.verify()` now uses JWT library [python-jose](https://github.com/mpdavis/python-jose) to get informations of the token instead of querying ESI `/verify` endpoint.
* `EsiSecurity.verify()` may raise exceptions if a token does not validate or if it is expired.

Changes
* `EsiSecurity.__init__()` has a new optional parameter `sso_endpoints_url` to provide the SSO discovery URL (which is different for Tranquility, Singularity and Serenity)
* `EsiSecurity.__init__()` has a new optional parameter `sso_endpoints` which can be used to give the content (cached by the user) of the SSO discovery URL. This will prevent `EsiSecurity` from making a request.
* `EsiSecurity.__init__()` has a new optional parameter `jwks_key` which can be used to give the content (cached by the user) of the JSON Web Key Set (JWKS). This will prevent `EsiSecurity` from making a request.
* `EsiSecurity.__init__()` has a new optional parameter `code_verifier` which can be used for PKCE flow.
* `EsiSecurity.refresh()` now accept `scope_list` parameter, a list of scope to only refresh a subset of scope for the token. (None by default to refresh everything)
* New utils functions have been added in the `esipy.utils` module:
* `generate_code_verifier(length)` to generate a code verifier for the PKCE flow that will respect the RFC requirements.
* `generate_code_challenge(code_verifier)` to generate the code_challenge to be used in the PKCE flow (used in `EsiSecurity`)

About PKCE
* If a secret key is provided, EsiSecurity will never use PKCE.
* If you want to use PKCE, you need to follow the 2 requirements while instanciating your `EsiSecurity` object:
* `secret_key` must be ignored or set to `None`
* `code_verifier` must be provided and must follow the [RFC 7636 format](https://tools.ietf.org/html/rfc7636#section-4.1)

*For a PKCE example, you can check the doc [here](https://kyria.github.io/EsiPy/getting_started/sso_authentification/#pkce)*

0.5.0

Changes
* Fix the typo for the warning in `EsiSecurity` when headers didn't have "User-Agent"
* Add `revoke()` in `EsiSecurity` to be able to revoke the current tokens
* Remove support to python 3.3.x as pyswagger dropped support.

0.4.3

- Fix ValueError/JSONDecodeError when ESI/SSO is not returning valid JSON data (ie. it returns plain HTML)
- Changed the content of `APIException.response` to be a string (containing either the HTML or JSON message) instead of being a json dict.
- updated minimal version required for pyswagger, to make sure some bug are fixed (case insensitive headers for example).

0.4.2

Change:
- Fix `UnboundLocalError` in `EsiApp`
- Fix the check for invalidate cache, as it was checking `self.expire` instead of `cache_expire`

0.4.1

- Fix header name that were overwritten when 304 to make sure they still have the capital E for expires and D for date. (until pyswagger is not anymore case sensitive for this)
- Fix EsiApp cache that wasn't updated when we had HTTP 304

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.