inst_access 0.4.1 → 0.4.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 +4 -4
- data/lib/inst_access/token.rb +8 -2
- data/lib/inst_access/version.rb +1 -1
- data/spec/inst_access/token_spec.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbec71c0ed08813dd78884db0a007ea381e8aa6c66eed9f716e2f98979034e2b
|
4
|
+
data.tar.gz: 49f346a1e2caedcd79e0e68e9ab141ce2ec38a6f4f8936181296af43a318d6b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6884908d27623419e8ac893fd9f101081303c6f0977cb1ef6a7bbdcd38a50f963235620bb59c39b738c67b63d968493b4e555e8d09b9b6e7e7c3e8d151dc6d4
|
7
|
+
data.tar.gz: 6de8f23b7d042a166d4f60b9ff57bfc9d855cc69b2ad9436ec1e278a88908b614f264370f2cde6fc93480e15bdb0bb0a91c5f111c67c680661bf1f077f9a8a7f
|
data/lib/inst_access/token.rb
CHANGED
@@ -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)
|
data/lib/inst_access/version.rb
CHANGED
@@ -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.
|
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:
|
11
|
+
date: 2024-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|