File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
backend/ee/onyx/external_permissions/slack Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ def _fetch_workspace_permissions(
30
30
external_user_emails = user_emails ,
31
31
# No group<->document mapping for slack
32
32
external_user_group_ids = set (),
33
- # No way to determine if slack is invite only without enterprise liscense
33
+ # No way to determine if slack is invite only without enterprise license
34
34
is_public = False ,
35
35
)
36
36
Original file line number Diff line number Diff line change 9
9
10
10
from ee .onyx .db .external_perm import ExternalUserGroup
11
11
from ee .onyx .external_permissions .slack .utils import fetch_user_id_to_email_map
12
+ from onyx .connectors .credentials_provider import OnyxDBCredentialsProvider
12
13
from onyx .connectors .slack .connector import make_paginated_slack_api_call_w_retries
14
+ from onyx .connectors .slack .connector import SlackConnector
13
15
from onyx .db .models import ConnectorCredentialPair
16
+ from onyx .redis .redis_pool import get_redis_client
14
17
from onyx .utils .logger import setup_logger
15
18
16
19
logger = setup_logger ()
@@ -55,9 +58,16 @@ def slack_group_sync(
55
58
tenant_id : str ,
56
59
cc_pair : ConnectorCredentialPair ,
57
60
) -> list [ExternalUserGroup ]:
58
- slack_client = WebClient (
59
- token = cc_pair .credential .credential_json ["slack_bot_token" ]
61
+
62
+ provider = OnyxDBCredentialsProvider (tenant_id , "slack" , cc_pair .credential .id )
63
+ r = get_redis_client (tenant_id = tenant_id )
64
+ slack_client = SlackConnector .make_slack_web_client (
65
+ provider .get_provider_key (),
66
+ cc_pair .credential .credential_json ["slack_bot_token" ],
67
+ SlackConnector .MAX_RETRIES ,
68
+ r ,
60
69
)
70
+
61
71
user_id_to_email_map = fetch_user_id_to_email_map (slack_client )
62
72
63
73
onyx_groups : list [ExternalUserGroup ] = []
You can’t perform that action at this time.
0 commit comments