omniauth-sberbusiness 1.0.4 → 1.0.5
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/omniauth/sberbusiness/version.rb +1 -1
- data/lib/omniauth/strategies/sberbusiness.rb +23 -1
- 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: ba7fa11ea9bd25f870de1fe86b3b2be85ebb8bacbba832ca69bc37de2900fd63
|
4
|
+
data.tar.gz: c3d1e32dd2eaa7500d85fd5a615a06232b3298c109fa3655311e1846cf01fa15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f74419d268a369102133a3029bf3316332c67cdc3d6615c81d9594c6e0b727b88a7808266986e48015c5110b358638435170a0f2e96258335f80022379a0ac1e
|
7
|
+
data.tar.gz: dc509a2030e560af04bb05188ae9f5d47464e541c315f7e150871b7cfff4ce6fedf3ccb4bed083038ac19a7e610bc4e591b6a8a59620927cb1c37eae42e83545
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require 'omniauth/strategies/oauth2'
|
4
4
|
require 'securerandom'
|
5
5
|
require 'base64'
|
6
|
+
require 'pry'
|
6
7
|
|
7
8
|
module OmniAuth
|
8
9
|
module Strategies
|
@@ -31,6 +32,11 @@ module OmniAuth
|
|
31
32
|
|
32
33
|
uid { raw_info['sub'].to_s }
|
33
34
|
|
35
|
+
def client
|
36
|
+
change_links if options.test
|
37
|
+
super
|
38
|
+
end
|
39
|
+
|
34
40
|
# https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema
|
35
41
|
info do
|
36
42
|
{
|
@@ -72,7 +78,7 @@ module OmniAuth
|
|
72
78
|
return result unless options.test
|
73
79
|
|
74
80
|
org_info = access_token.get(options.client_options['client_info_path'], headers: info_headers).body
|
75
|
-
result.merge(
|
81
|
+
result.merge(client_info: org_info.force_encoding('UTF-8'))
|
76
82
|
end
|
77
83
|
end
|
78
84
|
|
@@ -81,6 +87,9 @@ module OmniAuth
|
|
81
87
|
end
|
82
88
|
|
83
89
|
def authorize_params
|
90
|
+
# add links in options
|
91
|
+
change_links if options.test
|
92
|
+
|
84
93
|
super.tap do |params|
|
85
94
|
%w[state scope response_type client_type client_id nonce].each do |v|
|
86
95
|
next unless request.params[v]
|
@@ -103,6 +112,19 @@ module OmniAuth
|
|
103
112
|
}
|
104
113
|
end
|
105
114
|
|
115
|
+
def change_links
|
116
|
+
options.client_options[:site] = options.client_options[:test_site] ||
|
117
|
+
'https://edupirfintech.sberbank.ru:9443'
|
118
|
+
options.client_options[:token_url] = options.client_options[:test_token_url] ||
|
119
|
+
'https://edupirfintech.sberbank.ru:9443/ic/sso/api/v1/oauth/token'
|
120
|
+
options.client_options[:authorize_url] = options.client_options[:test_authorize_url] ||
|
121
|
+
'https://edupir.testsbi.sberbank.ru:9443/ic/sso/api/v1/oauth/authorize'
|
122
|
+
options.client_options[:user_info_path] = options.client_options[:test_user_info_path] ||
|
123
|
+
'/ic/sso/api/v1/oauth/user-info'
|
124
|
+
options.client_options[:client_info_path] = options.client_options[:test_client_info_path] ||
|
125
|
+
'/fintech/api/v1/client-info'
|
126
|
+
end
|
127
|
+
|
106
128
|
def callback_url
|
107
129
|
options.redirect_url || (full_host + script_name + callback_path)
|
108
130
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-sberbusiness
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergei Baksheev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|