Documentation ¶
Index ¶
- Constants
- func CurrentUserIsBot(mctx libkb.MetaContext, botUID *gregor1.UID) bool
- func DeleteTeambotEKForTest(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) error
- func DeleteTeambotKeyForTest(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) error
- func HandleNewTeambotKey(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (err error)
- func HandleTeambotKeyNeeded(mctx libkb.MetaContext, teamID keybase1.TeamID, botUID keybase1.UID, ...) (err error)
- func NewTeambotKeyersAndInstall(mctx libkb.MetaContext)
- func NotifyTeambotEKNeeded(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) error
- func NotifyTeambotKeyNeeded(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) error
- func ServiceInit(mctx libkb.MetaContext)
- func TeambotEKWrongKIDCacheKey(teamID keybase1.TeamID, botUID keybase1.UID, generation keybase1.EkGeneration) libkb.DbKey
- func TeambotEKWrongKIDPermitted(mctx libkb.MetaContext, teamID keybase1.TeamID, botUID keybase1.UID, ...) (bool, keybase1.Time, error)
- func TeambotKeyWrongKIDCacheKey(teamID keybase1.TeamID, botUID keybase1.UID, ...) libkb.DbKey
- func TeambotKeyWrongKIDPermitted(mctx libkb.MetaContext, teamID keybase1.TeamID, botUID keybase1.UID, ...) (bool, keybase1.Time, error)
- type BotKeyer
- func (k *BotKeyer) DeleteTeambotKeyForTest(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (err error)
- func (k *BotKeyer) GetLatestTeambotKey(mctx libkb.MetaContext, teamID keybase1.TeamID) (key keybase1.TeambotKey, err error)
- func (k *BotKeyer) GetTeambotKeyAtGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, ...) (key keybase1.TeambotKey, err error)
- func (k *BotKeyer) OnDbNuke(mctx libkb.MetaContext) error
- func (k *BotKeyer) OnLogout(mctx libkb.MetaContext) error
- func (k *BotKeyer) SetClock(clock clockwork.Clock)
- type MemberKeyer
- func (k *MemberKeyer) GetOrCreateTeambotKey(mctx libkb.MetaContext, teamID keybase1.TeamID, gBotUID gregor1.UID, ...) (key keybase1.TeambotKey, created bool, err error)
- func (k *MemberKeyer) OnDbNuke(mctx libkb.MetaContext) error
- func (k *MemberKeyer) OnLogout(mctx libkb.MetaContext) error
- func (k *MemberKeyer) PurgeCache(mctx libkb.MetaContext)
- func (k *MemberKeyer) PurgeCacheAtGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, botUID keybase1.UID, ...)
- type TeambotKeyBoxedResponse
- type TeambotKeyResponse
- type TeambotPermanentKeyError
- type TeambotTransientKeyError
Constants ¶
const MaxTeambotKeyWrongKIDPermitted = time.Hour * 24
Variables ¶
This section is empty.
Functions ¶
func CurrentUserIsBot ¶
func CurrentUserIsBot(mctx libkb.MetaContext, botUID *gregor1.UID) bool
func DeleteTeambotEKForTest ¶
func DeleteTeambotEKForTest(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration) error
func DeleteTeambotKeyForTest ¶
func DeleteTeambotKeyForTest(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.TeambotKeyGeneration) error
func HandleNewTeambotKey ¶
func HandleNewTeambotKey(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.TeambotKeyGeneration) (err error)
HandleNewTeambotKey checks that the bot's team cache has at least up to the generation just created.
func HandleTeambotKeyNeeded ¶
func HandleTeambotKeyNeeded(mctx libkb.MetaContext, teamID keybase1.TeamID, botUID keybase1.UID, generation keybase1.TeambotKeyGeneration) (err error)
HandleTeambotEKNeeded forces a teambot key to be generated since the bot does not have access. All team members are notified and race to publish the requested key.
func NewTeambotKeyersAndInstall ¶
func NewTeambotKeyersAndInstall(mctx libkb.MetaContext)
func NotifyTeambotEKNeeded ¶
func NotifyTeambotEKNeeded(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.EkGeneration) error
func NotifyTeambotKeyNeeded ¶
func NotifyTeambotKeyNeeded(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.TeambotKeyGeneration) error
func ServiceInit ¶
func ServiceInit(mctx libkb.MetaContext)
Types ¶
type BotKeyer ¶
type BotKeyer struct {
// contains filtered or unexported fields
}
func NewBotKeyer ¶
func NewBotKeyer(mctx libkb.MetaContext) *BotKeyer
func (*BotKeyer) DeleteTeambotKeyForTest ¶
func (k *BotKeyer) DeleteTeambotKeyForTest(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.TeambotKeyGeneration) (err error)
func (*BotKeyer) GetLatestTeambotKey ¶
func (k *BotKeyer) GetLatestTeambotKey(mctx libkb.MetaContext, teamID keybase1.TeamID) (key keybase1.TeambotKey, err error)
GetLatestTeambotKey finds the latest TeambotKey for *encryption*. Since bots depend on team members to derive a key for them, if the key is signed by an old PTK we allow it to be used for a short window before permanently failing, while we ask politely for a new key. If we don't have access to the latest generation we fall back to the first key we do as long as it's within the signing window.
func (*BotKeyer) GetTeambotKeyAtGeneration ¶
func (k *BotKeyer) GetTeambotKeyAtGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, generation keybase1.TeambotKeyGeneration) (key keybase1.TeambotKey, err error)
GetTeambotKeyAtGeneration finds the TeambotKey at the specified generation. This is used for *decryption* since we allow a key to be signed by an old PTK. For *encryption* keys, see GetLatestTeambotKey.
type MemberKeyer ¶
func NewMemberKeyer ¶
func NewMemberKeyer(mctx libkb.MetaContext) *MemberKeyer
func (*MemberKeyer) GetOrCreateTeambotKey ¶
func (k *MemberKeyer) GetOrCreateTeambotKey(mctx libkb.MetaContext, teamID keybase1.TeamID, gBotUID gregor1.UID, appKey keybase1.TeamApplicationKey) ( key keybase1.TeambotKey, created bool, err error)
GetOrCreateTeambotKey derives a TeambotKey from the given `appKey`, and posts the result to the server if necessary. An in memory cache is kept of keys that have already been posted so we don't hit the server each time.
func (*MemberKeyer) OnDbNuke ¶
func (k *MemberKeyer) OnDbNuke(mctx libkb.MetaContext) error
func (*MemberKeyer) OnLogout ¶
func (k *MemberKeyer) OnLogout(mctx libkb.MetaContext) error
func (*MemberKeyer) PurgeCache ¶
func (k *MemberKeyer) PurgeCache(mctx libkb.MetaContext)
func (*MemberKeyer) PurgeCacheAtGeneration ¶
func (k *MemberKeyer) PurgeCacheAtGeneration(mctx libkb.MetaContext, teamID keybase1.TeamID, botUID keybase1.UID, generation keybase1.TeambotKeyGeneration)
type TeambotKeyBoxedResponse ¶
type TeambotKeyResponse ¶
type TeambotKeyResponse struct { Result *struct { Sig string `json:"sig"` } `json:"result"` }
type TeambotPermanentKeyError ¶
type TeambotPermanentKeyError struct {
// contains filtered or unexported fields
}
func (TeambotPermanentKeyError) Error ¶
func (e TeambotPermanentKeyError) Error() string
type TeambotTransientKeyError ¶
type TeambotTransientKeyError struct {
// contains filtered or unexported fields
}
func (TeambotTransientKeyError) Error ¶
func (e TeambotTransientKeyError) Error() string