ironic.common.redfish.auth module¶
Async Redfish authentication mechanisms.
- class ironic.common.redfish.auth.AsyncAuthBase(username=None, password=None, root_prefix=None)[source]¶
Bases:
objectBase class for async Redfish authentication.
- abstractmethod can_refresh_session()[source]¶
Check if session can be refreshed.
- Returns:
True if session refresh is supported, False otherwise.
- class ironic.common.redfish.auth.AsyncBasicAuth(username=None, password=None, root_prefix=None)[source]¶
Bases:
AsyncAuthBaseHTTP Basic Authentication.
Uses HTTP Basic authentication for all requests.
- class ironic.common.redfish.auth.AsyncSessionAuth(username=None, password=None, root_prefix=None)[source]¶
Bases:
AsyncAuthBaseRedfish Session Authentication.
Creates and manages a Redfish session for authentication.
- can_refresh_session()[source]¶
Check if session can be refreshed.
- Returns:
True if session key and resource ID are available.
- async close()[source]¶
Close the Redfish session.
Attempts to DELETE the session from the BMC. A session the BMC has already dropped, by expiry or reboot, answers 404, which is the outcome this method wants rather than a failure: the goal is that the session no longer exists.
- get_session_key()[source]¶
Get the session authentication key.
- Returns:
Session key (X-Auth-Token value).
- get_session_resource_id()[source]¶
Get the session resource ID/URI.
- Returns:
Session resource URI for deletion.
- async refresh_session()[source]¶
Refresh the Redfish session.
Creates a new session after the previous one has expired.
- Raises:
MissingHeaderError if X-Auth-Token not in response.
- Raises:
ConnectionError on connection failures.
- Raises:
AccessError on authentication failures.
- Raises:
HTTPError on other HTTP errors.
- class ironic.common.redfish.auth.AsyncSessionOrBasicAuth(username=None, password=None, root_prefix=None)[source]¶
Bases:
AsyncSessionAuthSession authentication with fallback to basic auth.
Attempts to use session-based authentication. If session creation fails, falls back to HTTP Basic authentication.