Documentation
¶
Overview ¶
Package slackdesktop reads the Slack desktop application's on-disk state: the session `d` cookie (from the app's encrypted Cookies sqlite DB) and the list of signed-in workspaces (from storage/root-state.json).
The cookie-decryption logic is adapted from github.com/rneatherway/slack (MIT License, Copyright (c) rneatherway). Original notice retained.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrDesktopNotFound = errors.New("slack desktop app config directory not found") ErrNotSignedIn = errors.New("no slack workspaces are signed in") ErrCookieDBMissing = errors.New("slack cookie database not found") ErrKeyringLocked = errors.New("system keyring is locked") ErrNoSecretService = errors.New("no system secret service available") ErrDecryptFailed = errors.New("failed to decrypt slack session cookie") )
Functions ¶
func ConfigDir ¶
ConfigDir returns the Slack desktop config dir, or ErrDesktopNotFound if it does not exist on disk.
func Tokens ¶ added in v0.13.0
Tokens reads the desktop app's Local Storage LevelDB and returns a map of team ID to xoxc token. Returns ErrNotSignedIn if no localConfig_v2 entry with any team token is found.
The LevelDB is copied to a temp dir first (like the Cookies DB) so the live profile isn't locked or mutated while Slack is running.
Types ¶
type Workspace ¶
Workspace is one signed-in workspace from the Slack desktop app.
func Workspaces ¶
Workspaces reads and parses the desktop app's signed-in workspace list.