summaryrefslogtreecommitdiff
path: root/doc/source/keystone_scopes_and_roles_support.rst
blob: f446f8ccd085d6e27f4c48a06b55b68a327a4416 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
Keystone Scopes & Roles Support in Tempest
==========================================

OpenStack Keystone supports different scopes in token, refer to the
`Keystone doc <https://docs.openstack.org/keystone/latest/admin/tokens-overview.html#authorization-scopes>`_.
Along with the scopes, keystone supports default roles, one of which
is a reader role, for details refer to
`this keystone document <https://docs.openstack.org/keystone/latest/admin/service-api-protection.html>`_.

Tempest supports those scopes and roles credentials that can be used
to test APIs under different scope and roles.

Dynamic Credentials
-------------------

Dynamic credential supports all the below set of personas and allows
you to generate credentials tailored to a specific persona that you
can use in your test.

Domain scoped personas:
^^^^^^^^^^^^^^^^^^^^^^^^

  #. Domain Admin: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['domain_admin']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_d_admin_client = (
                     cls.os_domain_admin.availability_zone_client)

  #. Domain Member: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['domain_member']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_d_member_client = (
                     cls.os_domain_member.availability_zone_client)

  #. Domain Reader: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['domain_reader']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_d_reader_client = (
                     cls.os_domain_reader.availability_zone_client)

  #. Domain other roles: This is supported and can be requested and used from
     the test as below:

     You need to use the ``domain`` as the prefix in credentials type, and
     based on that, Tempest will create test users under 'domain' scope.

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = [['domain_my_role1', 'my_own_role1', 'admin']
                            ['domain_my_role2', 'my_own_role2']]

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_d_role1_client = (
                     cls.os_domain_my_role1.availability_zone_client)
                 cls.az_d_role2_client = (
                     cls.os_domain_my_role2.availability_zone_client)

System scoped personas:
^^^^^^^^^^^^^^^^^^^^^^^

  #. System Admin: This is supported and can be requested and used from the
     test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['system_admin']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_s_admin_client = (
                     cls.os_system_admin.availability_zone_client)

  #. System Member: This is supported and can be requested and used from the
     test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['system_member']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_s_member_client = (
                     cls.os_system_member.availability_zone_client)

  #. System Reader: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['system_reader']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_s_reader_client = (
                     cls.os_system_reader.availability_zone_client)

  #. System other roles: This is supported and can be requested and used from
     the test as below:

     You need to use the ``system`` as the prefix in credentials type, and
     based on that, Tempest will create test users under 'project' scope.

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = [['system_my_role1', 'my_own_role1', 'admin']
                            ['system_my_role2', 'my_own_role2']]

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_s_role1_client = (
                     cls.os_system_my_role1.availability_zone_client)
                 cls.az_s_role2_client = (
                     cls.os_system_my_role2.availability_zone_client)

Project scoped personas:
^^^^^^^^^^^^^^^^^^^^^^^^

  #. Project Admin: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['project_admin']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_p_admin_client = (
                     cls.os_project_admin.availability_zone_client)

  #. Project Member: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['project_member']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_p_member_client = (
                     cls.os_project_member.availability_zone_client)

  #. Project Reader: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['project_reader']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_p_reader_client = (
                     cls.os_project_reader.availability_zone_client)

  #. Project alternate Admin: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['project_alt_admin']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_p_alt_admin_client = (
                     cls.os_project_alt_admin.availability_zone_client)

  #. Project alternate Member: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['project_alt_member']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_p_alt_member_client = (
                     cls.os_project_alt_member.availability_zone_client)

  #. Project alternate Reader: This is supported and can be requested and used from
     the test as below:

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = ['project_alt_reader']

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_p_alt_reader_client = (
                     cls.os_project_alt_reader.availability_zone_client)

  #. Project other roles: This is supported and can be requested and used from
     the test as below:

     You need to use the ``project`` as the prefix in credentials type, and
     based on that, Tempest will create test users under 'project' scope.

     .. code-block:: python

         class TestDummy(base.DummyBaseTest):

             credentials = [['project_my_role1', 'my_own_role1', 'admin']
                            ['project_my_role2', 'my_own_role2']]

             @classmethod
             def setup_clients(cls):
                 super(TestDummy, cls).setup_clients()
                 cls.az_role1_client = (
                     cls.os_project_my_role1.availability_zone_client)
                 cls.az_role2_client = (
                     cls.os_project_my_role2.availability_zone_client)

Pre-Provisioned Credentials
---------------------------

Pre-Provisioned credentials support the below set of personas and can be
used in the test as shown above in the ``Dynamic Credentials`` Section.

* Domain Admin
* Domain Member
* Domain Reader
* System Admin
* System Member
* System Reader
* Project Admin
* Project Member
* Project Reader