Skip to content

Commit fbefe4b

Browse files
authored
Merge pull request #90 from smswithoutborders/staging
Staging
2 parents 0006b5d + 02c54f1 commit fbefe4b

5 files changed

Lines changed: 29 additions & 8 deletions

File tree

content_parser.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@ def extract_content_v1(service_type: str, content: bytes) -> tuple:
245245
result["from"],
246246
result["to"],
247247
result["body"],
248+
result.get("access_token"),
249+
result.get("refresh_token"),
248250
), None
249251

250252
if service_type == "test":
@@ -324,6 +326,8 @@ def extract_content_v2(service_type: str, content: bytes) -> tuple:
324326
result["from"],
325327
result["to"],
326328
result["body"],
329+
result.get("access_token"),
330+
result.get("refresh_token"),
327331
), None
328332

329333
if service_type == "test":

grpc_publisher_service.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,13 @@ def handle_oauth2_publication(
645645
"access_token": parts[2],
646646
"refresh_token": parts[3],
647647
},
648+
"message": lambda parts: {
649+
"sender_id": parts[0],
650+
"recipient": parts[1],
651+
"message": parts[2],
652+
"access_token": parts[3],
653+
"refresh_token": parts[4],
654+
},
648655
}
649656

650657
if service_type not in service_handlers:

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
fastapi[standard]==0.116.1
2-
GitPython==3.1.44
2+
GitPython==3.1.45
33
grpc-interceptor==0.15.4
4-
grpcio==1.73.1
5-
grpcio-testing==1.73.1
6-
grpcio-tools==1.73.1
4+
grpcio==1.74.0
5+
grpcio-testing==1.74.0
6+
grpcio-tools==1.74.0
77
peewee>=3.17.8
88
pymysql==1.1.1
9-
sentry-sdk[grpcio]==2.32.0
9+
sentry-sdk[grpcio]==2.33.2
1010
tqdm==4.67.1
11-
twilio==9.6.5
11+
twilio==9.7.0

tests/test_auth_and_publish.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def create_message_v1(platform, config):
235235
"telegram": ["from", "to", "body"],
236236
"reliability": ["from"],
237237
"bluesky": ["from", "body", "access_token", "refresh_token"],
238+
"slack": ["from", "to", "body", "access_token", "refresh_token"],
238239
}
239240

240241
if platform not in platform_specific_params:
@@ -296,6 +297,7 @@ def create_message_v2(platform, config):
296297
"telegram": ["from", "to", "body"],
297298
"reliability": ["from"],
298299
"bluesky": ["from", "body", "access_token", "refresh_token"],
300+
"slack": ["from", "to", "body", "access_token", "refresh_token"],
299301
}
300302

301303
if platform not in platform_specific_params:
@@ -458,7 +460,8 @@ def test_auth_and_publish_v0(
458460
# ("telegram", b"T", True),
459461
# ("reliability", b"r", False),
460462
# ("reliability", b"r", True),
461-
("bluesky", b"b", True),
463+
# ("bluesky", b"b", True),
464+
("slack", b"s", True),
462465
],
463466
)
464467
def test_auth_and_publish_v1(
@@ -505,7 +508,8 @@ def test_auth_and_publish_v1(
505508
# ("telegram", b"T", True),
506509
# ("reliability", b"r", False),
507510
# ("reliability", b"r", True),
508-
("bluesky", b"b", True),
511+
# ("bluesky", b"b", True),
512+
("slack", b"s", True),
509513
],
510514
)
511515
def test_auth_and_publish_v2(

tests/test_config_template.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,9 @@ bluesky_from =
5151
bluesky_body = Offline communication ensures that information can be shared and exchanged without relying on internet connectivity, fostering direct and uninterrupted interactions.
5252
bluesky_access_token =
5353
bluesky_refresh_token =
54+
55+
slack_from =
56+
slack_to =
57+
slack_body = Offline communication ensures that information can be shared and exchanged without relying on internet connectivity, fostering direct and uninterrupted interactions.
58+
slack_access_token =
59+
slack_refresh_token =

0 commit comments

Comments
 (0)