fix(slack): resolve direct-token selector contexts server-side - #7115
fix(slack): resolve direct-token selector contexts server-side#7115BillLeoutsakosvl346 wants to merge 4 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
ad5a672 to
0b8f18c
Compare
939feb5 to
13c5f6a
Compare
fafded6 to
0486f57
Compare
13c5f6a to
d035b0e
Compare
0486f57 to
17726cb
Compare
d035b0e to
50ffc7a
Compare
Greptile SummaryThe PR moves Slack channel and user selectors onto authorized server-side credential resolution while keeping direct tokens and references out of client cache identity.
Confidence Score: 5/5The reviewed changes appear safe to merge after the documented stacked-PR dependency and retargeting steps are completed. No blocking failure remains; the previously reported missing named input alias is now exported in the required form.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/api/contracts/selectors/slack.ts | Exports the named Slack selector credential schema and canonical input alias requested by the prior review thread without changing the wire schema. |
| apps/sim/lib/selectors/server/slack-credential.ts | Centralizes authorized resolution of direct tokens, environment references, OAuth credentials, and custom-bot credentials. |
| apps/sim/app/api/tools/slack/channels/route.ts | Migrates channel retrieval to authenticated server-side credential resolution while preserving channel visibility behavior. |
| apps/sim/app/api/tools/slack/users/route.ts | Migrates user retrieval to authenticated server-side credential resolution and preserves sanitized failure responses. |
| apps/sim/hooks/selectors/providers/slack/selectors.ts | Marks Slack credential context for server resolution and uses opaque selector cache scope rather than credential plaintext. |
| apps/sim/hooks/selectors/providers/slack/context.ts | Maps raw legacy Slack authentication dependencies while suppressing unsupported runtime block references. |
Sequence Diagram
sequenceDiagram
participant UI as Slack selector UI
participant Route as Slack selector route
participant Auth as Authorized context resolver
participant Slack as Slack API
UI->>Route: Raw credential/reference + optional workflowId
Route->>Auth: Authenticate request and resolve credential context
alt Unauthorized or unresolved
Auth-->>Route: Sanitized error
Route-->>UI: 4xx response
else Authorized
Auth-->>Route: Access token and credential metadata
Route->>Slack: Fetch channels or users
Slack-->>Route: Provider results
Route-->>UI: Filtered selector options
end
Reviews (2): Last reviewed commit: "fix(slack): preserve selector reauthoriz..." | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.
Re-trigger cubic
17726cb to
aeaa7ec
Compare
50ffc7a to
16f984b
Compare
16f984b to
5d9a783
Compare
There was a problem hiding this comment.
1 issue found across 12 files
Confidence score: 4/5
- In
apps/sim/app/api/tools/slack/users/route.ts, swallowing Slack’sinvalid_authresponse prevents the user selector from explaining the authentication failure or guiding reauthorization; preserve a sanitized known error so users can recover.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/app/api/tools/slack/users/route.ts">
<violation number="1" location="apps/sim/app/api/tools/slack/users/route.ts:98">
P2: When Slack rejects a token with `invalid_auth`, this catch hides the provider error, so the user selector cannot surface the authentication failure or guide reauthorization. Preserve a sanitized known error such as `invalid_auth` before falling back to the generic response.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
|
@cubic-dev-ai review this PR |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Requires human review: Auto-approval blocked by 1 unresolved issue from a previous review of this commit.
Re-trigger cubic
|
@cubic-dev-ai review this PR |
@BillLeoutsakosvl346 I have started the AI code review. It will take a few minutes to complete. |
|
Closing this stacked implementation while we investigate a provider-agnostic server-side selector gateway. The branches are being preserved for reference and recovery; this PR is superseded by the architecture investigation, not merged. |
Summary
Security behavior
authRequired: true; unrelated authorization and direct-token failures are unchanged.{{KEY}}refetches without exposing its value.Focused coverage
Verification
git diff --checkpassed on the combined stack.Browser verification
invalid_authwithout echoing either token.<block.output>token reference produced no selector request after prior retries settled.