eu-digital-green-certificates / dgc-testdata

Repository for storing generated QR code data for testing.
Apache License 2.0
157 stars 218 forks source link

test script fails to parse tag(0) date strings correctly. #213

Closed dirkx closed 3 years ago

dirkx commented 3 years ago

Issue Description

Test scripts appear to not deal correctly with a properly tagged (0) time string (https://datatracker.ietf.org/doc/html/rfc8949#section-3.4.1) according to RFC7049 (https://datatracker.ietf.org/doc/html/rfc7049#section-2.4) table 3 - "Value for Tags".

E.g. passing a QR with

    "XX":0(
        "2021-05-24T24:00:00.000008Z"
      ), 

where XX is sc, dr, etc seems to fail.

Proposed Solution

Fix the test to be RFC 8949 compliant. Specifically it is this comparison:

E - '2021-05-25T11:21:51.145008Z'), E + datetime.datetime(2021, 5, 25, 11, 21, 51, 145008, tzinfo=datetime.timezone.utc)),

Where the failed needs to either not convert the latter string to a datetime or convert the first string to a date time. I guess the most pragmatic thing would be to add to the loads() function flags similar as to the dumps() functions for controlling datetime conversion explictly.

SchulzeStTSI commented 3 years ago

@bhavin-qryptal Can you please add the tag 0 support for date time values?

bhavin-qryptal commented 3 years ago

In hand.

On Wed, 26 May 2021 at 17:47, SchulzeStTSI @.***> wrote:

@bhavin-qryptal https://github.com/bhavin-qryptal Can you please add the tag 0 support for date time values?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eu-digital-green-certificates/dgc-testdata/issues/213#issuecomment-848630788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUDF3WFHOTC43D5PS7JN3C3TPS7T7ANCNFSM45RRM5SQ .

bhavin-qryptal commented 3 years ago

@SchulzeStTSI and @daniel-eder , This could be verified and closed.