Commit graph

15243 commits

Author SHA1 Message Date
Artem Goncharov
c63efe1df1 Invalidate token of user disabled in readonly backend
We support custom identity plugins. They (and also LDAP backend) may be
considered as a read-only (not supporting user data modification through
Keystone API). When a user of such backend is disabled in the remote
system Keystone will never learn about that and as such tokens for those
users will remain active. They cannot be renewed, but still they stay
valid.
In order to address this situation we need to do additional steps in the
token validation and identify the current state of the user in the
backend. Due to the use of the token caching it is not possible to reuse
normal token validation functionality (it will never gets invalidated as
such). In order to keep performance impact as low as possible modify the
token validation as following:
- regular checks
- revocation check
- if token is still active and revoke check passed fetch current user
  data. When user is disabled - log a warning (explaining the situation)
  and raise `UserDisabled` exception.

Since Keystone also does not receive a message when user is reactivated
(i.e. it was accidentally disabled) we cannot use the same approach as
for regular user disabling and generate a token revocation event. This
would cause the user to be locked out until the revocation event
expires.

Closes-bug: #2122615
Change-Id: If5b83feabc670ced54ef12fe7826267af7e3419d
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025-11-14 09:13:49 +01:00
Zuul
c0a2c6b0ba Merge "fix ldap 'enabled' setting not interpreted as boolean" 2025-10-17 21:42:30 +00:00
Zuul
98b5b4c485 Merge "Fix federation mapping jsonschema" 2025-10-03 16:05:13 +00:00
Stephen Finucane
41b31668b9 Migrate setup configuration to pyproject.toml
Change-Id: I14a628f9100341ee532776cf6f7e348a0304cf3a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-09-22 11:49:15 +01:00
Zuul
4275c6801e Merge "Fix trusts jsonschema to support additional properties" 2025-09-19 16:33:41 +00:00
Zuul
5ef0015772 Merge "credentials: Don't try to decrypt already-decrypted credentials" 2025-09-19 16:33:36 +00:00
Zuul
4486ab58df Merge "Update master for stable/2025.2" 2025-09-19 16:33:31 +00:00
Zuul
0a774cd192 Merge "Replace the random library with secrets in oauth1" 2025-09-19 16:33:26 +00:00
Stephen Finucane
43706ee0b1 zuul: Remove deprecated job aliases
Now that reference from keystone-tempest-plugin have been cleaned up,
we can remove these aliases.

Change-Id: I80267d2fb74cebd5f2884d539436c44f17f117e1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Depends-on: https://review.opendev.org/c/openstack/keystone-tempest-plugin/+/951384
2025-09-19 03:50:27 +09:00
Adrian Jarvis
420503a373 Replace the random library with secrets in oauth1
The module keystone.oauth1.backends.sql was using the random library to
generate the verifier of a request token.  The bandit security scanner
tool from version 1.8.4 onwards identifies the use random.sample as a
low security issue, despite random actually being an alias to
random.SystemRandom(). This change replaces the use of random library
with the secrets library and avoids the use of shadowing random.

Change-Id: I1a0ecd80a44eae6032e985091032aa91ee5c81a5
Signed-off-by: Adrian Jarvis <adrian.jarvis@catalystcloud.nz>
2025-09-18 17:01:23 +12:00
OpenStack Release Bot
7fa2f6a200 Update master for stable/2025.2
Add file to the reno documentation build to show release notes for
stable/2025.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2025.2.

Sem-Ver: feature
Change-Id: I502489b74d553f0bfac193e61c9aa6887be7a710
Signed-off-by: OpenStack Release Bot <infra-root@openstack.org>
Generated-By: openstack/project-config:roles/copy-release-tools-scripts/files/release-tools/add_release_note_page.sh
2025-09-11 12:36:50 +00:00
Tim Burke
77c298beca credentials: Don't try to decrypt already-decrypted credentials
When using dogpile.cache.memory as the cache backend, the underlying
Python dict gets cached. Then, since we decrypt it in-place, the
decrypted dict remains in cache. As a result, subsequent attempts to
fetch (and decrypt) the credential result in KeyErrors, since
'encrypted_blob' was popped off in the original decryption.

Now, check for 'blob' (and the absence of 'encrypted_blob') in the
dict; if it looks like the credential has already been decrypted, skip
decryption.

Change-Id: Ic634c1c7db16c9acff5cdf39de74c3f82710a16e
Signed-off-by: Tim Burke <tim.burke@gmail.com>
2025-09-10 16:36:30 -07:00
Zuul
a568938e0c Merge "Fix AD nested groups issues" 2025-08-27 19:14:12 +00:00
Benedikt Trefzer
98e3e6bd84 fix ldap 'enabled' setting not interpreted as boolean
interpretation of the ldap enabled attribute as boolean
is only done if enabled_invert setting is set to true.

