rc: methods marked as AuthRequired need auth unless --rc-no-auth

Methods which can read or mutate external storage will require
authorisation - enforce this.  This can be overidden by `--rc-no-auth`.
This commit is contained in:
Nick Craig-Wood
2018-11-03 16:37:09 +00:00
parent 181267e20e
commit fa0a9653d2
8 changed files with 102 additions and 4 deletions

View File

@@ -16,10 +16,11 @@ type Func func(in Params) (out Params, err error)
// Call defines info about a remote control function and is used in
// the Add function to create new entry points.
type Call struct {
Path string // path to activate this RC
Fn Func `json:"-"` // function to call
Title string // help for the function
Help string // multi-line markdown formatted help
Path string // path to activate this RC
Fn Func `json:"-"` // function to call
Title string // help for the function
AuthRequired bool // if set then this call requires authorisation to be set
Help string // multi-line markdown formatted help
}
// Registry holds the list of all the registered remote control functions