prx_auth-rails 2.1.0 → 3.0.1

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: 3212721cc8a3569576581017749f0af4ebca8c3c6c50684f9d88587057e9517b
4
+ data.tar.gz: 41f92ebcf2c167cb48d00c39319a1a6663d9a7203aa9c6c7d69007f8230ba011
5
5
  SHA512:
6
- metadata.gz: 243d784cb14623fe63af154eb6c7146c767cb96f0edcb19b4977ae66d70dc3db5c6137448b1c82a892316a0a3754d9886429d0861a20593a43fa18749b7b5ef9
7
- data.tar.gz: 2844850399e1525cae1257cdd3e9f46f2ed0336ef4bf9e30b4737e0e535e0198f7f284855821b2bf092d1daf3afda6f6ea12a2bcb2517f37bd2b8a3c9b8a7661
6
+ metadata.gz: c3fa282bf2f549e40761da8b04ddb3944c20492818598bc2d391e7cc5e79b032a41c2d5914b5b2f7f70a3401492548149eb308b08b030efbcd87d817b05f7698
7
+ data.tar.gz: 6e25421712eb18d89fa5aa6fda01eb1641262f41ae294aa39630755ef342a743ecbd6d02bd985469eb56db25d20e4e0121696b5de8338219edf75d9597f16363
@@ -4,7 +4,7 @@ module PrxAuth::Rails
4
4
  class SessionsController < ApplicationController
5
5
  include PrxAuth::Rails::Engine.routes.url_helpers
6
6
 
7
- skip_before_action :authenticate!
7
+ skip_before_action :authenticate!, raise: false
8
8
 
9
9
  before_action :set_nonce!, only: [:new, :show]
10
10
  before_action :set_after_sign_in_path
@@ -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,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module PrxAuth
2
4
  module Rails
3
- VERSION = "2.1.0"
5
+ VERSION = '3.0.1'
4
6
  end
5
7
  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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Rhoden
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -270,7 +270,7 @@ homepage: https://github.com/PRX/prx_auth-rails
270
270
  licenses:
271
271
  - MIT
272
272
  metadata: {}
273
- post_install_message:
273
+ post_install_message:
274
274
  rdoc_options: []
275
275
  require_paths:
276
276
  - lib
@@ -285,9 +285,8 @@ 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
290
- signing_key:
288
+ rubygems_version: 3.1.4
289
+ signing_key:
291
290
  specification_version: 4
292
291
  summary: Rails integration for next generation PRX Authorization system.
293
292
  test_files: