inst_access 0.4.0 → 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: f3f8f9627e9866878600ebfffa114229879693c401e03a07f024c9ecc7aa4567
4
- data.tar.gz: 95a2ad12a7fbb4392c6828353734ad24a43cb10056c822b50d6234c4f8f2223d
3
+ metadata.gz: cbec71c0ed08813dd78884db0a007ea381e8aa6c66eed9f716e2f98979034e2b
4
+ data.tar.gz: 49f346a1e2caedcd79e0e68e9ab141ce2ec38a6f4f8936181296af43a318d6b9
5
5
  SHA512:
6
- metadata.gz: 1946b0ac1c71312c08d2e931f542e3e35119d3e26b4590c03f260bfec093d947cae388125e935ab03d1e63cbb2c06273ed9ed7da67bfba54406d523b78142988
7
- data.tar.gz: 650914d4e10bc474b71146351956ce903b318efb32c453da9ea697c3aac5cf0f840d2e455982f1abc6fa3ebf893857fef3db1fc990a8febd278e1b768034bab9
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.0'
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.0
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-05 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
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: json-jwt
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.13.0
33
+ version: '1.13'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.13.0
40
+ version: '1.13'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement