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

feat: validate credential expiration #49

Merged
merged 1 commit into from
Jul 22, 2022

Conversation

nichonien
Copy link
Contributor

This PR add validation for credential expiration for RoleEIP191Jwt.

@nichonien nichonien requested review from jrhender and JGiter and removed request for jrhender July 22, 2022 06:07
@nichonien nichonien force-pushed the task/EC-57_credential_expiration_date_validation branch from 7bd2299 to ba302fb Compare July 22, 2022 09:20
@nichonien nichonien force-pushed the task/EC-57_credential_expiration_date_validation branch from ba302fb to 02559b5 Compare July 22, 2022 09:34
@nichonien nichonien requested a review from JGiter July 22, 2022 09:56
Copy link
Collaborator

@jrhender jrhender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a comment about improving the VerificationResult but I think this PR looks great!

return verificationResult(false, ERRORS.IssuerCredentialRevoked);
const revocationStatusResult =
await this.revocationVerification.checkRevocationStatus(issuer, role);
if (!revocationStatusResult.status) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find this line pretty confusing because I typically expect status to be an enum of some kind instead of a boolean (e.g. HTTP status code are are large list)

This is probably a different task, but what do you think of either:

  • renaming status to verified and keeping it as a boolean
  • changing status to an enum of possible values (e.g. VERIFIED, NOT_VERIFIED)
  • or some other option

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, renaming it to verified sounds good. IMO boolean fits the return type and eases the validation upon it.

@nichonien nichonien merged commit 22cfa1b into develop Jul 22, 2022
@nichonien nichonien deleted the task/EC-57_credential_expiration_date_validation branch August 10, 2022 08:04
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