Documentation
¶
Index ¶
- func DecryptChromiumCookie(data []byte, password string, iterations int) (string, error)
- func DecryptCookieWindows(encrypted []byte, slackDataDir string) (string, error)
- func GetSafeStoragePasswords(prefix string) []string
- func IsEnterpriseURL(u string) bool
- func KeychainGet(account, service string) string
- func KeychainSet(account, value, service string) bool
- func NormalizeURL(u string) (string, error)
- func QueryReadonlySQLite(dbPath, query string) ([]map[string]any, error)
- func RemoveWorkspace(workspaceURL string) error
- func SaveCredentials(creds *Credentials) error
- func SetDefaultWorkspace(workspaceURL string) error
- func UpsertWorkspace(ws Workspace) error
- func UpsertWorkspaces(workspaces []Workspace) error
- type BraveExtracted
- type BrowserTeam
- type ChromeExtracted
- type Credentials
- type DesktopExtracted
- type DesktopSource
- type FirefoxExtracted
- type FirefoxSource
- type ParsedCurlTokens
- type Workspace
- func ResolveClient(workspaceSelector string) (*slack.Client, *Workspace, error)
- func ResolveDefaultWorkspace() (*Workspace, error)
- func ResolveEnterpriseClient() (*slack.Client, *Workspace, error)
- func ResolveWorkspaceForURL(workspaceURL string) (*Workspace, error)
- func ResolveWorkspaceSelector(selector string) (*Workspace, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptChromiumCookie ¶
DecryptChromiumCookie decrypts a Chromium cookie value using PBKDF2 + AES-128-CBC.
func DecryptCookieWindows ¶
DecryptCookieWindows decrypts a Chromium cookie on Windows using DPAPI + AES-256-GCM. This is a placeholder — Windows support requires os/exec PowerShell calls.
func GetSafeStoragePasswords ¶
GetSafeStoragePasswords retrieves Chromium Safe Storage passwords from the system keychain.
func IsEnterpriseURL ¶ added in v0.1.4
IsEnterpriseURL returns true if the URL is an Enterprise Grid org-level URL.
func KeychainGet ¶
KeychainGet reads a password from macOS keychain.
func KeychainSet ¶
KeychainSet stores a password in macOS keychain.
func NormalizeURL ¶
NormalizeURL returns canonical workspace URL.
func QueryReadonlySQLite ¶
QueryReadonlySQLite copies a SQLite DB (to avoid locking) and runs a query.
func RemoveWorkspace ¶
RemoveWorkspace removes a workspace from credentials.
func SaveCredentials ¶
func SaveCredentials(creds *Credentials) error
SaveCredentials writes credentials to disk.
func SetDefaultWorkspace ¶
SetDefaultWorkspace sets the default workspace.
func UpsertWorkspace ¶
UpsertWorkspace adds or updates a workspace in credentials.
func UpsertWorkspaces ¶
UpsertWorkspaces upserts multiple workspaces.
Types ¶
type BraveExtracted ¶
type BraveExtracted struct {
CookieD string
Teams []BrowserTeam
}
BraveExtracted holds tokens extracted from Brave browser.
func ExtractFromBrave ¶
func ExtractFromBrave() *BraveExtracted
ExtractFromBrave extracts Slack auth from Brave browser (macOS only).
type BrowserTeam ¶
type BrowserTeam struct {
URL string `json:"url"`
Name string `json:"name,omitempty"`
Token string `json:"token"`
EnterpriseID string `json:"enterprise_id,omitempty"`
EnterpriseDomain string `json:"enterprise_domain,omitempty"`
}
BrowserTeam represents a team extracted from a browser.
type ChromeExtracted ¶
type ChromeExtracted struct {
CookieD string
Teams []BrowserTeam
}
ChromeExtracted holds tokens extracted from Chrome.
func ExtractFromChrome ¶
func ExtractFromChrome() *ChromeExtracted
ExtractFromChrome extracts Slack auth from Google Chrome. Primary: reads Cookie DB + LevelDB directly (no AppleScript needed). Fallback: AppleScript on macOS if DB method fails.
type Credentials ¶
type Credentials struct {
Version int `json:"version"`
Default string `json:"default,omitempty"`
Workspaces []Workspace `json:"workspaces"`
}
Credentials holds all workspace credentials.
func LoadCredentials ¶
func LoadCredentials() (*Credentials, error)
LoadCredentials reads the stored credentials file.
type DesktopExtracted ¶
type DesktopExtracted struct {
CookieD string
Teams []BrowserTeam
Source DesktopSource
}
DesktopExtracted holds tokens extracted from Slack Desktop.
func ExtractFromDesktop ¶
func ExtractFromDesktop() (*DesktopExtracted, error)
ExtractFromDesktop extracts Slack auth from Slack Desktop application.
type DesktopSource ¶
type FirefoxExtracted ¶
type FirefoxExtracted struct {
CookieD string
Teams []BrowserTeam
Source FirefoxSource
}
FirefoxExtracted holds tokens extracted from Firefox.
func ExtractFromFirefox ¶
func ExtractFromFirefox(profileSelector string) *FirefoxExtracted
ExtractFromFirefox extracts Slack auth from Firefox profiles.
type FirefoxSource ¶
type ParsedCurlTokens ¶
ParsedCurlTokens holds tokens extracted from a cURL command.
func ParseSlackCurlCommand ¶
func ParseSlackCurlCommand(curlInput string) (*ParsedCurlTokens, error)
ParseSlackCurlCommand extracts tokens from a cURL command string.
type Workspace ¶
type Workspace struct {
WorkspaceURL string `json:"workspace_url"`
WorkspaceName string `json:"workspace_name,omitempty"`
Auth slack.Auth `json:"auth"`
}
Workspace represents a stored workspace with credentials.
func ResolveClient ¶
ResolveClient resolves a Slack API client from available credential sources. Priority: env vars → stored creds (selector match) → default workspace.
func ResolveDefaultWorkspace ¶
ResolveDefaultWorkspace returns the default workspace.
func ResolveEnterpriseClient ¶ added in v0.1.8
ResolveEnterpriseClient finds a stored workspace with an enterprise URL and returns a client for it. Used as fallback for APIs that require enterprise-level access (e.g. client.counts).
func ResolveWorkspaceForURL ¶
ResolveWorkspaceForURL finds a workspace by URL.
func ResolveWorkspaceSelector ¶
ResolveWorkspaceSelector does fuzzy matching on workspace URL/name.