refactor: tidy up sharing after the round of tweaks
- Go to's picker settings are one picker struct, set while picking.
- Opening a share link plans the save, then asks or saves; no more
offerWrite doing either by a flag.
- Closing the picker while it encrypts cancels the share, and a
second pick meanwhile is ignored.
- Favourites and Recent leave out plain env values as keys too.
- share.key in the config is checked with share.ParseKey, so
{{secrets/…}} is refused there already.
- A key that can't be read reads the same opening as sharing
("can't use …"); KeyError moved to share.go, maxFiles is
maxUnpacked (bytes), and a stray comment is gone.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
9 files changed
+218
-118
No files matched your search
@@ -67,13 +67,3 @@ func (r Rules) withDefaults() Rules {
|
||||
r.MinLength = max(r.MinLength, MinKey)
|
||||
return r
|
||||
}
|
||||
|
||||
// KeyError is a key that can't be used: it can't be read, or doesn't
|
||||
// keep to the rules.
|
||||
type KeyError struct {
|
||||
Name string // the secret's
|
||||
Err error
|
||||
}
|
||||
|
||||
func (e *KeyError) Error() string { return "can't use " + e.Name + ": " + e.Err.Error() }
|
||||
func (e *KeyError) Unwrap() error { return e.Err }
|
||||
Reference in new issue
Block a user