12731 Commits

Author SHA1 Message Date
Lance Bragstad
07a66b9c2e Mark the implied role API as stable
This API has been in keystone for a long time and we never updated it
to stable, yet we treat it like a stable API. This change updates the
JSON home document to reflect that. This is also consistent with
discussions during the Rocky PTG:

  https://etherpad.openstack.org/p/keystone-rocky-ptg-json-home

Change-Id: I0b5aef233d9e51799595802d0812015866727987
2018-03-16 16:04:27 +00:00
Zuul
6077dd1a45 Merge "Remove @expression from tags" 2018-03-07 15:46:12 +00:00
OpenStack Proposal Bot
e05e2b5a60 Updated from global requirements
Change-Id: I2af74b855bcf10a172d21b9b34f1a286edf7c115
2018-03-04 10:06:12 +00:00
Zuul
b1dd387ab7 Merge "Api-ref: fix resource_limit format" 2018-03-03 14:31:15 +00:00
OpenStack Proposal Bot
c4cac492e5 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I21e0c6ab1c985981747fce83b91724834de8daaa
2018-03-01 06:33:40 +00:00
Gage Hugo
94ef945885 Remove @expression from tags
This change makes tags a property of Project instead of a hybrid_property
since we will always have a Project contain some list of tags.

Change-Id: I1033321132cb3ec71bf94b8293cef91dfc6b8272
Co-Authored-By: Morgan Fainberg <morgan.fainberg@gmail.com>
Closes-Bug: #1752301
2018-02-28 11:23:16 +00:00
Zuul
a419d9b2d0 Merge "Consolidate endpoint-filtering.rst" 2018-02-27 13:30:07 +00:00
Zuul
85ddaa0250 Merge "Remove unnecessary config overrides from fernet tests" 2018-02-27 12:37:46 +00:00
wangxiyuan
f0c0634a92 Api-ref: fix resource_limit format
the resource_limit type is integer, not array.

Change-Id: I62fa0a82092945e7d5e866b27eb66a9a6a4e7d86
Closes-bug: #1751755
2018-02-27 11:19:57 +00:00
Zuul
991a36aa29 Merge "Correct typo in identity API reference" 2018-02-26 11:13:01 +00:00
Nathan Kinder
615ee81b8a Correct typo in identity API reference
This corrects a simple typo in the unified limits API reference.

Change-Id: I94ad9d2d79d9b1b187547d8129b617f7b919d8bb
2018-02-26 01:23:31 -08:00
OpenStack Proposal Bot
149753348c Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I46d6715129845dbfad47475fc826f4bb7927f76a
2018-02-26 06:37:44 +00:00
Suramya Shah
7abb53fb05 Consolidate endpoint-filtering.rst
Consolidate from configuration.rst into endpoint-filtering.rst.

Change-Id: Ie6ba10b71b1a25f8aa0470235b27723c529a6288
2018-02-23 12:25:47 +05:30
Lance Bragstad
a10b6ae5b9 Remove unnecessary config overrides from fernet tests
The fernet token unit tests had a bunch of config_fixture overrides to
populate the fernet max_active_keys configuration option with its
default value.  Since it is just setting these to the default, it's
not necessary to provide overrides when it's already established in
keystone.tests.unit.core.TestCase.

Change-Id: Id09459104d9b5ec412ec60211ef71b7c7c62b14f
2018-02-22 23:18:27 +00:00
Lance Bragstad
70dea443c1 Make assertValidFernetKey assertion more robust
This assertion was a bit misleading in that it seemed to validate
one key at a time. But the implementation of the assertion actually
assumes it is given a list of string values. This commit fixes the
name of the assertion to be more clear and it also makes the
assertion iterate all values given, which ensures each key in the
list is valid, not just the first one.

