Add an asynchronous aiohttp Redfish client - #190
Open
jyundt wants to merge 7 commits into
Open
Conversation
Add a caller-owned aiohttp transport with Basic authentication, timeout handling, same-origin target validation, and cached responses. Include standard ComputerSystem discovery and advertised reset support for asynchronous consumers. Signed-off-by: Jacob Yundt <me@jyundt.com>
Support standard Redfish login sessions, explicit Basic authentication, safe session cleanup, and read-only session recovery. Protect credentials and avoid retrying state-changing requests automatically. Signed-off-by: Jacob Yundt <me@jyundt.com>
Document session authentication, Basic authentication, explicit cleanup, session recovery, and caller-owned transport behavior. Signed-off-by: Jacob Yundt <me@jyundt.com>
Preserve restricted password-change sessions, serialize login and logout operations, and retain the existing service-root authentication workaround. Preserve all advertised reset types for forward compatibility. Signed-off-by: Jacob Yundt <me@jyundt.com>
Clarify Basic authentication validation, password-change sessions, service-root fallback behavior, and forward-compatible reset discovery. Declare direct async dependencies explicitly. Signed-off-by: Jacob Yundt <me@jyundt.com>
Remove ComputerSystem discovery, parsing, pagination, and reset helpers so the asynchronous API matches the generic abstraction of the existing REST client. Update documentation, examples, and tests to exercise resource-neutral operations. Signed-off-by: Jacob Yundt <me@jyundt.com>
Exercise successful service-root decoding and rejection of malformed or non-object JSON after removing the resource-specific discovery tests. Signed-off-by: Jacob Yundt <me@jyundt.com>
jyundt
marked this pull request as ready for review
August 15, 2026 18:21
Author
|
@mraineri take a look when you get a chance, full disclosure: there was a lot of AI for this. Happy to make any changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a separate, resource-neutral asynchronous Redfish client implemented with
aiohttpwhile leaving the existing synchronous API unchanged.The new
redfish.aiopackage supports caller-owned sessions, Redfish session authentication, HTTP Basic authentication, cached responses, configurable timeouts, and same-origin URL validation.Closes #189.
Motivation
Asyncio applications need nonblocking Redfish communication without maintaining a separate transport implementation. In particular, Home Assistant requires integrations to use its shared
aiohttp.ClientSessionso connection pooling, TLS configuration, proxy behavior, and session lifecycle remain under application control.This work supports the generic Redfish integration proposed in home-assistant/core#177991.
Implementation
The asynchronous transport:
aiohttp.ClientSession.get,head,post,put,patch, anddeletemethods.redfish[aiohttp]dependency.Authentication and session lifecycle support:
ClientSession.PasswordChangeRequired, including the advertised account URI, so callers can change the password before logging out.GETandHEADrequests when credentials are available.POST,PUT,PATCH, orDELETErequests.loginas authentication configuration; credentials are validated by the service on the next request.The asynchronous API deliberately remains resource-neutral, matching the abstraction of the existing synchronous REST client. Consumers follow advertised Redfish links and interpret resource payloads according to their application requirements.
Documentation and a generic asynchronous service-root example are included.
Backward compatibility
The existing synchronous client and public API are unchanged.
aiohttp,multidict, andyarlare optional and are not installed unless theaiohttpextra is selected.A base-wheel installation was verified to import successfully without
aiohttpinstalled.Validation
twine check.redfish[aiohttp]exposes the complete asynchronous API.aiohttppresent.Live validation
The asynchronous transport was validated against a physical Redfish BMC using a caller-owned
ClientSessionwith SHA-256 certificate fingerprint verification.Session authentication successfully:
ClientSession.