Debian Codegraph @

src/globus_sdk/testing/data/auth/get_projects.py

raw
1 import uuid
2
3 from globus_sdk.testing.models import RegisteredResponse, ResponseSet
4
5 GUARDIANS_IDP_ID = str(uuid.uuid1())
6 STAR_LORD = {
7 "identity_provider": GUARDIANS_IDP_ID,
8 "identity_type": "login",
9 "organization": "Guardians of the Galaxy",
10 "status": "used",
11 "id": str(uuid.uuid1()),
12 "name": "Star Lord",
13 "username": "[email protected]",
14 # I thought it would be funny if he didn't get 'star.lord'
15 # because someone else got it first
16 "email": "[email protected]",
17 }
18 ROCKET_RACCOON = {
19 "identity_provider": GUARDIANS_IDP_ID,
20 "identity_type": "login",
21 "organization": "Guardians of the Galaxy",
22 "status": "used",
23 "id": str(uuid.uuid1()),
24 "name": "Rocket",
25 "username": "[email protected]",
26 # and think about it, who else would try to lay claim
27 # to that email address?
28 "email": "[email protected]",
29 }
30
31 EVIL_TEST_PROJECT = {
32 "admin_ids": [ROCKET_RACCOON["id"]],
33 "contact_email": "[email protected]",
34 "display_name": "Evil Test Project Full of Evil",
35 "admin_group_ids": None,
36 "id": str(uuid.uuid1()),
37 "project_name": "Evil Test Project Full of Evil",
38 "admins": {
39 "identities": [ROCKET_RACCOON],
40 "groups": [],
41 },
42 }
43
44 GUARDIANS_PROJECT = {
45 "admin_ids": [ROCKET_RACCOON["id"]],
46 "contact_email": "[email protected]",
47 "display_name": "Guardians of the Galaxy Portal",
48 "admin_group_ids": None,
49 "id": str(uuid.uuid1()),
50 "project_name": "Guardians of the Galaxy Portal",
51 "admins": {
52 "identities": [STAR_LORD, ROCKET_RACCOON],
53 "groups": [],
54 },
55 }
56
57 RESPONSES = ResponseSet(
58 default=RegisteredResponse(
59 service="auth",
60 path="/v2/api/projects",
61 json={"projects": [EVIL_TEST_PROJECT, GUARDIANS_PROJECT]},
62 metadata={
63 "project_ids": [EVIL_TEST_PROJECT["id"], GUARDIANS_PROJECT["id"]],
64 "admin_map": {
65 EVIL_TEST_PROJECT["id"]: [ROCKET_RACCOON["id"]],
66 GUARDIANS_PROJECT["id"]: [STAR_LORD["id"], ROCKET_RACCOON["id"]],
67 },
68 },
69 )
70 )