Change-Id: Ifc9542e4e7f57f54d473183c97f616f92cb0961b
2018-02-22 22:10:59 +00:00
Lance Bragstad
1175a356fc Update 3.10 versioning to limits and system scope
This should have been done before the queens release. I noticed it
when looking at the API reference and only seeing application
credentials listed under 3.10 information.

Change-Id: I6f2d9551d15061dbe99e9228c097e735910a41db
2018-02-21 20:11:16 +00:00
Lance Bragstad
8948050c03 Remove v2.0 policies
In queens the v2.0 APIs were removed. This commit removes the
leftover v2.0 policies documented in the sample policy file.

Change-Id: Ibb841bcbc12d0be365ddb2681310a0eee6724782
2018-02-20 22:38:17 +00:00
Zuul
baedf62836 Merge "Force SQLite to properly deal with foreign keys" 2018-02-20 18:19:21 +00:00
Zuul
68df7bf1f3 Merge "Populate application credential data in token" 2018-02-20 04:50:33 +00:00
Lance Bragstad
796198f196 Populate application credential data in token
Without this patch, the token formatter does not have enough data to
construct a token created with an application credential. This means
that if the token cache is disabled or expired, when keystone goes to
create the token it will not find any application credential information
and will not recreate the application_credential_restricted parameter in
the token data. This patch creates a new Payload class for application
credentials so that the application credential ID is properly persisted
in the msgpack'd payload. It also adds more data to the token data
object so that the application credential ID and name as well as its
restricted status is available when the token is queried.

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

Change-Id: I322a40404d8287748fe8c3a8d6dc1256d935d84a
Closes-bug: #1750415
2018-02-19 22:41:12 +01:00
Zuul
c80df22669 Merge "Simplify federation and oauth token callbacks" 2018-02-19 17:16:42 +00:00
Zuul
7c96e99301 Merge "Simplify token persistence callbacks" 2018-02-19 17:16:39 +00:00
OpenStack Proposal Bot
3bc1de8bc5 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I3a43afcaa64388ac5e212766731350652f61ed03
2018-02-18 06:57:52 +00:00
Lance Bragstad
dd91f41c0a Simplify federation and oauth token callbacks
The token provider listened for specific callbacks from the
federation and oauth APIs. These were mainly for token invalidation
and token persistence removal. Now that the sql token driver and uuid
token provider have been removed, we can remove the need for
persistence notifications.

Instead, both of these cases can use a generic token cache
invalidation callback. This makes the token provider Manager simpler
because it only has to listen for a single internal notification to
invalidate the token cache, instead of multiple. It also makes the
code sending the notification easier to understand because it's
clearer about what it's doing.

Change-Id: I3281a013ce2764872dda8c183c4e9851974e1d14
2018-02-16 21:41:30 +00:00
Lance Bragstad
c7658abfd6 Simplify token persistence callbacks
The INVALIDATE_USER_TOKEN_PERSISTENCE and
INVALIDATE_USER_PROJECT_TOKEN_PERSISTENCE callbacks were meant to
clean up invalid tokens from the token storage layer. Now that the
sql token driver has been removed, we don't need them any more. This
commit removes those notifications and refactors the places where
notifications are still needed, making them more specific and not
eluding to token persistence.

This commit also removes a significant amount of logic from the
assignment API that used to notify the token API when assignments
were deleted. This made sense when tokens were written to disk
because there was an opportunity to invalidate them when users were
removed from projects. This is no longer needed since we do
validation online and we don't persist tokens anymore.

Change-Id: I100b7416e8ba61eb4ea2c2eb4962e952a53ea388
2018-02-16 21:40:07 +00:00
Lance Bragstad
db91bfc8c8 Refactor token cache invalidation callbacks
There are several cases where we need to invalidate the token cache.
Notifications are used to do this and the token provider API uses
callbacks to subscribe to those notifications. This commit makes them
all use a single callback function instead of each defining their own
just to do the same thing. A subsequent patch will refactor the term
"persistence" from the notification names used across keystone.

