Documentation
¶
Overview ¶
Package perm is the table that says which permission feature each host service belongs to. A host owner switches features on and off (`remohop config feature NAME on|off`); the host daemon refuses streams for services whose feature is off, and for services that are in no feature.
It is a leaf package so that service packages can register themselves from init() without importing the host daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register assigns a service to a feature. Service packages call it from init() for services not in the built-in table; a service that is never registered is refused by hosts. It panics on an unknown feature or on an attempt to move a service to a different feature, both programming errors.
Types ¶
type Feature ¶
type Feature string
Feature names a group of services a host owner allows or forbids as one.
const ( Shell Feature = "shell" // run commands: shell, exec, spawn, jobs File Feature = "file" // read and write files: fs, transfers, mounts Forward Feature = "forward" // port forwarding in both directions Clip Feature = "clip" // clipboard Screen Feature = "screen" // see the screen: screenshots, desktop viewing Input Feature = "input" // control keyboard and mouse Info Feature = "info" // system information VPN Feature = "vpn" // IP tunnel to this machine and its networks Serial Feature = "serial" // serial ports of this machine USB Feature = "usb" // export USB devices of this machine // Always is for services every authenticated client may use (ping, // pairing). It cannot be switched off. Always Feature = "always" )
type WithdrawnError ¶
type WithdrawnError struct{ Feature Feature }
WithdrawnError says that the host's owner switched Feature off (or a grant stopped allowing it) while a stream of it was open. The host daemon cancels the context of such a stream's handler with it as the cause, so a service can tell the client why it ends: see Withdrawn.
func Withdrawn ¶
func Withdrawn(err error) (*WithdrawnError, bool)
Withdrawn reports whether err, typically context.Cause of a handler's context, is a WithdrawnError, and returns it.
func (*WithdrawnError) Error ¶
func (e *WithdrawnError) Error() string