Commit Graph

42 Commits

Author SHA1 Message Date
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
Colleen Murphy f5348d3a2e Add vine to lower-constraints
The newest vine release (5.0.0) is incompatible with the version of amqp
used on stable branches and results in test errors[1]:

  "AttributeError: False does not have the attribute 'info'"

Ensure the lower-constraints tox environment uses the same version of
vine as defined in upper-constraints.txt.

[1] https://zuul.opendev.org/t/openstack/build/78dfcdd4272241459fb904aa70600e5b

Change-Id: I4b9b11b89e9f4120ae4b7fb8e213628dd9e8121c
2020-09-24 09:40:31 -07: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
Ghanshyam Mann 0ba9e3a12e Fix gate by running l-c job on Bionic
l-c job template moved the l-c jobs running on Focal
and currently fails on many constraints.

Let's keep running l-c job on bionic as it was before and we
can move it to Focal once issues are identified and fixed.

- Fixing the hacking tests which are behaving differently between
< 3.8.0 (until Ubuntu Bionic) and 3.8.2 (Ubuntu Focal).

Squashing below review also
- https://review.opendev.org/#/c/750786/

Co-Author: Lance Bragstad <lbragstad@gmail.com>

Change-Id: If733e9824d87d8c73797f753e4daf95489bed9c2
2020-09-10 20:25:27 -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
Zuul b187dfd05a Merge "requirements: Drop os-testr" 2020-07-29 14:18:21 +00:00
Vishakha Agarwal 3de085b1eb Fix lower-constraint for PyMySQL
keystone does not have any lower constraint for PyMySQL so the
latest version 0.10.0 is picked by the job which is failing [1]
In OpenStack, PyMySQL upper constraint is .9.3 means that version
is tested not 0.10.0 [2] let's add PyMySQL lower constraint also
so that we test lower-constraint job with correct lower version.

[1]https://zuul.opendev.org/t/openstack/build/3077d96f4fff4b7985cb763d0635d471/log/job-output.txt#621
[2]https://github.com/openstack/requirements/blob/master/upper-constraints.txt#L384

Change-Id: I3834b3b34641c006c70614d5331d292c41f8a346
Closes-Bug: #1888886
2020-07-24 19:58:30 +05:30
Zuul c74ef439ef Merge "Cap jsonschema 3.2.0 as the minimal version" 2020-07-16 02:08:50 +00:00
Stephen Finucane 5b552d8785 requirements: Drop os-testr
We migrated to os-testr some time ago. There's no reason to keep this
around as a dependency.

Change-Id: Iedde135b9de03229c27ed57638d0c404169f43ab
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-07-09 11:15:04 +01: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
Andreas Jaeger 7820cafffe Switch to newer openstackdocstheme and reno versions
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* parallelizing building of documents

Update Sphinx version as well.

openstackdocstheme renames some variables, so follow the renames. A
couple of variables are also not needed anymore, remove them.

Set openstackdocs_auto_name to use project as name.
Set openstackdocs_pdf_link to link to PDF file.

Remove docs requirements from lower-constraints, they are not installed.

Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.

See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html

Change-Id: I320a69816b4101bb76b88448881f3177c892ea92
2020-05-21 13:43:22 +00: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
Stephen Finucane 5c71ebd7a9 Stop explicitly requiring pycodestyle
pip doesn't have a dependency resolver. Instead, it "simply uses the
first specification it finds for a project." [1] In Train, keystone
switched from hacking 0.12.x/0.13.x to hacking 1.1.x [2]. That change
explicitly added a pycodestyle dependency for reasons that aren't
entirely clear to me, but pip's broken dependency resolution leads to
the below funkiness when trying to install the dependencies.

  ERROR: flake8 2.6.2 has requirement pycodestyle<2.1,>=2.0, but you'll have pycodestyle 2.5.0 which is incompatible.

As seen below, this can be easily reproduced and seems to happen because
pip doesn't go further than one level of dependencies, meaning it knows
about the dependency on flake8<2.7.0,>=2.6.0 from hacking, but not the
dependency on pycodestyle<2.1,>=2.0 that this in-turn introduces.

  $ virtualenv venv
  $ source venv/bin/activate
  $ (venv) cat requirements.txt
  hacking>=1.1.0,<1.2.0 # Apache-2.0
  pycodestyle>=2.0.0 # MIT License

  $ pip install -r requirements-new.txt
  Collecting hacking<1.2.0,>=1.1.0
    Using cached ...
  Collecting pycodestyle>=2.0.0
    Using cached ...
  Collecting six>=1.10.0
    Using cached ...
  Collecting flake8<2.7.0,>=2.6.0
    Using cached ...
  Collecting pbr!=2.1.0,>=2.0.0
    Using cached ...
  Collecting mccabe<0.6,>=0.2.1
    Using cached ...
  Collecting pyflakes!=1.2.0,!=1.2.1,!=1.2.2,<1.3,>=0.8.1
    Using cached ...
  ERROR: flake8 2.6.2 has requirement pycodestyle<2.1,>=2.0, but you'll have pycodestyle 2.5.0 which is incompatible.
  Installing collected packages: six, pycodestyle, mccabe, pyflakes, flake8, pbr, hacking
  Successfully installed flake8-2.6.2 hacking-1.1.0 mccabe-0.5.3 pbr-5.4.3 pycodestyle-2.5.0 pyflakes-1.2.3 six-1.12.0