Change-Id: I5e78f8aafec74e3edb952ab92947503c9be38b91
2018-02-15 20:38:57 +00:00
Lance Bragstad
1b8d0589ce Remove needs_persistence property from token providers
Since the sql token storage mechanism was removed in Rocky, we no
longer need hooks in the token Manager to determine if a token needs
to be retrieved from or written to a backend somewhere. Instead, token
providers will need to handle storage requirements if they need them.
This will result in a cleaner token provider interface.

Change-Id: Icc095987d41e9c08de2f34dc657b08b98bd944e4
2018-02-15 20:38:54 +00:00
Zuul
be644b773e Merge "Remove unused class variables from token provider" 2018-02-15 19:51:20 +00:00
Zuul
4732c67792 Merge "Imported Translations from Zanata" 2018-02-15 15:56:37 +00:00
OpenStack Proposal Bot
1cf11faeae Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I96dabd4b5944f464379c82e230e20f74ad12da6a
2018-02-15 07:08:14 +00:00
Zuul
b91b00e355 Merge "Add docs for application credentials" 2018-02-15 06:45:13 +00:00
Zuul
3eeb4901b3 Merge "Remove domains *-log-* from compile_catalog" 2018-02-14 21:41:08 +00:00
Colleen Murphy
25996a8534 Add docs for application credentials
Add documentation in the User section on managing, using, and rotating
application credentials.

Since application credential support didn't make it into
python-openstackclient in the Queens release, show examples using
python-keystoneclient.

Change-Id: I24bc51d2f3741771ba321fc05d49fd111aa76c15
2018-02-14 20:33:48 +01:00
David Stanek
ed2b65a5dd Force SQLite to properly deal with foreign keys
This will help with testing since SQLite will start enforcing the
foreign key relationships.

We will still have a problem with migrations for tables that refer to
each other. SQLite can't alter tables and sqlalchemy-migrates tmp table
strategy for migrations fails in this situation.

This patch did:
1. Add FK support for the tests. Disable it by default.
2. Make sure the Fk is disabled for test_sql_upgrade and
identity.backens.test_sql

Partial-Bug: #1744195

Co-Authored-By: wangxiyuan<wangxiyuan@huawei.com>
Change-Id: I276af7c0125dc2cb2c54215d54491665db1caa22
2018-02-14 16:54:15 +00:00
Lance Bragstad
34d65037b5 Remove unused class variables from token provider
These two were just chillin' as token provider class variables. They
are not used anywhere and we use special notification strings defined
in notification.py for good reason. Keeping things defined in one
place makes maintenance easier. Remove the unused variabels from the
token provider.

Change-Id: I98f29114daa01df94f12813143da9097c294b43a
2018-02-14 16:12:10 +00:00
Zuul
fae0296ab2 Merge "Imported Translations from Zanata" 2018-02-14 15:08:30 +00:00
Zuul
14626a8fb1 Merge "Delete system role assignments when deleting groups" 2018-02-14 09:08:17 +00:00
Zuul
9e1ee1b509 Merge "Expose bug in system assignment when deleting groups" 2018-02-14 09:08:14 +00:00
OpenStack Proposal Bot
e99dfd57ee Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I991979dd41217c34c5267cdfc99f0d95ea11193f
2018-02-14 07:12:20 +00:00
Zuul
e196fb9f52 Merge "Grant admin a role on the system during bootstrap" 2018-02-14 06:55:55 +00:00
Zuul
3376bf8fda Merge "Fix querying role_assignment with system roles" 2018-02-14 06:55:50 +00:00
Zuul
d877d5690b Merge "Expose bug in /role_assignments API with system-scope" 2018-02-14 06:55:47 +00:00
Lance Bragstad
3c524e6491 Grant admin a role on the system during bootstrap
Now that we have system scope in place, we should make sure at least
one user has a role assignment on the system. We can do this at the
same time we grant the user a role on a project during bootstrap.

This is backwards compatible because even if a deployment doesn't use
system-scope, the assignment will just sit there. The deployment will
have to opt into enforcing scope by updating configuration options
for oslo.policy to enforce scoping.

This shouldn't prevent deployments from fixing bug 968696 and using
system scope.

Closes-Bug: 1749268

Change-Id: I6b7196a28867d9a699716c8fef2609d608a5b2a2
2018-02-13 21:37:31 +00:00
Lance Bragstad
8748e729b2 Fix querying role_assignment with system roles
This commit removes system role assignments when querying keystone
for a list of assignments pertaining to a specific role. For example,
`GET /v3/role_assignments?role.id={role_id}`, now returns assignments
only for that role. Previously, the list contained false positives
because some system role assignments weren't being removed. This
was introduced in queens with the system scope work.

Change-Id: Iab35ae01bb715da5813e62cd09900de555dceaaa
Closes-Bug: 1748970
2018-02-13 21:37:15 +00:00
Lance Bragstad
5a24b96d95 Delete system role assignments when deleting groups
Keystone removes role assignments that groups have on projects and
domains when deleting groups. This should apply to system role
assignments, too.

Change-Id: Iebedfcae0b77e350e5359b97fa87894af3f1c8ba
Closes-Bug: 1749267
2018-02-13 20:47:54 +00:00
Lance Bragstad
3fa997531f Expose bug in system assignment when deleting groups
Project and domain role assignment are cleaned up when deleting
groups. This commit introduces a test case that shows this isn't the
case for system role assignments. A subsequent patch will implement
a fix to make sure system role assignments are removed when groups
are deleted, to be consistent with project and domain assignments.

Change-Id: I9b452aff144fd8867cdac2f44cbcaa0d1de63a12
Partial-Bug: 1749267
2018-02-13 20:38:05 +00:00
Lance Bragstad
3a3b3c5b5a Delete system role assignments when deleting users
Keystone removes role assignments that users have on projects and
domains when deleting users. This should also apply to system role
assignments, too.

Change-Id: Ied51b9c3b58714b2d5dbcb933eca1839d1351fc7
Closes-Bug: 1749264
2018-02-13 20:24:10 +00:00
Lance Bragstad
25596b874c Expose bug in system assignment when deleting users
Project and domain role assignment are cleaned up when deleting
users. This commit introduces a test case that shows this isn't the
case for system role assignments. A subsequent patch will implement
a fix to make sure system role assignments are removed when users
are deleted, to be consistent with project and domain assignments.

Change-Id: I1a1e7395f462159037e939aa143e9e24aefb1841
Partial-Bug: 1749264
2018-02-13 20:10:00 +00:00
Lance Bragstad
a226a3d8be Expose bug in /role_assignments API with system-scope
The role_assignment API supports a bunch of query parameters that
gives users flexibility when querying for role assignments. This
commit exposes an issue when querying keystone for a specific role
using /role_assignments?role.id={role_id}. The expected result was
that the returned list would only contain role assignments for that
specific role ID. The actual result is a set of role assignments with
that role ID and all system role assignments.

This caused issues in tempest because tempest goes through and cleans
up resources using `tearDownClass`, and it is common to remove
specific roles used in the test class. The problem is that keystone
queries the role assignment API for all role assignment with a
specific role ID, which is the equivalent to
`GET /v3/role_assignments?role.id={role_id}` when deleting a role. The
list returned included false positives, which were system role
assignments, resulting in revocation events getting persisted for
users in those role assignments. This prevented the administrator in
tempest from cleaning up the rest of the resources because the
revocation event would make the token being used to do resource
cleanup.

This commit exposes the bug using tests.

Change-Id: If93400be3c9d3fe8e266bb36c16accca93d77154
Partial-Bug: 1748970
2018-02-13 19:12:16 +00:00
Zuul
69b8815d04 Merge "Remove the sql token driver and uuid token provider" 2018-02-13 18:13:11 +00:00