Closes-Bug: #2121152
Change-Id: I7260bf46adf003aef7c7ac0d436c3758f658cb0c
Signed-off-by: Benedikt Trefzer <benedikt.trefzer@cirrax.com>
2025-08-25 09:21:26 +02:00
Artem Goncharov
69e5fc55c1 Fix trusts jsonschema to support additional properties
Trusts support custom setting and returning custom properties. Change
jsonschema to allow additional properties.

Closes-Bug: 2119543
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
Change-Id: I49a8d1d669c6f942bc798cac093f75350692220e
2025-08-15 16:35:23 +02:00
Artem Goncharov
c5151ed555 Fix federation mapping jsonschema
The `schema_version` schema element jsonschema specification is invalid
(https://json-schema.org/understanding-json-schema/reference/object).
Each element of the object properties must specify element data type.
`"name": {"type": "string"}` is not a valid data type, while
`{"type": "string"}` is (and the code treats `schema_version` as a string).
Since there is nearly no jsonschema validation across the keystone code
there is no violations, but once schemas are used in a wider scope (i.e.
to construct an OpenAPI spec) this becomes clearly a failure

Author: Artem Goncharov <artem.goncharov@gmail.com>
Co-author: Rafael Weingärtner <rafael@apache.org>

Change-Id: I8544f1ac45177b31482ad209f931c189eb5efeeb
Signed-off-by: Rafael Weingärtner <rafael@apache.org>
2025-08-13 10:31:25 -03:00
Zuul
e066e18abf Merge "Remove the password element from the generated dict in update_user" 2025-07-18 16:57:55 +00:00
Zuul
37bf23ac62 Merge "Remove Python 3.9 support" 2025-07-18 16:57:51 +00:00
Zuul
034be4e221 Merge "sqlalchemy: Use built-in declarative" 2025-07-18 16:57:46 +00:00
Zuul
b11214d86b Merge "Stop installing removed "memcache" extra" 2025-07-18 16:57:42 +00:00
Zuul
6e9cfb3743 Merge "Imported Translations from Zanata" 2025-07-18 16:57:37 +00:00
Zuul
31dcffe06c Merge "alembic: Explicitly set path_separator" 2025-07-18 16:57:33 +00:00
Jorge Merlino
f8338be430 Fix AD nested groups issues
The implementation of AD nested groups searches works fine when
listing the groups a user belongs to, but fails when listing all
members of a group. This function of listing all members is also
used to check if a user belongs to a group which also fails.
This patch fixes the query for getting all users in a group.

Closes-Bug: #2112477

Depends-on: https://review.opendev.org/c/openstack/devstack/+/953569
Depends-on: https://review.opendev.org/c/openstack/devstack/+/954914

Change-Id: I9707e1a9bc4a334902933d6251888144f8c3bc19
Signed-off-by: Jorge Merlino <jorge.merlino@canonical.com>
2025-07-17 14:39:11 +00:00
OpenStack Proposal Bot
cf6a83f9eb Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I330ad6e8ccaec92f5535779030f8b9eb0aac0bf6
Signed-off-by: OpenStack Proposal Bot <openstack-infra@lists.openstack.org>
Generated-By: openstack/openstack-zuul-jobs:roles/prepare-zanata-client/files/common_translation_update.sh
2025-07-09 04:05:30 +00:00
Zuul
4e4cd0dcdc Merge "Updated the doc for MySQL > 5.7" 2025-07-01 14:34:51 +00:00
Takashi Kajinami
9c8f3a410d Stop installing removed "memcache" extra
It was a left-over from a59ac9d823 ,
which removed the useless dependency.

Change-Id: I97f6a4b36b33954a1a427307285eff758e47c088
2025-07-01 00:41:25 +09:00
Takashi Kajinami
fa7fd43e88 alembic: Explicitly set path_separator
... to resolve the following warning.

DeprecationWarning: No path_separator found in configuration; falling
back to legacy splitting on spaces/commas for version_locations.
Consider adding path_separator=os to Alembic config.

Also use os.pathsep as the separate assuming it is more safe to be
separate paths.

Change-Id: I6fcf992a0468e76281e885849de69ac49dab61a0
2025-07-01 00:39:52 +09:00
Takashi Kajinami
f263a3b55b sqlalchemy: Use built-in declarative
sqlalchemy.ext.declarative was deprecated in sqlalchemy 1.4.0, due to
the built-in implementations[1].

[1] https://github.com/sqlalchemy/sqlalchemy/commit/450f5c0d6519a439f40

Change-Id: I9e13df28f1ca409cfa6348a5d7be2f04b2825267
2025-06-30 22:08:31 +09:00
Andrew Bogott
84a30d5607 trust schema: don't require user_id to be in uuid format
The user id might come from an external provider
in which case we can't make assumptions about its format.
The constraint removed here is breaking the credential APIs for
ldap-based clouds.

Change-Id: I80dfe07ae48fd08de3af9cf5508215e4bbcea13c
2025-06-29 22:01:09 -05:00
Takashi Kajinami
48407c6d7b Remove Python 3.9 support
Python 3.9 is no longer part of the tested runtimes[1].

[1] https://governance.openstack.org/tc/reference/runtimes/2025.2.html

Change-Id: I7ddaca78d0fe190e6384656b846da56e6ca24e88
2025-06-26 02:16:32 +00:00
Artem Goncharov
398e05c213 Fix json schema of user groups
2 properties are placed on the wrong level.

Change-Id: Ie3b44527c956fb6d3a2114b14a49e95abd408ccd
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025-06-23 15:50:36 +02:00
Zuul
72230d60fd Merge "trust schema: don't require project_id to be in uuid format" 2025-06-17 19:32:24 +00:00
Zuul
f8539f7541 Merge "Separate user response and request schema" 2025-06-16 09:25:01 +00:00
Zuul
35b2517eb9 Merge "Split role assignment request/response schemas" 2025-06-16 09:24:57 +00:00
Andrew Bogott
a2e54ac559 trust schema: don't require project_id to be in uuid format
Not all clouds have uuid project ids; projects might predate
the adoption of uuids in keystone code, or they might draw project
ids from an external provider.

In addition, this constraint is unique to trusts, which results in a
keystone api that works with non-uuid projects 98% of the time but
fails by surprise in this exact case.

For a similar example, see

https: //review.opendev.org/c/openstack/cinder/+/864585
Change-Id: Ic0fe21acb8adfe3030c9b58007456efb4b61799f
2025-06-15 16:43:19 -05:00
Zuul
141ceb1fd2 Merge "Remove OSA test job" 2025-06-13 19:16:31 +00:00
Zuul
b06ae73073 Merge "Prevent MFA bypass" 2025-06-13 16:46:37 +00:00
Zuul
7715b9d2bd Merge "Fix inconsistency in CADF initiator name field" 2025-06-13 15:37:09 +00:00
Zuul
a404693b25 Merge "Fix an error in the document" 2025-06-13 14:41:16 +00:00
Jonathan Rosser
8ab4ecd1bf Remove OSA test job
This job has not passed for several years and the test framework
it is based on is now deprecated in OSA.

Change-Id: I8a5d75750a8b028cddd9403a5212a1285b19eff7
2025-06-13 14:40:10 +00:00
Zuul
372795ca08 Merge "Remove tags from README" 2025-06-13 14:34:56 +00:00
Zuul
ad1dc363fd Merge "Revert "docs: identity service now use https"" 2025-06-13 14:30:31 +00:00
Artem Goncharov
ee4aef7dd7 Separate user response and request schema
There are more then only few attributes only present in the response and
cannot be present in the request. The worst effect is that boolean
(enabled) cannot be returned as all this amount of values supported on
the input. This leads to pretty weird results when using produces
openapi spec with the mock generators.

Copy out user properties adopting them to the reality of responses.

Change-Id: Ic4c81cc8f7b90adb2cb6cea19cf2b3c4bff2c00f
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
2025-06-10 12:16:31 +02:00
Artem Goncharov
1d67a0ae78 Split role assignment request/response schemas
Ensure that request and response schemas are separated to only specify
formats and patterns on request allowing response to be what it is.

Change-Id: I0a737231b4f3bf0c5fb3445fd1cbc5dbeb91f5ac
Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
Closes-bug: #2112112
2025-06-10 12:14:58 +02:00
Zuul
50d266e590 Merge "Add JSON schema and validation for region" 2025-06-06 18:12:52 +00:00
Zuul
d00cb54fb3 Merge "api: Remove constraints on user IDs" 2025-06-06 17:20:44 +00:00
Dr. Jens Harbott
26408ecd93 Revert "docs: identity service now use https"
This reverts commit 3c72ffb369.

Reason for revert: The install docs are broken when the refer to https URLs without actually deploying TLS for keystone

Change-Id: Id412e9f38ef9847092482524a6efe9fc62f06197
2025-06-03 19:26:47 +00:00
Zuul
b739fd6bcd Merge "Update pre-commit hook versions" 2025-05-30 18:11:36 +00:00
Zuul
deaa00b4bb Merge "Fix getting token from application credentials token" 2025-05-30 16:15:04 +00:00
Zuul
b472a3f28c Merge "docs: identity service now use https" 2025-05-30 16:08:15 +00:00