Support compact Remote setup with reader-owned access selection
This commit is contained in:
1 parent
952d3c8204
commit
bf4a23645e
9 files changed
+274
-61
No files matched your search
@@ -92,7 +92,7 @@ func (runtime *tentacleRuntime) interact(ctx context.Context, command tentacleCo
|
||||
}
|
||||
cleanupNext = value.Next
|
||||
if value.Remote != nil {
|
||||
action, approvalErr := runtime.authorize_remote_session(ctx, command.session, value.Remote.Role, value.Remote.Grants)
|
||||
action, approvalErr := runtime.authorize_remote_request(ctx, command.session, *value.Remote)
|
||||
submission := tentaclewire.Submission{}
|
||||
if approvalErr != nil {
|
||||
submission.Cancelled = true
|
||||
@@ -211,6 +211,12 @@ func (runtime *tentacleRuntime) interact(ctx context.Context, command tentacleCo
|
||||
}
|
||||
if submission.Cancelled {
|
||||
cleanupNext = ""
|
||||
// A status form may close while retaining its already-open lease.
|
||||
// Validate that terminal result in the ordinary ownership path above.
|
||||
terminal, decodeErr := tentaclewire.DecodeInteraction(raw)
|
||||
if decodeErr == nil && terminal.RemoteBackground != nil {
|
||||
continue
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -269,11 +275,11 @@ func (runtime *tentacleRuntime) waitTentacleForm(ctx context.Context, command te
|
||||
return internalUIResult{Cancelled: true}, nil
|
||||
}
|
||||
status, err := tentaclewire.DecodeInteraction(raw)
|
||||
if err != nil || status.Form != nil || status.Source != "" || status.Next != "" || status.Reader != nil || status.Remote != nil || status.RemoteBackground != nil {
|
||||
if err != nil || status.Source != "" || status.Reader != nil || status.Form == nil && status.Remote == nil && !status.Done && status.Next != "" {
|
||||
command.session.Disable()
|
||||
return internalUIResult{Cancelled: true}, nil
|
||||
}
|
||||
if status.Done {
|
||||
if status.Done || status.Form != nil || status.Remote != nil {
|
||||
return internalUIResult{}, raw
|
||||
}
|
||||
if status.Clipboard != nil {
|
||||
|
||||
Reference in new issue
Block a user