Skip to content

Don't retry all 401's and add a session handler#11

Open
carlosfunk wants to merge 2 commits into
mainfrom
feat/session-pooling
Open

Don't retry all 401's and add a session handler#11
carlosfunk wants to merge 2 commits into
mainfrom
feat/session-pooling

Conversation

@carlosfunk
Copy link
Copy Markdown
Member

Closes #9

Carl Robben added 2 commits May 29, 2026 17:27
- BaseClient and IfmClient each build one requests.Session at construction and route every send through it
- Session-wide verify default set once; per-call Authorization headers still merged at request time
- _build_session helper centralises the verify default so new endpoints can't forget the flag
- verify_ssl tests repointed at client._session.request to reflect the new dispatch site
- A 401 on a requires_authorization=False call now surfaces as-is instead of triggering a re-auth and replay
- Anonymous 401s (e.g. admin-install on an already-configured instance) no longer misreport as bad credentials
- Avoids a wasted login round-trip on calls the caller explicitly marked as not needing auth
- Test asserts a single request and no /api/auth/token/login/ replay on an anonymous 401

Closes #9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Don't retry calls on 401 errors when requires_authorization=False

1 participant