smart_app_launch_test_kit 0.1.1 → 0.1.2

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: 2c5933298e16b4e62b1381d8697fe077af1dcd3e953e930f3853fc1d0850d90c
4
- data.tar.gz: af74480ebd3eca40306158c0ef47a04f33325fb1a703b645a97344eb799c4cb9
3
+ metadata.gz: 4b5b5d83f2f6bd20c159c0c258b0a67123880f3f526c21487795c0b7e60dde44
4
+ data.tar.gz: bcd5875e3e0a8a34a5d573d1cfda6b6babfc55c1b4364834a761c21c264ad83b
5
5
  SHA512:
6
- metadata.gz: 822ea01dd26d84dbd79bb4d24cb45af8fc17e6aeea1522cf668962f5cf245b6fe07c24df658367892ad08f0ae3070e44579560e6a8f3c3b2272e6e971d804f1b
7
- data.tar.gz: ddd6263d76f090845a441edc8c103fd1516fc5bb5c7ffcf8de84aee2bac3e706ca3038e60b2e64b13c9a0b989067efe32d3818a32600ac720a46e55885c32ebe
6
+ metadata.gz: 76d53cd6f4b40e128dc3510f0e4e01de66e8e61c475c7db1516bf726e8f2890c4ebc08e5838e2d3714b7791a3e5a65fc4165eeae6136bada32e23a08ada64caf
7
+ data.tar.gz: 6d6a3851b0d01ceb6d1576be40eb74be5a8b86089d705c26ab877251a843d68d9d4afc10c13de43d5eb122e9e971c2e5d76f8afb17b30f3def60370769ecd660
@@ -87,7 +87,8 @@ module SMARTAppLaunch
87
87
  end
88
88
 
89
89
  if use_pkce == 'true'
90
- code_verifier = SecureRandom.uuid
90
+ # code verifier must be between 43 and 128 characters
91
+ code_verifier = SecureRandom.uuid + '-' + SecureRandom.uuid
91
92
  code_challenge =
92
93
  if pkce_code_challenge_method == 'S256'
93
94
  self.class.calculate_s256_challenge(code_verifier)
@@ -28,6 +28,12 @@ module SMARTAppLaunch
28
28
  end
29
29
  end
30
30
 
31
+ def validate_scope_subset(received_scopes, original_scopes)
32
+ extra_scopes = received_scopes.split - original_scopes.split
33
+ assert extra_scopes.empty?, "Token response contained scopes which are not a subset of the scope granted to the "\
34
+ "original access token: #{extra_scopes.join(', ')}"
35
+ end
36
+
31
37
  def validate_token_field_types(body)
32
38
  STRING_FIELDS
33
39
  .select { |field| body[field].present? }
@@ -11,6 +11,8 @@ module SMARTAppLaunch
11
11
  an access token or a message indicating that the authorization request
12
12
  has been denied. `access_token`, `expires_in`, `token_type`, and `scope` are
13
13
  required. `access_token` must be `Bearer`.
14
+
15
+ Scopes returned must be a strict subset of the scopes granted in the original launch.
14
16
  )
15
17
  input :received_scopes
16
18
  output :refresh_token, :access_token, :token_retrieval_time, :expires_in, :received_scopes
@@ -36,8 +38,7 @@ module SMARTAppLaunch
36
38
  validate_token_field_types(body)
37
39
  validate_token_type(body)
38
40
 
39
- assert received_scopes.split.sort == old_received_scopes.split.sort,
40
- 'Received scopes not equal to originally granted scopes'
41
+ validate_scope_subset(received_scopes, old_received_scopes)
41
42
  end
42
43
  end
43
44
  end
@@ -10,7 +10,7 @@ module SMARTAppLaunch
10
10
  description %(
11
11
  # Background
12
12
 
13
- The #{title} Sequence tests the ability of the system to successfuly
13
+ The #{title} Sequence tests the ability of the system to successfully
14
14
  exchange a refresh token for an access token. Refresh tokens are typically
15
15
  longer lived than access tokens and allow client applications to obtain a
16
16
  new access token Refresh tokens themselves cannot provide access to
@@ -1,3 +1,3 @@
1
1
  module SMARTAppLaunch
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_app_launch_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-05 00:00:00.000000000 Z
11
+ date: 2022-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core