-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: define and export known error prefixes
- Loading branch information
Showing
3 changed files
with
113 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Error prefixes used for known verification failure cases. | ||
* | ||
* For compatibility, these error prefixes match the existing error messages, but will be adjusted in a future major | ||
* version update to match the scenarios better. | ||
* | ||
* @beta | ||
*/ | ||
export const enum JWT_ERROR { | ||
/** | ||
* Thrown when a JWT payload schema is unexpected or when validity period does not match | ||
*/ | ||
INVALID_JWT = 'invalid_jwt', | ||
/** | ||
* Thrown when the verifier is not configured for the given JWT input | ||
*/ | ||
INVALID_CONFIG = 'invalid_config', | ||
/** | ||
* Thrown when none of the public keys of the issuer match the signature of the JWT | ||
*/ | ||
INVALID_SIGNATURE = 'invalid_signature', | ||
/** | ||
* Thrown when the `alg` of the JWT or the encoding of the key is not supported | ||
*/ | ||
NOT_SUPPORTED = 'not_supported', | ||
/** | ||
* Thrown when the DID document of the issuer does not have any keys that match the signature for the given | ||
* `proofPurpose` | ||
*/ | ||
NO_SUITABLE_KEYS = 'no_suitable_keys', | ||
/** | ||
* Thrown when the DID resolver is unable to resolve the issuer DID. | ||
*/ | ||
RESOLVER_ERROR = 'resolver_error', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters