smcli env: emit URI/USERNAME/PASSWORD for consumers; pin v5
ci / vet (push) Successful in 55s

convert of login items keeps original env names in fields; env now also
exposes the login triple so sourced consumers can map to legacy names.
Ticket: https://projects.knownelement.com/issues/832
This commit is contained in:
2026-09-06 17:23:22 -05:00
parent 0dcf41a839
commit 907ddb6000
5 changed files with 30 additions and 3 deletions
+14 -1
View File
@@ -90,7 +90,8 @@ type PlainCipher struct {
Username string `json:"username"`
Password string `json:"password"`
} `json:"login"`
FolderID string `json:"folderId"`
FolderID string `json:"folderId"`
URIs []string `json:"uris"`
}
// DecryptCipher converts a raw sync cipher into PlainCipher.
@@ -132,6 +133,18 @@ func DecryptCipher(userKey []byte, raw []byte) (*PlainCipher, error) {
if cr.Login.Password != nil {
pc.Login.Password, _ = decStr(userKey, ck, cr.Login.Password)
}
for _, u := range cr.Login.URIs {
var um map[string]any
um, _ = u.(map[string]any)
if um != nil {
if us, ok := um["uri"].(string); ok {
v, err := decStr(userKey, ck, &us)
if err == nil {
pc.URIs = append(pc.URIs, v)
}
}
}
}
}
return pc, nil
}