Commit Graph

26 Commits

Author SHA1 Message Date
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
Lance Bragstad 87a39635eb Convert policy API to flask
Migrate the policy APIs to use flask-native dispatching.

Change-Id: I03fc72b19e85df711b213c1fe47b30b3f9f91d6c
Partial-Bug: #1776504
2018-08-31 07:14:32 +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 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
Lance Bragstad 88d840e3ce Use keystone.common.provider_api for endpoint_policy 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: Ic38ee0128b6a5a486ab9854c4e331d6df62c5cb9
2017-12-27 16:56:49 +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
Lance Bragstad b272068e52 Ensure the endpoint policy API supports HEAD
This commit makes it so all endpoint policy GET APIs also support
HEAD.

Change-Id: Ib8eada4847506cc41eeb1e323752473608c38df5
Partial-Bug: 1696574
2017-06-20 19:44:43 +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
Jenkins 498d700c65 Merge "Create unit tests for endpoint policy drivers" 2016-11-10 13:45:23 +00:00
Steve Martinelli 810e15689b Remove stable driver interfaces
bp removed-as-of-ocata

Change-Id: I4672cf7d9d72ef725212085972dbcd90db0e47cf
2016-09-28 17:18:37 +00:00
Harini 97585c15a6 EndpointPolicy driver doesn't inherit interface
Added the driver interface 'base.EndpointPolicyDriverV8' as super class
of the sql driver implementation.

Removed unused methods from driver interface and added release notes.

Change-Id: I198dcbda7591e0dafb1da3a72e3f32b258c0e299
Closes-Bug: #1611102
2016-09-07 15:07:51 +05:30
Samuel de Medeiros Queiroz c4784d77f0 Create unit tests for endpoint policy drivers
This change adds unit tests for the current version of the endpoint
policy abstract driver.

It also clarifies the return type of get_policy_association in the
endpoint policy abstract driver definition.

Change-Id: Idde4b139ef4d1b048901f5a0a1fd9df3b6836994
2016-08-10 10:18:36 -03:00
Dolph Mathews d9c6b50a3a Replace keystone.common.config with keystone.conf package
keystone.common.config is 1200+ lines of super dense, merge-conflict
prone, difficult to navigate, and finicky to maintain code. Let's follow
nova's lead and break it down into more manageable modules.

This patch creates a new Python package, keystone.conf, and moves all of
our configuration options into it, mirroring nova's nova.conf package.

There are a couple special modules in keystone.conf introduced here as
well:

- keystone.conf.__init__: This causes all of Keystone options to be
  registered on import, so consumers of keystone.conf don't have
  races with config initialization code while trying to use
  oslo_config.cfg.CONF directly (keystone.conf replaces all uses for
  oslo_config.cfg.CONF in keystone).

- keystone.conf.base: Keystone's [DEFAULT] group options. I'd prefer
  this to be called 'default.py', but I'm just copying nova's lead here.

- keystone.conf.opts: The entry point for oslo.config itself.

- keystone.conf.constants: There are a few constants (deprecation
  messages, default paths, etc) that are used by multiple configuration
  modules, so they need to live in a common place.

Change-Id: Ia3daffe3fef111b42de203762e966cd14d8927e2
2016-06-24 17:02:15 +00:00
Jamie Lennox da6ea7e224 Pass a request to controllers instead of a context
Instead of the unformed context dictionary pass a full request object
with access to the context_dict so that existing functions still work.
After this we can replace smaller usages of the context dict with
functions and properties on the request directly.

Change-Id: Ibe822ed7c76a24a7d31d98ce62f873a01e5fb213
2016-06-08 14:56:52 +10:00
Samuel de Medeiros Queiroz a4a2ab6d4c Restructure endpoint policy abstract driver
Change I5ff9c4e4b6d64750f5db2a73cc4317358aea0649 restructured the
identity subsystem. As part of the change, the abstract driver
was extracted to identity/backends/base.py

This change does the same for the endpoint policy subsystem.

Change-Id: Ia7fb2b49cdbe75831a971cce3f33f0cfa269816b
2016-04-27 16:23:47 -03:00
Navid Pustchi aabc213040 Fix D401 PEP8 violation.
Currently tox ignores D401 (401: First line should be in imperative mood).
This change removes it and make keystoneauth docstring compliantwith it.

Change-Id: I136cf810f47c4c19f29216907a63f226930b5082
Partial-Bug: 1570049
2016-04-14 20:08:52 +00:00
Grzegorz Grasza 0e156737d0 Use the new enginefacade from oslo.db
EngineFacade is deprecated. This partially switches keystone to
use oslo.db.sqlalchemy.enginefacade. 'get_session' and 'get_engine'
methods are still used in sql migrations and related tests.

Change-Id: I221232d50821fe2adb9881f237f06714003ce79d
Partial-Bug: #1490571
2016-02-24 08:20:12 -08:00
Brant Knudson c807d1734a Remove useless {} from __table_args__
There's no need to have {} on __table_args__.

Change-Id: Ic094b6a40c3525d393203cf3dab2f6fc5ffa92c7
2016-02-19 13:06:21 -06:00
Brant Knudson c937b765ad Reference driver methods through the Manager
The driver methods should be referenced through the Manager when
possible so that the Manager can modify the driver call or return
value if we need to.

Change-Id: I66bda7a9b8a6a2cce6d9999e26f14a78a0ae4fef
2016-01-07 14:44:02 -06:00
Samuel de Medeiros Queiroz e64a1b5891 Remove exposure of routers at package level
Keystone API routers are exposed at their package
level (in __init__.py files). This causes them to
be unnecessarily executed each time something
whithin that package is used.

For example, simply importing
keystone.federation.constants would make the
federation routers code to be executed.

This patch remove routers exposure from package
level and import them directly in services.py,
which is the single place that needs them.

Change-Id: If68184c871ac77659ad2e64aa5f0aafac7a4bf70
2015-12-03 15:06:56 -03:00
Dave Chen 5070039812 Using the right format to render the docstring correctly
There are several issues in the docstring, the format is not
correct, not using the full path of class etc.

This patch corrects all of them, so the docstring will be rendered
correctly.

Change-Id: I04d5818f38b5e75b6f6197ef5e13dcd64ed91bf4
2015-11-24 04:37:14 +00:00
Jenkins 3d89038bd6 Merge "Enable try_except_pass Bandit test" 2015-11-06 10:52:00 +00:00
Dolph Mathews 618cb4a894 Fix D202: No blank lines after function docstring (PEP257)
No other PEP257 violations were addressed in this patch.

Change-Id: Ic2e2305d3f8e2c3c4b70c61c0868d310f14355be
2015-10-28 07:25:04 +00:00
Brant Knudson 068cba0047 Enable try_except_pass Bandit test
The try_except_pass test checks that pass isn't used in an except
block because it's the source of lots of security issues. The
current instances of pass in an except block are marked as nosec.

Change-Id: I73af6b80fa75286e96943026b7b71ad23dc1786b
2015-10-15 12:56:35 -05:00
Vivek Dhayaal ba317dedd8 Stable Keystone Driver Interfaces
Extended support for versioned driver classes to the rest of the
backends based on the design of the initial support for catalog backend @
https://review.openstack.org/#/c/218481/

partially Implements bp stable-driver-interfaces

Change-Id: I0078f6dc32932beb6db534ecf22b160097c5a090
2015-09-02 06:10:26 +00:00
Jamie Lennox 696c1569e8 Move endpoint policy into keystone core
Remove endpoint_policy as an extension and move it to a core resource.
For now we leave the database migrations in the extension directory
until we have a general policy for merging these into core.

DocImpact: You should no longer run the migrations for this extension.
Implements: bp replace-extensions
Change-Id: I6215b7df497c142a5e73b62543e0d76458c85f64
2015-05-25 15:27:08 +08:00