Debian Codegraph @

docs/authorization/scopes_and_consents/consents.rst

raw
1 .. _consents:
2
3 .. py:currentmodule:: globus_sdk.scopes.consents
4
5 Consents
6 ========
7
8 The Consents model provides a data model for loading consent information polled from
9 Globus Auth's ``get_consents`` API.
10
11 Consents are modeled as a ``ConsentForest`` full of ``ConsentTrees`` containing related
12 ``Consents``. These consents detail a path of authorization grants that have been
13 provided by a user to client applications for token grants under certain scoped
14 contexts.
15
16 While the consent model classes themselves are exposed here in ``globus_sdk.scopes.consents``,
17 most objects are actually loaded from a :meth:`globus_sdk.AuthClient.get_consents` response, using the attached :meth:`globus_sdk.GetConsentsResponse.to_forest()` method:
18
19 .. code-block:: python
20
21 import globus_sdk
22 from globus_sdk.scopes.consents import ConsentForest
23
24 my_identity_id = ...
25 client = globus_sdk.AuthClient(...)
26 response = client.get_consents(my_identity_id)
27
28 consent_forest: ConsentForest = response.to_forest()
29
30 Reference
31 ---------
32
33 .. autoclass:: ConsentForest
34 :members:
35
36 .. autoclass:: ConsentTree
37 :members:
38
39 .. autoclass:: Consent
40 :members:
41
42 .. autoexception:: ConsentParseError
43
44 .. autoexception:: ConsentTreeConstructionError