Documentation ¶
Overview ¶
Package perm implements mutation permission checking for servers.
Index ¶
Constants ¶
const WritersGroupFile = "Writers"
WritersGroupFile is the name of the Group file that specifies writers for a Perm instance.
Variables ¶
This section is empty.
Functions ¶
func WrapDir ¶
func WrapDir(cfg upspin.Config, ready <-chan struct{}, target upspin.UserName, dir upspin.DirServer) upspin.DirServer
WrapDir wraps the given DirServer with a DirServer that checks root-creation permissions. It will only start polling the store permissions after the ready channel is closed.
func WrapStore ¶
func WrapStore(cfg upspin.Config, ready <-chan struct{}, store upspin.StoreServer) upspin.StoreServer
WrapStore wraps the given StoreServer with a StoreServer that checks access permissions. It will only start polling the store permissions after the ready channel is closed.
Types ¶
type Perm ¶
type Perm struct {
// contains filtered or unexported fields
}
Perm tracks the set of users with write access to a server, as specified by the Writers Group file. These might be users who can write blocks to a StoreServer or create a root on a DirServer.
func New ¶
New creates a new Perm monitoring the target user's Writers Group file, resolving the DirServer using the given config. The target user is typically the user name of a server, such as a StoreServer or a DirServer.
func NewWithDir ¶
func NewWithDir(cfg upspin.Config, ready <-chan struct{}, target upspin.UserName, dir upspin.DirServer) *Perm
NewWithDir creates a new Perm monitoring the target user's Writers Group file which must reside on the given DirServer. The target user is typically the user name of a server, such as a StoreServer or a DirServer.
func (*Perm) Update ¶
Update retrieves and parses the Group file that rules over the set of allowed writers. This is mostly only exported for testing, but servers may use it to force immediate updates.
func (*Perm) WrapDir ¶
WrapDir wraps the given DirServer with a DirServer that checks root-creation permissions using Perm.
func (*Perm) WrapStore ¶
func (p *Perm) WrapStore(store upspin.StoreServer) upspin.StoreServer
WrapStore wraps the given StoreServer with a StoreServer that checks access permissions using Perm.