Closed aryounce closed 6 years ago
Stripping of leading zero is required by AWS Cognito.
That is unfortunate. Could %e
(which inserts a space instead of zero padding) work in this instance or is Cognito also sensitive to whitespace?
I will check it on Oct 1, but I think it will not work.
%e
causes an error
botocore.exceptions.ClientError: An error occurred (InvalidParameterException) when calling the RespondToAuthChallenge operation: TIMESTAMP format should be EEE MMM d HH:mm:ss z yyyy in english.
If there is any solution around? We have this problem too with alpine linux based Hass.io systems for Home-Assistant.
I introduced #75 which extracts the method to format the current time so that it is easily monkey patchable.
This line contains a GNU extension in the format string passed to
strftime
(specifically the%-d
part). This causes thetimestamp
variable to be an empty string on non-glibc systems (like the Alpine Linux Docker images, which use musl libc).Removing the hyphen modifier from
%-d
should be painless on glibc and non-glibc systems alike. Stripping leading zeros does not appear to be required by RFC2616 or RFC822 (which seems to be the format used here). Could this possibly be removed for good?https://github.com/capless/warrant/blob/3d6aa8c84841a1c7183f702ed7b4ad993c1ff37a/warrant/aws_srp.py#L170