Commit Graph

24 Commits

Author SHA1 Message Date
Hieu LE c77e0c709a Register default magnum service and stat policies in code
This commit uses the existing policy-in-code module to move all
default policies for magnum service and stat into code. This commit
also adds helpful documentation about each API those policies protect,
which will be generated in sample policy files and completely remove
usage of policy.json file.

Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code

Change-Id: I01a8ce964bf8bd569d4aa4e899cbcd9855281835
2017-10-23 02:57:29 +00:00
Hieu LE b7ca578416 Register default certificate policies in code
This commit uses the existing policy-in-code module to move all
default policies for certificates into code. This commit also adds
helpful documentation about each API those policies protect,
which will be generated in sample policy files.

Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code

Change-Id: I1abc75441d7984497739194a273d8bda63f832a0
2017-10-19 01:42:47 +00:00
Hieu LE c14af5c023 Register default quota policies in code
This commit uses the existing policy-in-code module to move all
default policies for quotas into code. This commit also adds
helpful documentation about each API those policies protect,
which will be generated in sample policy files.

Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code

Change-Id: I2fbd7577545ed08dee10064d321e8c6941324b5d
2017-10-19 01:40:52 +00:00
Hieu LE 38a8fed31a Register default cluster template policies in code
This commit uses the existing policy-in-code module to move all
default policies for cluster templates into code. This commit also adds
helpful documentation about each API those policies protect,
which will be generated in sample policy files.

Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code

Change-Id: I9a8176ea20e3c925441473d1d84db3a73edca7a5
2017-10-19 01:40:39 +00:00
Hieu LE 0d36f8b8bd Register default cluster policies in code
This commit uses the existing policy-in-code module to move all
default policies for clusters into code. This commit also adds
helpful documetation about each API those policies protect,
which will be generated in sample policy files.

Change-Id: I36e69fe930505c2777f4376be1f6ddf17016998f
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code
2017-10-19 01:40:27 +00:00
Hieu LE 1cbb1d451c Register default baymodel policies in code
This commit uses the existing policy-in-code module to move all
default policies for baymodels into code. This commit also adds
helpful documetation about each API those policies protect, which
will be generated in sample policy files.

Change-Id: Ia4409ff712d0e64985d9565e11671b33c8ac9ddf
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code
2017-10-19 01:40:11 +00:00
Hieu LE ac0756e60f Register default bay policies in code
This commit uses the existing policy-in-code module to move all
default policies for bays into code. This commit also adds helpful
documetation about each API those policies protect, which will be
generated in sample policy files.

Change-Id: I4221ed56146ed952781f5f38bc4344d8a0d07881
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code
2017-10-19 01:40:03 +00:00
Hieu LE e06004d9f5 Implement basic policy module in code
This change prepares the magnum project to start implementing
policies in code. Subsequent patches will register more magnum
policies in code and remove the corresponding entry from the
policy file maintained in source.

This is part of a community effort to provide better user
experience for those having to maintain RBAC policy. More
information on this effort can be found below:
https://governance.openstack.org/tc/goals/queens/policy-in-code.html

Change-Id: I0e2b34067ea1e4d5868df544a9f65ae3f1944c43
Co-authored-By: Dai Dang-Van <daidv@vn.fujitsu.com>
Implements: blueprint policy-in-code
2017-10-19 08:33:58 +07:00
Vijendar Komalla 51e833137b Magnum stats API
This change introduces a new /stats REST endpoint that
provide the following basic information;
1) Total number of clusters and nodes for the given tenant.
2) Total number of clusters and nodes across all the tenants.
Follow-up patches include more stats.

Change-Id: Iac0bf9343549de31654545d5b1fd7601e56142a7
Partially Implements blueprint magnum-stats-api
2017-01-17 09:48:54 -06:00
Feng Shengqin c3911af299 add cluster and clustertemplate to fake_policy.py
rename bay to cluster, baymodel to clustertemplate,
i think it is better to add policy rule to fack_policy.py.

certificate and magnum-service need be added, too.

Change-Id: I3bbfc01547c512f990e2ea15f2c2dac149eec5dc
2016-10-17 00:42:49 +00:00
PanFengyun 98516d4fa4 Clean rc from unit tests
Magnum have removed the k8s rc apis, but have not removed it from
policy.json. The patch (https://review.openstack.org/#/c/384064/)
remove rc from etc/magnum/policy.json.

And we should remove rc from tests/fake_policy.py.

Change-Id: Ia98e1637f2e3a5919be3784322a55005970d4da8
2016-10-11 11:03:19 +08:00
Tom Cammann 40aa6550f1 Remove container object
Following on from removing the k8s specific APIs in
I1f6f04a35dfbb39f217487fea104ded035b75569 the objects associated with
these APIs need removal.

Remove the container object, drop the db table and remove references to
the container object. The docker_conductor has also been removed as this
was used for managing containers using Magnum objects.

Change-Id: I288fa7a9717519b1ae8195820975676d99b4d6d2
Partially-Implements: blueprint delete-container-endpoint
Co-Authored-By: Spyros Trigazis <strigazi@gmail.com>
2016-08-01 16:16:20 +02:00
Tom Cammann 3e02840628 Remove service object
Following on from removing the k8s specific APIs in
I1f6f04a35dfbb39f217487fea104ded035b75569 the objects associated with
these APIs need removal.

Remove the service object, drop the db table and remove references to
the service object.

Change-Id: I4f06bb779caa0ad369a2b96b4714e1bf2db8acc6
Partially-Implements: blueprint delete-container-endpoint
2016-06-02 10:46:13 +01:00
Tom Cammann d20e5ef715 Remove pod object
Following on from removing the k8s specific APIs in
I1f6f04a35dfbb39f217487fea104ded035b75569 the objects associated with
these APIs need removal.

Remove the pod object, drop the db table and remove references to the
pod object.

Change-Id: I8c2499ccb97aae39d80868ce02fbef292d762c10
Partially-Implements: blueprint delete-container-endpoint
2016-05-27 11:34:09 +01:00
Hua Wang 342e83f033 Remove node object from Magnum
The node object represents either a bare metal or virtual machine
node that is provisioned with an OS to run the containers, or
alternatively, run kubernetes. Magnum use Heat to deploy the nodes,
so it is unnecessary to maintain node object in Magnum. Heat can do
the work for us. The code about node object is useless now, so let's
remove it from Magnum.

Closes-Bug: #1540790
Change-Id: If8761b06a364127683099afb4dc51ea551be6f89
2016-02-04 14:02:49 +08:00
Surojit Pathak deae4e44b0 Modify admin_api policy rule
Magnum API's magnum_service:get_all is enforced by admin_api.
Modifying the rule to use context_is_admin. Also changing the to_dict()
call to include change in roles.

Change-Id: I44dda27857945dfd3ad43fa28ea458ce2966388c
Closes-Bug: #1503402
2015-10-09 20:12:58 +00:00
Hua Wang ebc26f02c4 Remove redundant code about fake_policy
The code is copied from ironic. Ironic has no policy in Juno
, so it need the code to test. But it is not needed in magnum.

Change-Id: Ib066d953993b92c7c96d661cfcb7f2d3ef888659
Closes-Bug: #1482023
2015-08-07 01:29:26 +00:00
yuntongjin d9739584bf policy check for container
add policy check for container

Change-Id: I7ff39b37b4a65d882b896dcad65d6ff5dc08c0d1
Partial-implements: blueprint policy-enforce
2015-07-27 16:25:43 +08:00
yuntongjin 959f2330d7 policy check for service
add policy check for service
Partial-implements: blueprint policy-enforce

Change-Id: If2913657511d8c9c1da6992c4b694922c1d71fa6
2015-07-27 16:25:36 +08:00
yuntongjin ffb2840892 policy check for rc
add policy check for rc

Partial-implements: blueprint policy-enforce

Change-Id: Ie858b39682e7611e6793fbdcbdcad209b8cab3c3
2015-07-27 16:19:57 +08:00
leizhang 7566f1304e policy check for pod
add policy check for pod

Change-Id: I6f0526d0339f59f5842d4d66914e5f208f50f857
Partial-implements: blueprint policy-enforce
2015-07-15 08:40:15 +08:00
Yongli He 4ecd46800b policy check for node
add policy check for node.

Change-Id: I4b025cb4f47c4683d826237318afdf2c2009841a
Partial-implements: blueprint policy-enforce
2015-06-30 16:36:03 +08:00
Yongli He 24dcc5b8fd policy check for baymodel
add policy check for baymodel.

Partial-implements: blueprint policy-enforce

Change-Id: I5f0e4b54bc33ddc3f1cd2f88bf4388894099ac59
2015-06-18 13:17:11 +08:00
yuntongjin d057f8c442 first policy check for bay
add first policy check for bay.

Co-Authored-By: ShaoHe Feng <shaohe.feng@intel.com>
Change-Id: Ieadc95d84f0e4ecc68c95673617d154f05a15a57
Partial-implements: blueprint policy-enforce
2015-06-15 23:06:35 +08:00