aws-cognito-srp 0.3.0.1 → 0.4.0

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
  SHA256:
3
- metadata.gz: 180b657b77c00d5651c02440ac1c269fcf0ff0c0cfed35deb13224ea225585dc
4
- data.tar.gz: 776b06f5fced0c6c96d0fbc3a02810f11273ebc4e28e00199108dac461774cfd
3
+ metadata.gz: 6000777b1471345bf83ef454e2147786b46c8960218729c0ef9b33d05bc08634
4
+ data.tar.gz: 5b28a08b3614d6dbe6f05a1bc25fd54200a8c90bb6fe8e3a24f97e4afc1bbe80
5
5
  SHA512:
6
- metadata.gz: 56237ee2ed291d3a0a636f75ca9be3762444e8e18b989b75505d9d8a1c67ec1e3574e275ea83fb0b4d2fd873c524297a6280d03ffd93e19f88ddaaadef24f38b
7
- data.tar.gz: de22d3f26a0e34adab3acafc37e8822601565aaef64bfeff9a39a29d69dfc67784421f5dc1458c8424cf78930bf92bf6ee7c0ae2c888e4f03bd8718b2a347520
6
+ metadata.gz: d1e507ab4e5a8ce39647a2699ad1bac52a62352c6b2a04d2eb47b12954ae8c8a1f86f26c457583c13f84200064620cbf938381894d302a457b7a2c0468f5f26e
7
+ data.tar.gz: 3714f171b5527ed457d2c05e0ff5aece5f96d572e9f48e4fa6412b9cedad85d69ac54432b7e719f7afe0406aa7d135562b0f7446d705d0a4a494f22c48a45bd4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## Changelog for aws-cognito-srp-ruby
2
2
 
3
+ ### 0.4.0 (October 1, 2021)
4
+
5
+ * Added `refresh_tokens` method
6
+
3
7
  ### 0.3.0 (September 29, 2021)
4
8
 
5
9
  * Added support for Ruby 2.4 and 2.3
data/README.md CHANGED
@@ -38,6 +38,10 @@ resp = aws_srp.authenticate
38
38
  resp.id_token
39
39
  resp.access_token
40
40
  resp.refresh_token
41
+
42
+ # A few hours later ... ⌛️
43
+
44
+ new_tokens = aws_srp.refresh_tokens(resp.refresh_token)
41
45
  ```
42
46
 
43
47
  ## Supported rubies
@@ -2,9 +2,6 @@
2
2
 
3
3
  module Aws
4
4
  class CognitoSrp
5
- VERSION = "0.3.0.1"
6
- # ^
7
- # NOTE: the fourth version number is just temporary to reflect an update to
8
- # the gemspec (with no functional changes), remove it in next version bump
5
+ VERSION = "0.4.0"
9
6
  end
10
7
  end
@@ -59,9 +59,10 @@ module Aws
59
59
  # aws_srp.authenticate
60
60
  #
61
61
  class CognitoSrp
62
- USER_SRP_AUTH = "USER_SRP_AUTH"
63
- PASSWORD_VERIFIER = "PASSWORD_VERIFIER"
64
62
  NEW_PASSWORD_REQUIRED = "NEW_PASSWORD_REQUIRED"
63
+ PASSWORD_VERIFIER = "PASSWORD_VERIFIER"
64
+ REFRESH_TOKEN = "REFRESH_TOKEN"
65
+ USER_SRP_AUTH = "USER_SRP_AUTH"
65
66
 
66
67
  N_HEX = %w(
67
68
  FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08
@@ -127,6 +128,19 @@ module Aws
127
128
  auth_response.authentication_result
128
129
  end
129
130
 
131
+ def refresh_tokens(refresh_token)
132
+ resp = @aws_client.initiate_auth(
133
+ client_id: @client_id,
134
+ auth_flow: REFRESH_TOKEN,
135
+ auth_parameters: {
136
+ REFRESH_TOKEN: refresh_token
137
+ }
138
+ )
139
+
140
+ resp.authentication_result
141
+ end
142
+ alias_method :refresh, :refresh_tokens
143
+
130
144
  private
131
145
 
132
146
  def generate_random_small_a
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-cognito-srp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Viney
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubygems_version: 3.2.3
142
+ rubygems_version: 3.0.6
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: AWS Cognito SRP auth for Ruby