Update tests to match new error output, and add additional test for bad header parameter
This commit is contained in:
parent
3b9914f8e2
commit
cc1d4582bd
@ -89,6 +89,19 @@ TestRegister.addTests([
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "JWT Sign: HS256, invalid header",
|
||||||
|
input: inputObject,
|
||||||
|
expectedOutput: `Header must be a valid (or empty) json object.
|
||||||
|
|
||||||
|
SyntaxError: Unexpected token 'h', "this is not JSON" is not valid JSON`,
|
||||||
|
recipeConfig: [
|
||||||
|
{
|
||||||
|
op: "JWT Sign",
|
||||||
|
args: [hsKey, "HS256", "this is not JSON"],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "JWT Sign: HS256 with custom header",
|
name: "JWT Sign: HS256 with custom header",
|
||||||
input: inputObject,
|
input: inputObject,
|
||||||
@ -142,7 +155,7 @@ TestRegister.addTests([
|
|||||||
input: inputObject,
|
input: inputObject,
|
||||||
expectedOutput: `Error: Have you entered the key correctly? The key should be either the secret for HMAC algorithms or the PEM-encoded private key for RSA and ECDSA.
|
expectedOutput: `Error: Have you entered the key correctly? The key should be either the secret for HMAC algorithms or the PEM-encoded private key for RSA and ECDSA.
|
||||||
|
|
||||||
Error: "alg" parameter "ES384" requires curve "secp384r1".`,
|
DataError: Named curve mismatch`,
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
op: "JWT Sign",
|
op: "JWT Sign",
|
||||||
@ -189,7 +202,7 @@ Error: "alg" parameter "ES384" requires curve "secp384r1".`,
|
|||||||
input: inputObject,
|
input: inputObject,
|
||||||
expectedOutput: `Error: Have you entered the key correctly? The key should be either the secret for HMAC algorithms or the PEM-encoded private key for RSA and ECDSA.
|
expectedOutput: `Error: Have you entered the key correctly? The key should be either the secret for HMAC algorithms or the PEM-encoded private key for RSA and ECDSA.
|
||||||
|
|
||||||
Error: secretOrPrivateKey has a minimum key size of 2048 bits for RS256`,
|
TypeError: RS256 requires key modulusLength to be 2048 bits or larger`,
|
||||||
recipeConfig: [
|
recipeConfig: [
|
||||||
{
|
{
|
||||||
op: "JWT Sign",
|
op: "JWT Sign",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user