Skip to content

Commit f482a2d

Browse files
authored
Merge pull request #1061 from airweave-ai/fix/slack-auth-provider
Feat: Add auth provider support to federated search with shared utilities
2 parents 83d2367 + b87576f commit f482a2d

File tree

7 files changed

+581
-484
lines changed

7 files changed

+581
-484
lines changed

backend/airweave/platform/auth_providers/pipedream.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class PipedreamAuthProvider(BaseAuthProvider):
8989
SLUG_NAME_MAPPING = {
9090
"outlook_mail": "outlook",
9191
"outlook_calendar": "outlook",
92+
"slack": "slack_v2", # Pipedream uses slack_v2 for their newer Slack app
9293
# Add more mappings as needed when names differ
9394
}
9495

backend/airweave/platform/sources/slack.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
AuthenticationMethod.OAUTH_TOKEN,
2323
AuthenticationMethod.AUTH_PROVIDER,
2424
],
25-
oauth_type=OAuthType.WITH_REFRESH,
26-
auth_config_class=None,
25+
oauth_type=OAuthType.ACCESS_ONLY,
26+
auth_config_class="SlackAuthConfig",
2727
config_class="SlackConfig",
2828
labels=["Communication", "Messaging"],
2929
supports_continuous=False,
@@ -200,7 +200,20 @@ async def _fetch_search_page(
200200
if not response_data.get("ok"):
201201
error = response_data.get("error", "unknown_error")
202202
self.logger.error(f"Slack search API error: {error}")
203-
return None
203+
204+
# Provide helpful error messages for common issues
205+
if error == "missing_scope":
206+
raise ValueError(
207+
"Slack search failed: missing 'search:read' scope. "
208+
"Please ensure your Slack OAuth connection includes the 'search:read' scope "
209+
"to enable message search."
210+
)
211+
elif error == "not_authed":
212+
raise ValueError("Slack search failed: authentication token is invalid or expired")
213+
elif error == "account_inactive":
214+
raise ValueError("Slack search failed: account is inactive")
215+
else:
216+
raise ValueError(f"Slack search failed: {error}")
204217

205218
return response_data
206219

0 commit comments

Comments
 (0)