Skip to content

Map version codes to crypto features to allow more high-level decision making #528

Description

@petrdvorak

Currently, we can see code pieces like this one:

if (!"3.2".equals(version)) {
    // do something better
} else {
    // keep the legacy behavior
}

To simplify code and prevent possible errors, we should introduce a mapping to features, i.e., a map of <String,CryptoFeatures>, like so:

{
  "3.2": {
    "tokenExpiration": "SHORT",
    "uniquenessChecks": true,
    "...": "..."
  }
}

Then, we should be able to branch the code more easily, based on features rather than versions, and it would be easier to see all impacted parts depending on specific versions.

We should also introduce a helper class to provide the default strict feature set for unknown versions.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions