prx_auth-rails 2.1.0 → 3.0.0

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: fedf5cbb7d3255c080ab645aea53038bd7cf2e9bae4c4852841df32278a44e3b
4
- data.tar.gz: a33847b1bbf64bd0ed4d4839003edc2cf8f0cbc72731ffdf98828ae49e0c966e
3
+ metadata.gz: 5be902ae2b7abfd4c01d28511d99931969fb3dce4aaff815fab35df005b99e07
4
+ data.tar.gz: dd3f5cf76251b17ceccaf307275401939e3d361ec01e215325674bff27aa5313
5
5
  SHA512:
6
- metadata.gz: 243d784cb14623fe63af154eb6c7146c767cb96f0edcb19b4977ae66d70dc3db5c6137448b1c82a892316a0a3754d9886429d0861a20593a43fa18749b7b5ef9
7
- data.tar.gz: 2844850399e1525cae1257cdd3e9f46f2ed0336ef4bf9e30b4737e0e535e0198f7f284855821b2bf092d1daf3afda6f6ea12a2bcb2517f37bd2b8a3c9b8a7661
6
+ metadata.gz: '09589b75ff43d4da201e8ee6ebe7caca75dcada77e8c959588a7cc2832998d71eae72bea7bc44e8d0b02db5fa2dceb5284841930502bfbc8926096bb47cf9b63'
7
+ data.tar.gz: 1bf07c4a6edb477714297edbd2e6a1ba9e3289ef28babe973816eaf6b8984157b534b4556ec5840b5c6d4d7c7dc134fab415a404cc3bfbf2716b91c994f466c2
@@ -116,7 +116,8 @@ module PrxAuth
116
116
 
117
117
  def fetch_accounts(ids)
118
118
  ids_param = ids.map(&:to_s).join(',')
119
- fetch("/api/v1/accounts?account_ids=#{ids_param}")['accounts']
119
+ resp = fetch("/api/v1/accounts?account_ids=#{ids_param}")
120
+ resp.try(:[], '_embedded').try(:[], 'prx:items') || []
120
121
  end
121
122
 
122
123
  def fetch_userinfo
@@ -1,5 +1,5 @@
1
1
  module PrxAuth
2
2
  module Rails
3
- VERSION = "2.1.0"
3
+ VERSION = "3.0.0"
4
4
  end
5
5
  end
@@ -115,7 +115,7 @@ module PrxAuth::Rails::Ext
115
115
  with_stubbed_auth('some-jwt') do
116
116
  one = {'id' => 1, 'type' => 'IndividualAccount', 'name' => 'One'}
117
117
  three = {'id' => 3, 'type' => 'GroupAccount', 'name' => 'Three'}
118
- body = {'accounts' => [one, three]}
118
+ body = {'_embedded' => {'prx:items' => [one, three]}}
119
119
 
120
120
  id_host = PrxAuth::Rails.configuration.id_host
121
121
  stub_request(:get, "https://#{id_host}/api/v1/accounts?account_ids=1,2,3").
@@ -135,7 +135,7 @@ module PrxAuth::Rails::Ext
135
135
  with_stubbed_auth('some-jwt') do
136
136
  id_host = PrxAuth::Rails.configuration.id_host
137
137
  stub_request(:get, "https://#{id_host}/api/v1/accounts?account_ids=2").
138
- to_return(status: 200, body: JSON.generate({accounts: []})).
138
+ to_return(status: 200, body: JSON.generate({'_embedded' => {'prx:items' => []}})).
139
139
  times(3)
140
140
 
141
141
  assert_equal @controller.accounts_for([2]), [nil]
@@ -150,7 +150,7 @@ module PrxAuth::Rails::Ext
150
150
  two = {'id' => 2, 'type' => 'StationAccount', 'name' => 'Two'}
151
151
  three = {'name' => 'Three'}
152
152
  session[@account_mapping_key] = {1 => one, 3 => three}
153
- body = {'accounts' => [two]}
153
+ body = {'_embedded' => {'prx:items' => [two]}}
154
154
 
155
155
  id_host = PrxAuth::Rails.configuration.id_host
156
156
  stub_request(:get, "https://#{id_host}/api/v1/accounts?account_ids=2").
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prx_auth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Rhoden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -285,8 +285,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
285
285
  - !ruby/object:Gem::Version
286
286
  version: '0'
287
287
  requirements: []
288
- rubyforge_project:
289
- rubygems_version: 2.7.6.2
288
+ rubygems_version: 3.3.3
290
289
  signing_key:
291
290
  specification_version: 4
292
291
  summary: Rails integration for next generation PRX Authorization system.