The solution is simple: stop explicitly requiring this dependency and
instead rely on flake8 bringing it in.

[1] https://pip.pypa.io/en/stable/user_guide/#requirements-files
[2] I3fc591e09c1e25a3bd2a3922880772ea9617f1e3

Change-Id: Ic0991d3eeae018609be0ecbd43fa0b0b9f13d6ba
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-10-17 08:18:25 +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 6e4d06861e Pin Werkzeug in lower-constraints
upper-constraints pins Werkzeug to a known working version. The
lower-constraints job uses a different constraints file, the
locally-maintained lower-constraints.txt, which didn't pin Werkzeug and
resulted in the job breaking on the most recent 0.15.0 Werkzeug release.
This change pins Werkzeug to match the known working version in
upper-constraints. If and when upper-constraints raises its cap, we can
address the breakage on the regular unit test jobs.

Change-Id: I926e79e34072505f9edc4879b1d9237a3b85accd
2019-03-19 23:56:08 +01: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
Corey Bryant eca0829c4c PY3: switch to using unicode text values
In Python 3, python-ldap no longer allows bytes for some fields (DNs,
RDNs, attribute names, queries). Instead, text values are represented
as str, the Unicode text type. Compatibility support is provided for
Python 2 by setting bytes_mode=False [1].

Update the keystone LDAP backend to adhere to this behavior by using
bytes_mode=False for Python 2 and dropping UTF-8 encoding and decoding
fields that are now represented as text in python-ldap.

[1] More details about byte/str usage in python-ldap can be found at:
http://www.python-ldap.org/en/latest/bytes_mode.html#bytes-mode

Note that at a minimum python-ldappool 2.3.1 is required. For more
details see Depends-On's below.

Change-Id: Ifdd0644cd7042407a008c85c0b2c40a971c90bc3
Closes-Bug: #1798184
Depends-On: https://review.openstack.org/611401
Depends-On: https://review.openstack.org/613632
Depends-On: https://review.openstack.org/614052
2019-01-14 14:25:39 -05: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 090886902c Use pycodestyle in place of pep8
The lower version of pycodestyle lib (aliased to pep8) doesn't work
for py36 env. This commit unblocks the py36 gate by adding a
dependency on pycodestyle and using that for style checks.

Bump the "hacking" lib version to v1.1.0 which depends
on a higher verion of pycodestyle.

Change-Id: I3fc591e09c1e25a3bd2a3922880772ea9617f1e3
2018-11-20 17:16:01 +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
wangxiyuan 604e9dff0c Remove unused lower constraints
Change-Id: I1000482ea96b8c3d14358a6baef3a5de667f29f2
2018-11-06 16:52:33 +08: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
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
Zuul 059fa7eb83 Merge "Add project_id filter for listing limit" 2018-07-18 20:34:00 +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
Dirk Mueller 0fa6f97891 Switch to python-ldap
pyldap is deprecated and merged with python-ldap, so we should depend
on it directly instead of the deprecated wrapper. For details see
https://pypi.org/project/pyldap/

Change-Id: I2c8ee2c792a476fe12c234a55af24144e6b511cd
Depends-On: https://review.openstack.org/#/c/582973/
2018-07-16 17:33:38 +02:00
Zuul 0414441d93 Merge "pycrypto is not used by keystone" 2018-06-29 12:17:45 +00:00
Matthew Thode 9cece8220e
pycrypto is not used by keystone
remove unused libs from constraints

Change-Id: If8bb1e90d5a4de1d0c831e0b337ca1aaab711a1f
2018-06-28 09:50:12 -05: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 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
Nguyen Hai 0c5242b618
Fix incompatible requirement in lower-constraints
Fix lower-constraints don't match the lower bounds
in the requirements file(s). It causes fail in
requirements-check.

REF:
http://lists.openstack.org/pipermail/openstack-dev/2018-April/129056.html

Change-Id: I1fbb434e03a39c0352048d9e5a5c49d172b3413d
2018-04-06 12:17:26 -05:00
Doug Hellmann 6cb71c36c4 add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: Ide4d192e390ac78f860634014f2437dd6ea7b919
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-23 08:40:54 -04:00