inst_access 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3725e7d832fcddd123708c45dadc6541942fbd9dd01828a5b263aa76f9f048ef
4
- data.tar.gz: aa296914f1621d6b2f54829b3659b8ede1c719a89ea6357b9c65a8b4ce825990
3
+ metadata.gz: cbec71c0ed08813dd78884db0a007ea381e8aa6c66eed9f716e2f98979034e2b
4
+ data.tar.gz: 49f346a1e2caedcd79e0e68e9ab141ce2ec38a6f4f8936181296af43a318d6b9
5
5
  SHA512:
6
- metadata.gz: 3fb2fbe2884970be8de2a6a82b6a8b7011631f1243ab3accb9b547396591ada3a6f2741644ee4d1e2bf2cd598a434b2e978ec5ce93998ef0ff35ee69f5f2dabd
7
- data.tar.gz: 8d64e7490c1a4ae99216a94c6cd4b18227daec66d96111ba4497713ab8fb3300ee176318f24eb3dd18eab89efe8afef67949a35facca09103e9cd36c8c6d1f31
6
+ metadata.gz: d6884908d27623419e8ac893fd9f101081303c6f0977cb1ef6a7bbdcd38a50f963235620bb59c39b738c67b63d968493b4e555e8d09b9b6e7e7c3e8d151dc6d4
7
+ data.tar.gz: 6de8f23b7d042a166d4f60b9ff57bfc9d855cc69b2ad9436ec1e278a88908b614f264370f2cde6fc93480e15bdb0bb0a91c5f111c67c680661bf1f077f9a8a7f
@@ -62,6 +62,10 @@ module InstAccess
62
62
  jwt_payload[:instructure_service] == true
63
63
  end
64
64
 
65
+ def canvas_shard_id
66
+ jwt_payload[:canvas_shard_id]
67
+ end
68
+
65
69
  def jti
66
70
  jwt_payload[:jti]
67
71
  end
@@ -101,7 +105,8 @@ module InstAccess
101
105
  real_user_global_id: nil,
102
106
  region: nil,
103
107
  client_id: nil,
104
- instructure_service: nil
108
+ instructure_service: nil,
109
+ canvas_shard_id: nil
105
110
  )
106
111
  raise ArgumentError, 'Must provide user uuid and account uuid' if user_uuid.blank? || account_uuid.blank?
107
112
 
@@ -121,7 +126,8 @@ module InstAccess
121
126
  debug_masq_global_id: real_user_global_id&.to_s,
122
127
  region: region,
123
128
  client_id: client_id,
124
- instructure_service: instructure_service
129
+ instructure_service: instructure_service,
130
+ canvas_shard_id: canvas_shard_id
125
131
  }.compact
126
132
 
127
133
  new(payload)
@@ -19,5 +19,5 @@
19
19
  #
20
20
 
21
21
  module InstAccess
22
- VERSION = '0.4.1'
22
+ VERSION = '0.4.2'
23
23
  end
@@ -87,7 +87,8 @@ describe InstAccess::Token do
87
87
  real_user_shard_id: 5,
88
88
  region: 'us-west-2',
89
89
  client_id: 'client-id',
90
- instructure_service: true
90
+ instructure_service: true,
91
+ canvas_shard_id: 3
91
92
  )
92
93
  expect(id.canvas_domain).to eq('z.instructure.com')
93
94
  expect(id.masquerading_user_uuid).to eq('masq-id')
@@ -95,6 +96,7 @@ describe InstAccess::Token do
95
96
  expect(id.region).to eq('us-west-2')
96
97
  expect(id.client_id).to eq('client-id')
97
98
  expect(id.instructure_service?).to eq true
99
+ expect(id.canvas_shard_id).to eq(3)
98
100
  end
99
101
 
100
102
  it 'generates a unique jti' do
@@ -110,7 +112,8 @@ describe InstAccess::Token do
110
112
  real_user_shard_id: 5,
111
113
  region: 'us-west-2',
112
114
  client_id: 'client-id',
113
- instructure_service: true
115
+ instructure_service: true,
116
+ canvas_shard_id: 3
114
117
  )
115
118
 
116
119
  expect(id.jti).to eq uuid
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst_access
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Ziwisky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-06 00:00:00.000000000 Z
11
+ date: 2024-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport