Commit Graph

13 Commits

Author SHA1 Message Date
Radomir Dopieralski 34a0159d1a Add system scope support to context switcher
Change-Id: Idd2ec7ae6e978a358b4b3639e86cadae06c90976
2021-11-26 14:09:46 +01:00
Ivan Kolodyazhny ee6fa9a245 Remove Keystone v2 related code
Kyestone V2 support was removed in Train, so it's safe to do such cleanup.

* Functions which just return horizon settings are dropped and
  the settings are referred directly now.
* The service catalog in the sample test data is updated to match
  the format of the keystone API v3.
* Related to the above change of the sample service catalog,
  openstack_dashboard.test.unit.api.test_keystone.ServiceAPITests is
  updated to specify the region name explicitly because 'RegionTwo'
  endpoint is no longer the second entry of the endpoint list in the
  keystone API v3.

Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>
Change-Id: Ib60f360c96341fa5c618595f4a9bfdfe7ec5ae83
2020-04-23 11:43:12 +09:00
Ivan Kolodyazhny 086c6607ef Add auth_type to template context for openrc file rendering
We need to path auth_type value to the template because different
templates could be rendered for credentials and websso auth_type.

Closes-Bug: #1871806
Change-Id: If218813e0b4a8cc51c4e590081c5f3c50b35b8a7
2020-04-09 09:19:47 +00:00
Ivan Kolodyazhny 5dd2bf5fb6 Remove six usage from openstack_auth package
We don't support Python 2 anymore so we don't need this
compatibility library.

Change-Id: I0ecd706af1b4432fe439472189444141853c9d0b
2020-01-09 16:54:54 +02:00
Akihiro Motoki ac7ac272b3 pylint: fix several coding convention violations
openstack_dashboard/context_processors.py:94:15: C0122: Comparison should be link['url'] != 'horizon:project:api_access:openrcv2' (misplaced-comparison-constant)
openstack_dashboard/settings.py:467:4: C0412: Imports from package horizon are not grouped (ungrouped-imports)
openstack_dashboard/enabled/_1370_project_vg_snapshots.py:9:0: C0301: Line too long (86/80) (line-too-long)
openstack_dashboard/enabled/_1360_project_volume_groups.py:9:0: C0301: Line too long (85/80) (line-too-long)
openstack_dashboard/usage/base.py:62:8: W0106: Expression "[instance_list.extend(u.server_usages) for u in self.usage_list]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:43:12: W0106: Expression "[public_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:75:12: W0106: Expression "[community_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/api/glance.py:47:4: C0412: Imports from package glanceclient are not grouped (ungrouped-imports)
openstack_dashboard/api/cinder.py:60:4: C0412: Imports from package cinderclient are not grouped (ungrouped-imports)
openstack_auth/user.py:358:4: E0211: Method has no argument (no-method-argument)
openstack_auth/user.py:362:4: E0211: Method has no argument (no-method-argument)
openstack_dashboard/api/keystone.py:75:4: C0412: Imports from package keystoneclient are not grouped (ungrouped-imports)
horizon/loaders.py:43:16: W0706: The except handler raises immediately (try-except-raise)
horizon/themes.py:174:8: W0706: The except handler raises immediately (try-except-raise)

Change-Id: I40cf3ffbc4519657e11180d2e2fe7401387c5556
2019-01-17 00:05:27 +09:00
Akihiro Motoki a8edb5059d pylint: fix simplifiable-if-statement/expression
Change-Id: I9af66f886c47d3d2be61cba22b6c84460a178b8e
2019-01-16 13:08:08 +09:00
Thomas Bechtold 069329eeb2 Drop pki token check from Token class in openstack_auth
PKI Tokens got removed from Keystone in 2016[1] so this check is no
longer needed.

OPENSTACK_TOKEN_HASH_ALGORITHM setting is dropped
as it is used only in PKI token check.

[1] https://review.openstack.org/#/c/374479/

Change-Id: I2de02fe6fab531842752b03c5e17af2bcf502cd8
2018-12-09 16:58:25 +09:00
Jose Castro Leon 7fc8018956 Allow to specify redirections on single IdP scenarios
In scenarios where the cloud operators have only a single Identity Provider,
we can have a default redirection to remove unnecessary user clicks and
improve user experience.

Closes-bug: #1784368

Change-Id: I251703dcaeac43174fbcba7e0658c6f92098b2e0
2018-08-13 12:11:45 +02:00
Adrian Turjak 88fb018840 Rework DEFAULT_SERVICE_REGIONS
DEFAULT_SERVICE_REGIONS is cumbersome when you have
more than one keystone endpoint and all you want to do
is set a global default service region.

This adds '*' as an optional fallback key to mean global default.
If an endpoint matches it will take precedence over the '*' value.

This also fixes the precedence order for DEFAULT_SERVICE_REGIONS
so that a user controlled cookie is used instead when that cookie
is valid for the given catalog. This changes the way the setting
works, but retains the intended result the setting was originally
intended for.

Change-Id: Ieefbd642d853fcfcf22a17d9edcc7daae72790a4
blueprint: global-default-service-region
Closes-Bug: #1772345
Related-Bugs: #1359774 #1703390
2018-07-17 13:58:24 +12:00
Akihiro Motoki 11eb4e9d3e Fix W503 warnings
W503 line break before binary operator

Looking at the code base, it sounds okay to follow this check.

Change-Id: Id511e0104dc6de5b204021661d4a8776ca6d3658
2018-04-11 18:13:47 +09:00
Akihiro Motoki 71993e3c98 Drop deprecated settings
- HORIZON_IMAGES_ALLOW_UPLOAD (deprecated in Newton)
- CUSTOM_THEME_PATH (deprecated in Mitaka)
- DEFAULT_THEME_PATH (deprecated in Mitaka)
- OPENSTACK_TOKEN_HASH_ENABLED (deprecated in Mitaka)
- TOKEN_DELETION_DISABLED
  (not documented but it was marked as deprecated in Ocata
   in django-openstack-auth commit 5810f9c6)

The related logics related to dropped deprecated settings
have been dropped too.

- custom_path and default_path of get_available_themes() were
  dropped as they are no longer needed in favor of
  the removal of CUSTOM_THEME_PATH and DEFAULT_THEME_PATH.
- Unused remove_project_cache(), is_token_deletion_disabled()
  and delete_token() have been dropped.

Change-Id: Ic9406623cc092884c4136f78fb967b129bfda487
2018-03-23 18:37:02 +09:00
Akihiro Motoki 1a252cb5e8 django2: is_authenticated/is_anonymous is now property only
https://docs.djangoproject.com/en/2.0/releases/1.10/#user-is-auth-anon-deprecation

blueprint django2-support
Change-Id: I57a39417f0595eae8d1c06d7e61d0a67078bb231
2018-02-17 01:36:54 +09:00
Rob Cresswell e3e5812b19 Add Django OpenStack Auth to Horizon
Moves Django OpenStack Auth content to Horizon, since they are so
tightly coupled. This cleans up the development workflow and should
make keystone / auth related contributions easier.

Implements: blueprint merge-openstack-auth
Change-Id: Ia1cdc47bad1ca6e633073a9f9445b0c7f70d05bc
2017-09-27 12:06:57 +01:00