ruby_jwt 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e534fc72b29b3327c419953c2586ebe7bb044969
4
- data.tar.gz: ae170754b0293e51a43a286922b39e55f145599c
3
+ metadata.gz: a2305697acbc848b4f411f3fd04ae4aebb170916
4
+ data.tar.gz: 977aa56a5e39d101b7953b3f25670fc5b58e10aa
5
5
  SHA512:
6
- metadata.gz: bb923d58727f97d79f0c49e2b9f0604bc150a78a467e642f1a452a6ef388f6a227e28708ff1d9a5c5fa4767f4ada369517f80254d280aee57209fc28a026e43f
7
- data.tar.gz: 85495d0489e13a8cdf6deea6d2b358d5286823bd0992206f597f73f188c3a72b12f38dae6ff125418b607d6c5c8241d41a1b9e3e606dde3ccfa53befcfff7b0b
6
+ metadata.gz: 690ccbad507ae85a5317a5a9378633dac0b5a928748bdeb033def4a95c6677f6e2838dd258fa19642ae8ddef909f393526e29f5118a1f6595f8e0f7f93a49bc1
7
+ data.tar.gz: 322eacd961f81ae7a10ede831412d0026e7b380480e58f2a0ea2cc1c5b4fdcb64b23e2e17bba5eace169ab43573ffa9ec9fa06ed4582a2202520c68b3f3ee284
data/lib/ruby_jwt.rb CHANGED
@@ -128,7 +128,7 @@ module JWT
128
128
  return base64urlencode(key.dsa_sign_asn1(SIGNATURES[alg.gsub("ES","")].digest(data)))
129
129
  #return base64urlencode(key.sign(SIGNATURES[alg.gsub("ES","")],data))
130
130
  else
131
- raise NotImplementedError.new("Unsupported signing method!")
131
+ raise JWT::SignError.new("Unsupported signing method!")
132
132
  end
133
133
  end
134
134
 
@@ -144,7 +144,7 @@ module JWT
144
144
  return key.dsa_verify_asn1(SIGNATURES[alg.gsub("ES","")].digest(data),signature)
145
145
  #return key.verify(SIGNATURES[alg.gsub("ES","")],signature, data)
146
146
  else
147
- raise NotImplementedError.new("Unsupported signing method!")
147
+ raise JWT::VerificationError.new("Unsupported signing method!")
148
148
  end
149
149
  end
150
150
 
@@ -1,3 +1,3 @@
1
1
  module RubyJwt
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
@@ -4896,5 +4896,200 @@ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
4896
4896
   (0.0ms) begin transaction
4897
4897
  -----------------------------------------------
4898
4898
  RubyJwtTest: test_should_encode_and_decode_none
