Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix format of validation clock #49

Conversation

martinreichart
Copy link
Contributor

The current format of the validationClock in ExtermalParameter uses DateTimeFormatter.ISO_ZONED_DATE_TIME which includes a region information in square brackets. This leads to a DateTimeParseException (in DefaultCertLogicEngine.kt:111) when evaluating any rules that reference the validationClock.

@martinreichart martinreichart requested a review from a team as a code owner July 26, 2021 12:33
@oleksandrsarapulovgl
Copy link
Contributor

Thank you for finding and providing a fix @martinreichart !

As I see these changes are not fully applicable:
Screenshot from 2021-07-27 09-47-29

Could you please update it to support Android 21st API level?

@martinreichart
Copy link
Contributor Author

@oleksandrsarapulovgl I will try to adapt this, but this seems to already have been issue before already - DateTimeFormatter.ISO_ZONED_DATE_TIME uses the DateTimeFormatterBuilder internally which is only available on API Level 26

@martinreichart
Copy link
Contributor Author

@oleksandrsarapulovgl I have added core library desugaring to make the java.time packages available pre API level 26

@mlenkeit
Copy link
Collaborator

@martinreichart do you have sample data to reproduce this?

@martinreichart
Copy link
Contributor Author

@mlenkeit any rule which references external.validationClock - in our case we noticed it the first time with https://github.com/eu-digital-green-certificates/dgc-business-rules-testdata/tree/main/AT/TR-AT-0006
What's tricky is that the exception is internally hidden in DefaultCertLogic and the evaluation of the rule leads to a status of OPEN with the exception added as a validationError. That's why we only caught it by evaluating a PCR-Test certificate and noticing that the rule for the expiry of the test did not fail

@mlenkeit
Copy link
Collaborator

@martinreichart that's interesting. All our tests successfully passed (or failed, depending on the rule) even without this change 🤔 We'll test with the rule that you referenced.

The fact that exceptions are/were caught also got aus. With #45, there's now at least an option to for the consumer of CertLogic to log the exception or otherwise respond to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants