Commit Graph

258 Commits

Author SHA1 Message Date
Stephen Finucane 8c9462f6fa db: Remove legacy migrations
sqlalchemy-migrate does not (and will not) support sqlalchemy 2.0. We
need to drop these migrations to ensure we can upgrade our sqlalchemy
version.

Change-Id: I31ba9e4f129a7cc28744e814b5fd28eb284ae3de
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-28 17:26:39 +00:00
Stephen Finucane f24c77c774 Bump SQLAlchemy minimum version
Change-Id: I13eb367a46a5c47c8a79f621bb6fa4d7c3915c15
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-28 17:26:06 +00:00
Ghanshyam Mann 1561da645b Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: Id276f7efef3ef955b4c0b4b8d62f7c38cb535b33
2022-04-30 17:16:49 -05:00
Ghanshyam Mann 6f87111a92 Explicitly check policy name in policy warning tests
This commit makes keystone tests for oslo policy
warning to check policy name explicitly. oslo policy
3.10 modified the warning text to include the policy
name as well as the check-str so new warning message
verified in keystone test will not work on old
oslo policy (<3.10), so bumping the oslo.policy
in requirements.txt

Change-Id: I14132dfced48ddc93c29ce2b4c20ed2cabc1dbd6
2021-12-16 18:26:00 -06:00
Ghanshyam Mann e057378b82 Fix oslo policy DeprecatedRule warnings
Since 3.7.0, oslo policy started the DeprecationWarning[1] if
deprecated_reason and deprecated_since param are not passed
in DeprecatedRule or they are passed in RuleDefault object.

These warnings are logged for every test which increase the
log size and sometime can full the log buffer and fail the
job.

[1] https://github.com/openstack/oslo.policy/blob/3.7.0/oslo_policy/policy.py#L1538

Change-Id: Id9d89a04b480cbdcefead93ce55a1f174f948f5d
2021-08-20 14:30:23 -05:00
Ghanshyam Mann 256160b849 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: Ic65d2fd6ce7215b4a47a6fb41b9cbf991f27773b
2021-02-01 17:36:29 +00:00
Ghanshyam Mann db25e505a3 [goal] Migrate testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8 support
in their later version.

Story: #2007865
Task: #40190

Closes-Bug: #1886298

[1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal

Change-Id: I5712f29beee2bd7d8ba857c0ce2cd2287646d6b0
2020-09-16 15:33:44 -05:00
Raildo Mascena c0d63cecd8 Bump pysaml2 requeriment to avoid CVE-2020-5390
Although, Keystone doesn't use the pysaml2 signature on [0]
Would be nice to bump the pysaml2 version for, at least, 5.0.0[1] in
order to have the the CVE fix included[2].

[0]https://opendev.org/openstack/keystone/src/branch/master/keystone/federation/idp.py#L440-L521
[1] https://github.com/IdentityPython/pysaml2/releases/tag/v5.0.0
[2] https://github.com/advisories/GHSA-qf7v-8hj3-4xw7

Change-Id: I1d3776f7f1feb6485feecb140703f23027ca3a6f
2020-08-24 15:31:55 -03:00
Hervé Beraud 4d86f37aaf Cap jsonschema 3.2.0 as the minimal version
Previous versions of jsonschema (<3.2.0) doesn't support python 3.8 [1].
Python 3.8 is part of the victoria supported runtimes [2] so we now force
to use jsonschema version 3.2.0 to avoid issues, remove ambiguity and ensure
that everything works with python 3 in general.

[1] https://github.com/Julian/jsonschema/pull/627
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: Ia5f000e13f7973383fc0379266fe8d47e451eb31
2020-05-26 21:51:43 +02:00
Zuul c908edb2db Merge "Parse cli args in get_enforcer" 2020-04-22 11:06:04 +00:00
Andreas Jaeger af916d9baa Remove Babel as requirement
This repo does not use Babel as requirement. See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014227.html

Change I8636e7c86c6c5c608429fab88e181108ae615db9 added it temporarily,
it's time to remove it again.

Leave it in lower-constraints in case dependencies pull it in.

Change-Id: I66bfedcbe30c89a65355e5ab1db6996640d2bfcf
2020-04-21 08:15:48 +02:00
Ben Nemec ba8dd06e12 Parse cli args in get_enforcer
Previously this call to the conf object couldn't parse cli args
because the oslo.policy tool was registering its cli opts on a
private conf object, so attempting to parse them on the global
object would fail. The dependency makes oslo.policy use the global
object instead so cli arg parsing works correctly.

This is important because ignoring cli args as this was previously
doing caused things like --config-file to be dropped, which meant
that running the tool with that option specified did not work as
expected.

Depends-On: https://review.opendev.org/690628
Change-Id: Id553743277a35660a40d6b3b02847d7a35abbfb9
Closes-Bug: 1849518
2020-03-23 22:16:58 +00:00
Jon Schlueter e5bab15a09 remove oslo-concurrency from requirements
many years ago when eventlet support was dropped
the usage of osl_concurrency was also removed.
commit was here I963d94bbd188dbb6eba68623a42c5bc3f2289da4
dropping requirement on it since it is not used

Change-Id: I72f278b7da59096f71f0e59f0fb1f70f93265aa4
2020-03-17 08:39:37 -04:00
Vishakha Agarwal 4530041931 Remove six usage
This repo does not support Python 2 anymore, so we don't need
six for compatibility between Python2 and 3, convert six usage to Python
3 code.

Change-Id: Icba56808f38277b27af2ae5aac4b8507dee71b3b
2020-01-30 06:06:51 +00:00
Colleen Murphy 049d9bcbe4 Add access rules to token validation
This change adds application credential access rules to the token model
and ensures that only clients (that is, keystonemiddleware) that support
access rule enforcement are allowed to validate tokens containing
access rules.

Depends-on: https://review.openstack.org/633369

bp whitelist-extension-for-app-creds

Change-Id: I301651369cf03e06550bc29eb534506674e56a1f
2019-09-14 03:14:36 -07:00
Colleen Murphy e8151070c0 Suppress policy deprecation warnings in unit tests
Since the WSGI app is reinitialized pretty much for every unit test, and
we have deprecated so many policies, we get hundreds of megabytes of
deprecation warnings in the unit test logs. This is unnecessary for unit
tests, a noisy hindrance to developers, and causes a high failure rate
in our CI due to the huge logs. This change fixes the issue for the unit
tests by adding warnings filters for DeprecationWarnings and
UserWarnings from oslo.policy and oslo.context.

This does not solve the issue that deployers see a lot of noise in their
logs. However, since production servers aren't reinitializing the WSGI
app quite so often, it's a less severe issue.

Related-bug: #1836568

Change-Id: Iaa7eae03bde7ab43a8c5a5886686f834cf7ec620
Depends-on: https://review.opendev.org/673932
2019-08-05 14:23:17 -07:00
Lance Bragstad 092570fc5e Implement system scope and default roles for token API
This commit adds protection testing for the token API along with
changes to default policies to properly consume system-scope and
default roles.

Originally, this work was going to include the ability for project and
domain administrator to validate, check, or revoke tokens within the
context of their authorization (e.g., a domain administrator could
revoke tokens on projects within their domain). This seems like extra
work for not much benefit since we're using bearer tokens. The holder
of the token can do anything with that token, which means they can
validate it or revoke it without using their own token. Adding
project and domain administrator support seems unnecessary given the
existing functionality. If someone comes forward asking for this
functionality, we can re-evaluate the effort. For now, this patch is
limited to system user support, allowing them to validate, check, and
revoke any token in the system. Service users can still validate
tokens on behalf of users. Users can do anything they wish with their
own tokens.

This commit also bumps the minimum version of oslo.log so that we can
use the official TRAIN deprecated release marker.

Change-Id: Ia8b35258b43213bd117df4275c907aac223342b3
Closes-Bug: 1818844
Closes-Bug: 1750676
2019-06-17 15:57:51 +00:00
Colleen Murphy 6828a01eac Uncap jsonschema
The requirements check doesn't like it when upper-constraints isn't the
authoritative upper bound for a dependency. upper-constraints already
caps this library at 2.6.0.

Change-Id: I6033066b5e2fafb3104f7c9e1642c9b51ca923d0
2019-04-16 18:09:14 -07:00
Lance Bragstad e619912484 Add PyJWT as a requirement
A subsequent patch will be using this library to create JWS tokens.
Here, we are requiring a minimum version of 1.6.1 since that version
includes an exception exposed from PyJWT that we need in keystone:

  9d980786c9

bp json-web-tokens

Change-Id: I6b4b565fc7160fffe5e445673ccea9b3bba584d6
2019-01-31 19:42:09 +00:00
Lance Bragstad 4ffdc6c650 Bump oslo.policy and oslo.context versions
oslo.policy 1.43.1 includes support for domain scope types, which we
will need moving forward as we implement basic default role support.

oslo.context 2.22.0 includes support for domain-scoped tokens which
allows for better integration with oslo.policy.

We aren't going to consume oslo.policy 1.43.0 because it can possibly
log passwords for users when performing user operations with fully
logged RBAC enforcement data.

Change-Id: I44fd26d73fc5a331355542751eeb640ea394eb6e
2018-12-10 18:46:24 +00:00
Zuul ffeb6b3ad7 Merge "Bump sqlalchemy minimum version to 1.1.0" 2018-11-27 21:56:16 +00:00
Lance Bragstad 0dc5c4edab Pass context objects to policy enforcement
The oslo.policy library actually accepts context objects as a first
class citizen, instead of a hand-built `creds` dictionary. This is a
perferred approach because it's easier for services to use
oslo.context to generate a context object that they can automatically
pass to oslo.policy for enforcement instead of inspecting the context
object and building a dictionary manually to pass to oslo.policy.

This commit makes allows keystone to partake in this by pulling the
keystone request object, which is a subclass of oslo.context's
RequestContext object, and uses it in enforcement. Additionally,
we're overriding the to_policy_values() method of oslo.context
in order to make sure we port keystone-specific values to the policy
dict representation of a context object. This ensures we have values
present that we rely on with our default policies.

This commit also bumps the lower requirement for oslo.policy to
make sure we're always using a version that understands context
objects.

Change-Id: I63e713f4aebf3e8cf5189a6060569d2828bc364d
2018-11-26 19:48:10 +00:00
wangxiyuan bc6b2f1b0b Bump sqlalchemy minimum version to 1.1.0
Sqlalchemy add a new class for hybrid property in v1.1.0[1]. It
can solve the password length problem for User password SQL obj.

[1]: https://docs.sqlalchemy.org/en/latest/changelog/migration_11.html#change-3653

Change-Id: I7a18bd528607ec5112cc55c7682f95d61be8b509
Closes-bug: #1735250
2018-11-12 14:54:31 +08:00
Zuul 2af3707ace Merge "Remove pre-flask legacy code" 2018-10-24 08:29:20 +00:00
Lance Bragstad 6369796ebe Implement scaffolding for upgrade checks
One of the community goals for Stein is to implement a command-line
tool for operators that runs programmable checks that might impact
upgradability.

This commit lays down the basic structure for the upgrade checks and
ties it up to `keystone-status` command.

Story: 2003657
Task: 26135
Change-Id: I6586827104156ac549217967a1b9171f1a3b32e4
2018-10-17 16:54:53 -04:00
Morgan Fainberg 184c84ae76 Remove pre-flask legacy code
This removes common.controller, common.extension, common.router, and
common.wsgi. Relevant code from common.wsgi (used by AuthContext) was
moved into keystone.server.flask.request_processing.middleware.auth_context.

keystone.api.discovery now uses keystone.flask.base_url

test_middleware and test_exception were modified to reflect the changes
to the remaining code from keystone.common.wsgi

keystone.common.authorization only holds a couple constants for auth
work now.

Routes is removed from requirements.txt

Release-Note for migration to flask added.

Change-Id: I81563b6a49c8f12ecade058a9483f3b6f070dc72
Closes-Bug: #1776504
2018-10-15 10:56:26 -07:00
Tony Breeds 114cdeb7eb Move use of constraints out of install_cmd
If you have a -c in the install_cmd it gets used with all the deps
supplied this means that the lower-constraints job actually install from
upper-constraints :(

You can see what I mean in [1]
Note both lower-constraints.txt and upper-constraints.txt are used ; and
---
Collecting oslo.log===3.39.0 (from -c /home/zuul/src/git.openstack.org/openstack/requirements/upper-constraints.txt (line 247))
---

With this fixed we find a few minimums that needs to be bumped:

 * oslo.policy >= 1.33.0
   keystone uses the scope_types[2] kwarg to RuleDefault which was
   introduced in 52c82ff9ab04dd78ff7045cb30d2f5de535dd7da which is
   contained in 1.32.0  ; also we need the 'policy-in-code' feature
   which is in 1.33.0
 * oslo.log >= 0.38.0
   keystone used the ROCKY[3] constant for deprecations which was
   introduced in d68a895ee8e61b5c9d4ef368e7f04252e84649e9 which is
   contained in 3.38.0
 * msgpack >= 0.5.0
   the 0.4.x versions have been removed from pypi so we have to bump the
   minimum :(
 * SQLAlchemy >= 1.0.13
   identity_provider_id in token payload is byte in python3 which
   triggers a sqlalchemy bug[4]. The bug has been fixed in 1.0.13
 * keystonemiddleware >= 5.1.0
   unified limit feature uses system scope feature which is supported
   in keystonemiddleware after 5.1.0
   

We also add correct some errors in bindep.txt related to use on Fedora

[1] http://logs.openstack.org/47/599447/2/check/openstack-tox-lower-constraints/bbc912b/tox/lower-constraints-1.log
[2] http://git.openstack.org/cgit/openstack/keystone/tree/keystone/common/policies/access_token.py#n24
[3] http://git.openstack.org/cgit/openstack/keystone/tree/keystone/conf/default.py#n50
[4] http://docs.sqlalchemy.org/en/latest/changelog/changelog_10.html#change-a14dd2e73d889d065acc07a77b1ee7cb

Change-Id: Ic0de6799fddd86a70abae2c87c92d565072ebdb9
2018-09-12 03:54:38 +00:00
Matthew Thode e41065849c
Update the minimimum required version of oslo.log
keystone/conf/default.py is calling versionutils.deprecated.ROCKY
which was added in 3.37.0

Change-Id: I26a8febbee4bb485d7b5ac444520161475d0646f
2018-09-03 13:49:37 -05:00
Zuul 0da0874dcb Merge "Bump lower constraint for pysaml2 to 4.5.0" 2018-07-19 23:23:03 +00:00
Lance Bragstad 56b8578809 Bump lower constraint for pysaml2 to 4.5.0
Known moderate severity security vulnerability detected in pysaml2
<=4.4.0. Let's bump our requirements pass the versions with known
vulnerabilities.

Change-Id: I235062eace1fa9f581018f2eec519f3cbea11ef7
2018-07-18 17:56:22 +00:00
wangxiyuan dca9a05c7c Add project_id filter for listing limit
Add project_id filter for listing limit. This filter
can be only used by system-scoped request to fetch the
specified project's limits.

bp: strict-two-level-model

Change-Id: I1b8cc227ed0710702aa099f09821f6eb897bb32c
2018-07-17 12:00:08 +08:00
Morgan Fainberg 8dd2235cbc Add Flask-RESTful and update flask minimum(s)
Keystone's move to flask requires more than the general Flask library
as Keystone is a RESTful (ish) API. We will be using Flask-RESTful for
the easier mechanism to implment a REST API than standard flask
blueprints.

This also increases the base flask minimum requirements to unblock
requirements updates (flask has been updated in g-r to minimum of
1.0.2)

Partial-Bug: #1776504
Change-Id: I398acad439f4e525df3ca4e17fdd3e3ba90d58cc
2018-06-27 09:58:35 -07:00
Morgan Fainberg 8bf335bb01 Remove pastedeploy
This patchset removes the lingering code that supported paste.deploy
that is obsolted by the loader wrapped around keystone's use of Flask.

 * The keystone-paste.ini file has been removed.

 * All options have been removed (without deprecation) as they are no
   longer referenced.

 * The TokenAuthMiddleware code (with deprecation warning) has been
   removed as it was only provided to ensure compatibility with paste.ini
   files that were not updated (ensuring not breaking a deployer that
   did not update paste.ini file to remove it from the pipeline).

 * Paste deploy entrypoints have been removed.

Change-Id: I35064a440ef718f50c7e644e8b2d56a99c3ec74f
2018-06-06 19:30:26 +00:00
Morgan Fainberg 4ec6bc5a44 Convert Keystone to use Flask
Basic conversion of Keystone's core application to flask framework.

This doesn't add much in the way of flask-specific-isms but should
get keystone running directly under flask. This implementation does
not use paste-deploy.

Change-Id: Ib4c1ed3f645dd55fbfb76395263ecdaf605caae7
2018-06-04 20:14:41 -07:00
Matthew Thode 7c4c6a5fb3
Use the new pysaml2 constraints
Also updates lower-constraints as needed

Change-Id: Ic28b1e035e28a973ddda88dcb9cdaf91ee003e21
2018-04-06 12:17:54 -05:00
OpenStack Proposal Bot 7d8f525a1c Updated from global requirements
Change-Id: I8b77f4293a549d089349323471aaa1a358c4e544
2018-03-26 08:05:44 +00:00
OpenStack Proposal Bot ac4baf99f0 Updated from global requirements
Change-Id: I83d4b1b4ea6b6168c10288d00ac7b18a3449fb21
2018-03-17 08:34:34 +00:00
OpenStack Proposal Bot c16ed74402 Updated from global requirements
Change-Id: I196d41ddf16805197072a2182febfa4adef19f2d
2018-03-15 07:02:56 +00:00
OpenStack Proposal Bot e05e2b5a60 Updated from global requirements
Change-Id: I2af74b855bcf10a172d21b9b34f1a286edf7c115
2018-03-04 10:06:12 +00:00
OpenStack Proposal Bot ad6a2bce2a Updated from global requirements
Change-Id: I399e08cbd0d5fa519bd0a1995d61cbda340f34bb
2018-01-17 20:36:58 +00:00
Dirk Mueller aa482b3ac0 msgpack-python has been renamed to msgpack
Change-Id: I2469c62106a51c7cc8f44fc8e4a47dc69381dbd4
Related-Bug: #1743445
2018-01-15 20:41:13 +01:00
OpenStack Proposal Bot 4e70a5d1b7 Updated from global requirements
Change-Id: I44d25161c74587a2a15e048539fc210676f747ca
2017-12-19 01:19:50 +00:00
OpenStack Proposal Bot cfbc2aa30b Updated from global requirements
Change-Id: Ie618102f34453dd6c6a776839d687ffbd62f2529
2017-12-07 13:25:34 +00:00
OpenStack Proposal Bot ccbad41bd2 Updated from global requirements
Change-Id: I1cea76ecb31e790f34483c388e8271341e2f707b
2017-11-29 08:58:14 +00:00
OpenStack Proposal Bot dd0f7876d2 Updated from global requirements
Change-Id: I508ab26c6537104b1783f6653f04d85d885ef9d2
2017-11-16 11:06:56 +00:00
OpenStack Proposal Bot d2da034a93 Updated from global requirements
Change-Id: I55b360f23bca8b22e79bd7884cb415b87e8bf4e4
2017-11-13 10:19:51 +00:00
OpenStack Proposal Bot 82a761746e Updated from global requirements
Change-Id: Ie305b778b7ebb80e8901666b433b07b74804fe80
2017-11-03 17:51:18 +00:00
OpenStack Proposal Bot 47dbd25625 Updated from global requirements
Change-Id: Iedadaedc5ee5174358415eaeda0a1f069e4ae522
2017-10-12 21:54:46 +00:00
OpenStack Proposal Bot fdb6adf055 Updated from global requirements
Change-Id: I3e5bb988ef2dfe93442cb5eada086313d22d5857
2017-09-22 12:52:15 +00:00
OpenStack Proposal Bot a1f19c73b6 Updated from global requirements
Change-Id: I1e451ebff88a14928fe7d4014a837e11dfb91f6d
2017-08-24 05:50:44 +00:00