Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-keystoneauth1 for
openSUSE:Factory checked in at 2026-11-23 12:22:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-keystoneauth1 (Old)
and /work/SRC/openSUSE:Factory/.python-keystoneauth1.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-keystoneauth1"
Mon Nov 23 12:22:26 2026 rev:28 rq:1399674 version:5.19.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-keystoneauth1/python-keystoneauth1.changes
2026-11-13 18:38:04.467266980 +0100
+++
/work/SRC/openSUSE:Factory/.python-keystoneauth1.new.1340718/python-keystoneauth1.changes
2026-11-23 12:25:45.999671839 +0100
@@ -1,0 +2,18 @@
+Sat Nov 21 21:27:38 UTC 2026 - Dirk Müller <[email protected]>
+
+- update to 5.19.0:
+ * typing: Temporarily ignore unused imports
+ * reno: Update master for unmaintained/2025.1
+ * typing: Remove unnecessary kwargs
+ * typing: Narrow type ignores
+ * typing: Align signature with upstream
+ * typing: Fix incorrect type
+ * Remove use of sphinxcontrib.apidoc
+ * Remove extras deps from test-requirements.txt
+ * Remove linter deps from test-requirements.txt
+ * discover: Handle key-manager microversion discovery
+ automatically
+ * typing: Accept Adapters in discover
+ * session: Retain ownership after closing connection pools
+
+-------------------------------------------------------------------
Old:
----
keystoneauth1-5.18.1.tar.gz
New:
----
keystoneauth1-5.19.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-keystoneauth1.spec ++++++
--- /var/tmp/diff_new_pack.XMtlxn/_old 2026-11-23 12:25:47.444732663 +0100
+++ /var/tmp/diff_new_pack.XMtlxn/_new 2026-11-23 12:25:47.447732789 +0100
@@ -17,7 +17,7 @@
Name: python-keystoneauth1
-Version: 5.18.1
+Version: 5.19.0
Release: 0
Summary: OpenStack authenticating tools
License: Apache-2.0
++++++ keystoneauth1-5.18.1.tar.gz -> keystoneauth1-5.19.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/ChangeLog
new/keystoneauth1-5.19.0/ChangeLog
--- old/keystoneauth1-5.18.1/ChangeLog 2026-10-12 11:03:58.467755000 +0200
+++ new/keystoneauth1-5.19.0/ChangeLog 2026-11-19 13:07:49.426715000 +0100
@@ -1,10 +1,27 @@
CHANGES
=======
+5.19.0
+------
+
+* typing: Temporarily ignore unused imports
+* reno: Update master for unmaintained/2025.1
+* typing: Remove unnecessary kwargs
+* typing: Narrow type ignores
+* typing: Align signature with upstream
+* typing: Fix incorrect type
+* Remove use of sphinxcontrib.apidoc
+* Remove extras deps from test-requirements.txt
+* Remove linter deps from test-requirements.txt
+* discover: Handle key-manager microversion discovery automatically
+* typing: Accept Adapters in discover
+* session: Retain ownership after closing connection pools
+
5.18.1
------
* Handle optional RelayState in SAML2 ECP responses
+* docs: Add service tokens guide
* trivial: Add docstrings for ServiceTokenAuthWrapper
* Mark OAuth1 consumer and access secrets as sensitive opts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/PKG-INFO
new/keystoneauth1-5.19.0/PKG-INFO
--- old/keystoneauth1-5.18.1/PKG-INFO 2026-10-12 11:03:58.597758000 +0200
+++ new/keystoneauth1-5.19.0/PKG-INFO 2026-11-19 13:07:49.750717900 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.4
Name: keystoneauth1
-Version: 5.18.1
+Version: 5.19.0
Summary: Authentication Library for OpenStack Identity
Author-email: OpenStack <[email protected]>
License-Expression: Apache-2.0
@@ -28,16 +28,18 @@
Requires-Dist: stevedore>=5.9.1
Requires-Dist: os-service-types>=1.2.0
Requires-Dist: typing-extensions>=4.12
-Provides-Extra: kerberos
-Requires-Dist: requests-kerberos>=0.8.0; extra == "kerberos"
-Provides-Extra: saml2
-Requires-Dist: lxml>=4.2.0; extra == "saml2"
-Provides-Extra: oauth1
-Requires-Dist: oauthlib>=0.6.2; extra == "oauth1"
Provides-Extra: betamax
Requires-Dist: betamax>=0.7.0; extra == "betamax"
Requires-Dist: fixtures>=3.0.0; extra == "betamax"
Requires-Dist: PyYAML>=3.13; extra == "betamax"
+Provides-Extra: kerberos
+Requires-Dist: requests-kerberos>=0.8.0; extra == "kerberos"
+Provides-Extra: oauth1
+Requires-Dist: oauthlib>=0.6.2; extra == "oauth1"
+Provides-Extra: profiling
+Requires-Dist: osprofiler>=4.0.0; extra == "profiling"
+Provides-Extra: saml2
+Requires-Dist: lxml>=4.2.0; extra == "saml2"
Dynamic: license-file
Dynamic: requires-dist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/doc/requirements.txt
new/keystoneauth1-5.19.0/doc/requirements.txt
--- old/keystoneauth1-5.18.1/doc/requirements.txt 2026-10-12
11:03:24.594237800 +0200
+++ new/keystoneauth1-5.19.0/doc/requirements.txt 2026-11-19
13:06:57.713595200 +0100
@@ -1,14 +1,3 @@
-# For generationg sphinx documentation
openstackdocstheme>=2.2.1 # Apache-2.0
reno>=3.1.0 # Apache-2.0
-sphinx>=2.0.0 # BSD
-sphinxcontrib-apidoc>=0.2.0 # BSD
-
-# For autodoc builds
-fixtures>=3.0.0 # Apache-2.0/BSD
-betamax>=0.7.0 # Apache-2.0
-oslo.config>=5.2.0 # Apache-2.0
-oslo.utils>=3.33.0 # Apache-2.0
-requests-mock>=1.2.0 # Apache-2.0
-lxml>=4.2.0 # BSD
-oauthlib>=0.6.2 # BSD
+sphinx>=8.2.0 # BSD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/doc/source/conf.py
new/keystoneauth1-5.19.0/doc/source/conf.py
--- old/keystoneauth1-5.18.1/doc/source/conf.py 2026-10-12 11:03:24.595237700
+0200
+++ new/keystoneauth1-5.19.0/doc/source/conf.py 2026-11-19 13:06:57.632595500
+0100
@@ -21,14 +21,9 @@
'sphinx.ext.intersphinx',
'openstackdocstheme',
'ext.list_plugins',
- 'sphinxcontrib.apidoc',
+ 'sphinx.ext.apidoc',
]
-# sphinxcontrib.apidoc options
-apidoc_module_dir = '../../keystoneauth1'
-apidoc_output_dir = 'api'
-apidoc_excluded_paths = ['hacking', 'tests/*', 'tests', 'test']
-apidoc_separate_modules = True
todo_include_todos = True
# Add any paths that contain templates here, relative to this directory.
@@ -114,8 +109,28 @@
openstackdocs_bug_tag = 'doc'
+# -- Options for sphinx.ext.apidoc --------------------------------------------
+
+apidoc_modules = [
+ {
+ 'path': '../../keystoneauth1',
+ 'destination': 'api',
+ 'exclude_patterns': [
+ '../../keystoneauth1/hacking',
+ '../../keystoneauth1/tests/*',
+ '../../keystoneauth1/tests',
+ '../../keystoneauth1/test',
+ ],
+ 'separate_modules': True,
+ }
+]
+
+
# -- Options for autodoc
+# Apply to members and re-exported classes as well as their containing modules.
+autodoc_default_options = {'no-index': True}
+
def maybe_skip_member(app, what, name, obj, skip, options):
# workaround for https://github.com/sphinx-doc/sphinx/issues/10322
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/doc/source/index.rst
new/keystoneauth1-5.19.0/doc/source/index.rst
--- old/keystoneauth1-5.18.1/doc/source/index.rst 2026-10-12
11:03:24.595237700 +0200
+++ new/keystoneauth1-5.19.0/doc/source/index.rst 2026-11-19
13:06:57.633595700 +0100
@@ -14,6 +14,7 @@
using-sessions
authentication-plugins
+ service-tokens
plugin-options
plugins/index
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/doc/source/service-tokens.rst
new/keystoneauth1-5.19.0/doc/source/service-tokens.rst
--- old/keystoneauth1-5.18.1/doc/source/service-tokens.rst 1970-01-01
01:00:00.000000000 +0100
+++ new/keystoneauth1-5.19.0/doc/source/service-tokens.rst 2026-11-19
13:06:57.634595600 +0100
@@ -0,0 +1,274 @@
+==============
+Service Tokens
+==============
+
+Introduction
+============
+
+OpenStack services regularly communicate with each other on behalf of an end
+user. For example, the Compute service (Nova) calls the Block Storage service
+(Cinder) to attach a volume and the Networking service (Neutron) to configure
+ports. These operations can take significant time to complete, and a user's
+authentication token (``X-Auth-Token``) has a limited lifespan (typically one
+hour). In complex, multi-step operations (such as live migration, volume
+backups, or cluster provisioning), the initial user token may expire while
+subsequent API calls between services are still taking place. Without a
+mechanism to refresh or validate the user's ongoing request, those downstream
+calls fail with an HTTP 401 (Unauthorized) error.
+
+To solve this problem, OpenStack supports **service tokens**. A service token
+is a secondary authentication token issued to a designated service user account
+(such as ``nova`` or ``cinder``) and transmitted in the ``X-Service-Token``
+HTTP header alongside the user's ``X-Auth-Token`` header.
+
+How Service Tokens Work
+=======================
+
+When downstream services (such as Cinder, Glance, or Neutron) receive an
+incoming request, their `keystonemiddleware`_ authentication filter inspects
+both headers:
+
+* **User Token (``X-Auth-Token``)**: Identifies the end user and project on
+ whose behalf the action is taken.
+
+* **Service Token (``X-Service-Token``)**: Identifies the trusted OpenStack
+ service making the request.
+
+If the receiving service has service token validation enabled, the middleware
+verifies that the service token is valid and possesses a recognized service
role
+(such as ``service``). Once verified:
+
+* The request is permitted to proceed even if the end user's token has expired,
+ provided the overall operation was initiated when the user token was valid.
+
+* The target service can distinguish between requests originating directly from
+ an end user and those made by an authorized internal OpenStack service.
+
+For more details on configuring service users in the Identity service, refer to
+the `Keystone documentation on managing service users`__.
+
+.. _keystonemiddleware: https://docs.openstack.org/keystonemiddleware/latest/
+.. __: https://docs.openstack.org/keystone/latest/admin/manage-services.html
+
+ServiceTokenAuthWrapper
+=======================
+
+In `keystoneauth1`, support for service tokens is implemented via the
+:class:`~keystoneauth1.service_token.ServiceTokenAuthWrapper` class. This is a
+composite plugin that wraps two separate authentication plugins:
+
+* ``user_auth``: An instance of :class:`~keystoneauth1.plugin.BaseAuthPlugin`
+ representing the primary user context. This plugin provides the
+ ``X-Auth-Token`` header and is responsible for all endpoint discovery,
+ version negotiation, and identity queries.
+
+* ``service_auth``: An instance of
:class:`~keystoneauth1.plugin.BaseAuthPlugin`
+ representing the service account. This plugin provides the credentials
+ needed to fetch a service token for the ``X-Service-Token`` header.
+
+Delegation Behavior
+-------------------
+
+The wrapper delegates almost all plugin operations to ``user_auth``:
+
+* **Headers**: Calls :meth:`~keystoneauth1.plugin.BaseAuthPlugin.get_headers`
+ on ``user_auth`` and attaches ``X-Service-Token`` using the token retrieved
+ from ``service_auth.get_token(session)``.
+
+* **Endpoint Discovery & Catalog**: Methods like
+ :meth:`~keystoneauth1.plugin.BaseAuthPlugin.get_endpoint`,
+ :meth:`~keystoneauth1.plugin.BaseAuthPlugin.get_endpoint_data`, and
+ :meth:`~keystoneauth1.plugin.BaseAuthPlugin.get_api_major_version` are
+ delegated exclusively to ``user_auth``. This ensures service catalog
+ resolution and version negotiation always reflect the user's project scope
+ and permissions.
+
+* **Identity Attributes**: Methods such as
+ :meth:`~keystoneauth1.plugin.BaseAuthPlugin.get_user_id` and
+ :meth:`~keystoneauth1.plugin.BaseAuthPlugin.get_project_id` delegate to
+ ``user_auth``.
+
+* **Connection Parameters**: Merges parameters from both plugins via
+ :meth:`~keystoneauth1.plugin.BaseAuthPlugin.get_connection_params`, giving
+ priority to ``user_auth`` in case of conflict.
+
+Programmatic Usage
+==================
+
+Forwarding an Incoming User Token
+---------------------------------
+
+The most common use case in OpenStack services is receiving an existing user
+token from an incoming HTTP request (via request context) and forwarding it to
+another service alongside the calling service's own credentials:
+
+.. code-block:: python
+
+ from keystoneauth1 import identity
+ from keystoneauth1 import service_token
+ from keystoneauth1 import session
+
+ # 1. Primary user authentication using an existing token
+ user_auth = identity.v3.Token(
+ auth_url='https://identity.example.com/identity/v3',
+ token='user-token-received-from-request',
+ )
+
+ # 2. Service authentication using the calling service's credentials
+ service_auth = identity.v3.Password(
+ auth_url='https://identity.example.com/identity/v3',
+ username='nova',
+ password='service-password',
+ user_domain_name='Default',
+ project_name='service',
+ project_domain_name='Default',
+ )
+
+ # 3. Combine both plugins into the wrapper
+ auth = service_token.ServiceTokenAuthWrapper(
+ user_auth=user_auth,
+ service_auth=service_auth,
+ )
+
+ # 4. Create an authenticated Session
+ sess = session.Session(auth=auth)
+
+Every HTTP request sent through ``sess`` will contain both ``X-Auth-Token`` and
+``X-Service-Token`` headers.
+
+Using with an Adapter
+---------------------
+
+In OpenStack client libraries and services, HTTP communication is typically
+performed using :class:`~keystoneauth1.adapter.Adapter`. Because
+:class:`~keystoneauth1.service_token.ServiceTokenAuthWrapper` delegates
endpoint
+and version discovery to ``user_auth``, it works seamlessly with adapters:
+
+.. code-block:: python
+
+ from keystoneauth1 import adapter
+
+ # Create an adapter for the target service (e.g. Cinder / Block Storage)
+ cinder_client = adapter.Adapter(
+ session=sess,
+ service_type='block-storage',
+ interface='public',
+ )
+
+ # The adapter automatically discovers the endpoint from the user's catalog
+ # and transmits both X-Auth-Token and X-Service-Token headers
+ resp = cinder_client.get('/types')
+
+Combining Fixed Credentials
+---------------------------
+
+You can also wrap two credential-based plugins (such as two
+:class:`~keystoneauth1.identity.v3.Password` instances) for scripts, testing,
+or tooling that acts as both a specific end user and a service:
+
+.. code-block:: python
+
+ user_auth = identity.v3.Password(
+ auth_url='https://identity.example.com/identity/v3',
+ username='jdoe',
+ password='user-password',
+ user_domain_name='Default',
+ project_name='demo',
+ project_domain_name='Default',
+ )
+
+ service_auth = identity.v3.Password(
+ auth_url='https://identity.example.com/identity/v3',
+ username='nova',
+ password='service-password',
+ user_domain_name='Default',
+ project_name='service',
+ project_domain_name='Default',
+ )
+
+ auth = service_token.ServiceTokenAuthWrapper(
+ user_auth=user_auth,
+ service_auth=service_auth,
+ )
+ sess = session.Session(auth=auth)
+
+Usage with oslo.config
+======================
+
+In OpenStack services, client sessions and authentication options are loaded
+dynamically using `oslo.config`_ via :mod:`keystoneauth1.loading`.
+
+Configuration File
+------------------
+
+Services typically configure service user credentials in a dedicated
+configuration section (conventionally named ``[service_user]``):
+
+.. code-block:: ini
+
+ [service_user]
+ auth_type = password
+ auth_url = https://identity.example.com/identity/v3
+ project_domain_name = Default
+ project_name = service
+ user_domain_name = Default
+ username = nova
+ password = secret-nova-password
+
+Loading and Wrapping
+--------------------
+
+In service code, the ``service_auth`` plugin is loaded from configuration,
while
+``user_auth`` is obtained from the incoming request context (which provides an
+auth plugin populated with the incoming user token):
+
+.. code-block:: python
+
+ from keystoneauth1 import adapter
+ from keystoneauth1 import loading as ks_loading
+ from keystoneauth1 import service_token
+ from oslo_config import cfg
+
+ CONF = cfg.CONF
+
+ # Register standard session and auth options for the service user group
+ ks_loading.register_session_conf_options(CONF, 'service_user')
+ ks_loading.register_auth_conf_options(CONF, 'service_user')
+
+ # Load service user credentials from config
+ service_auth = ks_loading.load_auth_from_conf_options(CONF, 'service_user')
+
+ # Obtain user auth from the request context (e.g. in Nova or Cinder)
+ user_auth = context.get_auth_plugin()
+
+ # Wrap the user auth and service auth
+ auth = service_token.ServiceTokenAuthWrapper(
+ user_auth=user_auth,
+ service_auth=service_auth,
+ )
+
+ # Load a session and create an adapter for the target service
+ sess = ks_loading.load_session_from_conf_options(
+ CONF, 'cinder', auth=auth
+ )
+ cinder = adapter.Adapter(session=sess, service_type='block-storage')
+
+Sending services usually guard the wrapping logic behind an operator
+configuration option (such as ``[service_user] send_service_user_token =
true``)
+so that service token transmission can be toggled by operators.
+
+.. _oslo.config: https://docs.openstack.org/oslo.config/latest/
+
+Token Invalidation
+==================
+
+Calling :meth:`~keystoneauth1.service_token.ServiceTokenAuthWrapper.invalidate`
+invalidates both the ``user_auth`` and ``service_auth`` token caches:
+
+.. code-block:: python
+
+ auth.invalidate()
+
+If an HTTP request fails with an HTTP 401 Unauthorized status,
+:class:`~keystoneauth1.session.Session` invokes this method automatically to
+ensure that expired tokens on either side are refreshed on the subsequent
retry.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/doc/source/using-sessions.rst
new/keystoneauth1-5.19.0/doc/source/using-sessions.rst
--- old/keystoneauth1-5.18.1/doc/source/using-sessions.rst 2026-10-12
11:03:24.596237700 +0200
+++ new/keystoneauth1-5.19.0/doc/source/using-sessions.rst 2026-11-19
13:06:57.635595600 +0100
@@ -369,6 +369,19 @@
curious as to which major version was discovered, ``discover_versions`` can be
set to ``False`` to prevent fetching microversion metadata.
+Discovery applies service-specific compatibility behavior when the service
+type is known. For example, key-manager discovery automatically sends
+``OpenStack-API-Version: key-manager 1.1`` so that Barbican returns its
+microversion range rather than its legacy discovery document. This does not
+select a microversion for subsequent resource requests. If the automatic
+probe is rejected with HTTP 406, discovery retries without the header for
+compatibility with older deployments.
+
+Adapters already supply the service type. When performing discovery directly,
+pass e.g. ``service_type='key-manager'`` to ``Discover``, ``get_discovery()``,
+or ``get_version_data()`` to enable this behavior. Discovery documents
+requested with different version headers are cached separately.
+
Requesting a Microversion
-------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/keystoneauth1/discover.py
new/keystoneauth1-5.19.0/keystoneauth1/discover.py
--- old/keystoneauth1-5.18.1/keystoneauth1/discover.py 2026-10-12
11:03:24.598237800 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/discover.py 2026-11-19
13:06:57.714595000 +0100
@@ -22,10 +22,12 @@
"""
import copy
+import json
from collections.abc import Generator, Iterable
import re
-from typing import Any, cast, Optional, TYPE_CHECKING
+from typing import Any, cast, Optional, TypeAlias, TYPE_CHECKING
import urllib
+import warnings
import os_service_types
@@ -33,6 +35,7 @@
from keystoneauth1 import exceptions
if TYPE_CHECKING:
+ from keystoneauth1 import adapter as ks_adapter
from keystoneauth1 import session as ks_session
LOG = utils.get_logger(__name__)
@@ -42,6 +45,8 @@
_RAW_VERSION_T = str | int | float | Iterable[str | int | float]
_PARSED_VERSION_T = tuple[int | float, ...]
+_Session: TypeAlias = 'ks_session.Session | ks_adapter.Adapter'
+
def _str_or_latest(val: str | int | float) -> str:
"""Convert val to a string, handling LATEST => 'latest'.
@@ -63,11 +68,21 @@
return LATEST if val == 'latest' or val == LATEST else int(val)
+def _get_version_header(service_type: str | None) -> str | None:
+ # Barbican omits microversion metadata from its legacy discovery document.
+ # Request its first microversion to obtain the document with the range.
+ if service_type == 'key-manager':
+ return 'key-manager 1.1'
+ return None
+
+
def get_version_data(
- session: 'ks_session.Session',
+ session: _Session,
url: str,
authenticated: bool | None = None,
version_header: str | None = None,
+ *,
+ service_type: str | None = None,
) -> list[dict[str, Any]]:
"""Retrieve raw version data from a url.
@@ -99,17 +114,40 @@
Defaults to None.
:param version_header: provide the OpenStack-API-Version header for
services which don't return version information without it, for
- backward compatibility.
+ backward compatibility. Deprecated: provide service_type instead so
+ keystoneauth can apply the appropriate discovery behavior.
+ :param service_type: Service type used to apply service-specific discovery
+ behavior. For key-manager, a microversion header is sent automatically
+ unless version_header is explicitly supplied. (optional)
:return: A list of dicts containing version information.
"""
+ if version_header is not None:
+ warnings.warn(
+ 'The version_header argument is deprecated. Pass service_type '
+ 'instead to enable service-specific discovery behavior.',
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ effective_header: str | None = version_header
+ else:
+ effective_header = _get_version_header(service_type)
headers = {'Accept': 'application/json'}
- if version_header:
- headers['OpenStack-API-Version'] = version_header
+ if effective_header:
+ headers['OpenStack-API-Version'] = effective_header
try:
- resp = session.get(url, headers=headers, authenticated=authenticated)
- except exceptions.Unauthorized:
- resp = session.get(url, headers=headers, authenticated=True)
+ try:
+ resp = session.get(
+ url, headers=headers, authenticated=authenticated
+ )
+ except exceptions.Unauthorized:
+ resp = session.get(url, headers=headers, authenticated=True)
+ except exceptions.NotAcceptable:
+ if version_header is not None or service_type != 'key-manager':
+ raise
+ # Older Barbican deployments may reject the automatic probe. Retain
+ # legacy discovery without claiming a microversion range.
+ return get_version_data(session, url, authenticated=authenticated)
try:
body_resp = resp.json()
@@ -568,13 +606,19 @@
def __init__(
self,
- session: 'ks_session.Session',
+ session: _Session,
url: str,
authenticated: bool | None = None,
+ *,
+ service_type: str | None = None,
):
self._url = url
+ self._version_header = _get_version_header(service_type)
self._data = get_version_data(
- session, url, authenticated=authenticated
+ session,
+ url,
+ authenticated=authenticated,
+ service_type=service_type,
)
def raw_version_data(
@@ -1143,7 +1187,7 @@
def get_current_versioned_data(
self,
- session: 'ks_session.Session',
+ session: _Session,
allow: dict[str, Any] | None = None,
cache: dict[str, Discover] | None = None,
project_id: str | None = None,
@@ -1183,7 +1227,7 @@
def get_versioned_data(
self,
- session: 'ks_session.Session',
+ session: _Session,
allow: dict[str, Any] | None = None,
cache: dict[str, Any] | None = None,
allow_version_hack: bool = True,
@@ -1253,7 +1297,7 @@
return new_data
def get_all_version_string_data(
- self, session: 'ks_session.Session', project_id: str | None = None
+ self, session: _Session, project_id: str | None = None
) -> list['VersionData']:
"""Return version data for all versions discovery can find.
@@ -1264,7 +1308,9 @@
versions = []
for vers_url in self._get_discovery_url_choices(project_id=project_id):
try:
- d = get_discovery(session, vers_url)
+ d = get_discovery(
+ session, vers_url, service_type=self.service_type
+ )
except Exception as e:
# Ignore errors here - we're just searching for one of the
# URLs that will give us data.
@@ -1301,7 +1347,7 @@
def _set_version_info(
self,
- session: 'ks_session.Session',
+ session: _Session,
allow: dict[str, Any],
cache: dict[str, Discover] | None,
allow_version_hack: bool,
@@ -1329,6 +1375,10 @@
discovered_data = None
# Maybe we've run discovery in the past and have a document that can
# satisfy the request without further work
+ if self._disc and self._disc._version_header != _get_version_header(
+ self.service_type
+ ):
+ self._disc = None
if self._disc:
discovered_data = self._disc.versioned_data_for(
min_version=min_version,
@@ -1410,7 +1460,7 @@
def _run_discovery(
self,
- session: 'ks_session.Session',
+ session: _Session,
cache: dict[str, Discover] | None,
min_version: _PARSED_VERSION_T | None,
max_version: _PARSED_VERSION_T | None,
@@ -1437,7 +1487,11 @@
try:
self._disc = get_discovery(
- session, vers_url, cache=cache, authenticated=False
+ session,
+ vers_url,
+ cache=cache,
+ authenticated=False,
+ service_type=self.service_type,
)
break
except (
@@ -1641,10 +1695,12 @@
def get_discovery(
- session: 'ks_session.Session',
+ session: _Session,
url: str,
cache: dict[str, Discover] | None = None,
authenticated: bool | None = False,
+ *,
+ service_type: str | None = None,
) -> Discover:
"""Return the discovery object for a URL.
@@ -1662,6 +1718,8 @@
:param session: A session object to discover with.
:param url: The url to lookup.
+ :param service_type: Service type used to apply service-specific discovery
+ behavior. (optional)
:param cache: A dict to be used for caching results, in addition to caching
them on the Session. (optional) Defaults to None.
:param authenticated: Include a token in the discovery call. (optional)
@@ -1704,20 +1762,32 @@
parsed_url.fragment,
).geturl()
+ effective_header = _get_version_header(service_type)
+ # Preserve legacy URL-only keys for headerless discovery. JSON encoding
+ # makes header-specific keys unambiguous and distinct from ordinary URLs.
+ cache_key = (
+ json.dumps([url, effective_header]) if effective_header else url
+ )
+
for cache in caches:
- disc = cache.get(url)
+ disc = cache.get(cache_key)
if disc:
break
else:
- disc = Discover(session, url, authenticated=authenticated)
+ disc = Discover(
+ session,
+ url,
+ authenticated=authenticated,
+ service_type=service_type,
+ )
# Whether we get one from fetching or from cache, set it in the
# caches. This assures that if we combine sessions and auth plugins
# that we don't make unnecessary calls.
if disc:
for cache in caches:
- cache[url] = disc
+ cache[cache_key] = disc
return disc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1/extras/_saml2/v3/base.py
new/keystoneauth1-5.19.0/keystoneauth1/extras/_saml2/v3/base.py
--- old/keystoneauth1-5.18.1/keystoneauth1/extras/_saml2/v3/base.py
2026-10-12 11:03:24.599237700 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/extras/_saml2/v3/base.py
2026-11-19 13:06:57.714595000 +0100
@@ -11,7 +11,7 @@
# under the License.
from collections.abc import Mapping
-from typing import Any, cast, TypeVar
+from typing import TypeVar
try:
# explicitly re-export symbol
@@ -123,5 +123,5 @@
raise exceptions.AuthorizationFailure(msg)
@staticmethod
- def xml_to_str(content: etree._Element, **kwargs: Any) -> bytes:
- return cast(bytes, etree.tostring(content, **kwargs))
+ def xml_to_str(content: etree._Element) -> bytes:
+ return etree.tostring(content)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1/extras/_saml2/v3/saml2.py
new/keystoneauth1-5.19.0/keystoneauth1/extras/_saml2/v3/saml2.py
--- old/keystoneauth1-5.18.1/keystoneauth1/extras/_saml2/v3/saml2.py
2026-10-12 11:03:24.600237600 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/extras/_saml2/v3/saml2.py
2026-11-19 13:06:57.715595000 +0100
@@ -12,7 +12,7 @@
import abc
from collections.abc import Mapping
-from typing import Any, TypeVar
+from typing import Any
import urllib.parse
try:
@@ -121,11 +121,6 @@
)
-_PreparedRequestT = TypeVar(
- '_PreparedRequestT', bound=requests.PreparedRequest
-)
-
-
class _SamlAuth(requests.auth.AuthBase):
"""A generic SAML ECP plugin for requests.
@@ -166,17 +161,19 @@
self.identity_provider_url = identity_provider_url
self.requests_auth = requests_auth
- def __call__(self, request: _PreparedRequestT) -> _PreparedRequestT:
+ def __call__(
+ self, r: requests.models.PreparedRequest
+ ) -> requests.models.PreparedRequest:
try:
- accept = request.headers['Accept']
+ accept = r.headers['Accept']
except KeyError:
- request.headers['Accept'] = _PAOS_HEADER
+ r.headers['Accept'] = _PAOS_HEADER
else:
- request.headers['Accept'] = ','.join([accept, _PAOS_HEADER])
+ r.headers['Accept'] = ','.join([accept, _PAOS_HEADER])
- request.headers['PAOS'] = _PAOS_VER
- request.register_hook('response', self._handle_response) # type:
ignore[no-untyped-call]
- return request
+ r.headers['PAOS'] = _PAOS_VER
+ r.register_hook('response', self._handle_response) # type:
ignore[no-untyped-call]
+ return r
def _handle_response(
self, response: requests.Response, **kwargs: Any
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1/fixture/keystoneauth_betamax.py
new/keystoneauth1-5.19.0/keystoneauth1/fixture/keystoneauth_betamax.py
--- old/keystoneauth1-5.18.1/keystoneauth1/fixture/keystoneauth_betamax.py
2026-10-12 11:03:24.601237800 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/fixture/keystoneauth_betamax.py
2026-11-19 13:06:57.644595600 +0100
@@ -14,7 +14,7 @@
from collections.abc import Callable
from functools import partial
-from typing import TypeAlias
+from typing import cast, TypeAlias
from unittest import mock
import betamax
@@ -100,7 +100,7 @@
"""
if self.serializer:
# betamax is not typed yet
- return self.serializer.name # type: ignore
+ return cast(str, self.serializer.name)
return self._serializer_name
def setUp(self) -> None:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1/fixture/serializer.py
new/keystoneauth1-5.19.0/keystoneauth1/fixture/serializer.py
--- old/keystoneauth1-5.18.1/keystoneauth1/fixture/serializer.py
2026-10-12 11:03:24.601237800 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/fixture/serializer.py
2026-11-19 13:06:57.644595600 +0100
@@ -14,9 +14,8 @@
import json
import os
-from typing import Any
+from typing import Any, TypedDict
-from betamax import cassette
from betamax import serializers
import yaml
@@ -64,12 +63,16 @@
)
-def _is_json_body(interaction: cassette.Interaction) -> bool:
+class _SerializedHTTPMessage(TypedDict):
+ headers: dict[str, list[str]]
+
+
+def _is_json_body(interaction: _SerializedHTTPMessage) -> bool:
content_type = interaction['headers'].get('Content-Type', [])
return 'application/json' in content_type
-class YamlJsonSerializer(serializers.BaseSerializer): # type: ignore
+class YamlJsonSerializer(serializers.BaseSerializer): # type: ignore[misc]
name = "yamljson"
@staticmethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/keystoneauth1/identity/base.py
new/keystoneauth1-5.19.0/keystoneauth1/identity/base.py
--- old/keystoneauth1-5.18.1/keystoneauth1/identity/base.py 2026-10-12
11:03:24.602237700 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/identity/base.py 2026-11-19
13:06:57.646595500 +0100
@@ -240,6 +240,7 @@
endpoint_data = discover.EndpointData(
service_url=endpoint_override,
catalog_url=endpoint_override,
+ service_type=service_type,
interface=interface,
region_name=region_name,
service_name=service_name,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/keystoneauth1/loading/opts.py
new/keystoneauth1-5.19.0/keystoneauth1/loading/opts.py
--- old/keystoneauth1-5.18.1/keystoneauth1/loading/opts.py 2026-10-12
11:03:24.604237800 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/loading/opts.py 2026-11-19
13:06:57.651595400 +0100
@@ -106,6 +106,7 @@
return cfg.Opt(
name=self.name,
+ # https://review.opendev.org/c/openstack/oslo.config/+/1012466
type=self.type, # type: ignore[arg-type]
help=self.help,
secret=self.secret,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/keystoneauth1/plugin.py
new/keystoneauth1-5.19.0/keystoneauth1/plugin.py
--- old/keystoneauth1-5.18.1/keystoneauth1/plugin.py 2026-10-12
11:03:24.604237800 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/plugin.py 2026-11-19
13:06:57.652595500 +0100
@@ -130,6 +130,7 @@
*,
endpoint_override: str | None = None,
discover_versions: bool = True,
+ service_type: str | None = None,
**kwargs: Any,
) -> discover.EndpointData | None:
"""Return a valid endpoint data for a service.
@@ -139,6 +140,8 @@
:param discover_versions: Whether to get version metadata from the
version discovery document even if it major api version info can be
inferred from the url. (optional, defaults to True)
+ :param service_type: Service type used for version discovery.
+ (optional)
:param kwargs: Ignored
:raises keystoneauth1.exceptions.http.HttpError: An error from an
invalid HTTP response.
@@ -146,7 +149,9 @@
"""
if not endpoint_override:
return None
- endpoint_data = discover.EndpointData(catalog_url=endpoint_override)
+ endpoint_data = discover.EndpointData(
+ catalog_url=endpoint_override, service_type=service_type
+ )
if endpoint_data.api_version and not discover_versions:
return endpoint_data
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/keystoneauth1/session.py
new/keystoneauth1-5.19.0/keystoneauth1/session.py
--- old/keystoneauth1-5.18.1/keystoneauth1/session.py 2026-10-12
11:03:24.605237700 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/session.py 2026-11-19
13:06:57.716595200 +0100
@@ -44,9 +44,9 @@
netaddr = None
try:
- import osprofiler.web as osprofiler_web # type: ignore[import-not-found]
+ import osprofiler.web as osprofiler_web
except ImportError:
- osprofiler_web = None
+ osprofiler_web = None # type: ignore[assignment]
DEFAULT_USER_AGENT = (
f'keystoneauth1/{keystoneauth1.__version__} '
@@ -455,8 +455,10 @@
alias and the ``ssl.SSLError`` subclass) and
``requests.exceptions.RequestException`` from ``requests`` are
caught and discarded, since a failure to close an already-idle
- connection is not actionable. The requests session is dropped
- regardless, so ``close()`` stays idempotent.
+ connection is not actionable. The owned requests session is retained
+ so subsequent calls also release connections opened after reuse.
+ Closing an already-empty pool is harmless, so ``close()`` stays
+ idempotent.
:raises Exception: any error other than ``OSError`` and
``requests.exceptions.RequestException`` (both caught
@@ -467,8 +469,6 @@
self._session.close()
except (OSError, requests.exceptions.RequestException):
pass
- finally:
- self._session = None
def __del__(self) -> None:
"""Clean up resources on delete."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1/tests/unit/identity/test_identity_common.py
new/keystoneauth1-5.19.0/keystoneauth1/tests/unit/identity/test_identity_common.py
---
old/keystoneauth1-5.18.1/keystoneauth1/tests/unit/identity/test_identity_common.py
2026-10-12 11:03:24.608237700 +0200
+++
new/keystoneauth1-5.19.0/keystoneauth1/tests/unit/identity/test_identity_common.py
2026-11-19 13:06:57.661595300 +0100
@@ -2384,6 +2384,43 @@
self.assertEqual((2, 35), data.max_microversion)
self.assertEqual((2, 1), data.api_version)
+ def test_get_endpoint_data_key_manager(self):
+ url = self.OTHER_URL + '/v1/'
+ document = fixture.DiscoveryList(v2=False, v3=False)
+ document.add_microversion(
+ href=url, id='v1', min_version='1.0', max_version='1.3'
+ )
+ discovery_request = self.requests_mock.get(
+ url,
+ json=document,
+ request_headers={'OpenStack-API-Version': 'key-manager 1.1'},
+ )
+ token = fixture.V2Token()
+ token.add_service('key-manager').add_endpoint(public=url)
+ self.stub_url('POST', ['tokens'], base_url=self.V2_URL, json=token)
+ for endpoint_override in (None, url):
+ with self.subTest(endpoint_override=endpoint_override):
+ auth = identity.V2Password(
+ self.V2_URL, username='user', password='password'
+ )
+ client = adapter.Adapter(
+ session.Session(auth=auth),
+ service_type='key-manager',
+ interface='public',
+ endpoint_override=endpoint_override,
+ version='1',
+ )
+ data = client.get_endpoint_data()
+ self.assertEqual((1, 0), data.min_microversion)
+ self.assertEqual((1, 3), data.max_microversion)
+ self.assertEqual('key-manager', data.service_type)
+ self.assertEqual(
+ 'key-manager 1.1',
+ discovery_request.last_request.headers[
+ 'OpenStack-API-Version'
+ ],
+ )
+
def test_get_endpoint_data_compute(self):
common_disc = fixture.DiscoveryList(v2=False, v3=False)
common_disc.add_nova_microversion(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1/tests/unit/test_discovery.py
new/keystoneauth1-5.19.0/keystoneauth1/tests/unit/test_discovery.py
--- old/keystoneauth1-5.18.1/keystoneauth1/tests/unit/test_discovery.py
2026-10-12 11:03:24.612237700 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/tests/unit/test_discovery.py
2026-11-19 13:06:57.669595200 +0100
@@ -13,6 +13,7 @@
import json
import re
from unittest import mock
+import warnings
from testtools import matchers
@@ -885,6 +886,106 @@
plugin.get_endpoint(self.session, endpoint_override=V3_URL), V3_URL
)
+ def test_endpoint_data_key_manager_adapter(self):
+ url = BASE_URL + 'v1/'
+ document = fixture.DiscoveryList(v2=False, v3=False)
+ document.add_microversion(
+ href=url, id='v1', min_version='1.0', max_version='1.3'
+ )
+ self.requests_mock.get(
+ url,
+ json=document,
+ request_headers={'OpenStack-API-Version': 'key-manager 1.1'},
+ )
+ client = adapter.Adapter(
+ session.Session(noauth.NoAuth()),
+ endpoint_override=url,
+ service_type='key-manager',
+ )
+ for _ in range(2):
+ data = client.get_endpoint_data()
+ self.assertEqual((1, 0), data.min_microversion)
+ self.assertEqual((1, 3), data.max_microversion)
+ self.assertEqual(1, self.requests_mock.call_count)
+ self.assertIsNone(client.default_microversion)
+
+ self.requests_mock.get(url + 'secrets', json={})
+ client.get('/secrets')
+ self.assertNotIn(
+ 'OpenStack-API-Version', self.requests_mock.last_request.headers
+ )
+
+ def test_endpoint_data_legacy_key_manager(self):
+ url = BASE_URL + 'v1/'
+ document = {
+ 'version': {
+ 'id': 'v1',
+ 'status': 'STABLE',
+ 'links': [{'rel': 'self', 'href': url}],
+ }
+ }
+ for status in (200, 406):
+ with self.subTest(status=status):
+ self.requests_mock.get(url, json=document)
+ self.requests_mock.get(
+ url,
+ status_code=status,
+ json=document,
+ request_headers={
+ 'OpenStack-API-Version': 'key-manager 1.1'
+ },
+ )
+ client = adapter.Adapter(
+ session.Session(noauth.NoAuth()),
+ endpoint_override=url,
+ service_type='key-manager',
+ )
+ count = self.requests_mock.call_count
+ data = client.get_endpoint_data()
+ self.assertIsNone(data.min_microversion)
+ self.assertIsNone(data.max_microversion)
+ self.assertEqual(
+ count + (2 if status == 406 else 1),
+ self.requests_mock.call_count,
+ )
+ count = self.requests_mock.call_count
+ client.get_endpoint_data()
+ self.assertEqual(count, self.requests_mock.call_count)
+
+ def test_key_manager_version_header_override(self):
+ self.requests_mock.get(BASE_URL, json=V3_VERSION_LIST)
+ for header in ('key-manager 1.2', ''):
+ with self.subTest(header=header):
+ with warnings.catch_warnings(record=True) as captured:
+ warnings.simplefilter('always')
+ discover.get_version_data(
+ self.session,
+ BASE_URL,
+ service_type='key-manager',
+ version_header=header,
+ )
+ self.assertEqual(1, len(captured))
+ self.assertIs(DeprecationWarning, captured[0].category)
+ self.assertIn('service_type', str(captured[0].message))
+ self.assertEqual(
+ header or None,
+ self.requests_mock.last_request.headers.get(
+ 'OpenStack-API-Version'
+ ),
+ )
+
+ self.requests_mock.get(BASE_URL, status_code=406)
+ count = self.requests_mock.call_count
+ self.assertRaises(
+ exceptions.NotAcceptable,
+ discover.get_version_data,
+ self.session,
+ BASE_URL,
+ service_type='key-manager',
+ version_header='key-manager 1.1',
+ )
+ self.assertEqual(count + 1, self.requests_mock.call_count)
+
def test_endpoint_data_noauth_adapter(self):
self.requests_mock.get(BASE_URL, status_code=200, json=V3_VERSION_LIST)
self.requests_mock.get(V3_URL, status_code=200, json=V3_VERSION_ENTRY)
@@ -1424,16 +1525,100 @@
self.assertEqual(3, mock_get_disc.call_count)
mock_get_disc.assert_has_calls(
[
- mock.call('sess', url, cache='cache', authenticated=False)
+ mock.call(
+ 'sess',
+ url,
+ cache='cache',
+ authenticated=False,
+ service_type=None,
+ )
for url in ('url1', 'url2', 'url3')
]
)
+ def test_discovery_service_type_cache_isolation(self):
+ for cache_kind in ('explicit', 'session', 'auth'):
+ for service_types in (
+ (None, 'key-manager', 'compute'),
+ ('key-manager', None, 'compute'),
+ ):
+ with self.subTest(cache=cache_kind, services=service_types):
+ auth = noauth.NoAuth()
+ sess = session.Session(auth=auth)
+ cache = {}
+ if cache_kind != 'session':
+ del sess._discovery_cache
+ if cache_kind != 'auth':
+ del auth._discovery_cache
+ kwargs = (
+ {'cache': cache} if cache_kind == 'explicit' else {}
+ )
+ self.requests_mock.get(BASE_URL, json=V3_VERSION_LIST)
+ documents = {}
+ for service_type in service_types:
+ disc = discover.get_discovery(
+ sess, BASE_URL, service_type=service_type, **kwargs
+ )
+ documents[service_type] = disc
+ self.assertEqual(
+ 'key-manager 1.1'
+ if service_type == 'key-manager'
+ else None,
+ disc._version_header,
+ )
+ self.assertIs(documents[None], documents['compute'])
+ self.assertIsNot(documents[None], documents['key-manager'])
+ count = self.requests_mock.call_count
+ for service_type, disc in documents.items():
+ self.assertIs(
+ disc,
+ discover.get_discovery(
+ sess,
+ BASE_URL.rstrip('/'),
+ service_type=service_type,
+ **kwargs,
+ ),
+ )
+ self.assertEqual(count, self.requests_mock.call_count)
+
+ def test_endpoint_data_changed_service_type(self):
+ url = BASE_URL + 'v1/'
+ legacy_document = {
+ 'version': {
+ 'id': 'v1',
+ 'status': 'STABLE',
+ 'links': [{'rel': 'self', 'href': url}],
+ }
+ }
+ document = fixture.DiscoveryList(v2=False, v3=False)
+ document.add_microversion(
+ href=url, id='v1', min_version='1.0', max_version='1.3'
+ )
+ self.requests_mock.get(url, json=legacy_document)
+ self.requests_mock.get(
+ url,
+ json=document,
+ request_headers={'OpenStack-API-Version': 'key-manager 1.1'},
+ )
+ legacy = discover.EndpointData(catalog_url=url).get_versioned_data(
+ self.session
+ )
+ self.assertIsNone(legacy.max_microversion)
+ legacy.service_type = 'key-manager'
+ versioned = legacy.get_versioned_data(self.session)
+ self.assertEqual((1, 3), versioned.max_microversion)
+ self.assertIsNone(legacy.max_microversion)
+ versioned.service_type = None
+ self.assertIsNone(
+ versioned.get_versioned_data(self.session).max_microversion
+ )
+ self.assertEqual(2, self.requests_mock.call_count)
+
def test_run_discovery_auth(self):
url = 'https://example.com'
headers = {
'Accept': 'application/json',
- 'OpenStack-API-Version': 'version header test',
+ 'OpenStack-API-Version': 'key-manager 1.1',
}
session = mock.Mock()
@@ -1445,9 +1630,7 @@
]
try:
- discover.get_version_data(
- session, url, version_header='version header test'
- )
+ discover.get_version_data(session, url, service_type='key-manager')
except exceptions.BadRequest:
pass
# Only one call with 'url'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1/tests/unit/test_session.py
new/keystoneauth1-5.19.0/keystoneauth1/tests/unit/test_session.py
--- old/keystoneauth1-5.18.1/keystoneauth1/tests/unit/test_session.py
2026-10-12 11:03:24.613237600 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1/tests/unit/test_session.py
2026-11-19 13:06:57.671595300 +0100
@@ -914,7 +914,7 @@
) as close_mock:
session.close()
close_mock.assert_called_once()
- self.assertIsNone(session._session)
+ self.assertIs(session.session, session._session)
def test_close_leaves_external_session(self):
external = requests.Session()
@@ -922,6 +922,8 @@
self.assertIsNone(session._session)
with mock.patch.object(external, 'close') as close_mock:
session.close()
+ session.close()
+ session.__del__()
close_mock.assert_not_called()
def test_close_is_idempotent(self):
@@ -931,20 +933,55 @@
) as close_mock:
session.close()
session.close()
- close_mock.assert_called_once()
- self.assertIsNone(session._session)
+ self.assertEqual(2, close_mock.call_count)
+ self.assertIs(session.session, session._session)
def test_close_keeps_session_usable(self):
session = client_session.Session()
+ self.stub_url('GET', text='response')
session.close()
- self.assertIsNotNone(session.session)
+ resp = session.get(self.TEST_URL)
+ self.assertEqual('response', resp.text)
+
+ def test_close_releases_session_after_reuse(self):
+ session = client_session.Session()
+ self.stub_url('GET', text='response')
+ with mock.patch.object(
+ session.session, 'close', wraps=session.session.close
+ ) as close_mock:
+ session.get(self.TEST_URL)
+ session.close()
+ close_mock.assert_called_once()
+
+ session.get(self.TEST_URL)
+ session.close()
+ self.assertEqual(2, close_mock.call_count)
+
+ def test_del_releases_session_after_close_and_reuse(self):
+ session = client_session.Session()
+ self.stub_url('GET', text='response')
+ with mock.patch.object(
+ session.session, 'close', wraps=session.session.close
+ ) as close_mock:
+ session.close()
+ session.get(self.TEST_URL)
+ session.__del__()
+ self.assertEqual(2, close_mock.call_count)
def test_close_swallows_teardown_errors(self):
session = client_session.Session()
- session._session = mock.Mock()
- session._session.close.side_effect = OSError('socket gone')
- session.close()
- self.assertIsNone(session._session)
+ with mock.patch.object(
+ session.session,
+ 'close',
+ side_effect=(
+ OSError('socket gone'),
+ requests.exceptions.RequestException('request failed'),
+ ),
+ ) as close_mock:
+ session.close()
+ session.close()
+ self.assertEqual(2, close_mock.call_count)
+ self.assertIs(session.session, session._session)
def test_close_propagates_unexpected_errors(self):
session = client_session.Session()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/keystoneauth1.egg-info/PKG-INFO
new/keystoneauth1-5.19.0/keystoneauth1.egg-info/PKG-INFO
--- old/keystoneauth1-5.18.1/keystoneauth1.egg-info/PKG-INFO 2026-10-12
11:03:58.518756200 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1.egg-info/PKG-INFO 2026-11-19
13:07:49.568716300 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.4
Name: keystoneauth1
-Version: 5.18.1
+Version: 5.19.0
Summary: Authentication Library for OpenStack Identity
Author-email: OpenStack <[email protected]>
License-Expression: Apache-2.0
@@ -28,16 +28,18 @@
Requires-Dist: stevedore>=5.9.1
Requires-Dist: os-service-types>=1.2.0
Requires-Dist: typing-extensions>=4.12
-Provides-Extra: kerberos
-Requires-Dist: requests-kerberos>=0.8.0; extra == "kerberos"
-Provides-Extra: saml2
-Requires-Dist: lxml>=4.2.0; extra == "saml2"
-Provides-Extra: oauth1
-Requires-Dist: oauthlib>=0.6.2; extra == "oauth1"
Provides-Extra: betamax
Requires-Dist: betamax>=0.7.0; extra == "betamax"
Requires-Dist: fixtures>=3.0.0; extra == "betamax"
Requires-Dist: PyYAML>=3.13; extra == "betamax"
+Provides-Extra: kerberos
+Requires-Dist: requests-kerberos>=0.8.0; extra == "kerberos"
+Provides-Extra: oauth1
+Requires-Dist: oauthlib>=0.6.2; extra == "oauth1"
+Provides-Extra: profiling
+Requires-Dist: osprofiler>=4.0.0; extra == "profiling"
+Provides-Extra: saml2
+Requires-Dist: lxml>=4.2.0; extra == "saml2"
Dynamic: license-file
Dynamic: requires-dist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1.egg-info/SOURCES.txt
new/keystoneauth1-5.19.0/keystoneauth1.egg-info/SOURCES.txt
--- old/keystoneauth1-5.18.1/keystoneauth1.egg-info/SOURCES.txt 2026-10-12
11:03:58.554757000 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1.egg-info/SOURCES.txt 2026-11-19
13:07:49.651717000 +0100
@@ -27,6 +27,7 @@
doc/source/index.rst
doc/source/migrating.rst
doc/source/plugin-options.rst
+doc/source/service-tokens.rst
doc/source/using-sessions.rst
doc/source/images/graphs_authComp.svg
doc/source/images/graphs_authCompDelegate.svg
@@ -89,7 +90,6 @@
keystoneauth1/fixture/serializer.py
keystoneauth1/fixture/v2.py
keystoneauth1/fixture/v3.py
-keystoneauth1/hacking/__init__.py
keystoneauth1/identity/__init__.py
keystoneauth1/identity/access.py
keystoneauth1/identity/base.py
@@ -266,6 +266,7 @@
releasenotes/notes/improve-http-error-handling.yaml
releasenotes/notes/ironic-discovery-fe41793ef97027bf.yaml
releasenotes/notes/ironic-microversions-a69bf92ab21f0cf5.yaml
+releasenotes/notes/key-manager-discovery-54a8a4dd09c3d7b1.yaml
releasenotes/notes/ksa_2.2.0-81145229d4b43043.yaml
releasenotes/notes/microversion-header-support-901acd820a21d788.yaml
releasenotes/notes/noauth-discovery-c26d82a32c36d41d.yaml
@@ -277,6 +278,7 @@
releasenotes/notes/retry-authenticated-discovery-19c4354ff983f507.yaml
releasenotes/notes/retry-delay-68d0c0a1dffcf2fd.yaml
releasenotes/notes/serice-type-aliases-249454829c57f39a.yaml
+releasenotes/notes/session-close-after-reuse-c9c91e3ca80a8714.yaml
releasenotes/notes/status-code-retries-75052a43efa4edb2.yaml
releasenotes/notes/support-api-wg-discovery-2cb4b0186619e124.yaml
releasenotes/notes/timeout-float-a2433987d328604d.yaml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/keystoneauth1.egg-info/pbr.json
new/keystoneauth1-5.19.0/keystoneauth1.egg-info/pbr.json
--- old/keystoneauth1-5.18.1/keystoneauth1.egg-info/pbr.json 2026-10-12
11:03:58.526756300 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1.egg-info/pbr.json 2026-11-19
13:07:49.566716200 +0100
@@ -1 +1 @@
-{"git_version": "b532109", "is_release": true}
\ No newline at end of file
+{"git_version": "83e4acd", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/keystoneauth1.egg-info/requires.txt
new/keystoneauth1-5.19.0/keystoneauth1.egg-info/requires.txt
--- old/keystoneauth1-5.18.1/keystoneauth1.egg-info/requires.txt
2026-10-12 11:03:58.519756300 +0200
+++ new/keystoneauth1-5.19.0/keystoneauth1.egg-info/requires.txt
2026-11-19 13:07:49.570716100 +0100
@@ -15,5 +15,8 @@
[oauth1]
oauthlib>=0.6.2
+[profiling]
+osprofiler>=4.0.0
+
[saml2]
lxml>=4.2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/pyproject.toml
new/keystoneauth1-5.19.0/pyproject.toml
--- old/keystoneauth1-5.18.1/pyproject.toml 2026-10-12 11:03:24.613237600
+0200
+++ new/keystoneauth1-5.19.0/pyproject.toml 2026-11-19 13:06:57.716595200
+0100
@@ -34,19 +34,22 @@
"Release Notes" = "https://docs.openstack.org/releasenotes/keystoneauth/"
[project.optional-dependencies]
-kerberos = [
- "requests-kerberos>=0.8.0", # ISC
+betamax = [
+ "betamax>=0.7.0", # Apache-2.0
+ "fixtures>=3.0.0", # Apache-2.0/BSD
+ "PyYAML>=3.13", # MIT
]
-saml2 = [
- "lxml>=4.2.0", # BSD
+kerberos = [
+ "requests-kerberos>=0.8.0", # ISC
]
oauth1 = [
- "oauthlib>=0.6.2", # BSD
+ "oauthlib>=0.6.2", # BSD
]
-betamax = [
- "betamax>=0.7.0", # Apache-2.0
- "fixtures>=3.0.0", # Apache-2.0/BSD
- "PyYAML>=3.13", # MIT
+profiling = [
+ "osprofiler>=4.0.0", # Apache-2.0
+]
+saml2 = [
+ "lxml>=4.2.0", # BSD
]
[project.entry-points."keystoneauth1.plugin"]
@@ -89,6 +92,9 @@
show_error_context = true
strict = true
disable_error_code = ["import-untyped"]
+# temporary fix due to
+# https://review.opendev.org/c/openstack/oslo.config/+/1013888
+warn_unused_ignores = false
exclude = "(?x)(doc | releasenotes)"
[[tool.mypy.overrides]]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/releasenotes/notes/key-manager-discovery-54a8a4dd09c3d7b1.yaml
new/keystoneauth1-5.19.0/releasenotes/notes/key-manager-discovery-54a8a4dd09c3d7b1.yaml
---
old/keystoneauth1-5.18.1/releasenotes/notes/key-manager-discovery-54a8a4dd09c3d7b1.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/keystoneauth1-5.19.0/releasenotes/notes/key-manager-discovery-54a8a4dd09c3d7b1.yaml
2026-11-19 13:06:57.677595400 +0100
@@ -0,0 +1,17 @@
+---
+fixes:
+ - |
+ Key-manager endpoint discovery now automatically sends
+ ``OpenStack-API-Version: key-manager 1.1`` to obtain Barbican's
microversion
+ range. Previously, its legacy discovery document omitted that range,
+ preventing consumers such as openstacksdk from negotiating microversions.
+ This does not change the microversion used for resource requests.
+ Discovery caches distinguish documents requested with different version
+ headers. Direct discovery callers can supply the new ``service_type``
+ argument to enable service-specific discovery behavior.
+deprecations:
+ - |
+ The ``version_header`` argument to
``keystoneauth1.discover.get_version_data``
+ is deprecated. Supply ``service_type`` instead so keystoneauth can apply
+ service-specific discovery behavior automatically. Explicit header values
+ remain supported for compatibility during the deprecation period.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/keystoneauth1-5.18.1/releasenotes/notes/session-close-after-reuse-c9c91e3ca80a8714.yaml
new/keystoneauth1-5.19.0/releasenotes/notes/session-close-after-reuse-c9c91e3ca80a8714.yaml
---
old/keystoneauth1-5.18.1/releasenotes/notes/session-close-after-reuse-c9c91e3ca80a8714.yaml
1970-01-01 01:00:00.000000000 +0100
+++
new/keystoneauth1-5.19.0/releasenotes/notes/session-close-after-reuse-c9c91e3ca80a8714.yaml
2026-11-19 13:06:57.679595200 +0100
@@ -0,0 +1,8 @@
+---
+fixes:
+ - |
+ Fix ``Session.close()`` to retain ownership of an internally created
+ ``requests.Session`` after closing its connection pool. If the session
+ is reused, subsequent calls to ``close()`` and cleanup on deletion now
+ release newly opened pooled connections. Externally supplied requests
+ sessions remain untouched.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/releasenotes/source/2025.1.rst
new/keystoneauth1-5.19.0/releasenotes/source/2025.1.rst
--- old/keystoneauth1-5.18.1/releasenotes/source/2025.1.rst 2026-10-12
11:03:24.617237800 +0200
+++ new/keystoneauth1-5.19.0/releasenotes/source/2025.1.rst 2026-11-19
13:06:57.680595400 +0100
@@ -3,4 +3,4 @@
===========================
.. release-notes::
- :branch: stable/2025.1
+ :branch: unmaintained/2025.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/test-requirements.txt
new/keystoneauth1-5.19.0/test-requirements.txt
--- old/keystoneauth1-5.18.1/test-requirements.txt 2026-10-12
11:03:24.619237700 +0200
+++ new/keystoneauth1-5.19.0/test-requirements.txt 2026-11-19
13:06:57.717595000 +0100
@@ -1,19 +1,9 @@
-hacking~=6.1.0 # Apache-2.0
-flake8-docstrings~=1.7.0 # MIT
-flake8-import-order~=0.18.2 #LGPLv3
-bandit~=1.7.6 # Apache-2.0
-
coverage>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD
oslo.config>=5.2.0 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
-betamax>=0.7.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0
testresources>=2.0.0 # Apache-2.0/BSD
testtools>=2.2.0 # MIT
-PyYAML>=3.12 # MIT
-requests-kerberos>=0.8.0 # ISC
-lxml>=4.2.0 # BSD
-oauthlib>=0.6.2 # BSD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/keystoneauth1-5.18.1/tox.ini
new/keystoneauth1-5.19.0/tox.ini
--- old/keystoneauth1-5.18.1/tox.ini 2026-10-12 11:03:24.619237700 +0200
+++ new/keystoneauth1-5.19.0/tox.ini 2026-11-19 13:06:57.717595000 +0100
@@ -12,6 +12,12 @@
deps =
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
+extras =
+ betamax
+ kerberos
+ oauth1
+ profiling
+ saml2
allowlist_externals =
bash
commands =
@@ -58,9 +64,6 @@
oslo_debug_helper -t keystoneauth1/tests {posargs}
[testenv:docs]
-setenv =
- {[testenv]setenv}
- SPHINX_APIDOC_OPTIONS=noindex,members,undoc-members,show-inheritance
deps =
-r{toxinidir}/doc/requirements.txt
commands =
@@ -69,9 +72,6 @@
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:pdf-docs]
-setenv =
- {[testenv]setenv}
- SPHINX_APIDOC_OPTIONS=noindex,members,undoc-members,show-inheritance
deps =
{[testenv:docs]deps}
allowlist_externals =
@@ -85,6 +85,7 @@
[testenv:releasenotes]
deps =
-r{toxinidir}/doc/requirements.txt
+extras =
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html
releasenotes/source releasenotes/build/html