529 Commits

Author SHA1 Message Date
d5e6392454 Merge "identity: Remove unnecessary helper" 2025-05-30 14:37:41 +00:00
606fd132bc Merge "identity: Normalise output of application credentials commands" 2025-05-26 16:03:37 +00:00
2f03c3ea3c identity: Remove unnecessary helper
Make better use of argparse and eliminate the need for a helper in the
process.

Change-Id: Ibdc9b4bfbb4d532ddb05bce9b49bcf0580cce76d
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-26 16:12:28 +01:00
5a565ca1ce Merge "Fix missing 'options' field in 'user show' command" 2025-05-20 18:08:26 +00:00
9bcb1c5c00 Fix missing 'options' field in 'user show' command
This patch fixes a bug where the 'options' field was missing from
the output of the 'openstack user show' command since v7.0.0.

The issue was caused by the 'options' field not being included in
the column list in the _format_user function. This field is important
as it contains various user settings such as multi-factor authentication
configurations and password policy exemptions.

This patch:
1. Adds 'options' field to the column list in _format_user function
2. Updates all affected unit tests to include this field
3. Uses getattr() to safely handle cases where the options field may be absent

Without this fix, users cannot see important options like multi-factor
authentication settings through the CLI, which could lead to security
configuration issues being overlooked.

Closes-Bug: #2084946
Change-Id: I4319268ad4310e6164eb8e65664d73f9b32cdd78
2025-05-20 23:46:39 +09:00
a2be1b014e Identity: Migrate 'group' commands to SDK
Change-Id: I5a477426318d77021c0430efa1d1f9a7b1ee2633
2025-05-19 15:39:18 -07:00
5f2145d102 Merge "Add filters to search for enabled/disabled users and projects" 2025-05-19 14:17:22 +00:00
51305d06f7 Merge "identity: Migrate 'domain' commands to SDK" 2025-05-19 14:17:19 +00:00
f1cd38aabf identity: Normalise output of application credentials commands
cliff is now smarter (I9155763eee15e19eab23b48989dfcc19ea2c5d34), so we
can effectively revert change I6b4f1b793dc383856bfdf9a01514381be3cd2bf1.
We bump the dependencies to ensure this.

Change-Id: I2af19043fd66b5be0826a774baeabeac7110a4aa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-05-19 14:14:14 +01:00
eea369e73c Fix incorrect warning with --password-prompt option
When creating a user with the --password-prompt option, a warning is
incorrectly displayed stating that no password was supplied, even though
a password was entered. This occurs because the code checks parsed_args.password
instead of the password variable that actually stores the prompted password.

This patch fixes the issue by checking the 'password' variable
instead of 'parsed_args.password' in the warning condition. A test
case has been added to verify that no warning is displayed when
using --password-prompt and entering a password.

Closes-Bug: #2091836
Change-Id: Ib3ddc7e400ee7988f605c00db534bccc3617d982
2025-05-19 16:12:06 +09:00
79de137152 Merge "identity: Add missing user argument" 2025-05-16 02:50:39 +00:00
e26b447925 identity: Add missing user argument
Change-Id: Ifd2b32e97d1f5fd426f333da13852a8bb6821f1b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2110765
2025-05-15 16:05:56 +01:00
94d17b8762 identity: Fix listing of applications credentials by user
Change-Id: I71f1c4f338694e2b50e71b6907c415bbb6a768fa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2107354
2025-05-15 15:59:34 +01:00
2148a86fc5 Merge "Remove use of formatter function" 2025-04-02 10:19:34 +00:00
d95e23d92b Remove use of formatter function
Change-Id: I9ef88a4d69ffc3eaae183c77445ac10358d86337
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 16:42:13 +01:00
62c8b8217e typing: Indicate another tuple to be extended
One has been introduced since Ie5907de8d60f2f39e98f6a88227cebb2e2ff565c
merged.

