You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -176,10 +174,6 @@ class BaseRequestHandler(RequestHandler):
176
174
Override the class variable ``SUPPORTED_METHODS`` by writing down the necessary methods there.
177
175
Note that by default all HTTP methods are supported.
178
176
179
-
It is important to understand that the handler belongs to the system.
180
-
The class variable ``SYSTEM_NAME`` displays the system name. By default it is taken from the module name.
181
-
This value is used to generate the full component name, see :py:meth:`_getFullComponentName` method
182
-
183
177
This class also defines some variables for writing your handler's methods:
184
178
185
179
- ``DEFAULT_AUTHORIZATION`` describes the general authorization rules for the entire handler
@@ -200,7 +194,7 @@ class BaseRequestHandler(RequestHandler):
200
194
Also, if necessary, you can create a new type of authorization by simply creating the appropriate method::
201
195
202
196
def _authzMYAUTH(self):
203
-
'''Another authorization algoritm.'''
197
+
'''Another authorization algorithm.'''
204
198
# Do somthing
205
199
return S_OK(credentials) # return user credentials as a dictionary
206
200
@@ -212,13 +206,12 @@ def _authzMYAUTH(self):
212
206
The class contains methods that require implementation:
213
207
214
208
- :py:meth:`_pre_initialize`
215
-
- :py:meth:`_getCSAuthorizarionSection`
209
+
- :py:meth:`_getCSAuthorizationSection`
216
210
- :py:meth:`_getMethod`
217
211
- :py:meth:`_getMethodArgs`
218
212
219
213
Some methods have basic behavior, but developers can rewrite them:
220
214
221
-
- :py:meth:`_getFullComponentName`
222
215
- :py:meth:`_getComponentInfoDict`
223
216
- :py:meth:`_monitorRequest`
224
217
@@ -239,20 +232,20 @@ def _authzMYAUTH(self):
239
232
At startup, :py:class:`HandlerManager <DIRAC.Core.Tornado.Server.HandlerManager.HandlerManager>` call :py:meth:`__pre_initialize`
240
233
handler method that inspects the handler and its methods to generate tornados URLs of access to it:
241
234
242
-
- specifies the full name of the component, including the name of the system to which it belongs, see :py:meth:`_getFullComponentName`.
235
+
- specifies the full name of the component, including the name of the system to which it belongs as <System>/<Component>.
243
236
- initialization of the main authorization class, see :py:class:`AuthManager <DIRAC.Core.DISET.AuthManager.AuthManager>` for more details.
244
237
- call :py:meth:`__pre_initialize` that should explore the handler, prepare all the necessary attributes and most importantly - return the list of URL tornadoes
245
238
246
239
The first request starts the process of initializing the handler, see the :py:meth:`initialize` method:
247
240
248
241
- load all registered identity providers for authentication with access token, see :py:meth:`__loadIdPs`.
249
242
- create a ``cls.log`` logger that should be used in the children classes instead of directly ``gLogger`` (this allows to carry the ``tornadoComponent`` information, crutial for centralized logging)
250
-
- initialization of the monitoring specific to this handler, see :py:meth:`__initMonitoring`.
243
+
- initialization of the monitoring specific to this handler, see :py:meth:`_initMonitoring`.
251
244
- initialization of the target handler that inherit this one, see :py:meth:`initializeHandler`.
252
245
253
246
Next, first of all the tornados prepare method is called which does the following:
254
247
255
-
- determines determines the name of the target method and checks its presence, see :py:meth:`_getMethod`.
248
+
- determines the name of the target method and checks its presence, see :py:meth:`_getMethod`.
256
249
- request monitoring, see :py:meth:`_monitorRequest`.
257
250
- authentication request using one of the available algorithms called ``DEFAULT_AUTHENTICATION``, see :py:meth:`_gatherPeerCredentials` for more details.
258
251
- and finally authorizing the request to access the component, see :py:meth:`authQuery <DIRAC.Core.DISET.AuthManager.AuthManager.authQuery>` for more details.
@@ -262,7 +255,7 @@ def _authzMYAUTH(self):
262
255
263
256
- execute the target method in an executor a separate thread.
264
257
- defines the arguments of the target method, see :py:meth:`_getMethodArgs`.
265
-
- initialization of the each request, see :py:meth:`initializeRequest`.
258
+
- initialization of each request, see :py:meth:`initializeRequest`.
266
259
- the result of the target method is processed in the main thread and returned to the client, see :py:meth:`__execute`.
267
260
268
261
"""
@@ -279,13 +272,10 @@ def _authzMYAUTH(self):
279
272
# The variable that will contain the result of the request, see __execute method
280
273
__result=None
281
274
282
-
# Below are variables that the developer can OVERWRITE as needed
275
+
# Full component name in the form <System>/<Component>
276
+
_fullComponentName=None
283
277
284
-
# System name with which this component is associated.
285
-
# Developer can overwrite this
286
-
# if your handler is outside the DIRAC system package (src/DIRAC/XXXSystem/<path to your handler>)
287
-
SYSTEM_NAME=None
288
-
COMPONENT_NAME=None
278
+
# Below are variables that the developer can OVERWRITE as needed
289
279
290
280
# Base system URL. If defined, it is added as a prefix to the handler generated.
0 commit comments