github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/kbfsmd/team_membership_checker.go (about)

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