diff --git a/spec/fixtures/certs/ec256-wrong-private.pem b/spec/fixtures/certs/ec256-wrong-private.pem deleted file mode 100644 index a4d1da2c..00000000 --- a/spec/fixtures/certs/ec256-wrong-private.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MHQCAQEEICfA4AaomONdmPTzeyrx5U/jugYXTERyb5U3ETTv7Hx7oAcGBSuBBAAK -oUQDQgAEPmuXZT3jpJnEMVPOW6RMsmxeGLOCE1PN6fwvUwOsxv7YnyoQ5/bpo64n -+Jp4slSl1aUNoCBF2oz9bS0iyBo3jg== ------END EC PRIVATE KEY----- diff --git a/spec/fixtures/certs/ec384-wrong-private.pem b/spec/fixtures/certs/ec384-wrong-private.pem deleted file mode 100644 index 491f9908..00000000 --- a/spec/fixtures/certs/ec384-wrong-private.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MIGkAgEBBDAfZW47dSKnC5JkSVOk1ERxCIi/IJ1p1WBnVGx4hnrNHy+dxtaZJaF+ -YLInFQ/QbYegBwYFK4EEACKhZANiAAQwXkx4BFBGLXbzl5yVrfxK7er8hSi38iDE -K2+7cdrR137Wn5JUnL4WTwXTzkyUgfBOL3sHNozwfgU03GD/EOUEKqzsIJiz2cbP -bFALd4hS+8T4szDLVC9Jl1W6k0CAtmM= ------END EC PRIVATE KEY----- diff --git a/spec/fixtures/certs/ec384-wrong-public.pem b/spec/fixtures/certs/ec384-wrong-public.pem deleted file mode 100644 index 693bd019..00000000 --- a/spec/fixtures/certs/ec384-wrong-public.pem +++ /dev/null @@ -1,5 +0,0 @@ ------BEGIN PUBLIC KEY----- -MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEMF5MeARQRi1285ecla38Su3q/IUot/Ig -xCtvu3Ha0dd+1p+SVJy+Fk8F085MlIHwTi97BzaM8H4FNNxg/xDlBCqs7CCYs9nG -z2xQC3eIUvvE+LMwy1QvSZdVupNAgLZj ------END PUBLIC KEY----- diff --git a/spec/fixtures/certs/ec512-wrong-private.pem b/spec/fixtures/certs/ec512-wrong-private.pem deleted file mode 100644 index 692ff973..00000000 --- a/spec/fixtures/certs/ec512-wrong-private.pem +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN EC PRIVATE KEY----- -MIHbAgEBBEG/KbA2oCbiCT6L3V8XSz2WKBy0XhGvIFbl/ZkXIXnkYt+1B7wViSVo -KCHuMFsi6xU/5nE1EuDG2UsQJmKeAMkIOKAHBgUrgQQAI6GBiQOBhgAEAG0TFWe5 -cZ5DZIyfuysrCoQySTNxd+aT8sPIxsx7mW6YBTsuO6rEgxyegd2Auy4xtikxpzKv -soMXR02999Aaus2jAAt/wxrhhr41BDP4MV0b6Zngb72hna0pcGqit5OyU8AbOJUZ -+rdyowRGsOY+aPbOyVhdNcsEdxYC8GdIyCQLBC1H ------END EC PRIVATE KEY----- diff --git a/spec/fixtures/certs/ec512-wrong-public.pem b/spec/fixtures/certs/ec512-wrong-public.pem deleted file mode 100644 index a84be38c..00000000 --- a/spec/fixtures/certs/ec512-wrong-public.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQAbRMVZ7lxnkNkjJ+7KysKhDJJM3F3 -5pPyw8jGzHuZbpgFOy47qsSDHJ6B3YC7LjG2KTGnMq+ygxdHTb330Bq6zaMAC3/D -GuGGvjUEM/gxXRvpmeBvvaGdrSlwaqK3k7JTwBs4lRn6t3KjBEaw5j5o9s7JWF01 -ywR3FgLwZ0jIJAsELUc= ------END PUBLIC KEY----- diff --git a/spec/fixtures/certs/rsa-1024-private.pem b/spec/fixtures/certs/rsa-1024-private.pem deleted file mode 100644 index 7f01c002..00000000 --- a/spec/fixtures/certs/rsa-1024-private.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXgIBAAKBgQDO/ahgFDvniFoQ1dm+MdnkBi+Ts5W9AtQNgw4ZHIdPnqEzSgW7 -0opKEu8hnlLqsIyU2BC2op/xOanipdbXObuFlA6bth1cYRI+YJlR3BbPGOIL6YbJ -ud9m0gIsBlCDLm4e/E45ZS+emudISP7/SF7zxvxZlnr1z7HTm7nIIVBvuQIDAQAB -AoGBAMzFQAccvU6GI6O4C5sOsiHUxMh3xtCftaxQVGgfQvVPVuXoeteep1Q0ewFl -IV4vnkO5pH8pTtVTWG9x5KIy6QCql4qvr2jkOm4mo9uogrpNklvBl2lN4Lxubj0N -mGRXaM3hckZl8+JT6uzfBfjy+pd8AOigJGPQCOZn4gmANW7pAkEA82Nh4wpj6ZRU -NBiBq3ONZuH4xJm59MI2FWRJsGUFUYdSaFwyKKim52/13d8iUb7v9utWQFRatCXz -Lqw9fQyVrwJBANm3dBOVxpUPrYEQsG0q2rdP+u6U3woylxwtQgJxImZKZmmJlPr8 -9v23rhydvCe1ERPYe7EjF4RGWVPN3KLdExcCQDdzNfL3BApMS97OkoRQQC/nXbjU -2SPlN1MqVQuGCG8pqGG0V40h11y1CkvxMS10ldEojq77SOrwFnZUsXGS82sCQQC6 -XdO7QCaxSq5XIRYlHN4EtS40NLOIYy3/LK6osHel4GIyTVd+UjSLk0QzssJxqwln -V5TqWQO0cxPcLQiFUYEZAkEA2G84ilb9QXOgbNyoE1VifNk49hhodbSskLb86uwY -Vgtzq1ZsqoPBCasr4WRiXt270n+mo5dNYRlZwiUn9lH78Q== ------END RSA PRIVATE KEY----- diff --git a/spec/fixtures/certs/rsa-1024-public.pem b/spec/fixtures/certs/rsa-1024-public.pem deleted file mode 100644 index 7bec6ef0..00000000 --- a/spec/fixtures/certs/rsa-1024-public.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDO/ahgFDvniFoQ1dm+MdnkBi+T -s5W9AtQNgw4ZHIdPnqEzSgW70opKEu8hnlLqsIyU2BC2op/xOanipdbXObuFlA6b -th1cYRI+YJlR3BbPGOIL6YbJud9m0gIsBlCDLm4e/E45ZS+emudISP7/SF7zxvxZ -lnr1z7HTm7nIIVBvuQIDAQAB ------END PUBLIC KEY----- diff --git a/spec/fixtures/certs/rsa-2048-wrong-private.pem b/spec/fixtures/certs/rsa-2048-wrong-private.pem deleted file mode 100644 index 7cae44c6..00000000 --- a/spec/fixtures/certs/rsa-2048-wrong-private.pem +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpAIBAAKCAQEAzHAVGaW9j4l3/b4ngcjjoIoIcnsQEWOMqErb5VhLZMGIq1gE -O5qxPDAwooKsNotzcAOB3ZyLn7p5D+dmOrNUYkYWgYITNGeSifrnVqQugd5Fh1L8 -K7zOGltUo2UtjbN4uJ56tzxBMZp2wejs2/Qu0eu0xZK3To+YkDcWOk92rmNgmUSQ -C/kNyIOj+yBvOo3wTk6HvbhoIarCgJ6Lay1v/hMLyQLzwRY/Qfty1FTIDyTv2dch -47FsfkZ1KAL+MbUnHuCBPzGxRjXa8Iy9Z7YGxrYasUt1b0um64bscxoIiCu8yLL8 -jlg01Rwrjr/MTwKRhwXlMp8B7HTonwtaG6arJwIDAQABAoIBAGFR4dmJusl/qW1T -fj8cQLAFxaupxaZhe24J5NAyzgEy2Dqo9ariIwkB78UM66ozjEqAgOvcP+NTw5m8 -kD/VapA1yTTxlO7XdzzUAhiOo80S4IphCMZRZNPLMmluGtdf3lIUr1pXBrn0TCBX -H5o9jaREzpNXGof9d6T/dEdh2J9+uE/p1xE5GSxQfaPheZzCG7636La/DcArg/UR -+TusPqp62BEmk96pE/KKJRmEeH+WnPfSh6sMpLxi3hkEU7AynpliGT6Z6xV4csBI -S/rdpkcj5DWpbnQzkwdrnL2Q+POEq/vlx5/NlezvtQPNLvQWDyY4yBCoMKGb3EbX -xrxP7MECgYEA/kwe4P0Mqk+087IyhjDBGPfcMt8gfYc9nzNfIYSWdSwuSag/hqHq -I4GwHQzUV9ix3iM6w5hin10yAzWxCYZg9hquV+lSvNNpGB76FX6oOqwuAhyQMRwv -eW+VUyfFXeJugwL5JuIaNTvwPpQVDHYtELLifie+uzJ5HC6dhg/XchcCgYEAzc5/ -+IXjOlExd/mBgFk/5Y87ifA0ZOgbaJXifYgU0aNSgz1piHxU3n2p4jJ9lSdwwCl2 -Fb5EN7666t20PL5QcXJ5ZdaTRLzRlYiqTWzfYHBgttbB1Jl3Ed9GsKuzRgaRqGFC -ANJSqZlKG0NZ3keRtuKdFwq+IVOnsQr9g0TZiXECgYEAqUgtCiMKCloTIGMQpSnR -cXiWWjsUmturls4Q1vQ3YHrvuVLKLyqb/dT4Uu5WcMAs765OESThCit0/pQAbVHK -PCpYwubskAzAGjGM00BEZwJ1gixXhIm5xMIWCowgI7Z3ULlq+IptXeCvtkjHlksZ -BtO+WLLGkkEwRCV38WWcSzMCgYA/Xxqgl/mD94RYAQgTUWgPc69Nph08BQyLg7ue -E8z1UGkT6FEaqc4oRGGPOSTaTK63PQ0TXOb8k0pTD7l0CtYSWMFwzkXCoLGYbeCi -vqd5tqDRLAe7QxYa9rl5pSUqptMrGeeNATZa6sya4H5Hp5oCyny8n54z/OJh7ZRq -W0TwwQKBgQDDP7ksm2pcqadaVAmODdOlaDHbaEcxp8wN7YVz0lM3UpJth96ukbj7 -S39eJhXYWOn6oJQb/lN9fGOYqjg3y6IchGZDp67ATvWYvn/NY0R7mt4K4oHx5TuN -rSQlP3WmOGv8Kemw892uRfW/jZyBEHhsfS213WDttVPn9F635GdNWw== ------END RSA PRIVATE KEY----- diff --git a/spec/fixtures/certs/rsa-4096-private.pem b/spec/fixtures/certs/rsa-4096-private.pem deleted file mode 100644 index ddee0731..00000000 --- a/spec/fixtures/certs/rsa-4096-private.pem +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIJJwIBAAKCAgEAqETmgWBi5rCmb7euJplA/9xs65+bncc9Yvs5zjyycXSW82Jf -RuyguGm0OvA2wog24dR4N2kT/87DcGtp5JqJWADVFN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197PTmb9H67jos8nhauqOoW/qaMJK2M9D -tCubLUNf3eAT14R16CHNP93qnUE/TSeXQ3JsIofne0neb47u4F6zcuzvaNEbjSEn -HJqID7sw5GoA6WQo0I+yqWAXICMXmHf/gtYfxGHEFeSUwexULH5BKG1R8sncw7J0 -Ag3h8xkGrNON4SkcTLy8Iay/eS6YxRcKndo4mk2mU65tr77TX4xi3Z/jWkQLY5WO -eJwhAoIBABO17wkSxyGDjJ/fDfpsE3bDmgRV2KuBHoqqOBvXH26sM7ghXLZKjT4o -5ooqXmTYJm91GIjYs71exnkr8hDW9L4nbEuxOgeSVyRg69H+NMshOaQ8sE8GDJxO -wgsnAyY4Vq6UomwYW/E0RL/AxRezM/nZGaVzgo3qgLJXP4MwbOQm7hMq1FD2LQuW -PDhH3Ty+kA5ca97W0Asd/3k+Pi0pNDvdZUOj8e7E369cKoTcKAdPGGsQ8aILhsCd -q3EUTKwwDl8+KrH9utBJPejQzeTjfBVo/xH6q145QeVFcy9ku/zQN3M9p5vQMEuX -j1lBMTkpTFw7uYBE2idyHw5BJoZsWQcCggEADfZTChqnOncItSflzGoaAACrr4/x -KyT/4A+cPMCs11JN9J+EWsCezya2o1l/NF7YPcBR4qjCmFMEiq5GxH5fGLQp0aa7 -V13mHA8XBQ25OW2K7BGJhMHdbuvTnl6jsOfC4+t7P2bUAYxoP6/ncxTzZ5OlBN5k -aMv9firWl1kSKK75ww9DWn6j0rQ4dBetwX45EMcs+iKIdydg0fmJxR2EJ+uQsCFy -xcWBEDqV7qLUi6UrAPL3v/DXUv9wKcKOTbKw/aNE8+YTWMUO330GCJ5cVU1eTL5t -UrcNKOJkFIj7jJUCzv6vcy++hMJEbNXnnTVRnky6e9C2vwzMl33njntapg== ------END RSA PRIVATE KEY----- diff --git a/spec/fixtures/certs/rsa-4096-public.pem b/spec/fixtures/certs/rsa-4096-public.pem deleted file mode 100644 index 01055eb0..00000000 --- a/spec/fixtures/certs/rsa-4096-public.pem +++ /dev/null @@ -1,14 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqETmgWBi5rCmb7euJplA -/9xs65+bncc9Yvs5zjyycXSW82JfRuyguGm0OvA2wog24dR4N2kT/87DcGtp5JqJ -WADVFNr+2V2r6i57/OMLruRpn3p2r95dmo0COE+BxPFl7XEBT8JbH57ZtpgcB3/x -kS14nLOWFf96hrXPlXJC+VMVKVZmA8k2LRh42vT5wUf4U0Doy/p7yFNSFFa6Q8ww -e4TBy/z/f+rhFD1w8rxlYjallee/ocm7bjZCwbJGMm7orLViqWfsFX3O35PeoJ5h -/7uJ7iRwvTFERkTdwWP/0BeKBeItBR3YFc2mut+V9W+WKRkMSL6Crc+oVSx3p8aB -7j9SZFzQiRtes4BYETpX1xl2mgIq5hvsFbLw7ESrlIodiwUMTrSIid2DQ6q80kv1 -zXPr4+Id6L0sJLxPCaXnTmNtasSwyedJJYxLjwhHJwtzFAeaq18H3O791YKhjAJ6 -YxK3zJ59jTE6Pkvqjq183f2PGHVRvgSN7aCmI6MBUUB5wDP2K8zX2sh40/uPDVSd -6ei1vl3DpPk+h8iExx6AzbohfqZ+5RUUNx127L3MaQvOVC5TxV+R99gwKW++wzcV -uO3m2KqVUj+K1uYBy3KBCUMBbckpEWGbN++jcdV5oJX6fsC66nOmKlntYwCL/pRw -w+oLsbzF8J3dxeDbKNF9JDsCAwEAAQ== ------END PUBLIC KEY----- diff --git a/spec/fixtures/certs/ec256-private-v2.pem b/spec/fixtures/keys/ec256-private-v2.pem similarity index 100% rename from spec/fixtures/certs/ec256-private-v2.pem rename to spec/fixtures/keys/ec256-private-v2.pem diff --git a/spec/fixtures/certs/ec256-private.pem b/spec/fixtures/keys/ec256-private.pem similarity index 100% rename from spec/fixtures/certs/ec256-private.pem rename to spec/fixtures/keys/ec256-private.pem diff --git a/spec/fixtures/certs/ec256-public-v2.pem b/spec/fixtures/keys/ec256-public-v2.pem similarity index 100% rename from spec/fixtures/certs/ec256-public-v2.pem rename to spec/fixtures/keys/ec256-public-v2.pem diff --git a/spec/fixtures/certs/ec256-public.pem b/spec/fixtures/keys/ec256-public.pem similarity index 100% rename from spec/fixtures/certs/ec256-public.pem rename to spec/fixtures/keys/ec256-public.pem diff --git a/spec/fixtures/certs/ec256-wrong-public.pem b/spec/fixtures/keys/ec256-wrong-public.pem similarity index 100% rename from spec/fixtures/certs/ec256-wrong-public.pem rename to spec/fixtures/keys/ec256-wrong-public.pem diff --git a/spec/fixtures/certs/ec256k-private.pem b/spec/fixtures/keys/ec256k-private.pem similarity index 100% rename from spec/fixtures/certs/ec256k-private.pem rename to spec/fixtures/keys/ec256k-private.pem diff --git a/spec/fixtures/certs/ec256k-public.pem b/spec/fixtures/keys/ec256k-public.pem similarity index 100% rename from spec/fixtures/certs/ec256k-public.pem rename to spec/fixtures/keys/ec256k-public.pem diff --git a/spec/fixtures/certs/ec384-private.pem b/spec/fixtures/keys/ec384-private.pem similarity index 100% rename from spec/fixtures/certs/ec384-private.pem rename to spec/fixtures/keys/ec384-private.pem diff --git a/spec/fixtures/certs/ec384-public.pem b/spec/fixtures/keys/ec384-public.pem similarity index 100% rename from spec/fixtures/certs/ec384-public.pem rename to spec/fixtures/keys/ec384-public.pem diff --git a/spec/fixtures/certs/ec512-private.pem b/spec/fixtures/keys/ec512-private.pem similarity index 100% rename from spec/fixtures/certs/ec512-private.pem rename to spec/fixtures/keys/ec512-private.pem diff --git a/spec/fixtures/certs/ec512-public.pem b/spec/fixtures/keys/ec512-public.pem similarity index 100% rename from spec/fixtures/certs/ec512-public.pem rename to spec/fixtures/keys/ec512-public.pem diff --git a/spec/fixtures/certs/rsa-2048-private.pem b/spec/fixtures/keys/rsa-2048-private.pem similarity index 100% rename from spec/fixtures/certs/rsa-2048-private.pem rename to spec/fixtures/keys/rsa-2048-private.pem diff --git a/spec/fixtures/certs/rsa-2048-public.pem b/spec/fixtures/keys/rsa-2048-public.pem similarity index 100% rename from spec/fixtures/certs/rsa-2048-public.pem rename to spec/fixtures/keys/rsa-2048-public.pem diff --git a/spec/fixtures/certs/rsa-2048-wrong-public.pem b/spec/fixtures/keys/rsa-2048-wrong-public.pem similarity index 100% rename from spec/fixtures/certs/rsa-2048-wrong-public.pem rename to spec/fixtures/keys/rsa-2048-wrong-public.pem diff --git a/spec/jwk/ec_spec.rb b/spec/jwk/ec_spec.rb index ba67c46e..f2d947de 100644 --- a/spec/jwk/ec_spec.rb +++ b/spec/jwk/ec_spec.rb @@ -15,7 +15,7 @@ end context 'when a keypair with only public key is given' do - let(:keypair) { OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-public.pem'))) } + let(:keypair) { test_pkey('ec256-public.pem') } it 'creates an instance of the class' do expect(subject).to be_a described_class expect(subject.private?).to eq false @@ -49,7 +49,7 @@ end context 'when keypair with public key is exported' do - let(:keypair) { OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-public.pem'))) } + let(:keypair) { test_pkey('ec256-public.pem') } it 'returns a hash with the public parts of the key' do expect(subject).to be_a Hash expect(subject).to include(:kty, :kid, :x, :y) @@ -127,7 +127,7 @@ context 'when keypair is public' do context 'returns a public key' do - let(:keypair) { OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-public.pem'))) } + let(:keypair) { test_pkey('ec256-public.pem') } let(:params) { exported_key } it 'returns a hash with the public parts of the key' do diff --git a/spec/jwt_spec.rb b/spec/jwt_spec.rb index bfc831ac..edf1b20a 100644 --- a/spec/jwt_spec.rb +++ b/spec/jwt_spec.rb @@ -8,20 +8,20 @@ :empty_token => 'e30K.e30K.e30K', :empty_token_2_segment => 'e30K.e30K.', :secret => 'My$ecretK3y', - :rsa_private => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'rsa-2048-private.pem'))), - :rsa_public => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'rsa-2048-public.pem'))), - :wrong_rsa_private => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'rsa-2048-wrong-public.pem'))), - :wrong_rsa_public => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'rsa-2048-wrong-public.pem'))), - 'ES256_private' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-private.pem'))), - 'ES256_public' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-public.pem'))), - 'ES256_private_v2' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-private-v2.pem'))), - 'ES256_public_v2' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-public-v2.pem'))), - 'ES384_private' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec384-private.pem'))), - 'ES384_public' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec384-public.pem'))), - 'ES512_private' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec512-private.pem'))), - 'ES512_public' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec512-public.pem'))), - 'ES256K_private' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256k-private.pem'))), - 'ES256K_public' => OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256k-public.pem'))), + :rsa_private => test_pkey('rsa-2048-private.pem'), + :rsa_public => test_pkey('rsa-2048-public.pem'), + :wrong_rsa_private => test_pkey('rsa-2048-wrong-public.pem'), + :wrong_rsa_public => test_pkey('rsa-2048-wrong-public.pem'), + 'ES256_private' => test_pkey('ec256-private.pem'), + 'ES256_public' => test_pkey('ec256-public.pem'), + 'ES256_private_v2' => test_pkey('ec256-private-v2.pem'), + 'ES256_public_v2' => test_pkey('ec256-public-v2.pem'), + 'ES384_private' => test_pkey('ec384-private.pem'), + 'ES384_public' => test_pkey('ec384-public.pem'), + 'ES512_private' => test_pkey('ec512-private.pem'), + 'ES512_public' => test_pkey('ec512-public.pem'), + 'ES256K_private' => test_pkey('ec256k-private.pem'), + 'ES256K_public' => test_pkey('ec256k-public.pem'), 'NONE' => 'eyJhbGciOiJub25lIn0.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.', 'HS256' => 'eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.kWOVtIOpWcG7JnyJG0qOkTDbOy636XrrQhMm_8JrRQ8', 'HS512256' => 'eyJhbGciOiJIUzUxMjI1NiJ9.eyJ1c2VyX2lkIjoic29tZUB1c2VyLnRsZCJ9.Ds_4ibvf7z4QOBoKntEjDfthy3WJ-3rKMspTEcHE2bA', @@ -179,7 +179,7 @@ end it 'wrong key should raise JWT::DecodeError' do - key = OpenSSL::PKey.read File.read(File.join(CERT_PATH, 'rsa-2048-wrong-public.pem')) + key = test_pkey('rsa-2048-wrong-public.pem') expect do JWT.decode data[alg], key, true, algorithm: alg @@ -187,7 +187,7 @@ end it 'wrong key and verify = false should not raise JWT::DecodeError' do - key = OpenSSL::PKey.read File.read(File.join(CERT_PATH, 'rsa-2048-wrong-public.pem')) + key = test_pkey('rsa-2048-wrong-public.pem') expect do JWT.decode data[alg], key, false @@ -240,7 +240,7 @@ data[alg] = JWT.encode(payload, data["#{alg}_private"], alg) end - let(:wrong_key) { OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'ec256-wrong-public.pem'))) } + let(:wrong_key) { test_pkey('ec256-wrong-public.pem') } it 'should generate a valid token' do jwt_payload, header = JWT.decode data[alg], data["#{alg}_public"], true, algorithm: alg diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d4ec8deb..7dcfffba 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,16 +4,17 @@ require 'simplecov' require 'jwt' +require_relative 'spec_support/test_keys' + puts "OpenSSL::VERSION: #{OpenSSL::VERSION}" puts "OpenSSL::OPENSSL_VERSION: #{OpenSSL::OPENSSL_VERSION}" puts "OpenSSL::OPENSSL_LIBRARY_VERSION: #{OpenSSL::OPENSSL_LIBRARY_VERSION}\n\n" -CERT_PATH = File.join(__dir__, 'fixtures', 'certs') - RSpec.configure do |config| config.expect_with :rspec do |c| c.syntax = :expect end + config.include(SpecSupport::TestKeys) config.before(:example) { JWT.configuration.reset! } config.run_all_when_everything_filtered = true config.filter_run :focus diff --git a/spec/spec_support/test_keys.rb b/spec/spec_support/test_keys.rb new file mode 100644 index 00000000..8931e2e0 --- /dev/null +++ b/spec/spec_support/test_keys.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module SpecSupport + module TestKeys + KEY_FIXTURE_PATH = File.join(__dir__, '..', 'fixtures', 'keys') + + def test_pkey(key) + TestKeys.keys[key] ||= read_pkey(key) + end + + def read_pkey(key) + OpenSSL::PKey.read(File.read(File.join(KEY_FIXTURE_PATH, key))) + end + + def self.keys + @keys ||= {} + end + end +end diff --git a/spec/x5c_key_finder_spec.rb b/spec/x5c_key_finder_spec.rb index c5849101..46b17677 100644 --- a/spec/x5c_key_finder_spec.rb +++ b/spec/x5c_key_finder_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true describe JWT::X5cKeyFinder do - let(:root_key) { OpenSSL::PKey.read(File.read(File.join(CERT_PATH, 'rsa-2048-private.pem'))) } + let(:root_key) { test_pkey('rsa-2048-private.pem') } let(:root_dn) { OpenSSL::X509::Name.parse('/DC=org/DC=fake-ca/CN=Fake CA') } let(:root_certificate) { generate_root_cert(root_dn, root_key) } let(:leaf_key) { generate_key }