Change-Id: I37f7bf58a2cbecb69b370e832e56daa310cea3b6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 13:14:47 +01:00
c9e4e5404f Merge "Permit use of tuple API_VERSIONS" 2025-04-01 12:02:24 +00:00
77143f9bed Merge "typing: Resolve incompatible operand issues" 2025-04-01 11:50:55 +00:00
28bd00a642 Merge "typing: Correct type for missing attributes" 2025-04-01 11:50:53 +00:00
b2eccdcb1a Permit use of tuple API_VERSIONS
The values of these dictionaries are not used when SDK is in use,
which should soon account for all use cases. Eventually we should
probably look for plugins to return a proper class or typeddict but
that's a job for another day.

This began as a fix for in openstackclient/object/client.py which
referenced a non-existent class and quickly snowballed.

Change-Id: I7b807ec3a97124b35828ffdecbb36f6fde11e7b5
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-04-01 10:36:02 +01:00
7750fc1cf4 identity: Migrate 'endpoint' commands to SDK
Change-Id: I71b5ae8a4bbcb2fdebf894d8bd5cc8322c31bdb5
Depends-On: I599ff3e88d4e1e9ffafc638bb74186f2739b5a77
Depends-On: I9aa39810fe94f7ee9b68d34050f4adb9dbdfccb8
2025-03-31 16:58:27 -07:00
9de592ebaf typing: Resolve incompatible operand issues
Change-Id: I7f3dd908053b9ace5206d0a1bd3b8258fd0264ef
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:52:16 +01:00
e28046cc19 typing: Correct type for missing attributes
Change-Id: I55652220ecd663fa024937646dfef92595e1cd0f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:52:16 +01:00
bdd55d989d typing: Indicate tuples to be extended
Change-Id: Ie5907de8d60f2f39e98f6a88227cebb2e2ff565c
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-31 17:48:36 +01:00
ab2e68f407 Merge "Prepare for ruff bump" 2025-03-31 10:37:30 +00:00
3483117259 Add filters to search for enabled/disabled users and projects
Change-Id: Ie7d84f9e0158018083af2156d02dc86fefd79256
Signed-off-by: Jan Ueberacker <jan.ueberacker@inovex.de>
2025-03-26 14:41:50 +01:00
2883f3fb95 Specifying project-domain for project
The fix ensures that if a user wants to set a default project,
they must also provide the project domain. If it's missing,
an explicit error message is shown, making it clear that the
project domain is required.

Also adding some unit tests by modifying respective calls.

Change-Id: Ia6e921a53da55ab1bce85a42c8160872a9d47d64
Closes-Bug: #2102146
2025-03-23 09:38:24 +00:00
290bc580e6 Prepare for ruff bump
Change-Id: Ia9c402edebc8537d5019d18920b6679b05ea4378
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2025-03-19 12:04:39 +00:00
1458330d3b identity: Fix 'trust' commands to work with SDK
Closes-Bug: #2102039
Change-Id: I632937e06683cc76e78390a4e6f3de4e3c4f1f87
2025-03-11 12:31:09 -05:00
1979c20ff0 Fix credential creation
openstacksdk's Credential expects user_id and project_id, not user and
project. Previously, we would send payloads like

   {'type': 'ec2', 'blob': '{"access": "s3-user1", "secret": "s3-secret1"}'}

which Keystone would reject with

   'user_id' is a required property

Change-Id: I0544bef7df9247395f0726ea075112d6ac992252
2025-02-25 10:30:22 -08:00
0c2dee5e1f Merge "Identity: Deprecate --region None in limits/registered limits" 2025-02-12 00:22:23 +00:00
060d706bf4 Identity: Deprecate --region None in limits/registered limits
Change-Id: I37afac1185595216e868202c861d3de719b32073
2025-01-28 17:19:05 +00:00
8f1382eda3 Identity: Migrate 'role' commands to SDK
Depends-On: https://review.opendev.org/c/openstack/openstacksdk/+/929578
Change-Id: I22254604705080095ac852a1e03506b1552a1fd2
2025-01-13 21:55:10 +00:00
6ce1f7730c Merge "identity: Migrate 'trust' commands to SDK" 2024-12-19 21:33:28 +00:00
c74af3f01e Merge "identity: Migrate 'credential' commands to SDK" 2024-12-16 20:45:20 +00:00
fd232a43bc Merge "identity: Migrate 'service provider' commands to SDK" 2024-12-16 19:52:03 +00:00
769bf87d0a identity: Migrate 'trust' commands to SDK
Change-Id: Idb1fda3428ccf3022ee03c8fb7e42c7121683181
2024-12-16 18:24:10 +00:00
56baf50655 identity: Migrate 'service provider' commands to SDK
Change-Id: I7f5fba408b7c350bb0a279f8dd17bd7bae451774
2024-12-11 22:37:44 +00:00
52b2944b78 Merge "identity: Migrate region commands to SDK" 2024-12-10 18:32:38 +00:00
4bdd51cbea identity: Migrate 'domain' commands to SDK
Change-Id: Ide9cb9491334e139482f8cf1ea1874d01da0884f
Depends-On: Id1b7b00fe5b96f0cc922716afabcc678193f0f57
2024-11-20 23:28:47 +00:00
4c8290012d identity: Migrate region commands to SDK
Change-Id: I980693732d794f1ccbfc8d7f06d61b4a9824ef15
2024-11-20 23:26:30 +00:00
9c6df823e2 identity: Migrate 'credential' commands to SDK
Change-Id: I49391fec3d7b6a1b81438a2a311ac7b86173a6a4
2024-11-13 18:13:19 +00:00
2e491191e5 Fix ignored --user-domain in role assignment list
Fix the wrong value assignment which made the --user-domain option
ignored. Unit tests are updated to verify usage of domain options to
avoid further regressions.

Also drop the redundant look up of domain id to avoid unnecessary API
call.

Closes-Bug: #2085604
Change-Id: I5112b8e831fb26eb6544615277f0d3fe4f15dc5a
2024-10-29 21:20:07 +09:00
8979c00150 Merge "Always resolve domain id" 2024-10-03 11:59:16 +00:00
c8326b5525 Always resolve domain id
The --user-domain option and the --project-domain option may take id or
name. In case name is given it should be translated to id.

Closes-Bug: 2083390
Change-Id: Idf3f113a74452daabc80660574030cb9b24b1a15
2024-10-01 15:37:27 +00:00
52d56b3fd9 identity: in service set command, don't pass the enable option when it is None
Currently, it is passing None value which is not accepted by keystone
parameters validation:

BadRequestException: 400: Client Error for url: ... Invalid input for field 'enabled': None is not of type 'boolean'

Failed validating 'type' in schema['properties']['enabled']:
    {'enum': [True, False, None], 'type': 'boolean'}

On instance['enabled']:
    None

Closes-Bug: #2083021
Change-Id: Ia8772560deb54e71672102157659d4eb22e6ad59
2024-09-30 13:45:03 +02:00
2f790c319d Merge "identity: Don't pass unset options when creating user" 2024-09-25 08:22:26 +00:00
033793aa0e identity: Don't pass unset options when creating user
In change I06f3848812bce60c65909f1311f36b70eba427d4, we migrated the
'user *' commands from keystoneclient to SDK. One side effect of this is
that we are no longer able to rely on keystoneclient's 'filter_none'
helper method that filters out parameters that are set to None. As such,
we now need to do this ourselves. Eventually, it would be nice if SDK
provided such functionality itself.

The same change also introduced a bug where the '--domain' argument was
being used to lookup a project rather than the '--project-domain'
argument. This is also corrected.

Change-Id: I1204ca611a74d134c879467d6c2b73f16e043213
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #2080600
2024-09-17 13:26:26 +01:00
415f68016c identity: Migrate 'access rule' commands to SDK
Change-Id: Id5740cc61474650f22f9efe8d148c8c666c3b91e
2024-09-17 11:52:46 +01:00
f98006ca9d pre-commit: Migrate pyupgrade to ruff
Change-Id: Ic50d2a5e0bc9dcdfe29f382607135cab510cd396
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-09-12 18:08:23 +01:00