Fix empty string as "no attributes"

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-05-23 13:42:38 -07:00
parent 1eba43f96f
commit 23af4caf43

View File

@@ -450,6 +450,10 @@ func EncodeAuthorizeKeyAttributes(attrs policy.Attributes) string {
func decodeAuthorizeKeyAttributes(s string) (policy.Attributes, error) {
attrs := policy.Attributes{}
if s == "" {
return attrs, nil
}
if err := json.Unmarshal([]byte(s), &attrs); err != nil {
return nil, err
}