Commit Graph

406 Commits

Author SHA1 Message Date
Akihiro Motoki 2baea728dd Retire project
In Queens development cycle, openstack_auth code was merged
into the horizon repository.

blueprint merge-openstack-auth

Change-Id: I74b10a90fe79fc768cfb8de6f68d3cd2f4938e51
2017-12-23 03:22:21 +09:00
Colleen Murphy 1fa9ae26cc Don't add required attribute to html form fields
In Django 1.10 a new Form property was introduced, defaulting to True,
which enabled HTML form validation for fields marked "required" in
Django. This changed old behavior, which was that required fields were
only validated server-side. This patch restores old behavior by setting
use_required_attribute to False for the inherited AuthenticationForm.

This problem arose because when WebSSO is enabled and a
non-keystone-credentials authentication method is selected from the
dropdown list, the now-hidden username and password fields are still
marked "required" and still validated client-side, even though they are
invisible to the user and cannot be filled in. It would be nice to fix
the javascript to properly turn the "required" attribute on or off
depending on what authentication method is selected and whether the
"required" fields are even visible, but for now this just restores the
behavior we had before Djanto 1.10.

Change-Id: I3e798a2288d9c33396b40a86b07ea8c163d3b525
Closes-bug: #1703109
2017-11-02 18:19:09 +01:00
OpenStack Proposal Bot 3d5a5aadfd Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Idf5ecc6044c4470cf4496fe7ca1eda2ee1e99679
2017-10-15 10:31:40 +00:00
OpenStack Proposal Bot 73941654bf Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Idc03c122787afcb1f3ba7d8ab630e0a15b5848a5
2017-09-20 10:58:49 +00:00
OpenStack Proposal Bot e45760d904 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I8479435468d52b48f68fbd6d49de83b7de550598
2017-08-21 10:04:55 +00:00
Mathieu Gagné 346c36d798 Add support for policy directories per service
This change introduces the POLICY_DIRS setting which adds the ability
to define multiple policy directories per service.

Blueprint: policy-dirs
Change-Id: Ie42f1aa68539b7388661ddfe2c265255cd574736
2017-08-17 12:23:31 -04:00
OpenStack Proposal Bot 3688a8243f Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I0ee8e7c43990706cb2cc57e159a6c4d2eec90a2b
2017-08-07 10:18:10 +00:00
OpenStack Proposal Bot 9ec35007f6 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Ifed8fbafd93150cc869fed256c64c9e7526b32d3
2017-07-25 10:35:32 +00:00
Jenkins 3fa43f1431 Merge "Imported Translations from Zanata" 2017-07-20 16:01:29 +00:00
Jenkins acd690ae6c Merge "Allow for manual setting of default service region in config" 2017-07-20 11:48:37 +00:00
OpenStack Proposal Bot 5af6603618 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I8169342b724fe533138d269a50d01b8797d23955
2017-07-20 10:12:40 +00:00
Jenkins c6c8982fc1 Merge "hacking: Drop import_exceptions from tox.ini" 2017-07-19 12:40:02 +00:00
Jenkins fb76589a26 Merge "Fix Django 1.11 Compatibility" 2017-07-18 15:06:39 +00:00
Rob Cresswell 601e1ad44c Fix Django 1.11 Compatibility
Implements: blueprint dj111
Change-Id: Idfaef58b2a069006f6d792e43041dd136097c413
Co-Authored-By: Adrian Turjak <adriant@catalyst.net.nz>
2017-07-18 12:30:37 +01:00
OpenStack Proposal Bot 33524c8d2c Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I859cd55204ac4837793d34ddc6b6bb014acc9779
2017-07-13 10:22:29 +00:00
Rob Cresswell a0af708a49 Fix default mutable arg in k2k.py
Change-Id: I9e8d838315d521874e6f92922a9f488ee7029dbc
2017-07-11 15:33:08 +01:00
Timur Sufiev 3227365bc6 Allow for manual setting of default service region in config
In case DEFAULT_SERVICE_REGIONS setting in Horizon config is specified
(on a per-endpoint basis), use it instead of a value stored in
cookies. This value is still checked for sanity, i.e. it should be
present in Keystone service catalog.

Change-Id: Ia4787b56db7ce7787bd8aac21b5c0ec8a95a6f09
Related-Bug: #1506825
Closes-Bug: #1703390
2017-07-10 16:27:20 +02:00
Akihiro Motoki 28144e9a2f hacking: Drop import_exceptions from tox.ini
Current hacking check actually does not check attribute-level
imports. We can safely drop import_exceptions from tox.ini.

Also drops noqa to guard import exceptions from the same reason.

Change-Id: I4e37931a7bfb0aa7867d027125ffcf66e414cf08
2017-07-08 23:19:23 +00:00
Jenkins a1e421e0b7 Merge "Add support for a domain dropdown menu at login" 2017-07-03 21:01:15 +00:00
Colleen Murphy 35a2fb35a7 Add support for a domain dropdown menu at login
On clouds that use domain-specific Identity configuration[1], a user
must provide both their username and domain in order to log into
horizon. Without this patch, users must be aware of their domain's name
and enter it into a text box at login. This is sensible on public
clouds, because supplying potential domains to an unauthenticated user
exposes too much information about other customers and makes potential
attacks easier. On private clouds, however, it is a hinderance to
usability. For example, when migrating from a single-domain
configuration to a multi-domain configuration, users must now guess or
be informed of their domain in order to enter it in the text box. As
another example, when keystone domains are mapped to Active Directory
domains, the user may not be used to having to know their AD domains and
would prefer to select a likely one based on their geographical location
or department from a dropdown menu.

This patch adds support for a new config option,
"OPENSTACK_KEYSTONE_DOMAIN_DROPDOWN" for enabling a dropdown menu
instead of a textbox when MULTIDOMAIN_SUPPORT is enabled. The dropdown
is disabled by default. If enabled, choices for domains to display and
submit are configured in "OPENSTACK_KEYSTONE_DOMAIN_CHOICES". It is not
possible to dynamically generate a list of domains before the user has
authenticated and this would be a huge security hole if this was
possible. Requiring the admin to statically set the domain list allows
them to hide private domains like the service users domain.

[1] https://docs.openstack.org/developer/keystone/configuration.html#domain-specific-drivers

Change-Id: Ie0a7e36b9975342fab81ddebb87880608d3ef187
Needed-By: I71d64182524d1f54745d9e42347b3a605fa2a920
2017-07-03 10:37:41 +02:00
OpenStack Proposal Bot dd3b786895 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Ic6cc1494aa1ce4cdbb97912507d323fdf3fa1516
2017-06-29 10:19:12 +00:00
OpenStack Proposal Bot 08a5622853 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I19eab7d5dcdb2d1b8c505abba1fc44ef32d0ab99
2017-06-08 10:54:41 +00:00
OpenStack Proposal Bot 525b76dc32 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Ica9d6ec65228b7815975c583ed0f62c9eebc0869
2017-05-22 10:32:46 +00:00
OpenStack Proposal Bot 444b317195 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Ia3ee207fcb608a4f553d77c31d7dbf28c5ac0b63
2017-04-11 06:45:09 +00:00
OpenStack Proposal Bot 6eea808e24 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Ibd980066d6fc32777cb49e21d0ad30e6e970f457
2017-04-08 06:44:01 +00:00
Jenkins 27a1b7a312 Merge "Cleanup doc warnings and enforce warning-is-error in sphinx" 2017-03-24 17:49:10 +00:00
Akihiro Motoki bc5f1df5a9 Cleanup doc warnings and enforce warning-is-error in sphinx
* doc/source/conf.py: html_static_path pointed to nonexisting dir
* Fix indent error in python codes
* Insert blank lines before starting code block
* Enable warning-is-error in setup.cfg to prevent future warnings
* 'all_files' should be 'all-files' in setup.cfg

Change-Id: I7c5bc31be9c95ec78f18f895014a03cb003d7e04
2017-03-24 23:05:56 +09:00
OpenStack Proposal Bot 13af89c865 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Id081f21015abdbd447793d9c3b3d350b63511b8a
2017-03-24 06:48:18 +00:00
jlopezgu d0a4f14fbb Implement expiration date alert message
A new attribute was added to keystone user response, that will allow
us to warn users if their passwords are about to expire.
This will be configured in the local_settings.py file

Implements blueprint: password-expires-validation

Change-Id: Id66aa1c9596f8db8d07f63f3feb5166cb723a8e1
2017-02-15 20:57:30 +00:00
OpenStack Proposal Bot b19cf2c852 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I7a8ada1d5e043e5bb461558af6305e620271dc6b
2017-02-06 06:26:18 +00:00
OpenStack Proposal Bot 8fc4eb768b Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I467ec457ff34ffd3877dcca42852e654966ce575
2017-02-04 06:30:17 +00:00
OpenStack Proposal Bot c4885055f0 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Ic4c4bef868112e38542ba290203a5fe9faf9a832
2017-02-03 06:30:19 +00:00
Jenkins 0c195604f6 Merge "Add info logs to plugin scoping" 2017-02-02 16:32:19 +00:00
Jenkins 87f39581eb Merge "Imported Translations from Zanata" 2017-02-02 16:26:47 +00:00
Colleen Murphy 1fa3ad7179 Store the project domain ID in the Token object
The project domain ID is needed if a client needs to rescope a token
using the Identity V3 endpoint, so make it available.

Change-Id: I18a9d42906cb2116903600d47880ebdfff1e1ef9
Partial-bug: #1660436
2017-02-01 19:04:14 +01:00
OpenStack Proposal Bot 08cd8d923c Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I4a5940a3045c6057a104239bf605092bc5f93983
2017-02-01 06:36:24 +00:00
OpenStack Proposal Bot fa0994968e Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: I026ee5762d3705025d88861967dfe41533504ca4
2017-01-31 06:33:06 +00:00
Colleen Murphy 57b1f94818 Add info logs to plugin scoping
As requested[1], this patch adds info logging when an unscoped token
cannot be scoped to a given project or domain returned by list_projects
or list_domains.

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

Change-Id: I0cb4b7450528cd1e056b8a2af4f820a17914209c
2017-01-29 17:58:44 +01:00
Jenkins 8afdc7c80e Merge "Allow federated users to auth with domain scope" 2017-01-27 16:19:26 +00:00
OpenStack Proposal Bot 93b1799b73 Imported Translations from Zanata
For more information about this automatic import see:
http://docs.openstack.org/developer/i18n/reviewing-translation-import.html

Change-Id: Iffa99d3abc3b4b1510fdb7c2c9a935e330e65e04
2017-01-26 06:26:54 +00:00
Colleen Murphy ca3166707b Allow federated users to auth with domain scope
When a federated user logs in, openstack_auth receives an unscoped
token and no user_domain_name parameter. Currently, if the federated
user has a role in one or more domains, but no roles in any projects,
openstack_auth prevents authorization and denies the user's login with
the error "You are not authorized for any projects or domains." This is
a problem because first, it's inaccurate, as the user is authorized for
at least one domain, and second, a keystone administrator may want to
give federated users access to a domain without any projects in it, for
example so delegate the creation of projects to the federated users
themselves. This patch allows federated users without project roles to
log in by looking up domains as well as projects when attempting to
scope the token. This lookup is skipped if the domain was passed as
part of the request.

This patch also slightly restructures the OpenStackAuthTestsWebSSO
and OpenStackAuthTestsV3 tests because mox needs to simulate only one instance
of the plugin but two instances of the client objects for every call to
authenticate().

Closes-bug: #1649101

Change-Id: I151218ff28c0728898ed5315d63dd8122ce3b166
2017-01-25 19:42:26 +01:00
Colleen Murphy f3c21575d2 Fix exception catch-all in domain scope auth
Previously, the get_domain_scoped_auth plugin method caught any
exceptions found while trying to scope a token and logged the error
without addressing it. This was hiding an error that was occuring in
the unit tests, which was that some of the plugin calls were not being
mocked properly. This patch narrows down the exception handling to the
same exceptions handled in the project scoping case and adds the
necessary mocks to the tests.

Change-Id: I80a085ca731391b3f54a5ef999c92ab8ba3e69a0
2017-01-20 15:22:00 +01:00
Jenkins ea208c774f Merge "Add K2K Auth Dropdown" 2017-01-19 22:35:20 +00:00
Jenkins 75f274da94 Merge "Fix policy check short circuit" 2017-01-19 21:02:21 +00:00
Elvin Tubillara f0c7f27af6 Add K2K Auth Dropdown
This adds auth functionality to the Auth Drop down.
A new K2K django auth plugin has been added (With the intent
to do K2K at Login Time). Session variables have been
added so horizon can display the names of the Keystone Providers.
An endpoint was also added that allows the user to
switch keystone providers.

Change-Id: I75b1a10a3b40b5544b60f6fdc060e0070c585977
Implements: blueprint k2k-horizon
2017-01-19 13:00:08 -07:00
Elvin Tubillara 597e6d79b4 Refactor project and domain scoping
Moves the project and domain logic into their own functions
inside the plugin object.

Change-Id: I3aa026364443220c9b3fa38ec306fed4d9e878cc
2017-01-12 14:01:47 -06:00
Jenkins 32f7ad1bd8 Merge "Get remote address from client, behind proxy servers, to log on console." 2017-01-03 15:41:15 +00:00
Helber Maciel Guerra 96ca1097a5 Get remote address from client, behind proxy servers, to log on console.
Discovering REMOTE_IP using headers variables and displaing on console
log.

The messages will be:
"Login successful for user "%(username)s", remote address %(remote_ip)s."
and
"Login failed for user "%(username)s", remote address %(remote_ip)s."

This patch was tested behind haproxy and nginx reverse proxy.

To set variable that want to use, must inform using settings
SECURE_PROXY_ADDR_HEADER variable. Whitout this setting the remote ip
will use REMOTE_ADDR header variable.

Change-Id: I977be6cb1d029048b9862cac4b6596fc2e2b3431
Closes-Bug: #1461266
2016-12-30 01:54:32 +00:00
xhzhf 21f6235716 python3.0 has disable LOG.warn
python3.0 has disable LOG.warn.
remove usages.

Change-Id: Iee087af55dc4103d8cd54f83bfb2291a52be050e
Closes-Bug: #1650248
2016-12-15 03:38:57 +08:00
David Lyle b8567d6060 Fix policy check short circuit
The check() method was broken during a refactor and now only
checks the first result in the list and then returns that result.

This patch restores the AND functionality of check and only short
circuits on a failed result.

Closes-Bug: #1643082
Change-Id: I7d976299de2a35b81ced29d2c3f265da62f20eff
2016-11-18 15:47:09 -07:00