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

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

Open
petrdvorak opened this issue Sep 7, 2023 · 0 comments
Assignees

Comments

@petrdvorak
Copy link
Member

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.

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

No branches or pull requests

3 participants