Documentation
¶
Overview ¶
Package auth keeps the Slack tokens: login, refresh and the Keychain.
Index ¶
Constants ¶
const UserScopes = "search:read,channels:history,groups:history,im:history,mpim:history," +
"channels:read,groups:read,im:read,mpim:read,users:read,users:read.email," +
"chat:write,im:write,reactions:read,reactions:write,files:read"
UserScopes is the scope list Login asks for.
Variables ¶
var ( // ErrNotFound is a Keychain item that is absent. ErrNotFound = errors.New("no such keychain item") // ErrNotLoggedIn is a Store with no token. ErrNotLoggedIn = errors.New("not logged in to Slack") )
Functions ¶
This section is empty.
Types ¶
type Login ¶
type SecurityKeychain ¶
type SecurityKeychain struct{ Bin string }
SecurityKeychain shells out to Bin (default "/usr/bin/security"). Set writes through `security -i` with `add-generic-password -U -s <svc> -a <acct> -X <hex secret>` on stdin; the secret never reaches argv.
func (SecurityKeychain) Delete ¶
func (k SecurityKeychain) Delete(service, account string) error
type Store ¶
type Store struct {
Keychain Keychain
Service string
LockPath string // default <os.UserCacheDir()>/<Service>.lock, so every process using one service shares the lock
Client *slack.Client
ClientID string
Now func() time.Time
Log func(format string, args ...any) // names the service, never a token
// contains filtered or unexported fields
}
func (*Store) DeleteAppToken ¶
func (*Store) SaveAppToken ¶
SaveAppToken refuses a value that is not an app-level token.