Fix empty string as "no attributes"
Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -450,6 +450,10 @@ func EncodeAuthorizeKeyAttributes(attrs policy.Attributes) string {
|
|||||||
|
|
||||||
func decodeAuthorizeKeyAttributes(s string) (policy.Attributes, error) {
|
func decodeAuthorizeKeyAttributes(s string) (policy.Attributes, error) {
|
||||||
attrs := policy.Attributes{}
|
attrs := policy.Attributes{}
|
||||||
|
if s == "" {
|
||||||
|
return attrs, nil
|
||||||
|
}
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(s), &attrs); err != nil {
|
if err := json.Unmarshal([]byte(s), &attrs); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user