Documentation ¶
Overview ¶
Similar to libkb/kbsigs.go, but for teams sigs.
Index ¶
- Constants
- func AcceptInvite(ctx context.Context, g *libkb.GlobalContext, token string) error
- func AddMember(ctx context.Context, g *libkb.GlobalContext, teamname, username string, ...) (keybase1.TeamAddMemberResult, error)
- func AnnotateInvites(ctx context.Context, g *libkb.GlobalContext, ...) (map[keybase1.TeamInviteID]keybase1.AnnotatedTeamInvite, error)
- func ChangeRoles(ctx context.Context, g *libkb.GlobalContext, teamname string, ...) error
- func ChangeSig(me *libkb.User, prev libkb.LinkID, seqno keybase1.Seqno, key libkb.GenericKey, ...) (*jsonw.Wrapper, error)
- func CreateRootTeam(ctx context.Context, g *libkb.GlobalContext, name string) (err error)
- func CreateSubteam(ctx context.Context, g *libkb.GlobalContext, subteamBasename string, ...) (ret *keybase1.TeamID, err error)
- func Delete(ctx context.Context, g *libkb.GlobalContext, ui keybase1.TeamsUiInterface, ...) error
- func Details(ctx context.Context, g *libkb.GlobalContext, name string, forceRepoll bool) (res keybase1.TeamDetails, err error)
- func EditMember(ctx context.Context, g *libkb.GlobalContext, teamname, username string, ...) error
- func GetRootID(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID) (keybase1.TeamID, error)
- func HandleChangeNotification(ctx context.Context, g *libkb.GlobalContext, rows []keybase1.TeamChangeRow, ...) error
- func HandleRotateRequest(ctx context.Context, g *libkb.GlobalContext, teamID keybase1.TeamID, ...) (err error)
- func HandleSBSRequest(ctx context.Context, g *libkb.GlobalContext, msg keybase1.TeamSBSMsg) error
- func IdentifyLite(ctx context.Context, g *libkb.GlobalContext, arg keybase1.IdentifyLiteArg, ...) (res keybase1.IdentifyLiteRes, err error)
- func IgnoreRequest(ctx context.Context, g *libkb.GlobalContext, teamname, username string) error
- func InviteEmailMember(ctx context.Context, g *libkb.GlobalContext, teamname, email string, ...) error
- func Leave(ctx context.Context, g *libkb.GlobalContext, teamname string, permanent bool) error
- func List(ctx context.Context, g *libkb.GlobalContext, arg keybase1.TeamListArg) (*keybase1.AnnotatedTeamList, error)
- func ListRequests(ctx context.Context, g *libkb.GlobalContext) ([]keybase1.TeamJoinRequest, error)
- func LoadTeamPlusApplicationKeys(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID, ...) (res keybase1.TeamPlusApplicationKeys, err error)
- func MemberInvite(ctx context.Context, g *libkb.GlobalContext, teamname, username, typ string) (*keybase1.TeamInvite, error)
- func MemberRole(ctx context.Context, g *libkb.GlobalContext, teamname, username string) (keybase1.TeamRole, error)
- func NewPrevError(format string, args ...interface{}) error
- func NewSubteamID() keybase1.TeamID
- func NewSubteamSig(me *libkb.User, key libkb.GenericKey, parentTeam *TeamSigChainState, ...) (*jsonw.Wrapper, error)
- func NewTeamDoesNotExistError(descriptor string) error
- func NewUserVersion(uid keybase1.UID, eldestSeqno keybase1.Seqno) keybase1.UserVersion
- func ParseUserVersion(s string) (res keybase1.UserVersion, err error)
- func RemoveMember(ctx context.Context, g *libkb.GlobalContext, teamname, username string) error
- func RenameSubteam(ctx context.Context, g *libkb.GlobalContext, prevName keybase1.TeamName, ...) error
- func RenameSubteamSig(me *libkb.User, key libkb.GenericKey, parentTeam *TeamSigChainState, ...) (*jsonw.Wrapper, error)
- func RenameUpPointerSig(me *libkb.User, key libkb.GenericKey, subteam *TeamSigChainState, ...) (*jsonw.Wrapper, error)
- func RequestAccess(ctx context.Context, g *libkb.GlobalContext, teamname string) error
- func ResolveIDToName(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID) (name keybase1.TeamName, err error)
- func ResolveNameToID(ctx context.Context, g *libkb.GlobalContext, name keybase1.TeamName) (id keybase1.TeamID, err error)
- func RootTeamIDFromName(n keybase1.TeamName) keybase1.TeamID
- func RootTeamIDFromNameString(name string) keybase1.TeamID
- func SetRoleAdmin(ctx context.Context, g *libkb.GlobalContext, teamname, username string) error
- func SetRoleOwner(ctx context.Context, g *libkb.GlobalContext, teamname, username string) error
- func SetRoleReader(ctx context.Context, g *libkb.GlobalContext, teamname, username string) error
- func SetRoleWriter(ctx context.Context, g *libkb.GlobalContext, teamname, username string) error
- func SubteamHeadSig(me *libkb.User, key libkb.GenericKey, subteamTeamSection SCTeamSection) (*jsonw.Wrapper, error)
- func TeamRootSig(me *libkb.User, key libkb.GenericKey, teamSection SCTeamSection) (*jsonw.Wrapper, error)
- func TeamTree(ctx context.Context, g *libkb.GlobalContext, arg keybase1.TeamTreeArg) (res keybase1.TeamTreeResult, err error)
- type AdminNotFoundError
- type AdminPermissionError
- type AppendLinkError
- type DiskStorage
- type DiskStorageItem
- type InflateError
- type InvalidLink
- type InviteError
- type LameSecretUI
- type LoaderContext
- type LoaderContextG
- type MemberChecker
- type MemoryStorage
- type PerTeamSharedSecretBox
- type PerTeamSharedSecretBoxes
- type PermissionError
- type PrevError
- type ProofError
- type ResolveError
- type SCChainLink
- type SCChainLinkPayload
- type SCKeySection
- type SCMerkleRootSection
- type SCPayloadBody
- type SCPerTeamKey
- type SCSubteam
- type SCTeamAdmin
- type SCTeamID
- type SCTeamInvite
- type SCTeamInviteID
- type SCTeamInvites
- type SCTeamMember
- type SCTeamMembers
- type SCTeamName
- type SCTeamParent
- type SCTeamSection
- type Storage
- type StubbedError
- type Team
- func GetForTeamManagementByStringName(ctx context.Context, g *libkb.GlobalContext, name string, needAdmin bool) (*Team, error)
- func GetMaybeAdminByStringName(ctx context.Context, g *libkb.GlobalContext, name string) (*Team, error)
- func Load(ctx context.Context, g *libkb.GlobalContext, lArg keybase1.LoadTeamArg) (*Team, error)
- func NewTeam(ctx context.Context, g *libkb.GlobalContext, teamData *keybase1.TeamData) *Team
- func (t *Team) AllAdmins(ctx context.Context) ([]keybase1.UserVersion, error)
- func (t *Team) AllApplicationKeys(ctx context.Context, application keybase1.TeamApplication) (res []keybase1.TeamApplicationKey, err error)
- func (t *Team) ApplicationKey(ctx context.Context, application keybase1.TeamApplication) (keybase1.TeamApplicationKey, error)
- func (t *Team) ApplicationKeyAtGeneration(application keybase1.TeamApplication, generation keybase1.PerTeamKeyGeneration) (res keybase1.TeamApplicationKey, err error)
- func (t *Team) ChangeMembership(ctx context.Context, req keybase1.TeamChangeReq) error
- func (t *Team) ChatKey(ctx context.Context) (keybase1.TeamApplicationKey, error)
- func (t *Team) CurrentSeqno() keybase1.Seqno
- func (t *Team) ExportToTeamPlusApplicationKeys(ctx context.Context, idTime keybase1.Time, ...) (ret keybase1.TeamPlusApplicationKeys, err error)
- func (t *Team) ForceMerkleRootUpdate(ctx context.Context) error
- func (t *Team) Generation() keybase1.PerTeamKeyGeneration
- func (t *Team) HasActiveInvite(name, typ string) (bool, error)
- func (t *Team) InviteEmailMember(ctx context.Context, email string, role keybase1.TeamRole) error
- func (t *Team) InviteMember(ctx context.Context, username string, role keybase1.TeamRole, ...) (keybase1.TeamAddMemberResult, error)
- func (t *Team) IsMember(ctx context.Context, uv keybase1.UserVersion) bool
- func (t *Team) KBFSKey(ctx context.Context) (keybase1.TeamApplicationKey, error)
- func (t *Team) Leave(ctx context.Context, permanent bool) error
- func (t *Team) MemberRole(ctx context.Context, uv keybase1.UserVersion) (keybase1.TeamRole, error)
- func (t *Team) Members() (keybase1.TeamMembers, error)
- func (t *Team) Name() keybase1.TeamName
- func (t *Team) NextSeqno() keybase1.Seqno
- func (t *Team) Rotate(ctx context.Context) error
- func (t *Team) SharedSecret(ctx context.Context) (ret keybase1.PerTeamKeySeed, err error)
- func (t *Team) UsersWithRole(role keybase1.TeamRole) ([]keybase1.UserVersion, error)
- type TeamBox
- type TeamDoesNotExistError
- type TeamIDAndName
- type TeamKeyManager
- func (t *TeamKeyManager) EncryptionKey() (libkb.NaclDHKeyPair, error)
- func (t *TeamKeyManager) RotateSharedSecretBoxes(ctx context.Context, senderKey libkb.GenericKey, ...) (boxes *PerTeamSharedSecretBoxes, keySection *SCPerTeamKey, err error)
- func (t *TeamKeyManager) SharedSecret() keybase1.PerTeamKeySeed
- func (t *TeamKeyManager) SharedSecretBoxes(ctx context.Context, senderKey libkb.GenericKey, ...) (boxes *PerTeamSharedSecretBoxes, err error)
- func (t *TeamKeyManager) SigningKey() (libkb.NaclSigningKeyPair, error)
- type TeamLoader
- func (l *TeamLoader) ImplicitAdmins(ctx context.Context, teamID keybase1.TeamID) (impAdmins []keybase1.UserVersion, err error)
- func (l *TeamLoader) Load(ctx context.Context, lArg keybase1.LoadTeamArg) (res *keybase1.TeamData, err error)
- func (l *TeamLoader) MapIDToName(ctx context.Context, id keybase1.TeamID) (keybase1.TeamName, error)
- func (l *TeamLoader) NotifyTeamRename(ctx context.Context, id keybase1.TeamID, newName string) error
- func (l *TeamLoader) OnLogout()
- func (l *TeamLoader) VerifyTeamName(ctx context.Context, id keybase1.TeamID, name keybase1.TeamName) error
- type TeamSigChainPlayer
- type TeamSigChainState
- func (t TeamSigChainState) AssertWasAdminAt(uv keybase1.UserVersion, scl keybase1.SigChainLocation) (err error)
- func (t TeamSigChainState) AssertWasReaderAt(uv keybase1.UserVersion, scl keybase1.SigChainLocation) (err error)
- func (t TeamSigChainState) DeepCopy() TeamSigChainState
- func (t *TeamSigChainState) FindActiveInvite(name, typ string) (*keybase1.TeamInvite, error)
- func (t *TeamSigChainState) FindActiveInviteByID(id keybase1.TeamInviteID) (keybase1.TeamInvite, bool)
- func (t TeamSigChainState) GetAdminUserLogPoint(user keybase1.UserVersion) *keybase1.UserLogPoint
- func (t TeamSigChainState) GetID() keybase1.TeamID
- func (t TeamSigChainState) GetLatestGeneration() keybase1.PerTeamKeyGeneration
- func (t TeamSigChainState) GetLatestLibkbLinkID() (libkb.LinkID, error)
- func (t TeamSigChainState) GetLatestLinkID() keybase1.LinkID
- func (t TeamSigChainState) GetLatestPerTeamKey() (keybase1.PerTeamKey, error)
- func (t TeamSigChainState) GetLatestSeqno() keybase1.Seqno
- func (t TeamSigChainState) GetLibkbLinkIDBySeqno(seqno keybase1.Seqno) (l2 libkb.LinkID, err error)
- func (t TeamSigChainState) GetLinkIDBySeqno(seqno keybase1.Seqno) (keybase1.LinkID, error)
- func (t TeamSigChainState) GetParentID() *keybase1.TeamID
- func (t TeamSigChainState) GetPerTeamKeyAtGeneration(gen keybase1.PerTeamKeyGeneration) (keybase1.PerTeamKey, error)
- func (t TeamSigChainState) GetSubteamName(id keybase1.TeamID) (*keybase1.TeamName, error)
- func (t TeamSigChainState) GetUserLogPoint(user keybase1.UserVersion) *keybase1.UserLogPoint
- func (t TeamSigChainState) GetUserRole(user keybase1.UserVersion) (keybase1.TeamRole, error)
- func (t TeamSigChainState) GetUsersWithRole(role keybase1.TeamRole) (res []keybase1.UserVersion, err error)
- func (t *TeamSigChainState) HasActiveInvite(name, typ string) (bool, error)
- func (t TeamSigChainState) HasAnyStubbedLinks() bool
- func (t TeamSigChainState) HasStubbedSeqno(seqno keybase1.Seqno) bool
- func (t TeamSigChainState) IsLinkFullyPresent(seqno keybase1.Seqno) bool
- func (t TeamSigChainState) IsSubteam() bool
- func (t TeamSigChainState) LatestLastNamePart() keybase1.TeamNamePart
- func (t *TeamSigChainState) ListSubteams() (res []TeamIDAndName)
- func (t *TeamSigChainState) SubteamRenameOccurred(subteamID keybase1.TeamID, newName keybase1.TeamName, seqno keybase1.Seqno) error
- type UnexpectedSeqnoError
Constants ¶
const MemCacheLRUSize = 50
const TeamSigChainPlayerSupportedLinkVersion = 2
Variables ¶
This section is empty.
Functions ¶
func AcceptInvite ¶
func AddMember ¶
func AddMember(ctx context.Context, g *libkb.GlobalContext, teamname, username string, role keybase1.TeamRole) (keybase1.TeamAddMemberResult, error)
func AnnotateInvites ¶
func AnnotateInvites(ctx context.Context, g *libkb.GlobalContext, invites map[keybase1.TeamInviteID]keybase1.TeamInvite, teamName string) (map[keybase1.TeamInviteID]keybase1.AnnotatedTeamInvite, error)
func ChangeRoles ¶
func ChangeRoles(ctx context.Context, g *libkb.GlobalContext, teamname string, req keybase1.TeamChangeReq) error
func CreateRootTeam ¶
func CreateSubteam ¶
func Delete ¶
func Delete(ctx context.Context, g *libkb.GlobalContext, ui keybase1.TeamsUiInterface, teamname string) error
func Details ¶
func Details(ctx context.Context, g *libkb.GlobalContext, name string, forceRepoll bool) (res keybase1.TeamDetails, err error)
func EditMember ¶
func HandleChangeNotification ¶
func HandleChangeNotification(ctx context.Context, g *libkb.GlobalContext, rows []keybase1.TeamChangeRow, changes keybase1.TeamChangeSet) error
func HandleRotateRequest ¶
func HandleRotateRequest(ctx context.Context, g *libkb.GlobalContext, teamID keybase1.TeamID, generation keybase1.PerTeamKeyGeneration) (err error)
func HandleSBSRequest ¶
func HandleSBSRequest(ctx context.Context, g *libkb.GlobalContext, msg keybase1.TeamSBSMsg) error
func IdentifyLite ¶
func IdentifyLite(ctx context.Context, g *libkb.GlobalContext, arg keybase1.IdentifyLiteArg, au libkb.AssertionURL) (res keybase1.IdentifyLiteRes, err error)
func IgnoreRequest ¶
func InviteEmailMember ¶
func List ¶
func List(ctx context.Context, g *libkb.GlobalContext, arg keybase1.TeamListArg) (*keybase1.AnnotatedTeamList, error)
func ListRequests ¶
func ListRequests(ctx context.Context, g *libkb.GlobalContext) ([]keybase1.TeamJoinRequest, error)
func LoadTeamPlusApplicationKeys ¶
func LoadTeamPlusApplicationKeys(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID, application keybase1.TeamApplication, refreshers keybase1.TeamRefreshers) (res keybase1.TeamPlusApplicationKeys, err error)
func MemberInvite ¶
func MemberInvite(ctx context.Context, g *libkb.GlobalContext, teamname, username, typ string) (*keybase1.TeamInvite, error)
func MemberRole ¶
func NewPrevError ¶
func NewSubteamID ¶
15 random bytes, followed by the byte 0x25, encoded as hex
func NewSubteamSig ¶
func NewSubteamSig(me *libkb.User, key libkb.GenericKey, parentTeam *TeamSigChainState, subteamName keybase1.TeamName, subteamID keybase1.TeamID, admin *SCTeamAdmin) (*jsonw.Wrapper, error)
func NewUserVersion ¶
Create a new user/version pair.
func ParseUserVersion ¶
func ParseUserVersion(s string) (res keybase1.UserVersion, err error)
func RemoveMember ¶
func RenameSubteam ¶
func RenameSubteamSig ¶
func RenameSubteamSig(me *libkb.User, key libkb.GenericKey, parentTeam *TeamSigChainState, teamSection SCTeamSection) (*jsonw.Wrapper, error)
func RenameUpPointerSig ¶
func RenameUpPointerSig(me *libkb.User, key libkb.GenericKey, subteam *TeamSigChainState, teamSection SCTeamSection) (*jsonw.Wrapper, error)
func RequestAccess ¶
func ResolveIDToName ¶
func ResolveIDToName(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID) (name keybase1.TeamName, err error)
ResolveIDToName takes a team ID and resolve it to a name. It can use server-assist but always cryptographically checks the result.
func ResolveNameToID ¶
func ResolveNameToID(ctx context.Context, g *libkb.GlobalContext, name keybase1.TeamName) (id keybase1.TeamID, err error)
ResolveNameToID takes a team name and resolve it to a team ID. It can use server-assist but always cryptographically checks the result.
func RootTeamIDFromNameString ¶
the first 15 bytes of the sha256 of the lowercase team name, followed by the byte 0x24, encoded as hex
func SetRoleAdmin ¶
func SetRoleOwner ¶
func SetRoleReader ¶
func SetRoleWriter ¶
func SubteamHeadSig ¶
func SubteamHeadSig(me *libkb.User, key libkb.GenericKey, subteamTeamSection SCTeamSection) (*jsonw.Wrapper, error)
func TeamRootSig ¶
func TeamRootSig(me *libkb.User, key libkb.GenericKey, teamSection SCTeamSection) (*jsonw.Wrapper, error)
func TeamTree ¶
func TeamTree(ctx context.Context, g *libkb.GlobalContext, arg keybase1.TeamTreeArg) (res keybase1.TeamTreeResult, err error)
Types ¶
type AdminNotFoundError ¶
type AdminNotFoundError struct {
Admin SCTeamAdmin
}
func NewAdminNotFoundError ¶
func NewAdminNotFoundError(a SCTeamAdmin) AdminNotFoundError
func (AdminNotFoundError) Error ¶
func (e AdminNotFoundError) Error() string
type AdminPermissionError ¶
type AdminPermissionError struct { TeamID keybase1.TeamID UserVersion keybase1.UserVersion Desc string }
func NewAdminPermissionError ¶
func NewAdminPermissionError(t keybase1.TeamID, uv keybase1.UserVersion, d string) AdminPermissionError
func (AdminPermissionError) Error ¶
func (e AdminPermissionError) Error() string
type AppendLinkError ¶
type AppendLinkError struct {
// contains filtered or unexported fields
}
func NewAppendLinkError ¶
func NewAppendLinkError(l *chainLinkUnpacked, prevSeqno keybase1.Seqno, inner error) AppendLinkError
func (AppendLinkError) Error ¶
func (e AppendLinkError) Error() string
type DiskStorage ¶
type DiskStorage struct { libkb.Contextified sync.Mutex // contains filtered or unexported fields }
Store TeamData's on disk. Threadsafe.
func NewDiskStorage ¶
func NewDiskStorage(g *libkb.GlobalContext) *DiskStorage
type DiskStorageItem ¶
type InflateError ¶
type InflateError struct {
// contains filtered or unexported fields
}
func NewInflateError ¶
func NewInflateError(l *chainLinkUnpacked) InflateError
func NewInflateErrorWithNote ¶
func NewInflateErrorWithNote(l *chainLinkUnpacked, note string) InflateError
func (InflateError) Error ¶
func (e InflateError) Error() string
type InvalidLink ¶
type InvalidLink struct {
// contains filtered or unexported fields
}
func NewInvalidLink ¶
func NewInvalidLink(l *chainLinkUnpacked, format string, args ...interface{}) InvalidLink
func (InvalidLink) Error ¶
func (e InvalidLink) Error() string
type InviteError ¶
type InviteError struct {
// contains filtered or unexported fields
}
func NewInviteError ¶
func NewInviteError(m string) InviteError
func (InviteError) Error ¶
func (i InviteError) Error() string
type LameSecretUI ¶
type LameSecretUI struct{}
func (LameSecretUI) GetPassphrase ¶
func (d LameSecretUI) GetPassphrase(pinentry keybase1.GUIEntryArg, terminal *keybase1.SecretEntryArg) (keybase1.GetPassphraseRes, error)
type LoaderContext ¶
type LoaderContext interface {
// contains filtered or unexported methods
}
Things TeamLoader uses that are mocked out for tests.
func NewLoaderContextFromG ¶
func NewLoaderContextFromG(g *libkb.GlobalContext) LoaderContext
type LoaderContextG ¶
type LoaderContextG struct {
libkb.Contextified
}
The main LoaderContext is G.
type MemberChecker ¶
type MemberChecker interface {
IsMember(context.Context, keybase1.UserVersion) bool
}
type MemoryStorage ¶
type MemoryStorage struct { libkb.Contextified // contains filtered or unexported fields }
Store some TeamSigChainState's in memory. Threadsafe.
func NewMemoryStorage ¶
func NewMemoryStorage(g *libkb.GlobalContext) *MemoryStorage
type PerTeamSharedSecretBox ¶
type PerTeamSharedSecretBox struct { // contains filtered or unexported fields }
type PerTeamSharedSecretBoxes ¶
type PerTeamSharedSecretBoxes struct {}
type PermissionError ¶
type PermissionError struct { TeamID keybase1.TeamID UserVersion keybase1.UserVersion Desc string }
func NewPermissionError ¶
func NewPermissionError(t keybase1.TeamID, uv keybase1.UserVersion, d string) PermissionError
func (PermissionError) Error ¶
func (e PermissionError) Error() string
type ProofError ¶
type ProofError struct {
// contains filtered or unexported fields
}
func NewProofError ¶
func NewProofError(p proof, s string) ProofError
func (ProofError) Error ¶
func (p ProofError) Error() string
type ResolveError ¶
type ResolveError struct {
// contains filtered or unexported fields
}
func NewResolveError ¶
func NewResolveError(name keybase1.TeamName, id keybase1.TeamID) ResolveError
func (ResolveError) Error ¶
func (e ResolveError) Error() string
type SCChainLink ¶
type SCChainLink struct { Seqno keybase1.Seqno `json:"seqno"` Sig string `json:"sig"` // string containing json of a SCChainLinkPayload. Payload string `json:"payload_json"` // uid of the signer UID keybase1.UID `json:"uid"` Version int `json:"version"` }
func ParseTeamChainLink ¶
func ParseTeamChainLink(link string) (res SCChainLink, err error)
Parse a chain link from a string. Just parses, does not validate.
func (*SCChainLink) UnmarshalPayload ¶
func (link *SCChainLink) UnmarshalPayload() (res SCChainLinkPayload, err error)
type SCChainLinkPayload ¶
type SCChainLinkPayload struct { Body SCPayloadBody `json:"body,omitempty"` Ctime int `json:"ctime,omitempty"` ExpireIn int `json:"expire_in,omitempty"` Prev *string `json:"prev,omitempty"` SeqType keybase1.SeqType `json:"seq_type,omitempty"` Seqno keybase1.Seqno `json:"seqno,omitempty"` Tag string `json:"tag,omitempty"` }
func (SCChainLinkPayload) SigChainLocation ¶
func (s SCChainLinkPayload) SigChainLocation() keybase1.SigChainLocation
func (*SCChainLinkPayload) SignatureMetadata ¶
func (i *SCChainLinkPayload) SignatureMetadata() keybase1.SignatureMetadata
func (SCChainLinkPayload) TeamAdmin ¶
func (s SCChainLinkPayload) TeamAdmin() *SCTeamAdmin
type SCKeySection ¶
type SCMerkleRootSection ¶
type SCMerkleRootSection struct { Ctime int `json:"ctime"` Seqno keybase1.Seqno `json:"seqno"` HashMeta keybase1.HashMeta `json:"hash_meta"` }
func (SCMerkleRootSection) ToMerkleRootV2 ¶
func (sr SCMerkleRootSection) ToMerkleRootV2() keybase1.MerkleRootV2
type SCPayloadBody ¶
type SCPayloadBody struct { Key *SCKeySection `json:"key,omitempty"` Type string `json:"type,omitempty"` MerkleRoot SCMerkleRootSection `json:"merkle_root"` Version int `json:"version"` Team *SCTeamSection `json:"team,omitempty"` }
type SCPerTeamKey ¶
type SCSubteam ¶
type SCSubteam struct { ID SCTeamID `json:"id"` Name SCTeamName `json:"name"` }
type SCTeamAdmin ¶
type SCTeamAdmin struct { TeamID SCTeamID `json:"team_id"` Seqno keybase1.Seqno `json:"seqno"` SeqType keybase1.SeqType `json:"seq_type"` }
func (SCTeamAdmin) SigChainLocation ¶
func (a SCTeamAdmin) SigChainLocation() keybase1.SigChainLocation
type SCTeamInvite ¶
type SCTeamInvite struct { Type string `json:"type"` Name string `json:"name"` ID SCTeamInviteID `json:"id"` }
func (SCTeamInvite) TeamInvite ¶
func (i SCTeamInvite) TeamInvite(g *libkb.GlobalContext, r keybase1.TeamRole, inviter keybase1.UserVersion) (keybase1.TeamInvite, error)
type SCTeamInviteID ¶
type SCTeamInviteID string
func NewInviteID ¶
func NewInviteID() SCTeamInviteID
func (SCTeamInviteID) TeamInviteID ¶
func (i SCTeamInviteID) TeamInviteID() (keybase1.TeamInviteID, error)
type SCTeamInvites ¶
type SCTeamInvites struct { Admins *[]SCTeamInvite `json:"admin,omitempty"` Writers *[]SCTeamInvite `json:"writer,omitempty"` Readers *[]SCTeamInvite `json:"reader,omitempty"` Cancel *[]SCTeamInviteID `json:"cancel,omitempty"` }
type SCTeamMember ¶
type SCTeamMember keybase1.UserVersion
A (username, seqno) pair. The username is adorned with "%n" at the end where n is the seqno IF the seqno is not 1.
func (*SCTeamMember) MarshalJSON ¶
func (s *SCTeamMember) MarshalJSON() (b []byte, err error)
func (*SCTeamMember) UnmarshalJSON ¶
func (s *SCTeamMember) UnmarshalJSON(b []byte) (err error)
type SCTeamMembers ¶
type SCTeamMembers struct { Owners *[]SCTeamMember `json:"owner,omitempty"` Admins *[]SCTeamMember `json:"admin,omitempty"` Writers *[]SCTeamMember `json:"writer,omitempty"` Readers *[]SCTeamMember `json:"reader,omitempty"` None *[]SCTeamMember `json:"none,omitempty"` }
type SCTeamName ¶
type SCTeamName string
type SCTeamParent ¶
type SCTeamSection ¶
type SCTeamSection struct { ID SCTeamID `json:"id"` Name *SCTeamName `json:"name,omitempty"` Members *SCTeamMembers `json:"members,omitempty"` Parent *SCTeamParent `json:"parent,omitempty"` Subteam *SCSubteam `json:"subteam,omitempty"` PerTeamKey *SCPerTeamKey `json:"per_team_key,omitempty"` Admin *SCTeamAdmin `json:"admin,omitempty"` Invites *SCTeamInvites `json:"invites,omitempty"` CompletedInvites map[keybase1.TeamInviteID]keybase1.UID `json:"completed_invites,omitempty"` }
type Storage ¶
type Storage struct { libkb.Contextified sync.Mutex // contains filtered or unexported fields }
Store TeamData's on memory and disk. Threadsafe.
func NewStorage ¶
func NewStorage(g *libkb.GlobalContext) *Storage
type StubbedError ¶
type StubbedError struct {
// contains filtered or unexported fields
}
func NewStubbedError ¶
func NewStubbedError(l *chainLinkUnpacked) StubbedError
func NewStubbedErrorWithNote ¶
func NewStubbedErrorWithNote(l *chainLinkUnpacked, note string) StubbedError
func (StubbedError) Error ¶
func (e StubbedError) Error() string
type Team ¶
type Team struct { libkb.Contextified ID keybase1.TeamID Data *keybase1.TeamData // contains filtered or unexported fields }
func GetForTeamManagementByStringName ¶
func GetForTeamManagementByStringName(ctx context.Context, g *libkb.GlobalContext, name string, needAdmin bool) (*Team, error)
needAdmin must be set when interacting with links that have a possibility of being stubbed.
func GetMaybeAdminByStringName ¶
func GetMaybeAdminByStringName(ctx context.Context, g *libkb.GlobalContext, name string) (*Team, error)
Get a team with no stubbed links if we are an admin. Use this instead of NeedAdmin when you don't know whether you are an admin. This always causes roundtrips. Doesn't work for implicit admins.
func Load ¶
func Load(ctx context.Context, g *libkb.GlobalContext, lArg keybase1.LoadTeamArg) (*Team, error)
Load a Team from the TeamLoader. Can be called from inside the teams package.
func (*Team) AllApplicationKeys ¶
func (t *Team) AllApplicationKeys(ctx context.Context, application keybase1.TeamApplication) (res []keybase1.TeamApplicationKey, err error)
func (*Team) ApplicationKey ¶
func (t *Team) ApplicationKey(ctx context.Context, application keybase1.TeamApplication) (keybase1.TeamApplicationKey, error)
ApplicationKey returns the most recent key for an application.
func (*Team) ApplicationKeyAtGeneration ¶
func (t *Team) ApplicationKeyAtGeneration( application keybase1.TeamApplication, generation keybase1.PerTeamKeyGeneration) (res keybase1.TeamApplicationKey, err error)
func (*Team) ChangeMembership ¶
func (*Team) CurrentSeqno ¶
func (*Team) ExportToTeamPlusApplicationKeys ¶
func (t *Team) ExportToTeamPlusApplicationKeys(ctx context.Context, idTime keybase1.Time, application keybase1.TeamApplication) (ret keybase1.TeamPlusApplicationKeys, err error)
func (*Team) ForceMerkleRootUpdate ¶
ForceMerkleRootUpdate will call LookupTeam on MerkleClient to update cached merkle root to include latest team sigs. Needed if client wants to create a signature that refers to an adminship, signature's merkle_root has to be more fresh than adminship's.
func (*Team) Generation ¶
func (t *Team) Generation() keybase1.PerTeamKeyGeneration
func (*Team) InviteEmailMember ¶
func (*Team) InviteMember ¶
func (t *Team) InviteMember(ctx context.Context, username string, role keybase1.TeamRole, resolvedUsername libkb.NormalizedUsername, uv keybase1.UserVersion) (keybase1.TeamAddMemberResult, error)
func (*Team) MemberRole ¶
func (*Team) SharedSecret ¶
func (*Team) UsersWithRole ¶
type TeamBox ¶
type TeamBox struct { Nonce string SenderKID keybase1.KID `json:"sender_kid"` Generation keybase1.PerTeamKeyGeneration Ctext string PerUserKeySeqno keybase1.Seqno `json:"per_user_key_seqno"` }
TeamBox comes from api server team/get endpoint.
func (*TeamBox) Open ¶
func (t *TeamBox) Open(encKey *libkb.NaclDHKeyPair) (keybase1.PerTeamKeySeed, error)
Open decrypts Ctext using encKey.
type TeamDoesNotExistError ¶
type TeamDoesNotExistError struct {
// contains filtered or unexported fields
}
func (TeamDoesNotExistError) Error ¶
func (e TeamDoesNotExistError) Error() string
type TeamKeyManager ¶
type TeamKeyManager struct { libkb.Contextified // contains filtered or unexported fields }
func NewTeamKeyManager ¶
func NewTeamKeyManager(g *libkb.GlobalContext) (*TeamKeyManager, error)
func NewTeamKeyManagerWithSecret ¶
func NewTeamKeyManagerWithSecret(g *libkb.GlobalContext, secret keybase1.PerTeamKeySeed, generation keybase1.PerTeamKeyGeneration) (*TeamKeyManager, error)
func (*TeamKeyManager) EncryptionKey ¶
func (t *TeamKeyManager) EncryptionKey() (libkb.NaclDHKeyPair, error)
EncryptionKey returns the derived NaclDHKeyPair from the team's shared secret.
func (*TeamKeyManager) RotateSharedSecretBoxes ¶
func (t *TeamKeyManager) RotateSharedSecretBoxes(ctx context.Context, senderKey libkb.GenericKey, recipients map[keybase1.UserVersion]keybase1.PerUserKey) (boxes *PerTeamSharedSecretBoxes, keySection *SCPerTeamKey, err error)
RotateSharedSecretBoxes creates a new shared secret for the team and the required PerTeamKey section.
func (*TeamKeyManager) SharedSecret ¶
func (t *TeamKeyManager) SharedSecret() keybase1.PerTeamKeySeed
SharedSecret returns the team's shared secret.
func (*TeamKeyManager) SharedSecretBoxes ¶
func (t *TeamKeyManager) SharedSecretBoxes(ctx context.Context, senderKey libkb.GenericKey, recipients map[keybase1.UserVersion]keybase1.PerUserKey) (boxes *PerTeamSharedSecretBoxes, err error)
SharedSecretBoxes creates the PerTeamSharedSecretBoxes for recipients with the existing team shared secret.
func (*TeamKeyManager) SigningKey ¶
func (t *TeamKeyManager) SigningKey() (libkb.NaclSigningKeyPair, error)
EncryptionKey returns the derived NaclSigningKeyPair from the team's shared secret.
type TeamLoader ¶
type TeamLoader struct { libkb.Contextified // contains filtered or unexported fields }
Loader of keybase1.TeamData objects. Handles caching. Because there is one of this global object and it is attached to G, its Load interface must return a keybase1.TeamData not a teams.Team. To load a teams.Team use the package-level function Load. Threadsafe.
func NewTeamLoader ¶
func NewTeamLoader(g *libkb.GlobalContext, world LoaderContext, storage *Storage) *TeamLoader
func NewTeamLoaderAndInstall ¶
func NewTeamLoaderAndInstall(g *libkb.GlobalContext) *TeamLoader
NewTeamLoaderAndInstall creates a new loader and installs it into G.
func (*TeamLoader) ImplicitAdmins ¶
func (l *TeamLoader) ImplicitAdmins(ctx context.Context, teamID keybase1.TeamID) (impAdmins []keybase1.UserVersion, err error)
List all the admins of ancestor teams. Includes admins of the specified team only if they are also admins of ancestor teams. The specified team must be a subteam, or an error is returned. Always sends a flurry of RPCs to get the most up to date info.
func (*TeamLoader) Load ¶
func (l *TeamLoader) Load(ctx context.Context, lArg keybase1.LoadTeamArg) (res *keybase1.TeamData, err error)
func (*TeamLoader) MapIDToName ¶
func (*TeamLoader) NotifyTeamRename ¶
func (*TeamLoader) OnLogout ¶
func (l *TeamLoader) OnLogout()
func (*TeamLoader) VerifyTeamName ¶
type TeamSigChainPlayer ¶
type TeamSigChainPlayer struct { libkb.Contextified sync.Mutex // contains filtered or unexported fields }
Threadsafe handle to a local model of a team sigchain.
func NewTeamSigChainPlayer ¶
func NewTeamSigChainPlayer(g *libkb.GlobalContext, reader keybase1.UserVersion) *TeamSigChainPlayer
Load a team chain from the perspective of uid.
func NewTeamSigChainPlayerWithState ¶
func NewTeamSigChainPlayerWithState(g *libkb.GlobalContext, reader keybase1.UserVersion, state TeamSigChainState) *TeamSigChainPlayer
func (*TeamSigChainPlayer) AppendChainLink ¶
func (t *TeamSigChainPlayer) AppendChainLink(ctx context.Context, link *chainLinkUnpacked, signer *signerX) error
Add a chain link to the end. It can be stubbed. It must have already been partially verified by TeamLoader. `signer` may be nil iff link is stubbed. If this returns an error, the TeamSigChainPlayer was not modified.
func (*TeamSigChainPlayer) GetState ¶
func (t *TeamSigChainPlayer) GetState() (res TeamSigChainState, err error)
Get the latest state. The caller may _not_ modify the returned state.
func (*TeamSigChainPlayer) InflateLink ¶
func (t *TeamSigChainPlayer) InflateLink(link *chainLinkUnpacked, signer signerX) error
Add the full inner link for a link that has already been added in stubbed form.
type TeamSigChainState ¶
type TeamSigChainState struct {
// contains filtered or unexported fields
}
Accessor wrapper for keybase1.TeamSigChainState
func (TeamSigChainState) AssertWasAdminAt ¶
func (t TeamSigChainState) AssertWasAdminAt(uv keybase1.UserVersion, scl keybase1.SigChainLocation) (err error)
AssertWasAdminAt asserts that user (uv) was an admin (or owner) at the team at the given SigChainLocation (scl). Thus, we start at the point given, go backwards until we find a promotion, the go forwards to make sure there wasn't a demotion before the specified time. If there was, we return an AdminPermissionError. If no adminship was found at all, we return a AdminPermissionError.
func (TeamSigChainState) AssertWasReaderAt ¶
func (t TeamSigChainState) AssertWasReaderAt(uv keybase1.UserVersion, scl keybase1.SigChainLocation) (err error)
AssertWasReaderAt asserts that user (uv) was a reader or above at the team at the given SigChainLocation (scl). Thus, we start at the point given, go backwards until we find a promotion, the go forwards to make sure there wasn't a demotion before the specified time. If there was, we return a PermissionError. If no adminship was found at all, we return a PermissionError. NOTE: This is a copy-pasta of AssertWasAdminAt, but I became sad about having to factor out the commonality, so decided copy-paste was easiest.
func (TeamSigChainState) DeepCopy ¶
func (t TeamSigChainState) DeepCopy() TeamSigChainState
func (*TeamSigChainState) FindActiveInvite ¶
func (t *TeamSigChainState) FindActiveInvite(name, typ string) (*keybase1.TeamInvite, error)
func (*TeamSigChainState) FindActiveInviteByID ¶
func (t *TeamSigChainState) FindActiveInviteByID(id keybase1.TeamInviteID) (keybase1.TeamInvite, bool)
func (TeamSigChainState) GetAdminUserLogPoint ¶
func (t TeamSigChainState) GetAdminUserLogPoint(user keybase1.UserVersion) *keybase1.UserLogPoint
func (TeamSigChainState) GetID ¶
func (t TeamSigChainState) GetID() keybase1.TeamID
func (TeamSigChainState) GetLatestGeneration ¶
func (t TeamSigChainState) GetLatestGeneration() keybase1.PerTeamKeyGeneration
func (TeamSigChainState) GetLatestLibkbLinkID ¶
func (t TeamSigChainState) GetLatestLibkbLinkID() (libkb.LinkID, error)
func (TeamSigChainState) GetLatestLinkID ¶
func (t TeamSigChainState) GetLatestLinkID() keybase1.LinkID
func (TeamSigChainState) GetLatestPerTeamKey ¶
func (t TeamSigChainState) GetLatestPerTeamKey() (keybase1.PerTeamKey, error)
func (TeamSigChainState) GetLatestSeqno ¶
func (t TeamSigChainState) GetLatestSeqno() keybase1.Seqno
func (TeamSigChainState) GetLibkbLinkIDBySeqno ¶
func (TeamSigChainState) GetLinkIDBySeqno ¶
func (TeamSigChainState) GetParentID ¶
func (t TeamSigChainState) GetParentID() *keybase1.TeamID
Only non-nil if this is a subteam.
func (TeamSigChainState) GetPerTeamKeyAtGeneration ¶
func (t TeamSigChainState) GetPerTeamKeyAtGeneration(gen keybase1.PerTeamKeyGeneration) (keybase1.PerTeamKey, error)
func (TeamSigChainState) GetSubteamName ¶
func (TeamSigChainState) GetUserLogPoint ¶
func (t TeamSigChainState) GetUserLogPoint(user keybase1.UserVersion) *keybase1.UserLogPoint
func (TeamSigChainState) GetUserRole ¶
func (t TeamSigChainState) GetUserRole(user keybase1.UserVersion) (keybase1.TeamRole, error)
func (TeamSigChainState) GetUsersWithRole ¶
func (t TeamSigChainState) GetUsersWithRole(role keybase1.TeamRole) (res []keybase1.UserVersion, err error)
func (*TeamSigChainState) HasActiveInvite ¶
func (t *TeamSigChainState) HasActiveInvite(name, typ string) (bool, error)
func (TeamSigChainState) HasAnyStubbedLinks ¶
func (t TeamSigChainState) HasAnyStubbedLinks() bool
func (TeamSigChainState) HasStubbedSeqno ¶
func (t TeamSigChainState) HasStubbedSeqno(seqno keybase1.Seqno) bool
func (TeamSigChainState) IsLinkFullyPresent ¶
func (t TeamSigChainState) IsLinkFullyPresent(seqno keybase1.Seqno) bool
func (TeamSigChainState) IsSubteam ¶
func (t TeamSigChainState) IsSubteam() bool
func (TeamSigChainState) LatestLastNamePart ¶
func (t TeamSigChainState) LatestLastNamePart() keybase1.TeamNamePart
func (*TeamSigChainState) ListSubteams ¶
func (t *TeamSigChainState) ListSubteams() (res []TeamIDAndName)
Only call this on a Team that has been loaded with NeedAdmin. Otherwise, you might get incoherent answers due to links that were stubbed over the life of the cached object.
For subteams that you were removed from, this list may still include them because your removal was stubbed. The list will not contain duplicate names. Since this should only be called when you are an admin, none of that should really come up, but it's here just to be less fragile.
func (*TeamSigChainState) SubteamRenameOccurred ¶
func (t *TeamSigChainState) SubteamRenameOccurred( subteamID keybase1.TeamID, newName keybase1.TeamName, seqno keybase1.Seqno) error
Check that a subteam rename occurred just so. That the subteam `subteamID` got a new name `newName` at exactly `seqno` in this, the parent, chain. Note this only checks against the last part of `newName` because mid-team renames are such a pain. This is currently linear in the number of times that subteam has been renamed. It should be easy to add an index if need be.
type UnexpectedSeqnoError ¶
type UnexpectedSeqnoError struct {
// contains filtered or unexported fields
}
func NewUnexpectedSeqnoError ¶
func NewUnexpectedSeqnoError(expected, actual keybase1.Seqno) UnexpectedSeqnoError
func (UnexpectedSeqnoError) Error ¶
func (e UnexpectedSeqnoError) Error() string