15023 Commits

Author SHA1 Message Date
Zuul
97431ec99b Merge "Remove logic to support pysaml2<3.0.0" 26.0.0.0rc1 26.0.0 2024-09-06 15:48:48 +00:00
Zuul
afed96b107 Merge "tox: Drop envdir" 2024-09-03 05:49:42 +00:00
Zuul
7ecd4ca287 Merge "Correct format for token expiration time" 2024-09-03 05:29:30 +00:00
Zuul
9aa6b031ca Merge "Update OIDC Apache config to avoid masking Keystone API endpoint" 2024-09-03 03:08:16 +00:00
Takashi Kajinami
170d9f4809 Remove logic to support pysaml2<3.0.0
The xmldsig module was moved to the pysaml2 namespace in 3.0.0, but
now 5.0.0 is the minimum required version.

See c90dd3a0f8280e28bbbff691c0ae27aff736658a for details.

Change-Id: I96b01da509c96387bd7f3c2a814f579a070815ae
2024-09-02 12:29:54 +00:00
Takashi Kajinami
637fb7534a Remove support-matrix.css
The file is generated during doc build.

Change-Id: If51c6af2a2cae25c8f8d73b63f3aa61c2937310c
2024-09-01 22:14:10 +09:00
Zuul
dd30a921a2 Merge "Implement the Domain Manager Persona for Keystone" 2024-08-28 18:29:44 +00:00
Markus Hentsch
69d1897d09 Implement the Domain Manager Persona for Keystone
Introduces domain-scoped policies for the 'manager' role to permit
domain-wide management capabilities in regards to users, groups,
projects and role assignments.
Defines a new base policy rule to restrict the roles assignable by
domain managers.

Closes-Bug: #2045974
Change-Id: I62742ed7d906c92d1132251080758bb54d0fc8e1
2024-08-28 15:54:42 +02:00
Zuul
b95b2b8002 Merge "Add blackify commit to blame ignore" 2024-08-27 21:26:56 +00:00
Zuul
af0f27ee9d Merge "Update hacking to latest version" 2024-08-27 21:26:53 +00:00
Zuul
b4e34c9bf5 Merge "Enable hacking check in pre-commit" 2024-08-27 21:03:44 +00:00
Zuul
7cad8a5301 Merge "Fix role statement in admin doc" 2024-08-27 19:29:46 +00:00
Artem Goncharov
8c3113b513 Update hacking to latest version
Change-Id: I00cc5a3f35747411aaeac4ef41da9c3793da5530
2024-08-22 19:00:55 +02:00
Artem Goncharov
0d293d5c7e Enable hacking check in pre-commit
Hacking is a OpenStack style guide enforcement library. Many projects
use it.

Python imports sorting check in the hacking makes lot of sense since it
verifies the code is readable and matches the pep8 style as well.
Convert code base with `isort --profile open_stack --sl  --py 311
--honor-noqa  keystone` and 2 manual fixes so that hacking check passes
(it is a bit weird case, but black forces new line before comment in an
import while flake8-import-order thinks it is bad: keystone/api/auth.py.
So add a noqa here since there are currently no configuration options to
skip that.)

Change-Id: I31bd6d5f37910097ef0fae72f678c758411b5b03
2024-08-22 18:58:44 +02:00
Zuul
bb16ddf3bd Merge "Enable mypy" 2024-08-21 16:56:31 +00:00
Artem Goncharov
112331d9e9 Fix role statement in admin doc
Closes-Bug: 2076670
Change-Id: I843dcce351d664124c769d815f72cd57caa5e429
2024-08-14 17:37:46 +02:00
Artem Goncharov
4dbcce303c Replace deprecated in py312 datetime usages
- replaced `datetime.utcnow` with `oslo_utils.timeutils.utcnow`
- replaces `datetime.utcfromtimestamp(X)` with `datetime.fromtimestamp(X,
  datetime.timezone.utc).replace(tzinfo=None)`

Change-Id: Iae1656d55f5960d2b9873a8a36ca6d9140e2742e
2024-08-09 08:58:27 +02:00
Zuul
831d9098a2 Merge "Add keystone-manage reset_last_active command" 2024-08-07 16:36:46 +00:00
Douglas Mendizábal
e9513f8e4f Add keystone-manage reset_last_active command
This patch adds the `reset_last_active` subcommand to the
`keystone-manage` command line tool.

This subcommand will update every user in the database that has a null
value in the `last_active_at` property to the current server time. This
is necessary to prevent user lockout in deployments that have been
running for a long time without `disable_user_account_days_inactive` and
later decide to turn it on.

This patch also includes a change to the logic that sets
`last_active_at` to fix the root issue of the lockout.

Closes-Bug: 2074018
Change-Id: I1b71fb3881dc041db01083fbb4f2592400096a31
2024-08-06 22:45:30 -04:00
Zuul
f45921840c Merge "Re-join the strings after re-formatting" 2024-08-02 17:17:59 +00:00
Zuul
9682ebcf48 Merge "Move bandit to pre-commit" 2024-08-02 17:17:57 +00:00
Zuul
bf82973ba3 Merge "Only log a small debug message for NotFound" 2024-08-02 17:17:54 +00:00
Boris Bobrov
d01cde5a19
Correct format for token expiration time
Tokens with expiration time limited by application credentials had an
incorrect format.

Fix the format, control it with the test.

Closes-Bug: 2075723
Change-Id: I09fe34541615090766a5c4a010a3f39756debedc
2024-08-02 17:42:33 +02:00
Jadon Naas
7ac0c3cd33 Update OIDC Apache config to avoid masking Keystone API endpoint
The current configuration for the OIDCRedirectURI results in
mod_auth_openidc masking the Keystone federation authentication
endpoint, which results in incorrect responses to requests for
Keystone tokens. This change updates the documentation to
recommend using a vanity URL that does not match a Keystone
API endpoint.

Closes-Bug: 2075349
Change-Id: I1dfba5c71da68522fdb6059f0dc03cddc74cb07d
2024-08-01 21:13:17 -04:00
Zuul
f0352c5481 Merge "Enable pyupgrade" 2024-07-26 20:26:41 +00:00
Zuul
267474d318 Merge "Enable black in pre-commit" 2024-07-26 19:44:38 +00:00
Zuul
fb0180a164 Merge "Add a release note to cover fix of implied role for application credentials" 2024-07-26 16:25:59 +00:00
Artem Goncharov
80db930895 Enable mypy
Enable mypy and fix/ignore found issues.

With mypy it is possible to declare/define optional or mandatory
attributes in the base classes. Those are checked statically with mypy
making existing validations and tests in the code unnecessary.

Change-Id: I7246d4e68386e9f72559e8948c475e5916359922
2024-07-26 14:06:23 +02:00
Artem Goncharov
aa95af38ea Enable non-voting OpenAPI build job
We are going to start building OpenAPI using codegenerator directly in
the Keystone and move all the schemas into the codebasis. It is going to
be very helpful to immediately see whether generation is possible and
the OpenAPI spec is valid. Thus adding it as non-voting for now (and it
makes no sense of having non-voting job in gate).

Change-Id: Iaf418d69cbb55fbe9dde3f2ec4213e64345057c2
2024-07-26 09:52:07 +00:00
Artem Goncharov
8416b72bff Re-join the strings after re-formatting
After reformatting there are some cases of previously strings split
across the lines were simply placed on a single line ("foo " "bar baz").
Join such cases properly.

Change-Id: Ie56d5ca35d3e0983a73554916f5399837a3b35b4
2024-07-26 11:45:16 +02:00
Artem Goncharov
204ea42232 Move bandit to pre-commit
Ensure committing locally will raise bandit check errors before we push
the change by putting it into the pre-commit. Since pre-commit is
already invoked in the pep8 env we can drop bandit from there.

Change-Id: I4d9d5aa283fb6cb91d610e23c6a44e98d8df46aa
2024-07-26 11:44:25 +02:00
Artem Goncharov
aaf0cc8fae Enable pyupgrade
pyupgrade is a tool (and pre-commit hook) to automatically upgrade
syntax for newer versions of the language. It helps getting rid of
syntax required for older python versions not supported anymore and
prepare us for easier support of newer python versions. The tool is
already used in some other OpenStack projects, so it is time to start
using it also for Keystone.

The change is generated by uncommenting the pre-commit hook and
executing `pre-commit run -a` to convert the data. The same could be
also achieved by simply trying to commit and adding converted files in
few iterations.

Change-Id: Ia1f64709e57ebb4e44db128bfea4c5957b2071df
2024-07-26 11:43:25 +02:00
Artem Goncharov
55e8c1e605 Enable black in pre-commit
With this black performs linter check even before the commit is created
allowing devs to spot issues before sending change to the CI.

With this we also switch from flake8 to pre-commit to ensure we run the
same tests locally and in the CI thus preventing accidential drift.

Change-Id: I121f55a2f00817dc4b6061933752b81e01d62cb4
2024-07-26 11:42:33 +02:00
Artem Goncharov
5f66f8d4ad Add blackify commit to blame ignore
In order to keep git blame not overloaded with recent reformat changes
add the reformat commit to the ignore list.

