diaspora-event-sdk 0.3.6__py3-none-any.whl → 0.3.8__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.
- diaspora_event_sdk/sdk/_environments.py +3 -4
- diaspora_event_sdk/sdk/kafka_client.py +9 -9
- diaspora_event_sdk/version.py +1 -1
- {diaspora_event_sdk-0.3.6.dist-info → diaspora_event_sdk-0.3.8.dist-info}/METADATA +1 -1
- {diaspora_event_sdk-0.3.6.dist-info → diaspora_event_sdk-0.3.8.dist-info}/RECORD +9 -9
- {diaspora_event_sdk-0.3.6.dist-info → diaspora_event_sdk-0.3.8.dist-info}/WHEEL +1 -1
- tests/unit/apis_test.py +2 -1
- {diaspora_event_sdk-0.3.6.dist-info → diaspora_event_sdk-0.3.8.dist-info}/LICENSE +0 -0
- {diaspora_event_sdk-0.3.6.dist-info → diaspora_event_sdk-0.3.8.dist-info}/top_level.txt +0 -0
|
@@ -2,7 +2,6 @@ import os
|
|
|
2
2
|
from typing import Union
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
# TOKEN_EXCHANGE = "http://3.220.110.101/"
|
|
6
5
|
DIASPORA_RESOURCE_SERVER = "2b9d2f5c-fa32-45b5-875b-b24cd343b917"
|
|
7
6
|
|
|
8
7
|
|
|
@@ -13,10 +12,10 @@ def _get_envname():
|
|
|
13
12
|
def get_web_service_url(envname: Union[str, None] = None) -> str:
|
|
14
13
|
env = envname or _get_envname()
|
|
15
14
|
urls = {
|
|
16
|
-
"production": "https://diaspora-web-service.
|
|
17
|
-
"dev": "https://diaspora-web-service
|
|
15
|
+
"production": "https://diaspora-web-service.qpp943wkvr7b2.us-east-1.cs.amazonlightsail.com/",
|
|
16
|
+
"dev": "https://diaspora-web-service.qpp943wkvr7b2.us-east-1.cs.amazonlightsail.com/",
|
|
18
17
|
"local": "http://localhost:8000",
|
|
19
|
-
"legacy": "
|
|
18
|
+
"legacy": "https://diaspora-web-service-dev.ml22sevubfnks.us-east-1.cs.amazonlightsail.com",
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
return urls.get(env, urls["production"])
|
|
@@ -27,7 +27,6 @@ def get_diaspora_config(extra_configs: Dict[str, Any] = {}) -> Dict[str, Any]:
|
|
|
27
27
|
Merges default configurations with custom ones provided.
|
|
28
28
|
"""
|
|
29
29
|
|
|
30
|
-
bootstrap_servers = None
|
|
31
30
|
try:
|
|
32
31
|
if (
|
|
33
32
|
"OCTOPUS_AWS_ACCESS_KEY_ID" not in os.environ
|
|
@@ -37,14 +36,13 @@ def get_diaspora_config(extra_configs: Dict[str, Any] = {}) -> Dict[str, Any]:
|
|
|
37
36
|
keys = Client().retrieve_key()
|
|
38
37
|
os.environ["OCTOPUS_AWS_ACCESS_KEY_ID"] = keys["access_key"]
|
|
39
38
|
os.environ["OCTOPUS_AWS_SECRET_ACCESS_KEY"] = keys["secret_key"]
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
bootstrap_servers = os.environ["OCTOPUS_BOOTSTRAP_SERVERS"]
|
|
39
|
+
os.environ["OCTOPUS_BOOTSTRAP_SERVERS"] = keys["endpoint"]
|
|
40
|
+
|
|
43
41
|
except Exception as e:
|
|
44
42
|
raise RuntimeError("Failed to retrieve Kafka keys") from e
|
|
45
43
|
|
|
46
44
|
conf = {
|
|
47
|
-
"bootstrap_servers":
|
|
45
|
+
"bootstrap_servers": os.environ["OCTOPUS_BOOTSTRAP_SERVERS"],
|
|
48
46
|
"security_protocol": "SASL_SSL",
|
|
49
47
|
"sasl_mechanism": "OAUTHBEARER",
|
|
50
48
|
"api_version": (3, 5, 1),
|
|
@@ -100,8 +98,9 @@ def block_until_ready(max_minutes=5):
|
|
|
100
98
|
value={"message": "Synchronous message from Diaspora SDK"},
|
|
101
99
|
)
|
|
102
100
|
result["producer_connection_test"] = future.get(timeout=10)
|
|
103
|
-
except Exception:
|
|
104
|
-
|
|
101
|
+
except Exception as e:
|
|
102
|
+
raise e
|
|
103
|
+
print(e)
|
|
105
104
|
|
|
106
105
|
def consumer_connection_test(result):
|
|
107
106
|
try:
|
|
@@ -113,8 +112,9 @@ def block_until_ready(max_minutes=5):
|
|
|
113
112
|
for msg in consumer:
|
|
114
113
|
result["consumer_connection_test"] = msg
|
|
115
114
|
break
|
|
116
|
-
except Exception:
|
|
117
|
-
|
|
115
|
+
except Exception as e:
|
|
116
|
+
raise e
|
|
117
|
+
print(e)
|
|
118
118
|
|
|
119
119
|
result, retry_count = {}, 0
|
|
120
120
|
start_time = time.time()
|
diaspora_event_sdk/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.3.
|
|
1
|
+
__version__ = "0.3.8"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
diaspora_event_sdk/__init__.py,sha256=x5A69JeA_iNi0i1XK3T2wuSTiOLxRhNdGYN4G39wtFw,455
|
|
2
|
-
diaspora_event_sdk/version.py,sha256=
|
|
2
|
+
diaspora_event_sdk/version.py,sha256=7dTW0A5-FkrEuNOotvR8oW59M2lvIwYouVqfJzvXpKk,22
|
|
3
3
|
diaspora_event_sdk/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
diaspora_event_sdk/sdk/_environments.py,sha256=
|
|
4
|
+
diaspora_event_sdk/sdk/_environments.py,sha256=HH5mDqxmgryJfc_LOYkfSL6V9oSC6GmIvPvUV-qbn0c,697
|
|
5
5
|
diaspora_event_sdk/sdk/aws_iam_msk.py,sha256=9fPH7lgdfZhxKohdZE7shGPYIA4-X-XRbA5KdY-Agjo,3933
|
|
6
6
|
diaspora_event_sdk/sdk/client.py,sha256=6UuFuFX02Q62_iOkjRHDp7iFQs9vGRJ3J-QDa_rqJDc,8767
|
|
7
7
|
diaspora_event_sdk/sdk/decorators.py,sha256=Gel8AyhIjbf4-FNintTNcOqvC9hHH_YwbOH257Nfmf0,884
|
|
8
|
-
diaspora_event_sdk/sdk/kafka_client.py,sha256=
|
|
8
|
+
diaspora_event_sdk/sdk/kafka_client.py,sha256=Ge4_Az1cSN3HJcPJJZgY8TE6j1J-sGPCNABE8F5Oi8g,4663
|
|
9
9
|
diaspora_event_sdk/sdk/web_client.py,sha256=mc6OvYgq8Cl-irjOW5FfhU_1fl1nRF8OKlPPmaQc0zo,4992
|
|
10
10
|
diaspora_event_sdk/sdk/botocore/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
11
|
diaspora_event_sdk/sdk/botocore/auth.py,sha256=QXwCNMzM0wAqD64RlFd-K27atRpixti73VKConpb1kk,18699
|
|
@@ -25,10 +25,10 @@ diaspora_event_sdk/sdk/login_manager/tokenstore.py,sha256=ImncC8EIxoAuGtDiZIwdtU
|
|
|
25
25
|
diaspora_event_sdk/sdk/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
26
|
diaspora_event_sdk/sdk/utils/uuid_like.py,sha256=xbxf0YXpDhdii16lwPLWRN21qFekHrNrqODSToMPtCg,470
|
|
27
27
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
|
-
tests/unit/apis_test.py,sha256=
|
|
28
|
+
tests/unit/apis_test.py,sha256=Fo_WxVARfcqIPmKuLHJFAwRINW-3wzEWmttunOcOhMQ,4463
|
|
29
29
|
tests/unit/client_test.py,sha256=kmvrZnxzri20BDO8g8IWiZvnQGNjD1b970kLr4BwEe4,3012
|
|
30
|
-
diaspora_event_sdk-0.3.
|
|
31
|
-
diaspora_event_sdk-0.3.
|
|
32
|
-
diaspora_event_sdk-0.3.
|
|
33
|
-
diaspora_event_sdk-0.3.
|
|
34
|
-
diaspora_event_sdk-0.3.
|
|
30
|
+
diaspora_event_sdk-0.3.8.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
|
31
|
+
diaspora_event_sdk-0.3.8.dist-info/METADATA,sha256=ycOjo9eJ7Uzz-OS0U5doRomEwSfF1F2QDvrY5Pe9ns0,3631
|
|
32
|
+
diaspora_event_sdk-0.3.8.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
33
|
+
diaspora_event_sdk-0.3.8.dist-info/top_level.txt,sha256=OVun-67t3fkLFEIwvJuNINgFFvAc--bClYhXjLhMmvs,25
|
|
34
|
+
diaspora_event_sdk-0.3.8.dist-info/RECORD,,
|
tests/unit/apis_test.py
CHANGED
|
@@ -66,6 +66,7 @@ def test_register_topic(setup, client):
|
|
|
66
66
|
|
|
67
67
|
def test_list_topics(setup, client):
|
|
68
68
|
topics = client.list_topics()
|
|
69
|
+
print(client.subject_openid, topics)
|
|
69
70
|
assert topics["status"] == "success"
|
|
70
71
|
assert isinstance(topics["topics"], list)
|
|
71
72
|
assert len(topics["topics"]) > 0
|
|
@@ -116,7 +117,7 @@ def test_reset_topic(setup, client):
|
|
|
116
117
|
def test_user_access_management(setup, client):
|
|
117
118
|
topic = "topic" + client.subject_openid[-12:]
|
|
118
119
|
client.register_topic(topic)
|
|
119
|
-
user_id = "
|
|
120
|
+
user_id = "diaspora-cicd"
|
|
120
121
|
grant_response = client.grant_user_access(topic, user_id)
|
|
121
122
|
assert grant_response["status"] in ["success", "no-op"]
|
|
122
123
|
assert "message" in grant_response
|
|
File without changes
|
|
File without changes
|