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

Offer proguard consumer rules for downstream library consumers. #44

Conversation

d4rken
Copy link
Contributor

@d4rken d4rken commented Jul 21, 2021

Keep rule to prevent code shrinker from breaking validation.

Specifically, proguard/R8 removes values from ExternalParameter due to its private constructor:

class ExternalParameter private constructor(
val validationClock: String,
val valueSets: Map<String, List<String>>,
val countryCode: String,
val exp: String,
val iat: String,
val issuerCountryCode: String,
val kid: String,
val region: String = ""
) {

Without Proguard: {
    "external": {
        "validationClock": "2021-07-21T15:22:45Z",
        "valueSets": {...},
        "countryCode": "DE",
        "exp": "2022-07-21T07:05:48Z",
        "iat": "2021-07-21T07:05:48Z",
        "issuerCountryCode": "DE",
        "kid": "f1sfUVIx8CA=",
        "region": ""
    },
    "payload": {...}
}

vs

Proguard: {
    "external": {
        "valueSets": {...}
    },
    "payload": {...}
}

Due to the way exceptions are caught, this resulted in a silent fail where a rule evaluation just defaulted to OPEN.

Keep rule to prevent code shrinker from breaking validation, e.g.
dgca.verifier.app.engine.data.ExternalParameter's private constructor
@d4rken d4rken requested a review from a team as a code owner July 21, 2021 15:47
@oleksandrsarapulovgl oleksandrsarapulovgl merged commit 012b453 into eu-digital-green-certificates:main Jul 22, 2021
@d4rken d4rken deleted the proguard-consumer-rules branch July 22, 2021 07:38
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.

2 participants