Repository navigation
fix(commands): keep /login to direct messages, as documented - #192
Merged
Merged
Conversation
A Slack slash command in a channel is typed private_command so its reply is ephemeral, and /login treated that as private: the link it opened wrote to the channel office's vault, which every caller there uses. /login now checks that the conversation is direct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
/loginis documented as DM only (commands.mdx: "Open a 15-minute login/vault link. DM only."; the refusal text says the same; the Slack command description says "Store credentials in your private vault"). A Slack slash command typed in a channel bypassed that:/pi-loginfrom a channel asprivate_command, so its reply is ephemeral (slack/bot.ts).isPrivateConversationcountsprivate_commandas private, and/loginchecked only that.vaultConversationIdis never set, so the conversation ID is used), which every caller in that channel shares, while the link labelled it "your vault".So a person following the description in a channel would put personal credentials into a vault the whole channel's agent uses.
Fix
CommandContextgainsdirectConversation(event.conversationKind === "direct"), and/loginchecks it instead ofprivateConversation.privateConversationkeeps its meaning for choosing a private reply./pi-logintyped inChannel office development keys (ADR 0013) stay editable through the Admin portal.
/login shared …and/login copyfollow the same DM-only rule they were documented with.Existing data
Existing vault contents are left alone.
Verification
refuses a slash command in a channel, whose reply is private but whose vault is the channel'sfails onmain(a link token is created) and passes here.lint,fmt:check,knip,typecheck,build, full test suite (2,064 passed), duplication guard.chat.commandneeds a client token the QA users do not have, so the channel case was not reproduced on the real platform and is covered by the unit test.CommandContextgains a required field; an embedder that builds contexts itself must set it.