-
Notifications
You must be signed in to change notification settings - Fork 20
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: add support for ocsp reason code suspended #306
feat: add support for ocsp reason code suspended #306
Conversation
…r invalid OCSP reason code
… DID document is signed but is found by an OCSP with an invalid reasoncode" for v3
@@ -40,7 +40,7 @@ export type DidSignedIssuanceStatusArray = Static<typeof DidSignedIssuanceStatus | |||
* OCSP response | |||
*/ | |||
|
|||
export const ValidOcspReasonCode = Number.withConstraint((n) => n >= 0 && n <= 10 && n != 7); | |||
export const ValidOcspReasonCode = Number.withConstraint((n) => [1, 2, 3, 4, 5, 6, 8, 9, 10, 1001].includes(n)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just thinking, would this be simpler and still work?
export const ValidOcspReasonCode = Number.withConstraint((n) => Object.values(OcspResponderRevocationReason).includes(n));
This will need to import OcspResponderRevocationReason
from revocation.types.ts
into this file though. But what you have works too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing is, n >= 0 && n <= 10 && n != 7
includes 0
but [1, 2, 3, 4, 5, 6, 8, 9, 10, 1001]
doesn't. So maybe need to add 0
if we prefer listing out the numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
I will follow your suggestion as it is cleaner
….type.ts Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
To support the new reason code
1001
which represents thesuspended
document status on OCSP responderChanges
ValidOcspReasonCode
to validate reason code1001
OcspResponderRevocationReason
to returnSUSPENDED
for reason code1001