Persist remote bindings through app state

This commit is contained in:
Joe Julian
2026-04-06 12:13:07 -07:00
parent 677464dc9a
commit 66d105d2a9
2 changed files with 79 additions and 0 deletions
+21
View File
@@ -853,6 +853,27 @@ func (s *State) OpenBoundRemoteVault(binding RemoteBinding, key vault.MasterKey)
return s.OpenRemoteVault(client, resolved.Profile.Path, key)
}
func (s *State) ConfigureRemoteBinding(input RemoteBindingInput) (RemoteBinding, error) {
session, ok := s.Session.(MutableSession)
if !ok {
return RemoteBinding{}, fmt.Errorf("session is not mutable")
}
model, err := session.Current()
if err != nil {
return RemoteBinding{}, err
}
binding, err := ConfigureRemoteBinding(&model, input)
if err != nil {
return RemoteBinding{}, err
}
session.Replace(model)
s.Dirty = true
return binding, nil
}
func (s *State) CreateGroup(name string) error {
session, ok := s.Session.(MutableSession)
if !ok {