Requests

class DIRAC.FrameworkSystem.private.authorization.utils.Requests.OAuth2Request(method: str, uri: str, body=None, headers=None)

Bases: OAuth2Request

OAuth2 request object

__init__(method: str, uri: str, body=None, headers=None)
addScopes(scopes)

Add new scopes to query

Parameters:

scopes (list) – scopes

property args
property client_id: str

The authorization server issues the registered client a client identifier – a unique string representing the registration information provided by the client. The value is extracted from request.

Returns:

string

property data
property datalist: DefaultDict[str, list]

Return all the data in query parameters and the body of the request as a dictionary with all the values in lists.

property form
property grant_type: str
property group

Search DIRAC group in scopes

Returns:

str

property groups

Search DIRAC groups in scopes

Returns:

list

headers

HTTP headers

method

HTTP method

property path

URL path

Returns:

str

property provider

Search IdP in scopes

Returns:

str

property redirect_uri
property response_type: str
property scope: str
property sessionID

Search IdP in scopes

Returns:

str

setQueryArguments(**kwargs)

Set query arguments

property state
toDict()

Convert class to dictionary

Returns:

dict

DIRAC.FrameworkSystem.private.authorization.utils.Requests.createOAuth2Request(request, method_cls=<class 'DIRAC.FrameworkSystem.private.authorization.utils.Requests.OAuth2Request'>, use_json=False)

Create request object

Parameters:
  • request (object, dict) – request

  • method_cls (object) – returned class

  • use_json (str) – if data is json

Returns:

object – OAuth2Request