Debian Codegraph @

docs/user_guide/usage_patterns/data_transfer/create_guest_collection/index.rst

raw
1 Creating a Guest Collection
2 ===========================
3
4 Within the Globus Ecosystem, data is managed through the abstraction of *Collections*.
5 The example included on this page demonstrate how to create specifically a
6 *Guest Collection* using the Globus Python SDK. Guest collections, formerly known as
7 "Shares", are collections which provide access to a subdirectory of an existing
8 collection through a particular user or client's local permissions.
9
10 Guest collections are a great way to set up data automation. They may be scoped down
11 to a particular directory within an existing "Mapped Collection" and don't implicitly
12 inherit the same authorization timeout requirements as their parent Mapped Collection.
13 Once created, they can be shared to other users/entities, in effect giving another
14 entity access, through you, to some underlying data.
15
16 .. Warning::
17
18 While guest collections don't implicitly inherit their parent mapped collection's
19 authorization timeout in some cases they do or alternatively may be disabled
20 entirely. This is a decision made by the endpoint owner, not Globus.
21
22 Because requirements can vary so drastically between endpoints, we recommend
23 consulting with the particular endpoint's documentation and/or owner to determine
24 whether guest collections provide the desired level of access with the desired
25 minimization of authorization.
26
27 .. Note::
28
29 The scripts reference a globus hosted "tutorial" mapped collection. This is just
30 to provide as simple of a functioning example out of the box as possible.
31
32 For actual application, replace the IDs with the relevant collection and
33 storage gateway IDs.
34
35
36 .. tab-set::
37
38 .. tab-item:: User-owned Collection
39
40 This script demonstrates how to create a guest collection owned by a human.
41
42 It will prompt the user to authenticate through a browser and authorize the
43 script to act on their behalf.
44
45 .. literalinclude:: create_guest_collection_user_owned.py
46 :caption: ``create_guest_collection_user_owned.py`` [:download:`download <create_guest_collection_user_owned.py>`]
47 :language: python
48
49
50 .. tab-item:: Client-owned Collection
51
52 This script demonstrates how to create a guest collection owned by a client
53 (i.e. a service account).
54
55 It will automatically request and use client access tokens based on the supplied
56 client ID and secret.
57
58 .. literalinclude:: create_guest_collection_client_owned.py
59 :caption: ``create_guest_collection_client_owned.py`` [:download:`download <create_guest_collection_client_owned.py>`]
60 :language: python