Skip to content

Commit 6a216c6

Browse files
authored
Merge pull request #144 from codeflash-ai/feature/slack-hosted-public-v2
Harden hosted Slack polling and discovery
2 parents d6837ad + 62a364e commit 6a216c6

25 files changed

Lines changed: 6662 additions & 26 deletions

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/locality-slack/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ reqwest = { version = "0.13", default-features = false, features = ["blocking",
1919
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
2020
serde = { version = "1.0", features = ["derive"] }
2121
serde_json = "1.0"
22+
tokio = { version = "1", features = ["macros", "rt", "sync", "time"] }
23+
24+
[dev-dependencies]
25+
tokio = { version = "1", features = ["test-util"] }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"operation": "verify_installation"
4+
},
5+
{
6+
"operation": "conversations_info",
7+
"channel_id": "C08ENGINEER1"
8+
}
9+
]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
{
3+
"operation": "verify_installation"
4+
},
5+
{
6+
"operation": "conversations_info",
7+
"channel_id": "C08ENGINEER1"
8+
},
9+
{
10+
"operation": "conversations_history",
11+
"request": {
12+
"installation_id": "0198f3c2-7d4e-7a61-8b25-4f9c8d7e6a10",
13+
"team_id": "T08LOCALITY1",
14+
"channel_id": "C08ENGINEER1",
15+
"phase": "historical_history",
16+
"oldest": "1767225599.999999",
17+
"latest": "1780272000.000000",
18+
"inclusive": false,
19+
"cursor": null,
20+
"limit": 15
21+
}
22+
},
23+
{
24+
"operation": "conversations_history",
25+
"request": {
26+
"installation_id": "0198f3c2-7d4e-7a61-8b25-4f9c8d7e6a10",
27+
"team_id": "T08LOCALITY1",
28+
"channel_id": "C08ENGINEER1",
29+
"phase": "historical_history",
30+
"oldest": "1767225599.999999",
31+
"latest": "1780272000.000000",
32+
"inclusive": false,
33+
"cursor": "history-next",
34+
"limit": 15
35+
}
36+
}
37+
]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"ok": true,
3+
"channels": [
4+
{
5+
"id": "C08ENGINEER1",
6+
"context_team_id": "T08LOCALITY1",
7+
"team_id": "T08LOCALITY1",
8+
"name": "engineering",
9+
"created": 1780000000,
10+
"updated": "malformed-timestamp-secret",
11+
"is_archived": false,
12+
"is_private": true,
13+
"is_shared": false,
14+
"is_ext_shared": false,
15+
"is_org_shared": false,
16+
"is_member": true,
17+
"shared_team_ids": [
18+
"T08LOCALITY1"
19+
]
20+
}
21+
],
22+
"response_metadata": {
23+
"next_cursor": ""
24+
}
25+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"ok": true,
3+
"headers": {
4+
"Authorization": "Bearer discovery-secret"
5+
},
6+
"cookies": "discovery-cookie",
7+
"channels": [
8+
{
9+
"id": "C08ENGINEER1",
10+
"context_team_id": "T08LOCALITY1",
11+
"team_id": "T08LOCALITY1",
12+
"name": "engineering",
13+
"topic": {
14+
"value": "Build safely",
15+
"creator": "U08TOPIC001"
16+
},
17+
"purpose": {
18+
"value": "Engineering"
19+
},
20+
"created": 1780000000,
21+
"updated": 1780000010123,
22+
"is_archived": false,
23+
"is_private": true,
24+
"is_shared": false,
25+
"is_ext_shared": false,
26+
"is_org_shared": false,
27+
"is_member": true,
28+
"shared_team_ids": [
29+
"T08LOCALITY1"
30+
],
31+
"latest": {
32+
"text": "private-message-secret",
33+
"files": [
34+
{
35+
"url_private": "https://provider.invalid/discovery-file-secret"
36+
}
37+
]
38+
},
39+
"creator_profile": {
40+
"email": "discovery-secret@example.invalid"
41+
}
42+
}
43+
],
44+
"response_metadata": {
45+
"next_cursor": "page-two"
46+
}
47+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"ok": true,
3+
"channels": [
4+
{
5+
"id": "C08GENERAL01",
6+
"context_team_id": "T08LOCALITY1",
7+
"team_id": "T08LOCALITY1",
8+
"name": "general",
9+
"topic": {
10+
"value": ""
11+
},
12+
"purpose": {
13+
"value": ""
14+
},
15+
"created": 1780000020,
16+
"is_archived": true,
17+
"is_private": false,
18+
"is_shared": false,
19+
"is_ext_shared": false,
20+
"is_org_shared": false,
21+
"is_member": false,
22+
"shared_team_ids": []
23+
}
24+
],
25+
"response_metadata": {
26+
"next_cursor": ""
27+
}
28+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"channel": {
3+
"team_id": "T08LOCALITY1",
4+
"id": "C08ENGINEER1",
5+
"name": "engineering",
6+
"topic": "Build safely",
7+
"purpose": "Engineering",
8+
"created_ts": "1780000000.000000",
9+
"updated_ts": "1780000010.123000",
10+
"sharing": "private"
11+
},
12+
"is_member": true,
13+
"is_archived": false
14+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"ok": true,
3+
"channels": [
4+
{
5+
"id": "C08CONNECT01",
6+
"context_team_id": "T08LOCALITY1",
7+
"team_id": "T08LOCALITY1",
8+
"name": "shared-partner",
9+
"topic": {
10+
"value": "Cross-company coordination"
11+
},
12+
"purpose": {
13+
"value": "Slack Connect"
14+
},
15+
"created": 1780000000,
16+
"updated": 1780000010123,
17+
"is_archived": false,
18+
"is_private": true,
19+
"is_shared": true,
20+
"is_ext_shared": true,
21+
"is_org_shared": false,
22+
"is_member": true,
23+
"shared_team_ids": [
24+
"T08EXTERNAL1",
25+
"T08LOCALITY1"
26+
]
27+
}
28+
],
29+
"response_metadata": {
30+
"next_cursor": ""
31+
}
32+
}

0 commit comments

Comments
 (0)