omniauth-signicat 1.6.1 → 1.6.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
  SHA1:
3
- metadata.gz: 743cd89aa46b73fe9eb294506cbe0d564776fd0d
4
- data.tar.gz: dee77f87d25693fa2b35c6584decb71d26464e6c
3
+ metadata.gz: 05a174ed5554d8195893b87261e594545a9184b0
4
+ data.tar.gz: 6e5f6200fab15559ff66a5e332033893a6a12cbb
5
5
  SHA512:
6
- metadata.gz: ff5d5d942a1a70c432ec37ac1a6a573e83a756598ea93c936876f44e8a7e21e39e1c539afd6f4cf78d57c1b8cf73aa8f1617b5da7c164d36cd752b3ae75f87e4
7
- data.tar.gz: 0fc4bf8eb157ca4c17222c7a952a81a03d5da7716e2f5bd087eca91e9e1989579483d06b97d0c9f6832f7163494078cc3447bfd416b51611afef9db4bd01a74c
6
+ metadata.gz: de66cc3ac40a9ef934c8906b6594285d69d4acb1115764466ff53d96434a68d0f44474142796d608724fef02c454a6b2e40f9135d00941fddd201b0337230096
7
+ data.tar.gz: 13312615e62872be46f32b8a872a0a66c444e739c98c9941835f5fbbc0450f73bf2d7d93cd024d1b5b7425792adf9b6f12bcc94d86638361ba278ec076e479f3
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Signicat
3
- VERSION = '1.6.1'.freeze
3
+ VERSION = '1.6.2'.freeze
4
4
  end
5
5
  end
@@ -46,6 +46,7 @@ module OmniAuth
46
46
  "https://#{options[:env]}.signicat.com",
47
47
  "/std/method/#{options[:service]}",
48
48
  "?id=#{options[:method]}:#{options[:profile]}:#{options[:language]}",
49
+ "&#{prefilled_query_params}",
49
50
  "&target=#{CGI.escape(callback_url)}"
50
51
  ].join('')
51
52
  end
@@ -64,6 +65,12 @@ module OmniAuth
64
65
 
65
66
  private
66
67
 
68
+ def prefilled_query_params
69
+ options.fetch(:prefilled, {}).map do |key, value|
70
+ "prefilled.#{key}=#{value}"
71
+ end.join('&')
72
+ end
73
+
67
74
  def verify_signature!(xml)
68
75
  key = extract_public_key(xml)
69
76
 
@@ -33,6 +33,34 @@ describe OmniAuth::Strategies::Signicat, type: :strategy do
33
33
  it 'should redirect correctly' do
34
34
  last_response.location.should include 'https://preprod.signicat.com/std/method/demo?id=nbid:default:nb'
35
35
  end
36
+
37
+ context 'when passing phone and subject' do
38
+ around do |example|
39
+ signicat_options[:prefilled] = {
40
+ phone: '99988777',
41
+ subject: '010170'
42
+ }
43
+ example.run
44
+ end
45
+
46
+ it 'should include prefilled query params' do
47
+ last_response.location.should include '&prefilled.subject=010170'
48
+ last_response.location.should include '&prefilled.phone=99988777'
49
+ end
50
+ end
51
+
52
+ context 'when passing subject' do
53
+ around do |example|
54
+ signicat_options[:prefilled] = {
55
+ subject: '01017012345'
56
+ }
57
+ example.run
58
+ end
59
+
60
+ it 'should include prefilled query params' do
61
+ last_response.location.should include '&prefilled.subject=01017012345'
62
+ end
63
+ end
36
64
  end
37
65
 
38
66
  describe 'POST /auth/signicat/callback' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-signicat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theodor Tonum
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2016-05-16 00:00:00.000000000 Z
18
+ date: 2016-12-15 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: omniauth
@@ -128,11 +128,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.5.1
131
+ rubygems_version: 2.6.8
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Signicat strategy for OmniAuth.
135
135
  test_files:
136
136
  - spec/omniauth/strategies/signicat_spec.rb
137
137
  - spec/spec_helper.rb
138
- has_rdoc: