Commit Graph

34 Commits

Author SHA1 Message Date
Akihiro Motoki 9c19b07a26 Define default settings explicitly (openstack_dashboard 1/5)
Currently horizon defines default values of settings in the logic
using getattr(settings, <setting name>, <default value>) and
it is not easy to handle the default values of available settings.

This commit starts the effort to define default settings explicitly.
This is a preparation for ini-based-configurations.

It covers settings in openstack_dashboard/api.

Part of blueprint ini-based-configuration
Change-Id: Id4c3287f0a572fd14ea93b54bcab8fabda39e583
2019-04-24 02:32:47 +09:00
Akihiro Motoki a984ae43e5 pylint: fix raising-non-exception error
django.http.HttpResponseNotFound is not an exception.
Django recommends to return it. @rest_utils.ajax can handle it.

Change-Id: I26f82da022a2c2725d62cc136c5da8eafc0ac26f
2019-01-20 05:48:09 +09:00
Akihiro Motoki 150dcc3fb0 pylint: fix redundant-keyword-arg error
pylint complains 'name' argument is redundant
in positional and keyword arguments.
The existence of 'name' in kwargs is checked before passing to
api.keystone.tenant_create, so we can pass 'name' as part of kwargs.

Change-Id: Ice09cecb21217b042d44a8c1dda7a4736e2b391b
2019-01-17 00:47:31 +09:00
Zuul c9536342c2 Merge "pylint: fix len-as-condition warning" 2019-01-16 14:25:39 +00:00
Akihiro Motoki a8edb5059d pylint: fix simplifiable-if-statement/expression
Change-Id: I9af66f886c47d3d2be61cba22b6c84460a178b8e
2019-01-16 13:08:08 +09:00
Akihiro Motoki c076db20c8 pylint: fix len-as-condition warning
Change-Id: Ib89c1854ad42b96e4caf281160d568fe98430afe
2019-01-16 12:56:20 +09:00
Alex Petrenko 31718cd1af Refactor app response for api request '/api/keystone/svc-catalog'
Add filtration for service catalog. Now all endpoints that are not
public will not be seen.

Change-Id: I6db214f849d13c4c71e176f00113e889ff2d2997
Closes-Bug: #1798832
2018-10-23 20:30:11 +03:00
qiaomin effc34fdad Adding identity ng-groups create action
This patch adds angular groups create action.

To be added in subsequent patches:
 - Delete, edit, manage members action

To Test
 - set 'groups_panel': True in settings.py
 - enable keystone v3 in local_settings.py

Co-Authored-By: Shu Muto <shu.mutow@gmail.com>

Change-Id: If072ef89dab7aeccef8988d165d687621f1edb7c
Implements: blueprint ng-groups-actions
2018-07-18 02:26:09 +00:00
wei.ying dc9a6a33ea Fix unauthorized exception when using member user to access angular users panel
When a member role user go to angular users panel, it will be
raised unauthorized exception since the user has no access to
get users list. It should be add a policy check mechanism at
the panel.

Change-Id: I9cfa1aeab27aca1631322d8c0b3e6a7a930d9cfe
Closes-Bug: #1694127
2018-03-31 18:57:58 +08:00
Shu Muto c174036c84 Add Change Password Action for Angular users panel
To Test
 - set 'users_panel' to True in settings.py

Change-Id: I779b26d34658ea5f3222ebf31f1401bc7a43960b
Partially-Implements: blueprint ng-users
2018-01-16 18:15:19 +09:00
jing.liuqing 4c8f4a0306 Add Angular keystone user creation action
- fix users rest API to handle description,
  project, and enabled attribute properly
- fix hz-password-match to work, but also so
  it uses model-based checks rather than HTML
  element lookups
- add schema form password-confirm type

To Test
 - set 'users_panel': True in settings.py

Co-Authored-By: Cindy Lu <clu@us.ibm.com>
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Co-Authored-By: Shu Muto <shu-mutou@rf.jp.nec.com>

Change-Id: I2e8f5ac1dbfae9634fa5b72f7f6c0278d5a81249
Partially-Implements: blueprint ng-users
2017-12-13 12:13:07 +09:00
Cindy Lu 924fb68645 Add REST APIs for Keystone Group
This patch adds REST APIs (read, create, edit, delete)
for Keystone Group.

Change-Id: I9ca3b509bcd6ab3f255094fa367f9b236caf13da
Partially-Implements: blueprint ng-groups
Co-Authored-By: Shu Muto <shu-mutou@rf.jp.nec.com>
2017-10-10 13:35:52 +09:00
Akihiro Motoki b9d0243c33 Fix H405 (multi line docstring) warnings (openstack_dashboard)
H405: multi line docstring summary not separated with an empty line

Closes-Bug: #1696996

Change-Id: Id895695663b19522d9cdc22f8b012e49680d708b
2017-06-09 16:05:31 +00:00
liyingjun 942fa3d7cd Fix the return value for glance get_version
The VERSIONS.get_version returned a Version object instead of a string,
it will raise ValueError: Circular reference detected when json encode.

This issue was introduced by commit
834722cf8a

Change-Id: Ib41b2f7e77ac49911e9d5a4e129047f941bf5d24
Closes-bug: #1672291
2017-03-14 10:48:38 +08:00
Cindy Lu 8130a79589 Add Keystone Groups to REST API
Adding REST API calls to retrieve group list

Co-Authored-By: zhurong <aaronzhu1121@gmail.com>

Partially-Implements: blueprint angularize-identity-tables
Change-Id: I12ca270036b4963fb20d3f6f1a630ded60a449f8
2016-10-11 11:33:37 -07:00
Kevin Fox 31e5672905 Angular direct service access.
Angular based Horizon widgets and Horizon plugins will want to
contact OpenStack API's directly to enable much more responsive UI
and to place less load on the Horizon servers by proxying service
calls through horizon proxies.

Change-Id: I612c6bfefa8e157f7219938bb3e82896dde8fa09
2016-07-18 13:30:51 -07:00
Bo Wang 16a471f6a7 Clear confusing annotation in rest create_user
email should be None if not provided, ref[1]

[1] https://github.com/openstack/horizon/commit/
311bbd7d16

Closes-Bug: #1553148
Change-Id: I0530a78f3b354f06b2d9608f5da7ce31ea80085b
2016-06-15 17:16:51 +08:00
Bo Wang 6acf839c3a Trivial: Fix import order in api/rest/*.py
refer to:http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: I9f522215985cb9ce1cbbc022b08962cfb31d3349
2016-02-12 12:41:44 +08:00
Rajat Vig 436e0fb868 Add API services for system information
Adding API services that are necessary for displaying System Information.
This patch will contain all of the APIs necessary to populate those tabs.
HTTP code 501 is introduced, to communicate to the UI that an API extension
is not available. This simplifies the UI implementation by avoiding making
an additional 'check' call from the UI

Co-Authored-By: Kristine Brown <kbrown@thoughtworks.com>
Co-Authored-By: Kyle Olivo <kyle@kyleolivo.com>
Co-Authored-By: Rajat Vig <rajatv@thoughtworks.com>
Co-Authored-By: Dan Siwiec <dan.siwiec@thoughtworks.com>

Change-Id: I64167d8f5f8e914667f4b6582edc00463f9e0d4a
Partially-Implements: blueprint ng-system-information
2015-12-16 23:22:20 +00:00
Thai Tran cc2cdc01f8 Creating new user does not require project
When creating a new user, adding the user to a project is optional.
The REST api needs to respect this.

Change-Id: I2345476afcb3e0df27e50dabf5d19ec2b0f4b1dc
Closes-Bug: #1487251
2015-10-05 12:12:16 -07:00
Jenkins 8879e6f7ee Merge "Fix 'paginate' and 'admin' GET parameters in Keystone Projects REST API" 2015-08-08 04:46:09 +00:00
Thai Tran ecdad15800 Keystone project role REST is broken
There is an extra white space in the REST url making it impossible to reach
the endpoint. Removing the white space will fix this issue.

Change-Id: Ic49d3821c0bc266a13522723323bda74a27f0389
Closes-Bug: #1479551
2015-07-29 23:21:06 +00:00
Jenkins 91875edeb0 Merge "Keystone REST handles default role incorrectly" 2015-07-28 08:28:17 +00:00
Paulo Ewerton Gomes Fragoso 82393a010a Fix 'paginate' and 'admin' GET parameters in Keystone Projects REST API
This patch converts 'paginate' and 'admin' parameter values to
Python boolean values in the Projects get method in openstack_dashboard/
api/rest/keystone.py.

Change-Id: I94c09c68152e39d5304065fe1287ac994c958cbe
Closes-Bug: 1472747
2015-07-16 14:47:27 +00:00
Cindy Lu a515a0de2f Add keystone version to REST API
Change-Id: Ice72447a222552772da307e324e15f7dbdb30ee0
Partially-Implements: blueprint filtered-client-side-table
2015-07-14 13:30:46 -07:00
Thai Tran 9347cb43cc Keystone REST handles default role incorrectly
The keystone REST currently assigns a role to the user even if the role is the
default role (_member_). This causes keystone client v2 to return an error.
This patch fixes this issue.

Change-Id: I6de6c66eb88abfd23a171c0f13aeff2f707991e2
Closes-bug: #1453245
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
2015-07-08 12:50:38 +10:00
Travis Tripp 2d548313cc Launch Instance - MultiRegion Support / Networks
This makes it so that networks are only provided
if the network service is enabled.

This bugfix also adds multi-region support.

Details on how to setup a multi-region test
to verify it in horizon are in the bug.

Closes-Bug: #1432401
Co-Authored-By: Shaoquan Chen <sean.chen2@hp.com>
Co-Authored-By: Brian Tully <brian.tully@hp.com>
Co-Authored-By: Richard Jones <r1chardj0n3s@gmail.com>
Change-Id: I4e98c18b579eb5fc9e1b76ddf57d22142a7ddeab
2015-04-01 19:38:32 +00:00
Thai Tran 4cb1700509 Updated keystone api for roles and edit
Creating a user does not associate roles properly.
Also updated the users patch code and tests.

Change-Id: I7a28fab574da94bc5933fc5a8d7dfa52f9d6fcc7
Implemenents: blueprint angularize-identity-tables
2015-03-31 10:36:40 -07:00
Jenkins 30e014cf25 Merge "Rest API for Users list filter" 2015-03-06 01:15:32 +00:00
Travis Tripp 1bcd269b71 Keystone REST API single project GET
The URL regex was not including the ID capture, so actually calling
the URL via angular didn't work. This adds the ID capture.

You can manually verify it by going to with POSTMAN:

http://localhost:9000/api/keystone/projects/9e789090449f45f3aaf15823f7e2da1a

See also: https://wiki.openstack.org/wiki/Horizon/RESTAPI

Partially Implements: blueprint instance-details-redesign

Change-Id: I83a8312e772422d96f3c7a15816c45a700e2d047
2015-03-02 14:54:16 -07:00
Cindy Lu 2cca73ff5f Rest API for Users list filter
Add the filter functionality that Keystone supports.
Used by Randy's Magic Search patch:
https://review.openstack.org/#/c/151386/.

Also refactor out parse_filters_kwargs method which is used
by several rest api.

Co-Authored-By: Justin Pomeroy <jpomero@linux.vnet.ibm.com>

Change-Id: Ib65395eae345e1368fbb45f6b4ce3cbb9595d61b
Partially-Implements: blueprint filtered-client-side-table
2015-03-02 13:12:05 -08:00
Richard Jones 1c91850542 Add service catalog get for keystone REST API
This adds full access to the keystone service catalog for the user.

The service catalog can be used to determine whether or not
Neutron or Nova networking is enabled. This is needed in
launch instance.

Change-Id: I9e19563b0d9b8d106274d6806b302eb01bb51915
Partially Implements: blueprint launch-instance-redesign
2015-02-20 10:18:46 -07:00
Richard Jones 64f7bad172 Alter verb usage for keystone REST and add Angular service
This patch adds an Angular service to isolate client-side code from REST API
changes, and also changes the REST API to use PATCH instead of PUT as the
update verb. Except the one new PUT method for granting a role.

Multiple DELETE is removed from the overloaded POST actions, and the role
grant is moved to a PUT action.

The new angular API service implements error handling by default.

The request Python API JSON body test was made more sane. Thanks to all the
reviewers who brought that up, I finally saw the light!

Change-Id: Ifd58fbf4fac3c3f53dc4769fd76cddfa3101d9d2
2015-02-04 04:59:05 +00:00
Richard Jones fd99a0bd7f Keystone REST API for angular front end.
This change implements the REST API for keystone required for the
identity angular front end.

Changes in this patch:

- fix PUT so it actually works
- move to using new test util module
- address TODO in tests

Partially Implemenents: blueprint angularize-identity-tables
Change-Id: I5b8cdc44250fcc5afdb41a5a33fb34dc8ea7d6c0
2015-01-23 00:59:44 +00:00