4899
+ -----------------------------------------------
4900
+  (0.0ms) rollback transaction
4901
+  (0.1ms) begin transaction
4902
+ -----------------------------------------------------
4903
+ RubyJwtTest: test_decodes_and_verifies_existing_token
4904
+ -----------------------------------------------------
4905
+  (0.0ms) rollback transaction
4906
+  (0.0ms) begin transaction
4907
+ ---------------------------------------------------------
4908
+ RubyJwtTest: test_returns_decode_error_for_invalid_base64
4909
+ ---------------------------------------------------------
4910
+  (0.0ms) rollback transaction
4911
+  (0.0ms) begin transaction
4912
+ ---------------------------------------------
4913
+ RubyJwtTest: test_returns_false_if_before_nbf
4914
+ ---------------------------------------------
4915
+  (0.0ms) rollback transaction
4916
+  (0.0ms) begin transaction
4917
+ ------------------------------------------
4918
+ RubyJwtTest: test_returns_false_if_expired
4919
+ ------------------------------------------
4920
+  (0.0ms) rollback transaction
4921
+  (0.0ms) begin transaction
4922
+ ----------------------------------------------------
4923
+ RubyJwtTest: test_returns_false_if_invalid_signature
4924
+ ----------------------------------------------------
4925
+  (0.0ms) rollback transaction
4926
+  (0.0ms) begin transaction
4927
+ -------------------------------------------------
4928
+ RubyJwtTest: test_returns_false_if_wrong_audience
4929
+ -------------------------------------------------
4930
+  (0.0ms) rollback transaction
4931
+  (0.0ms) begin transaction
4932
+ -----------------------------------------------
4933
+ RubyJwtTest: test_returns_false_if_wrong_issuer
4934
+ -----------------------------------------------
4935
+  (0.0ms) rollback transaction
4936
+  (0.0ms) begin transaction
4937
+ -------------------------------------------------------------------------
4938
+ RubyJwtTest: test_returns_not_implemented_error_for_unsupported_algorithm
4939
+ -------------------------------------------------------------------------
4940
+  (0.0ms) rollback transaction
4941
+  (0.0ms) begin transaction
4942
+ -----------------------------------------------
4943
+ RubyJwtTest: test_returns_sign_error_for_no_key
4944
+ -----------------------------------------------
4945
+  (0.0ms) rollback transaction
4946
+  (0.0ms) begin transaction
4947
+ ------------------------------------------------
4948
+ RubyJwtTest: test_should_encode_and_decode_ECDSA
4949
+ ------------------------------------------------
4950
+  (0.0ms) rollback transaction
4951
+  (0.0ms) begin transaction
4952
+ ----------------------------------------------
4953
+ RubyJwtTest: test_should_encode_and_decode_RSA
4954
+ ----------------------------------------------
4955
+  (0.0ms) rollback transaction
4956
+  (0.1ms) begin transaction
4957
+ ----------------------------------------------------------
4958
+ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
4959
+ ----------------------------------------------------------
4960
+  (0.0ms) rollback transaction
4961
+  (0.0ms) begin transaction
4962
+ -----------------------------------------------
4963
+ RubyJwtTest: test_should_encode_and_decode_none
4964
+ -----------------------------------------------
4965
+  (0.0ms) rollback transaction
4966
+  (0.1ms) begin transaction
4967
+ -----------------------------------------------------
4968
+ RubyJwtTest: test_decodes_and_verifies_existing_token
4969
+ -----------------------------------------------------
4970
+  (0.0ms) rollback transaction
4971
+  (0.0ms) begin transaction
4972
+ ---------------------------------------------------------
4973
+ RubyJwtTest: test_returns_decode_error_for_invalid_base64
4974
+ ---------------------------------------------------------
4975
+  (0.0ms) rollback transaction
4976
+  (0.0ms) begin transaction
4977
+ ---------------------------------------------
4978
+ RubyJwtTest: test_returns_false_if_before_nbf
4979
+ ---------------------------------------------
4980
+  (0.0ms) rollback transaction
4981
+  (0.1ms) begin transaction
4982
+ ------------------------------------------
4983
+ RubyJwtTest: test_returns_false_if_expired
4984
+ ------------------------------------------
4985
+  (0.0ms) rollback transaction
4986
+  (0.0ms) begin transaction
4987
+ ----------------------------------------------------
4988
+ RubyJwtTest: test_returns_false_if_invalid_signature
4989
+ ----------------------------------------------------
4990
+  (0.0ms) rollback transaction
4991
+  (0.0ms) begin transaction
4992
+ -------------------------------------------------
4993
+ RubyJwtTest: test_returns_false_if_wrong_audience
4994
+ -------------------------------------------------
4995
+  (0.0ms) rollback transaction
4996
+  (0.0ms) begin transaction
4997
+ -----------------------------------------------
4998
+ RubyJwtTest: test_returns_false_if_wrong_issuer
4999
+ -----------------------------------------------
5000
+  (0.0ms) rollback transaction
5001
+  (0.0ms) begin transaction
5002
+ -------------------------------------------------------------------------
5003
+ RubyJwtTest: test_returns_not_implemented_error_for_unsupported_algorithm
5004
+ -------------------------------------------------------------------------
5005
+  (0.0ms) rollback transaction
5006
+  (0.0ms) begin transaction
5007
+ -----------------------------------------------
5008
+ RubyJwtTest: test_returns_sign_error_for_no_key
5009
+ -----------------------------------------------
5010
+  (0.0ms) rollback transaction
5011
+  (0.0ms) begin transaction
5012
+ ------------------------------------------------
5013
+ RubyJwtTest: test_should_encode_and_decode_ECDSA
5014
+ ------------------------------------------------
5015
+  (0.0ms) rollback transaction
5016
+  (0.0ms) begin transaction
5017
+ ----------------------------------------------
5018
+ RubyJwtTest: test_should_encode_and_decode_RSA
5019
+ ----------------------------------------------
5020
+  (0.0ms) rollback transaction
5021
+  (0.0ms) begin transaction
5022
+ ----------------------------------------------------------
5023
+ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
5024
+ ----------------------------------------------------------
5025
+  (0.0ms) rollback transaction
5026
+  (0.0ms) begin transaction
5027
+ -----------------------------------------------
5028
+ RubyJwtTest: test_should_encode_and_decode_none
5029
+ -----------------------------------------------
5030
+  (0.0ms) rollback transaction
5031
+  (0.1ms) begin transaction
5032
+ -----------------------------------------------------
5033
+ RubyJwtTest: test_decodes_and_verifies_existing_token
5034
+ -----------------------------------------------------
5035
+  (0.0ms) rollback transaction
5036
+  (0.0ms) begin transaction
5037
+ ---------------------------------------------------------
5038
+ RubyJwtTest: test_returns_decode_error_for_invalid_base64
5039
+ ---------------------------------------------------------
5040
+  (0.0ms) rollback transaction
5041
+  (0.0ms) begin transaction
5042
+ ---------------------------------------------
5043
+ RubyJwtTest: test_returns_false_if_before_nbf
5044
+ ---------------------------------------------
5045
+  (0.0ms) rollback transaction
5046
+  (0.0ms) begin transaction
5047
+ ------------------------------------------
5048
+ RubyJwtTest: test_returns_false_if_expired
5049
+ ------------------------------------------
5050
+  (0.0ms) rollback transaction
5051
+  (0.0ms) begin transaction
5052
+ ----------------------------------------------------
5053
+ RubyJwtTest: test_returns_false_if_invalid_signature
5054
+ ----------------------------------------------------
5055
+  (0.0ms) rollback transaction
5056
+  (0.0ms) begin transaction
5057
+ -------------------------------------------------
5058
+ RubyJwtTest: test_returns_false_if_wrong_audience
5059
+ -------------------------------------------------
5060
+  (0.0ms) rollback transaction
5061
+  (0.0ms) begin transaction
5062
+ -----------------------------------------------
5063
+ RubyJwtTest: test_returns_false_if_wrong_issuer
5064
+ -----------------------------------------------
5065
+  (0.0ms) rollback transaction
5066
+  (0.0ms) begin transaction
5067
+ -------------------------------------------------------------------------
5068
+ RubyJwtTest: test_returns_not_implemented_error_for_unsupported_algorithm
5069
+ -------------------------------------------------------------------------
5070
+  (0.0ms) rollback transaction
5071
+  (0.0ms) begin transaction
5072
+ -----------------------------------------------
5073
+ RubyJwtTest: test_returns_sign_error_for_no_key
5074
+ -----------------------------------------------
5075
+  (0.0ms) rollback transaction
5076
+  (0.0ms) begin transaction
5077
+ ------------------------------------------------
5078
+ RubyJwtTest: test_should_encode_and_decode_ECDSA
5079
+ ------------------------------------------------
5080
+  (0.1ms) rollback transaction
5081
+  (0.0ms) begin transaction
5082
+ ----------------------------------------------
5083
+ RubyJwtTest: test_should_encode_and_decode_RSA
5084
+ ----------------------------------------------
5085
+  (0.0ms) rollback transaction
5086
+  (0.0ms) begin transaction
5087
+ ----------------------------------------------------------
5088
+ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
5089
+ ----------------------------------------------------------
5090
+  (0.0ms) rollback transaction
5091
+  (0.0ms) begin transaction
5092
+ -----------------------------------------------
5093
+ RubyJwtTest: test_should_encode_and_decode_none
4899
5094
  -----------------------------------------------
4900
5095
   (0.0ms) rollback transaction
@@ -84,7 +84,7 @@ class RubyJwtTest < ActiveSupport::TestCase
84
84
  end
85
85
 
86
86
  test "returns not implemented error for unsupported algorithm" do
87
- assert_raises(NotImplementedError){@header[:alg] = "HS422";jwt = JWT.sign(@payload,@secret,@payload_options,@header)}
87
+ assert_raises(JWT::SignError){@header[:alg] = "HS422";jwt = JWT.sign(@payload,@secret,@payload_options,@header)}
88
88
  end
89
89
 
90
90
  test "returns decode error for invalid base64" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_jwt
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Weston