Skip to content

Fix nonce, add auto retry on auth exception, fix session id int, improve code quality#336

Merged
iMicknl merged 5 commits intomainfrom
enhancement/various_improvements
Aug 9, 2024
Merged

Fix nonce, add auto retry on auth exception, fix session id int, improve code quality#336
iMicknl merged 5 commits intomainfrom
enhancement/various_improvements

Conversation

@iMicknl
Copy link
Copy Markdown
Owner

@iMicknl iMicknl commented Aug 9, 2024

This pull request includes several changes to improve error handling, enhance functionality, and update configurations. The most important changes include adding new exception handling for invalid sessions, updating the postCreateCommand in the devcontainer, and adding custom funding options.

Error Handling Improvements:

  • Added InvalidSessionException to handle invalid session errors and updated relevant methods to raise this exception when needed (sagemcom_api/client.py, sagemcom_api/const.py, sagemcom_api/exceptions.py). [1] [2] [3] [4] [5]
  • Introduced retry_login function to retry login on specific exceptions using backoff (sagemcom_api/client.py). [1] [2]

Functional Enhancements:

  • Modified get_hosts method to include capability-flags in the options for retrieving hosts (sagemcom_api/client.py).
  • Corrected the nonce generation logic to use the correct range (sagemcom_api/client.py).

Configuration Updates:

  • Updated postCreateCommand in .devcontainer/devcontainer.json to include pre-commit install-hooks for better pre-commit setup.
  • Added a custom funding option in .github/FUNDING.yml to include a PayPal link.

@github-actions github-actions bot added the enhancement New feature or request label Aug 9, 2024
@iMicknl iMicknl merged commit 7e039cb into main Aug 9, 2024
@iMicknl iMicknl deleted the enhancement/various_improvements branch August 9, 2024 21:38
jsongerber pushed a commit to jsongerber/python-sagemcom-api that referenced this pull request Nov 8, 2024
…ove code quality (iMicknl#336)

This pull request includes several changes to improve error handling,
enhance functionality, and update configurations. The most important
changes include adding new exception handling for invalid sessions,
updating the `postCreateCommand` in the devcontainer, and adding custom
funding options.

### Error Handling Improvements:
* Added `InvalidSessionException` to handle invalid session errors and
updated relevant methods to raise this exception when needed
(`sagemcom_api/client.py`, `sagemcom_api/const.py`,
`sagemcom_api/exceptions.py`).
[[1]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R32)
[[2]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R46)
[[3]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R220-R225)
[[4]](diffhunk://#diff-57cf505b5e01fc69f170c5a1b839fb40b45a97a9c0ebc1fe53f4bd524ae9ac04R10)
[[5]](diffhunk://#diff-63c847110513149341a9f7e94d412bfb7c67d79df07a321774a9a2f3329ca34fR4-L43)
* Introduced `retry_login` function to retry login on specific
exceptions using backoff (`sagemcom_api/client.py`).
[[1]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R58-R62)
[[2]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R260-R270)

### Functional Enhancements:
* Modified `get_hosts` method to include `capability-flags` in the
options for retrieving hosts (`sagemcom_api/client.py`).
* Corrected the nonce generation logic to use the correct range
(`sagemcom_api/client.py`).

### Configuration Updates:
* Updated `postCreateCommand` in `.devcontainer/devcontainer.json` to
include `pre-commit install-hooks` for better pre-commit setup.
* Added a custom funding option in `.github/FUNDING.yml` to include a
PayPal link.
bakonyiferenc pushed a commit to bakonyiferenc/python-sagemcom-api that referenced this pull request Dec 16, 2025
…ove code quality (iMicknl#336)

This pull request includes several changes to improve error handling,
enhance functionality, and update configurations. The most important
changes include adding new exception handling for invalid sessions,
updating the `postCreateCommand` in the devcontainer, and adding custom
funding options.

### Error Handling Improvements:
* Added `InvalidSessionException` to handle invalid session errors and
updated relevant methods to raise this exception when needed
(`sagemcom_api/client.py`, `sagemcom_api/const.py`,
`sagemcom_api/exceptions.py`).
[[1]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R32)
[[2]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R46)
[[3]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R220-R225)
[[4]](diffhunk://#diff-57cf505b5e01fc69f170c5a1b839fb40b45a97a9c0ebc1fe53f4bd524ae9ac04R10)
[[5]](diffhunk://#diff-63c847110513149341a9f7e94d412bfb7c67d79df07a321774a9a2f3329ca34fR4-L43)
* Introduced `retry_login` function to retry login on specific
exceptions using backoff (`sagemcom_api/client.py`).
[[1]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R58-R62)
[[2]](diffhunk://#diff-052218051094ff1cc2c8352cd555cfb9eb02bf261eb5e635cf73b798809306a5R260-R270)

### Functional Enhancements:
* Modified `get_hosts` method to include `capability-flags` in the
options for retrieving hosts (`sagemcom_api/client.py`).
* Corrected the nonce generation logic to use the correct range
(`sagemcom_api/client.py`).

### Configuration Updates:
* Updated `postCreateCommand` in `.devcontainer/devcontainer.json` to
include `pre-commit install-hooks` for better pre-commit setup.
* Added a custom funding option in `.github/FUNDING.yml` to include a
PayPal link.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant