File: consents.rst

package info (click to toggle)
python-globus-sdk 3.54.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,032 kB
  • sloc: python: 34,226; sh: 44; makefile: 31
file content (45 lines) | stat: -rw-r--r-- 1,242 bytes parent folder | download
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
.. _consents:

.. py:currentmodule:: globus_sdk.scopes.consents

Consents
========

The Consents model provides a data model for loading consent information polled from
Globus Auth's ``get_consents`` API.

Consents are modeled as a ``ConsentForest`` full of ``ConsentTrees`` containing related
``Consents``. These consents detail a path of authorization grants that have been
provided by a user to client applications for token grants under certain scoped
contexts.

While the consent model classes themselves are exposed here in ``globus_sdk.scopes.consents``,
most objects are actually loaded from a :meth:`globus_sdk.AuthClient.get_consents` response, using the attached :meth:`globus_sdk.GetConsentsResponse.to_forest()` method:

.. code-block:: python

    import globus_sdk
    from globus_sdk.scopes.consents import ConsentForest

    my_identity_id = ...
    client = globus_sdk.AuthClient(...)
    response = client.get_consents(my_identity_id)

    consent_forest: ConsentForest = response.to_forest()

Reference
---------

.. autoclass:: ConsentForest
   :members:

.. autoclass:: ConsentTree
   :members:

.. autoclass:: Consent
   :members:

.. autoexception:: ConsentParseError

.. autoexception:: ConsentTreeConstructionError