forked from keybase/kbfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteam_membership_checker.go
30 lines (26 loc) · 1.11 KB
/
team_membership_checker.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2017 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
package kbfsmd
import (
"context"
"github.com/keybase/client/go/protocol/keybase1"
"github.com/keybase/kbfs/kbfscrypto"
)
// TeamMembershipChecker is an interface for objects that can check
// the writer/reader membership of teams.
type TeamMembershipChecker interface {
// IsTeamWriter checks whether the given user (with the given
// verifying key) is a writer of the given team right now.
IsTeamWriter(ctx context.Context, tid keybase1.TeamID, uid keybase1.UID,
verifyingKey kbfscrypto.VerifyingKey) (bool, error)
// IsTeamReader checks whether the given user is a reader of the
// given team right now.
IsTeamReader(ctx context.Context, tid keybase1.TeamID, uid keybase1.UID) (
bool, error)
// TODO: add Was* method for figuring out whether the user was a
// writer/reader at a particular Merkle root. Not sure whether
// these calls should also verify that sequence number corresponds
// to a given TLF revision, or leave that work to another
// component.
}