Change-Id: I0b474143d07436d9b92cbe98e9caafe8318c2719
2024-07-26 10:05:15 +02:00
Dr. Jens Harbott
d4695b318e Only log a small debug message for NotFound
NotFound exceptions happen regularly during normal operations,
e.g. when doing "openstack role show member", so don't make a fuss
about them.

Change-Id: I59ad6fe4ff167a431eae943dd261d4a69c21e980
2024-07-25 17:53:11 +02:00
Zuul
181dc7b03f Merge "Blackify the keystone code base" 2024-07-24 17:15:09 +00:00
Artem Goncharov
a00839ca02 Blackify the keystone code base
Improve code maintainability by enabling us to use automatic code
formatter. We use black as a relatively fast code formatter (ruff is an
lternative, but it will immediately require also changing all quotes
chaos). In the next change black is going to be added into the
pre-commit allowing contributors to spot formatting issues before
sending code to the CI sending precious run hours. Same steps has been
performed in the openstasksdk/cli and partially nova.

Steps performed:
- `black -l 79 -S keystone`
- add exceptions to the tox.ini for the lines which black decided not to
  split

Following files are polished manually due to noqa headers and similar
being reformatted to wrong strings:

keystone/auth/plugins/totp.py
keystone/common/password_hashing.py
keystone/tests/unit/ksfixtures/__init__.py

Change-Id: I832ec4c152fa58fb0088d9f880add86a20ec95fc
2024-07-22 09:02:23 +02:00
Zuul
04fdf7c0e6 Merge "Fix bindep for py312 job" 2024-07-19 16:50:01 +00:00
Zuul
6db53e793c Merge "Add pre-commit" 2024-07-19 16:49:59 +00:00
Dmitriy Rabotyagov
09c57923fc Add a release note to cover fix of implied role for application credentials
Change-Id: I627eac6934a056a921e922de4c898faccb2cb968
2024-07-15 15:19:22 +02:00
gtema
c3c6d9854c Fix implied roles in the application credentials
When user requests new application credentials without specifying roles
explicitly all current roles from the token are being used for that
(including implied roles).
When new application credentials are requested specifying a role that
implies another role (i.e. member) only that role is added into the
list. This is not what is expected, so change it by looping through
every requested role and add every implied role into the list if it is
not already there.

Related-Bug: https://bugs.launchpad.net/keystone/+bug/2030061

Change-Id: I452313ac7e1e6960748bcd1e667fb7c0076eb7a2
2024-07-15 15:09:41 +02:00
Artem Goncharov
24113bb182 Fix bindep for py312 job
python-all-dev is not available on the newer ubuntu images
(ubuntu-nobble). Replace it with `python3-dev` as used by majority of
other OpenStack repositories. This change does not fix the tests, it
just ensures tests are being executed.

Change-Id: I860ca5e6259459716e606a4c76002164d6a18668
2024-07-12 20:30:33 +02:00
Artem Goncharov
430bebe376 Add pre-commit
As a starting point for the code renovation it makes sense to add
pre-commit with the same configuration as we spread across the other
services. For now comment out hooks that fail and address them one by
one.
At the end of the series we would have pre-commit executing all the
necessary checks (linting, flake, black, mypy, etc) and it will be
invoked directly in the `tox -e pep8` to unify all the processing. We
are going to re-format source code with `black` adding revisions to
git blame ignore to reduce amount of noise. This will help us to have
reasonable formatting of the code with possibility to just auto-format
the code.

Change-Id: Ia00f4209cde8f64828dc2d827d49bfc4bd6c1efa
2024-07-12 20:30:33 +02:00
Zuul
1b78b57ec5 Merge "Improve configuration of out-of-tree identity drivers" 2024-07-12 18:16:30 +00:00
Zuul
0bc2af48d5 Merge "reno: Update master for unmaintained/zed" 2024-07-03 05:51:31 +00:00
Zuul
90695d8da6 Merge "Add test with noauth for s3tokens and ec2tokens" 2024-06-28 17:14:41 +00:00
Zuul
3353ca1456 Merge "Remove SQLAlchemy tips jobs" 2024-06-28 17:14:38 +00:00
Zuul
89b2f1cb60 Merge "do not use str(url) to stringify a URL for subsequent use" 2024-06-28 17:14:36 +00:00
Zuul
1ea4a15e9e Merge "Replace use of testtools.testcase.TestSkipped" 2024-06-28 16:21:27 +00:00
Stephen Finucane
53d547fcb8 Replace use of testtools.testcase.TestSkipped
This has been deprecated for removal [1]. Use the stdlib variant
instead.

[1] https://github.com/testing-cabal/testtools/commit/59b890db3c

Change-Id: I7701872d2de44bb7c8296501015c24d0741adc93
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2024-06-24 10:43:09 +01:00