Comprehensive typing pass - #25
Conversation
| @contextmanager | ||
| def challenge_server(self, http_01_resources): | ||
| def challenge_server( | ||
| self, http_01_resources: set[standalone.HTTP01RequestHandler.HTTP01Resource] |
There was a problem hiding this comment.
Huh, this is revealing to me that we've been taking a set this whole time despite exclusively calling it with a single-element set (in perform_http01, below). Is that... correct? Is that what we've been meaning to do?
There was a problem hiding this comment.
yes, the set is required by the internal api, but we're specifically allowing one http-based challenge for this. Suppose can move this lower into the api.
There was a problem hiding this comment.
Although, not sure its worth a breaking change to remove the set from the param 🤷
There was a problem hiding this comment.
Hm yeah, if it's part of the public API then we shouldn't change it.
|
|
||
|
|
||
| def sign(data, private_key): | ||
| def sign(data: str, private_key: ec.EllipticCurvePrivateKey) -> str: |
There was a problem hiding this comment.
Hm, it looks like we only ever pass test data here. Should we just have been passing bytestrings the whole time rather than converting str to bytes in here?
There was a problem hiding this comment.
That's just testing the signing immediately when the key is loaded just in case -- we call this with the hash that's passed in from the SignReq model as part of the sign request:
see: https://github.com/webrecorder/authsign/blob/main/authsign/signer.py#L326
add typeddict for 'timestamping' init declaration
Ended up doing a fairly comprehensive typing pass on the codebase. Fixes #10