Eliminate white space around ristretto key when reading key file
Created by: hacklschorsch
It is easy to erroneously add extra white space to a text file. For example when writing with an editor like nano
or when using echo
without the -n
argument.
Handing that white space over to python-challenge-bypass-ristretto's decode_base64()
method will make it fail in a rather opaque way, see https://github.com/LeastAuthority/python-challenge-bypass-ristretto/issues/37.
This eliminates white space including newlines around the key expected to be in that file.
Merge request reports
Activity
Created by: hacklschorsch
I could also make the point that Unit testing here might not be the right thing:
- the
SigningKey.decode_base64()
unit is imported from another library and tested there. It specifies the parameter it expects, and it's our job to adhere to the spec - the
FilePath(...).getContent()
unit is from the standard library and widely tested, - as is the
strip()
unit.
It's the integration of all this we want to test. Testing that integration makes good sense, and I also think it is a good location to spec our expected input.
I think it is worth while to add an integration test for this.
But honestly, trying to be very street smart I want to do something else.
- the