Commit Graph

299 Commits

Author SHA1 Message Date
Takashi Kajinami 307296af5e Deprecate templated catalog driver
Keystone provided two in-tree catalog drivers, sql and templated.
However the templated driver hasn't been properly maintained.
The default template had not been updated for 8 years until it was
recently updated by [1].

This deprecates the driver assuming it's not widely used and sql driver
meets usual requirements.

This also restores the image service endpoints which were wrongly
removed by [1].

[1] c32bedb654

Related-Bug: #2013473
Change-Id: Iadb7bd5d7c4cf82aea2a7dbc1d8c4dbe53b9f763
2024-03-13 22:09:30 +09:00
Takashi Kajinami 6c7020c51a Drop remaining references to eventlet options
Because these were removed by [1]. Also update the previous release
note to document the upgrade impact on catalog information (like
endpoint urls) including string interpolations requiring these removed
options.

[1] 2a3c73c49b

Change-Id: If78d0b93665410b86754ea35653ca9d4c15c81c5
2024-01-27 21:02:14 +09:00
Takashi Kajinami 2a3c73c49b Clean up deprecated options for eventlet server
The eventlet server implementation was removed during Newton, and have
not been used by any other implementations for a while.

Change-Id: I01f9adfc3e610d820c1834209d36c10568cccf41
2023-12-07 10:40:11 +09:00
Stephen Finucane 5d2ab6c63b db: Replace use of Query.get()
Resolve the following LegacyAPIWarning warning:

  The Query.get() method is considered legacy as of the 1.x series of
  SQLAlchemy and becomes a legacy construct in 2.0. The method is now
  available as Session.get()

Change-Id: I30d0bccaddff6a1d91fcd5660f490f904e7c8965
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-28 17:26:39 +00: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
Jose Castro Leon 6cdb3a8374 Allow to filter endpoint groups by name
While using the openstack client command, the list on endpoint filters
cannot be filtered by name. This adds an optional parameter on the query
to allow the name to be specified as filter. This fixes the behavior on
OSC to search.

Change-Id: Ia1cbc9f4ded8f2494b1bf7ba5e953be0dfaf11f5
Closes-Bug: #1828565
2019-07-18 08:57:50 +02:00
David Lyle ef331f46b4 Region update extra support
The region update API currently does not allow for adding any
extra values via the update API. This effectively means that while
an extra can be set at create time, they cannot be altered once
set, nor can any additional values be added.

This patch add the missing inclusion of extra to the new ref.

Change-Id: I6e99764c0e360656ddbb47ebb23fe9576c97b99f
Closes-Bug: #1729933
2018-11-07 22:57:11 +00:00
Zuul 06b024a223 Merge "Remove get_catalog from manage layer" 2018-08-17 16:57:43 +00:00
Zuul d93ef56da1 Merge "Add callback action back in" 2018-08-16 18:48:01 +00:00
Zuul 604141a230 Merge "Convert endpoints api to flask native dispatching" 2018-08-15 03:41:23 +00:00
Zuul 3280aaacfc Merge "Convert services api to flask native dispatching" 2018-08-15 01:01:54 +00:00
Zuul 68b2293fd9 Merge "Convert regions API to flask native dispatching" 2018-08-14 02:12:29 +00:00
Morgan Fainberg 56d9c30f8f Convert endpoints api to flask native dispatching
Convert endpoints api to flask native dispatching.

Change-Id: I684e6117dc7fdd535f2ae530d44e6d5088624793
Partial-Bug: #1776504
2018-08-13 20:06:20 +00:00
Morgan Fainberg 18c6e838b9 Convert services api to flask native dispatching
Convert the services api to flask native dispatching.

Change-Id: Ibdecc157e1f540bbd2b0378283ec09f5677798f0
Partial-Bug: #1776504
2018-08-13 20:06:11 +00:00
Morgan Fainberg 84c074f28c Convert regions API to flask native dispatching
Convert regions API to flask native dispatching.

Change-Id: Ic38065441adb33f1f0550a6ae4cb1bd94ff2e079
Partial-Bug: #1776504
2018-08-13 20:05:57 +00:00
Zuul 7618e9d11e Merge "Migrate OS-EP-FILTER to flask native dispatching" 2018-08-13 08:49:59 +00:00
Morgan Fainberg 4ec63548c2 Add callback action back in
Add the callback action to delete endpoint group association by project
that was dropped in the conversion of OS-EP-FILTER to flask.

Change-Id: Id16f18f6bac9b232564bc7643f282a8ca2bd7080
Partial-Bug: #1776504
2018-08-09 17:33:50 -07:00
Morgan Fainberg 8eaf0854ff Migrate OS-EP-FILTER to flask native dispatching
Migrate the OS-EP-FILTER API to flask-native dispatching. This does
not migrate the standard catalog "region", "service" or "endpoint"
APIs.

Change-Id: Ia7c2ab211e2f7fb136e5817390751121f97f4340
Partial-Bug: #1776504
2018-08-06 13:10:21 -07:00
zlyqqq 91b4009094 Unified code style nullable description parameter
We define unified parameter types for validating a request reference,
such as 'boolean', 'url' and 'description'. In order to keep the code
style consistent, each schema should use it in addition to its own
specific parameters.

For catalog schema, parameter 'description' in _region_properties and
_endpoint_group_properties has different definitions, which reduces the
readability of the code.

Change-Id: Ia94bc3368f3623a91ffde9a78d2310f8a8e290c2
2018-08-01 16:30:36 +08:00
wangxiyuan db5d2bcf1e Remove get_catalog from manage layer
the get_catalog method which is used by V2 now is used nowhere.

It's safe to remove it.

Change-Id: I709d82868531c4cb59c6a3195b8c9136473217e3
2018-07-31 10:45:16 +08:00
Morgan Fainberg 3e3ba18bfa Convert json_home and version discovery to Flask
Move the JSON Home Document and Version Discovery Documents out of
the webob-based mapper and into Flask.

This change removes the keystone.version.controller and
keystone.version.router modules as they have been moved into
keystone.api.discovery.

The keystone.api.discovery module is somewhat specialized as there
are no "resources" and it must handle multiple types of responses
based upon the ACCEPTS header (JSON Home or JSON). In lieu of the
flask-RESTful mechanisms, keystone.api.discovery utilizes bare
flask blueprint and functions. Minor scaffolding work has been done
to ensure the discovery blueprint can be loaded via the loader loop
in keystone.server.flask.application (a stub object in
keystone.api.discovery).

Partial-Bug: #1776504
Change-Id: Ib25380cefdbb7147661bb9853de7872a837322e0
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
Erik Olof Gunnar Andersson 1483e056bd Fixing multi-region support in templated v3 catalog
Previously each region had its own entry for each service_type
with only it's own endpoints listed. This patch changes this
so that each service type has the endpoints from all regions
listed.

We also move the flawed templated get_v3_catalog function call
from the base catalog class into the templated class.

Change-Id: Ifddf08990539b6ac7d8289d410092b2ae9f5cbed
Closes-Bug: #1703666
2018-03-13 11:10:08 -07:00
Lance Bragstad 2e778f829d Use keystone.common.provider_api for catalog APIs
This change converts the usage of self.<provider_api> to
keystone.common.providers_api.ProviderAPIs.<provider_api> in manager
and controller logic. This is the correct way to reference
providers from other managers and controllers now that dependency
injection has been eliminated.

Change-Id: I86e3e360b01b3ce27414c13da3d94e22076ee93c
2017-12-27 16:32:18 +00:00
Morgan Fainberg 81f9fe6fed Remove Dependency Injection
Refactors all of keystone's dependency injection to maintain a
single centralized repository of instantiated objects. This
means that we are no longer having to resolve order. All
objects that need to reference the various manager APIs simply
do so via the __getattr__ built into the Manager common object
or the ProviderAPIMixin object.

This is also the first step towards correcting our tests to
where they cannot run "load_backends" multiple times.

This forces any/all managers to properly run super()
as the way to register the api is via __init__.

This eliminates all use of the @dependency.requires and
@dependency.provides decorators, simplifying the objects
all around.

Any instantiations of a Manager after keystone is running
will now generate an error, ensuring everything for keystone
is running before handling requests. An exception is for
CLI and CLI tests, as the CLI may directly instantiate
managers and will not lock the registry.

Change-Id: I4ba17855efd797c0db9f4824936b49e4bff54b6a
2017-12-13 10:59:39 -08:00
Gage Hugo 665cca0161 Remove v2 schema and validation tests
With the removal of the v2.0 APIs in Queens, the schema
for specific v2.0 actions can be removed.

Change-Id: Id63dbdab0b13995e6d42d19f6c224f23a2ce8d19
2017-10-19 17:20:47 -05:00
Lance Bragstad 70ad022f70 Remove v2.0 service and endpoint APIs
These were deprecated in Mitaka and slated for removal in Queens.

bp removed-as-of-queens

Change-Id: I9fc718b48b64d5d607eb6ed53a0974d18ac41d3c
2017-08-31 20:17:54 +00:00
Lance Bragstad 5f4c2f5b8d Ensure the endpoint filter API supports HEAD
This commit makes it so all GET APIs within the endpoint filter API
support HEAD as well.

Change-Id: I6dd8b3f7494003bca110623a3b8133c81ff90877
Partial-Bug: 1696574
2017-06-13 14:03:14 +00:00
Jenkins 39c6b0ff53 Merge "Make use of Dict-base including extras explicit" 2017-03-31 20:11:14 +00:00
wingwj ca35d003dc Remove log translations in keystone
Log messages are no longer being translated. This removes all use of
the _LC, _LE, _LI, and _LW translation markers to simplify logging
and to avoid confusion with new contributions.

See:
http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html
http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html

Co-Authored-By: David Stanek <dstanek@dstanek.com>

Change-Id: I45862f944107c1b4b73aa4d2fd95940f0b67eb1b
2017-03-25 18:17:15 +00:00
Morgan Fainberg dce7c52de9 Make use of Dict-base including extras explicit
This change replaces the use of DictBase with the ModelDictMixin
for any SQL models that do not contain an extra column and renames
the DictBase to a more descriptive name of ModelDictMixinWithExtras.

A Docstring has been added indicating the continued usage of
ModelDictMixinWithExtras should not be done for any "new"
models.

Change-Id: I9a4767cacf7620e878df70084060f3e43e1318df
2017-02-06 19:15:15 -08:00
Morgan Fainberg 6f1079586e Do not call `to_dict` outside of a session context
Do not call `to_dict` outside of a session context as if to_dict
interacts with lazy-loaded relationships it can cause errors. For
the most part these are edge-cases and unlikely to happen.

A couple FIXMEs were added to restructure the calls to allow for
`to_dict` to be moved into a method that will act within a session
context.

Change-Id: I769c2cdea1b08a780093d27cdc70bce9f004017b
2017-01-25 06:12:20 +00:00
Kanika Singh 3039e6c4bc Handling of 'region' parameter as None
In V2 Endpoint creation it returns 500 error due to missing
'region'. So, changed the way of fetching the same parameter to handle
None case.

Change-Id: I5c9ef206193072da73d3990d5f77003124db8265
Closes-Bug: #1557166
2017-01-17 20:03:03 +00:00
Jenkins cdaf2c77d9 Merge "Replace tenant with project for keystone catalog" 2016-11-14 14:30:29 +00:00
Jenkins 474b762561 Merge "Deprecate `endpoint_filter.sql` backend" 2016-11-14 14:17:26 +00:00
Jeremy Liu e49a95ff6e Pass a request to controllers instead of a context
Some 'context' have not been changed to 'request',
this patch fix that.

Change-Id: I30c97c0be4141767543e04f6a954d158d2fb26e6
2016-10-29 21:19:08 +08:00
Dave Chen 4f92ac0461 Replace tenant with project for keystone catalog
Change-Id: I46113ba17f86b07545584aeddd2d92dc1f67dc98
Partial-Bug: #1017606
2016-10-16 11:20:12 +08:00
Jenkins 83bd595b22 Merge "Pass initiator to Manager as a kwarg" 2016-10-09 02:57:43 +00:00
Dave Chen fd3e6276a3 Deprecate `endpoint_filter.sql` backend
`endpoint_filter.sql` backend is the only left-over from
endpoint filter extension, all others has been moved into
keystone catalog dir.

This patch deprecate `endpoint_filter.sql` backend and
consolidate the backend with SQL backend.

This patch also update some related testcases to make sure
project id exists instead of some random uuids since original
logic from endpoint filter extension has the constraint and
this is make sense to inherent into SQL backend as well.

Partially implements: bp deprecated-as-of-ocata
Change-Id: I28b37fc98cf63da11c0dd200b5f657507c0bca6a
2016-10-09 09:26:07 +08:00
Jenkins eb55c2c9f1 Merge "Move audit initiator creation to request" 2016-10-08 00:58:51 +00:00
Lance Bragstad 86229b3e75 Pass initiator to Manager as a kwarg
Keystone's various Manager classes typically handle the sending of
a notification. In order to send the notification an `initiator` is
needed. All Manager CRUD methods typically ask for this as a kwarg
since it's not required in all cases.

Most of the controller layers pass the initiator value as a
positional argument. This commit makes it so the controller passes it
as a kwarg since that's how the Manager class method signature
describes it.

Change-Id: Ic805f6ea2767c9c5cf01aa04ad554773b9cc8c39
2016-10-07 15:20:45 +00:00
Jamie Lennox 9117e45d6e Move audit initiator creation to request
The audit initiator is basically a context with all the information
about the current operation available. This information is all gathered
from the request and context so we can simplify its generation by moving
it onto the request object.

Change-Id: If91eacd3e07e0d9cd825f92b06c0ac819b3daf8c
2016-10-05 11:42:03 +11:00
Steve Martinelli 810e15689b Remove stable driver interfaces
bp removed-as-of-ocata

Change-Id: I4672cf7d9d72ef725212085972dbcd90db0e47cf
2016-09-28 17:18:37 +00:00
Lu lei e7b845cca9 Replace six iteration methods with standard ones
1.As mentioned in [1], we should avoid using six.iterXXX
to achieve iterators. We can use dict.XXX instead, as it will
return iterators in PY3 as well.

2.In py2, the performance about list should be negligible,
see the link [2].

[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html

Change-Id: I8ca16e539d3bd1ef9ac685f1852a2f5e745f8731
2016-09-08 18:56:31 +08:00
David Stanek 42eda48c78 Distributed cache namespace to invalidate regions
dogpile.cache's region invalidation is not designed to work across
processes. This patch enables distributed invalidation of keys in a
region.

Instead of using a static cache key, we use the original cache key
and append a dynamic value to it. This value is looked up in
memcached using the region name as a key. So anytime the value of
the region key changes the cache keys in that region are
effectively invalidated.

Closes-Bug: #1590779
Change-Id: Ib80d41d43ef815b37282d72ad68e7aa8e1ff354e
2016-08-29 16:38:55 +00:00
Gage Hugo f250fe407b Add schema validation to create service in v2
Added validation for create service in the v2 api

Partially implements: bp schema-validation-extent

Change-Id: If6e24b6c0c005aa7568a652aed5ee9d8273d2da7
2016-08-01 10:30:40 -05:00
Henry Nash 511a860648 Move logic for catalog driver differences to manager
The templated catalog driver does not support some of the
association cleanup methods. Since these are called in normal
operation, we have to mask the raising of NotImplemented. This
masking is currently done in the controller, but should really
be done in the manager layer.

Testing is added for the methods affected at the manager layer,
and an existig v3 API test is tidied up.

Change-Id: Ie68774fef07678b67eb70b90a0e4b81fc0df88b9
2016-07-11 11:45:07 +01:00
Jenkins 7fd720be1f Merge "Move request validation inline" 2016-07-09 09:47:39 +00:00
Jenkins ee58ebb724 Merge "Use http_client constants instead of hardcoding" 2016-07-09 00:53:19 +00:00