earthscope-sdk 0.2.0__py3-none-any.whl → 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. earthscope_sdk/__init__.py +5 -1
  2. earthscope_sdk/auth/auth_flow.py +240 -346
  3. earthscope_sdk/auth/client_credentials_flow.py +42 -162
  4. earthscope_sdk/auth/device_code_flow.py +169 -213
  5. earthscope_sdk/auth/error.py +46 -0
  6. earthscope_sdk/client/__init__.py +3 -0
  7. earthscope_sdk/client/_client.py +35 -0
  8. earthscope_sdk/client/user/_base.py +39 -0
  9. earthscope_sdk/client/user/_service.py +94 -0
  10. earthscope_sdk/client/user/models.py +53 -0
  11. earthscope_sdk/common/__init__.py +0 -0
  12. earthscope_sdk/common/_sync_runner.py +141 -0
  13. earthscope_sdk/common/client.py +99 -0
  14. earthscope_sdk/common/context.py +174 -0
  15. earthscope_sdk/common/service.py +59 -0
  16. earthscope_sdk/config/__init__.py +0 -0
  17. earthscope_sdk/config/_bootstrap.py +42 -0
  18. earthscope_sdk/config/_compat.py +148 -0
  19. earthscope_sdk/config/_util.py +48 -0
  20. earthscope_sdk/config/error.py +4 -0
  21. earthscope_sdk/config/models.py +310 -0
  22. earthscope_sdk/config/settings.py +295 -0
  23. earthscope_sdk/model/secret.py +29 -0
  24. {earthscope_sdk-0.2.0.dist-info → earthscope_sdk-1.0.0.dist-info}/METADATA +147 -123
  25. earthscope_sdk-1.0.0.dist-info/RECORD +30 -0
  26. {earthscope_sdk-0.2.0.dist-info → earthscope_sdk-1.0.0.dist-info}/WHEEL +1 -1
  27. earthscope_sdk/user/user.py +0 -32
  28. earthscope_sdk-0.2.0.dist-info/RECORD +0 -12
  29. /earthscope_sdk/{user → client/user}/__init__.py +0 -0
  30. {earthscope_sdk-0.2.0.dist-info → earthscope_sdk-1.0.0.dist-info/licenses}/LICENSE +0 -0
  31. {earthscope_sdk-0.2.0.dist-info → earthscope_sdk-1.0.0.dist-info}/top_level.txt +0 -0
@@ -1,32 +0,0 @@
1
- import requests
2
- import os
3
-
4
- from typing import List
5
-
6
- API_BASE_URL = os.environ.get("API_BASE_URL", "https://data-idm.unavco.org/user/profile")
7
-
8
-
9
- def get_user(access_token: str):
10
- r = requests.get(
11
- f"{API_BASE_URL}/api/user/",
12
- headers={"authorization": f"Bearer {access_token}"},
13
- )
14
- if r.status_code == 200:
15
- return r.json()
16
-
17
- raise RuntimeError(r.json()["detail"])
18
-
19
-
20
- def lookup_anon(access_token: str, ids: List[str], emails: List[str]):
21
- r = requests.post(
22
- f"{API_BASE_URL}/api/user/anon/",
23
- headers={"authorization": f"Bearer {access_token}"},
24
- json={"ids": ids, "emails": emails},
25
- )
26
-
27
- if r.status_code == 200:
28
- return r.json()
29
-
30
- raise RuntimeError(r.json()["detail"])
31
-
32
-
@@ -1,12 +0,0 @@
1
- earthscope_sdk/__init__.py,sha256=Zn1KFblwuFHiDRdRAiRnDBRkbPttWh44jKa5zG2ov0E,22
2
- earthscope_sdk/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- earthscope_sdk/auth/auth_flow.py,sha256=xky9ee8p3-lm-c-8rfnNXWSrPBLW3MG-sHDhjlvzohQ,11701
4
- earthscope_sdk/auth/client_credentials_flow.py,sha256=G4NeWLtKoDZlbx7Fk6TY5fNaGXf3E43YMQcI3vFVsYE,5602
5
- earthscope_sdk/auth/device_code_flow.py,sha256=tl87wYYVqWkM4gJ33735jccpqYqX7P1g_TDo8YAM5rk,9149
6
- earthscope_sdk/user/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
- earthscope_sdk/user/user.py,sha256=Y6mJemHgvDksloO0HndbqPlTHOvJhiIPk-NMKt_EmU0,750
8
- earthscope_sdk-0.2.0.dist-info/LICENSE,sha256=E_MrVXxRaMQNpvZhsDuz_J9N_ux7dlL_WpYSsE391HU,11349
9
- earthscope_sdk-0.2.0.dist-info/METADATA,sha256=OZ_dJczrI-IkZHV9hqVcDdnos-GmQFbtSkj0gS8dGbE,18770
10
- earthscope_sdk-0.2.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
11
- earthscope_sdk-0.2.0.dist-info/top_level.txt,sha256=zTtIT9yN3JPJF7TqmTzqQcAvZZe4pAm907DLoGa5T_E,15
12
- earthscope_sdk-0.2.0.dist-info/RECORD,,
File without changes