Open imalsogreg opened 4 years ago
At some point in the last several years, the format for users.json changed, specifically the uidCache field. The one in use by a deployment of https://github.com/imalsogreg/reffit several years old was encoded as:
uidCache
{ uidCache: [ [ 999, { "last_ip": null, "roles": [], "current_ip": "127.0.0.1", "activated_at": null, "reset_requested_at": null, "uid": "999", ... "login": "Interfacelea", "reset_token": null } ], ... ], ... }
(id and info tuples were in a list of length-2 lists, not key-value entries in a map)
When I bumped snap to the most recent version, parsing failed because the new format is expected to be key-value pairs in a map:
snap
{ uidCache: { "999": { "last_ip": null, "roles": [], "current_ip": "127.0.0.1", "activated_at": null, "reset_requested_at": null, "uid": "999", ... "login": "Interfacelea", "reset_token": null } ... }, ... }
Apologies for vagueness about the dates - I'd need to do some research to get more details.
If anyone else runs into this, the following jq call can do the migration:
jq
jq '.uidCache = ([.uidCache[] | { "key": .[0], "value": .[1] }] | from_entries)' users.json
We can fix this simply by adding another parser in the json-file auth backend.
At some point in the last several years, the format for users.json changed, specifically the
uidCache
field. The one in use by a deployment of https://github.com/imalsogreg/reffit several years old was encoded as:(id and info tuples were in a list of length-2 lists, not key-value entries in a map)
When I bumped
snap
to the most recent version, parsing failed because the new format is expected to be key-value pairs in a map:Apologies for vagueness about the dates - I'd need to do some research to get more details.
If anyone else runs into this, the following
jq
call can do the migration: