ruby_jwt 1.0.7 → 1.0.8

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: a35fbfd1f6a8578d44a2f9e0b9da563f8efbf397
4
- data.tar.gz: c9e1694cf9f99c0181f34d52d7e89ef3107eb5e1
3
+ metadata.gz: 12a81af8351dec3535a610f497e1a63744bd6634
4
+ data.tar.gz: 6b26382441a091ee8c064498a8a09158237ee1cf
5
5
  SHA512:
6
- metadata.gz: 437117ca4d94645600462f933d9fba248bbfc25619e37bab928c3a492b18499f9a8bd151a56b597f6a4ebde80bd886b48698b8ba8aad1f7fd056ea9f29f456a6
7
- data.tar.gz: ad1ebcd48ed95c8d52fe5f5dd53d8b3f41ef5198dcfa43921cd31449902226b9c96c3a1dc95814801611d7abb3b5e6eb51cca24ad9f6c466f0980da0ce8a6259
6
+ metadata.gz: 38e06e77cbc8e0a2fb6ee0651ea71f47f44289977d5130c0c377f4470dbc1c840af1b7ae535b7963af955421a9c8800f250ebb61f6fb09fd1676a2736315fa2b
7
+ data.tar.gz: 8ba33e322dcc0941d32636ea45e4b005b68b92aa9a1a208944c1eecc3ed357ad1a93d76e626250fec3e9610470d538cb2f7290661d2ee03893b3f2f9a5791b30
data/lib/ruby_jwt.rb CHANGED
@@ -71,12 +71,12 @@ module JWT
71
71
  return VerificationResponse.new(false,"Key cannot be blank if algorithm is not 'none'") if(alg != "none" and !secret)
72
72
  payload = json_decode_data(jwt_parts[1])
73
73
  signature = base64urldecode(jwt_parts[2]) if alg != "none"
74
-
75
- if(payload[:exp] and Time.now.to_i >= payload[:exp])
74
+ current_time = Time.now.to_i
75
+ if(payload[:exp] and current_time >= payload[:exp])
76
76
  return VerificationResponse.new(false,"JWT is expired.")
77
77
  end
78
78
 
79
- if(payload[:nbf] and Time.now.to_i < payload[:nbf])
79
+ if(payload[:nbf] and current_time < payload[:nbf])
80
80
  return VerificationResponse.new(false, "JWT nbf has not passed yet.")
81
81
  end
82
82
 
@@ -1,3 +1,3 @@
1
1
  module RubyJwt
2
- VERSION = "1.0.7"
2
+ VERSION = "1.0.8"
3
3
  end
@@ -3483,3 +3483,198 @@ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
3483
3483
  RubyJwtTest: test_should_encode_and_decode_none
3484
3484
  -----------------------------------------------
3485
3485
   (0.1ms) rollback transaction
3486
+  (0.1ms) begin transaction
3487
+ -----------------------------------------------------
3488
+ RubyJwtTest: test_decodes_and_verifies_existing_token
3489
+ -----------------------------------------------------
3490
+  (0.0ms) rollback transaction
3491
+  (0.0ms) begin transaction
3492
+ ---------------------------------------------------------
3493
+ RubyJwtTest: test_returns_decode_error_for_invalid_base64
3494
+ ---------------------------------------------------------
3495
+  (0.0ms) rollback transaction
3496
+  (0.0ms) begin transaction
3497
+ ---------------------------------------------
3498
+ RubyJwtTest: test_returns_false_if_before_nbf
3499
+ ---------------------------------------------
3500
+  (0.0ms) rollback transaction
3501
+  (0.0ms) begin transaction
3502
+ ------------------------------------------
3503
+ RubyJwtTest: test_returns_false_if_expired
3504
+ ------------------------------------------
3505
+  (0.0ms) rollback transaction
3506
+  (0.0ms) begin transaction
3507
+ ----------------------------------------------------
3508
+ RubyJwtTest: test_returns_false_if_invalid_signature
3509
+ ----------------------------------------------------
3510
+  (0.0ms) rollback transaction
3511
+  (0.0ms) begin transaction
3512
+ -------------------------------------------------
3513
+ RubyJwtTest: test_returns_false_if_wrong_audience
3514
+ -------------------------------------------------
3515
+  (0.0ms) rollback transaction
3516
+  (0.0ms) begin transaction
3517
+ -----------------------------------------------
3518
+ RubyJwtTest: test_returns_false_if_wrong_issuer
3519
+ -----------------------------------------------
3520
+  (0.0ms) rollback transaction
3521
+  (0.0ms) begin transaction
3522
+ -------------------------------------------------------------------------
3523
+ RubyJwtTest: test_returns_not_implemented_error_for_unsupported_algorithm
3524
+ -------------------------------------------------------------------------
3525
+  (0.0ms) rollback transaction
3526
+  (0.0ms) begin transaction
3527
+ -----------------------------------------------
3528
+ RubyJwtTest: test_returns_sign_error_for_no_key
3529
+ -----------------------------------------------
3530
+  (0.0ms) rollback transaction
3531
+  (0.0ms) begin transaction
3532
+ ------------------------------------------------
3533
+ RubyJwtTest: test_should_encode_and_decode_ECDSA
3534
+ ------------------------------------------------
3535
+  (0.0ms) rollback transaction
3536
+  (0.0ms) begin transaction
3537
+ ----------------------------------------------
3538
+ RubyJwtTest: test_should_encode_and_decode_RSA
3539
+ ----------------------------------------------
3540
+  (0.0ms) rollback transaction
3541
+  (0.0ms) begin transaction
3542
+ ----------------------------------------------------------
3543
+ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
3544
+ ----------------------------------------------------------
3545
+  (0.0ms) rollback transaction
3546
+  (0.0ms) begin transaction
3547
+ -----------------------------------------------
3548
+ RubyJwtTest: test_should_encode_and_decode_none
3549
+ -----------------------------------------------
3550
+  (0.0ms) rollback transaction
3551
+  (0.1ms) begin transaction
3552
+ -----------------------------------------------------
3553
+ RubyJwtTest: test_decodes_and_verifies_existing_token
3554
+ -----------------------------------------------------
3555
+  (0.0ms) rollback transaction
3556
+  (0.0ms) begin transaction
3557
+ ---------------------------------------------------------
3558
+ RubyJwtTest: test_returns_decode_error_for_invalid_base64
3559
+ ---------------------------------------------------------
3560
+  (0.0ms) rollback transaction
3561
+  (0.0ms) begin transaction
3562
+ ---------------------------------------------
3563
+ RubyJwtTest: test_returns_false_if_before_nbf
3564
+ ---------------------------------------------
3565
+  (0.0ms) rollback transaction
3566
+  (0.0ms) begin transaction
3567
+ ------------------------------------------
3568
+ RubyJwtTest: test_returns_false_if_expired
3569
+ ------------------------------------------
3570
+  (0.0ms) rollback transaction
3571
+  (0.0ms) begin transaction
3572
+ ----------------------------------------------------
3573
+ RubyJwtTest: test_returns_false_if_invalid_signature
3574
+ ----------------------------------------------------
3575
+  (0.0ms) rollback transaction
3576
+  (0.1ms) begin transaction
3577
+ -------------------------------------------------
3578
+ RubyJwtTest: test_returns_false_if_wrong_audience
3579
+ -------------------------------------------------
3580
+  (0.0ms) rollback transaction
3581
+  (0.1ms) begin transaction
3582
+ -----------------------------------------------
3583
+ RubyJwtTest: test_returns_false_if_wrong_issuer
3584
+ -----------------------------------------------
3585
+  (0.0ms) rollback transaction
3586
+  (0.0ms) begin transaction
3587
+ -------------------------------------------------------------------------
3588
+ RubyJwtTest: test_returns_not_implemented_error_for_unsupported_algorithm
3589
+ -------------------------------------------------------------------------
3590
+  (0.0ms) rollback transaction
3591
+  (0.0ms) begin transaction
3592
+ -----------------------------------------------
3593
+ RubyJwtTest: test_returns_sign_error_for_no_key
3594
+ -----------------------------------------------
3595
+  (0.0ms) rollback transaction
3596
+  (0.0ms) begin transaction
3597
+ ------------------------------------------------
3598
+ RubyJwtTest: test_should_encode_and_decode_ECDSA
3599
+ ------------------------------------------------
3600
+  (0.0ms) rollback transaction
3601
+  (0.0ms) begin transaction
3602
+ ----------------------------------------------
3603
+ RubyJwtTest: test_should_encode_and_decode_RSA
3604
+ ----------------------------------------------
3605
+  (0.0ms) rollback transaction
3606
+  (0.0ms) begin transaction
3607
+ ----------------------------------------------------------
3608
+ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
3609
+ ----------------------------------------------------------
3610
+  (0.1ms) rollback transaction
3611
+  (0.0ms) begin transaction
3612
+ -----------------------------------------------
3613
+ RubyJwtTest: test_should_encode_and_decode_none
3614
+ -----------------------------------------------
3615
+  (0.0ms) rollback transaction
3616
+  (0.1ms) begin transaction
3617
+ -----------------------------------------------------
3618
+ RubyJwtTest: test_decodes_and_verifies_existing_token
3619
+ -----------------------------------------------------
3620
+  (0.0ms) rollback transaction
3621
+  (0.0ms) begin transaction
3622
+ ---------------------------------------------------------
3623
+ RubyJwtTest: test_returns_decode_error_for_invalid_base64
3624
+ ---------------------------------------------------------
3625
+  (0.0ms) rollback transaction
3626
+  (0.0ms) begin transaction
3627
+ ---------------------------------------------
3628
+ RubyJwtTest: test_returns_false_if_before_nbf
3629
+ ---------------------------------------------
3630
+  (0.0ms) rollback transaction
3631
+  (0.1ms) begin transaction
3632
+ ------------------------------------------
3633
+ RubyJwtTest: test_returns_false_if_expired
3634
+ ------------------------------------------
3635
+  (0.0ms) rollback transaction
3636
+  (0.0ms) begin transaction
3637
+ ----------------------------------------------------
3638
+ RubyJwtTest: test_returns_false_if_invalid_signature
3639
+ ----------------------------------------------------
3640
+  (0.0ms) rollback transaction
3641
+  (0.0ms) begin transaction
3642
+ -------------------------------------------------
3643
+ RubyJwtTest: test_returns_false_if_wrong_audience
3644
+ -------------------------------------------------
3645
+  (0.0ms) rollback transaction
3646
+  (0.0ms) begin transaction
3647
+ -----------------------------------------------
3648
+ RubyJwtTest: test_returns_false_if_wrong_issuer
3649
+ -----------------------------------------------
3650
+  (0.0ms) rollback transaction
3651
+  (0.0ms) begin transaction
3652
+ -------------------------------------------------------------------------
3653
+ RubyJwtTest: test_returns_not_implemented_error_for_unsupported_algorithm
3654
+ -------------------------------------------------------------------------
3655
+  (0.0ms) rollback transaction
3656
+  (0.0ms) begin transaction
3657
+ -----------------------------------------------
3658
+ RubyJwtTest: test_returns_sign_error_for_no_key
3659
+ -----------------------------------------------
3660
+  (0.0ms) rollback transaction
3661
+  (0.0ms) begin transaction
3662
+ ------------------------------------------------
3663
+ RubyJwtTest: test_should_encode_and_decode_ECDSA
3664
+ ------------------------------------------------
3665
+  (0.0ms) rollback transaction
3666
+  (0.0ms) begin transaction
3667
+ ----------------------------------------------
3668
+ RubyJwtTest: test_should_encode_and_decode_RSA
3669
+ ----------------------------------------------
3670
+  (0.0ms) rollback transaction
3671
+  (0.0ms) begin transaction
3672
+ ----------------------------------------------------------
3673
+ RubyJwtTest: test_should_encode_and_decode_and_verify_hmac
3674
+ ----------------------------------------------------------
3675
+  (0.0ms) rollback transaction
3676
+  (0.0ms) begin transaction
3677
+ -----------------------------------------------
3678
+ RubyJwtTest: test_should_encode_and_decode_none
3679
+ -----------------------------------------------
3680
+  (0.0ms) rollback transaction
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: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Weston