mesh-issues: record who acted as the caller the runtime proves (hq issue 365)
The tool runner now takes a call's caller from the subject it arrived on and hands it to the module through the SDK (stdio.CallerOf); the tracker records that bus user on what each verb writes instead of unproven. Never from the arguments, which still refuse any caller, and unproven where the runtime proves none. Needs mesh-sdk's go/caller.go (pinned at its branch head until merged).
This commit is contained in:
@@ -214,6 +214,11 @@ type candidate struct {
|
||||
// number: create-if-absent on the key, the counter untouched. See the file's comment for what it never
|
||||
// does.
|
||||
func (t *Tracker) Import(a ImportAsk, records Records) (*Imported, error) {
|
||||
return t.importAs(t.by(), a, records)
|
||||
}
|
||||
|
||||
// importAs is Import as the one who acts.
|
||||
func (t *Tracker) importAs(by string, a ImportAsk, records Records) (*Imported, error) {
|
||||
settings, err := t.Settings()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("the settings cannot be read (%v); nothing was imported", err)
|
||||
@@ -241,7 +246,6 @@ func (t *Tracker) Import(a ImportAsk, records Records) (*Imported, error) {
|
||||
}
|
||||
out := &Imported{DryRun: a.DryRun, Commit: commit, ByStatus: map[string]int{}, Rows: []ImportRow{}}
|
||||
at := t.now()
|
||||
by := t.by()
|
||||
|
||||
// Every folder's number, and no two folders sharing one.
|
||||
var cands []*candidate
|
||||
|
||||
Reference in New Issue
Block a user