-
Notifications
You must be signed in to change notification settings - Fork 3
Conversation
catalystwan/session.py
Outdated
if self._limiter is None: | ||
response = super(ManagerSession, self).request(method, full_url, *args, **_kwargs) | ||
else: | ||
delayed_request = lambda: super(ManagerSession, self).request(method, full_url, *args, **_kwargs) | ||
response = self._limiter.send_request(delayed_request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create dummy limiter and do it in this way:
if self._limiter is None: | |
response = super(ManagerSession, self).request(method, full_url, *args, **_kwargs) | |
else: | |
delayed_request = lambda: super(ManagerSession, self).request(method, full_url, *args, **_kwargs) | |
response = self._limiter.send_request(delayed_request) | |
with self._limiter: | |
response = super(ManagerSession, self).request(method, full_url, *args, **_kwargs) |
catalystwan/abstractions.py
Outdated
def clear_sync(self, last_request: Optional[PreparedRequest]) -> None: | ||
... | ||
|
||
def register_session(self) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name suggest something else than it does.
catalystwan/abstractions.py
Outdated
def clear(self) -> None: | ||
... | ||
|
||
def clear_sync(self, last_request: Optional[PreparedRequest]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this moment method clear is not public api method. Maybe you can replace clear(...)
by _clear(...)
and clear_sync(...)
by clear(...)
self.cookies.clear_session_cookies() | ||
self._auth.clear() | ||
self._auth.clear_sync(self._last_request) | ||
self.auth = self._auth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this line. Why we want make auth public after login. Do we need later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we need it. Auth is called with every request and requests
library expects it in that place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need it for requests :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* csr generation as task for >=20.16 (#838) * Bump actions/checkout from 4.2.0 to 4.2.1 Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.0 to 4.2.1. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@d632683...eef6144) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Multithreading Auth (#842) * Bump actions/checkout from 4.2.1 to 4.2.2 (#846) Bumps [actions/checkout](https://github.com/actions/checkout) from 4.2.1 to 4.2.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@eef6144...11bd719) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump abatilo/actions-poetry from 3.0.0 to 3.0.1 (#845) Bumps [abatilo/actions-poetry](https://github.com/abatilo/actions-poetry) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/abatilo/actions-poetry/releases) - [Changelog](https://github.com/abatilo/actions-poetry/blob/master/.releaserc) - [Commits](abatilo/actions-poetry@7b6d33e...e78f54a) --- updated-dependencies: - dependency-name: abatilo/actions-poetry dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump actions/setup-python from 5.2.0 to 5.3.0 (#844) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](actions/setup-python@f677139...0b93645) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * bump dev version --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: PrzeG <86780353+PrzeG@users.noreply.github.com>
Pull Request summary:
Adds support for multithreading authentication, which allows for concurrent requests using the same auth.
Usage example:
Checklist: