inst_access 0.4.3 → 0.4.4

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: a559457afcb20a5ef4814c6320932e837a2c40713956ca89c72dbae487e41a47
4
- data.tar.gz: a075d8e49d0244b3a2a36b7246500f4bbd833cdacc954b5320e066164824a822
3
+ metadata.gz: d5ba1db50c0d9738f9845b2f553e2c3906c9e8bcad0bfb1fbf7d50027b5357f8
4
+ data.tar.gz: 226f184ea24923d9eb95a836ddb6ee7b03258eed74d070bb2686db85c8075984
5
5
  SHA512:
6
- metadata.gz: d0de198d5e310d3262dbe9bb558b2fee295dba2977e50b83cfdd4cb5e54d8582f8de9d209e2c0c3d590a84456c367a40b030e574cf0ccbcd5ee99a7572a33322
7
- data.tar.gz: 97d977d4b0a4f83b93702d3b71635629ba710046f23dcd71f3f7ff333c15ed5eca5263dfccd667adc2f2397fb35e95e0cc7d25482276870d2fda6d87899d3ec3
6
+ metadata.gz: 7ab6da2741107934b9d52f168a7d88821b850ee60850d7ab2e190531d08c4e3390822faf25f03a0619e3c311f91215315d51d0eac35e67e7d28562b2f8a690ec
7
+ data.tar.gz: 0c2058387c8f73dea54577a38691fc5eca384dbaf9cac6d04398fac3ebf49b2d0a239c4dc72b9fa49d5cca6953660102b155bb2e11fb0347cb76e0fb3be08fa2
@@ -159,8 +159,8 @@ module InstAccess
159
159
 
160
160
  def token?(string)
161
161
  jwt = JSON::JWT.decode(string, :skip_verification)
162
- issuers = InstAccess.configured? && (issuers = InstAccess.config.issuers)
163
- issuers ? issuers.include?(jwt[:iss]) : jwt[:iss] == ISSUER
162
+ InstAccess.configured? && (issuers = InstAccess.config.issuers)
163
+ issuers&.include?(jwt[:iss]) || jwt[:iss] == ISSUER
164
164
  rescue StandardError
165
165
  false
166
166
  end
@@ -19,5 +19,5 @@
19
19
  #
20
20
 
21
21
  module InstAccess
22
- VERSION = '0.4.3'
22
+ VERSION = '0.4.4'
23
23
  end
@@ -63,6 +63,18 @@ describe InstAccess::Token do
63
63
  expect(described_class.token?(unencrypted_token)).to eq(true)
64
64
  end
65
65
  end
66
+
67
+ it 'returns true for JWTs from the default issuer when issuers are configured' do
68
+ token = described_class.for_user(user_uuid: 'user-uuid', account_uuid: 'acct-uuid')
69
+ jws = InstAccess.with_config(signing_key: signing_priv_key) do
70
+ token.to_unencrypted_token_string
71
+ end
72
+ jwt = JSON::JWT.decode(jws, :skip_verification)
73
+ expect(jwt[:iss]).to eq(InstAccess::Token::ISSUER)
74
+ InstAccess.with_config(signing_key: signing_priv_key, issuers: issuers) do
75
+ expect(described_class.token?(jws)).to eq(true)
76
+ end
77
+ end
66
78
  end
67
79
 
68
80
  it 'returns true for an expired InstAccess token' do
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.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Ziwisky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-05 00:00:00.000000000 Z
11
+ date: 2024-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport