spruceid / siwe-py

A Python implementation of Sign-In with Ethereum
https://login.xyz
Apache License 2.0
66 stars 28 forks source link

Only set valid fields when building SiweMessage with dictionary #18

Closed payton closed 2 years ago

payton commented 2 years ago

When building a SiweMessage instance from an input dictionary, only set valid fields.

Resolves #15

payton commented 2 years ago

Initially, I thought we should raise a ValueError when building from a dictionary if there was an invalid field. However, I'm now leaning more towards the idea of passively skipping invalid fields since any missing attributes / invalid attributes should be caught when validating... What are your thoughts @sbihel and @twinsant?

twinsant commented 2 years ago

That's fine.