You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems one has to persist credentials. One easy way to do so would be to store them as JSON. But corresponding JSON is ugly because Credential does not have json struct tags.
Use Case
No response
Documentation
No response
The text was updated successfully, but these errors were encountered:
I can likely add this in v0.10.0. It's technically a breaking change but as we're v0 we can probably afford to and people can just copy the old struct as an intermediary if they have issues. Not sure golang's json library has any tooling specifically to handle this situation.
So golang json library in fact ignores JSON field case (which is what I primarily would want to achieve with struct tags). So adding json struct tags should just make new JSON have new case, but it would continue to parse old ones. So if somebody did already marshal credentials they will be able to continue use those.
To unmarshal JSON into a struct, Unmarshal matches incoming object keys to the keys used by Marshal (either the struct field name or its tag), preferring an exact match but also accepting a case-insensitive match.
Only if they marshal credentials and parse them with some other tool they might have a problem.
mitar
added a commit
to mitar/webauthn
that referenced
this issue
Dec 3, 2023
Description
It seems one has to persist credentials. One easy way to do so would be to store them as JSON. But corresponding JSON is ugly because
Credential
does not have json struct tags.Use Case
No response
Documentation
No response
The text was updated successfully, but these errors were encountered: