omniauth_fresh_account 0.2.6 → 0.3.1
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/.gitignore +1 -0
- data/Gemfile.lock +64 -0
- data/bin/console +1 -1
- data/lib/omniauth/fresh_account/version.rb +1 -1
- data/lib/omniauth/strategies/fresh_account.rb +38 -0
- data/lib/omniauth_fresh_account.rb +2 -0
- data/omniauth_fresh_account.gemspec +0 -1
- metadata +5 -23
- data/lib/omniauth/fresh_account.rb +0 -40
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 783902dc49efc2857c38a65112de58c4c52256d576ca96b28ebbdb7b4bdf92ec
|
4
|
+
data.tar.gz: 0517a593e3432f1edec810fe587ecdc48cf3f8c53f1dfe37288f7e0e7046e4b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c9aeec71a51373d0402746581155bfff94f2a87c7b81153ed1cf3db63a03f784fb63a9a7570a4ff9bf8bc846d4a8a122f8d62d2119c23d5307fd1426bf2dfa2
|
7
|
+
data.tar.gz: 24c3d9c704f68c569adf7ccfabae7f35a17bce031e9be6c8a278ec0b20b3c9215954cdfce3a3981e686c36d1dc9294dfb86e9f863dca2a63801147cc6a9c465d
|
data/.gitignore
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
omniauth_fresh_account (0.2.7)
|
5
|
+
omniauth-oauth2 (~> 1.7.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
diff-lcs (1.4.4)
|
11
|
+
faraday (1.3.0)
|
12
|
+
faraday-net_http (~> 1.0)
|
13
|
+
multipart-post (>= 1.2, < 3)
|
14
|
+
ruby2_keywords
|
15
|
+
faraday-net_http (1.0.1)
|
16
|
+
hashie (4.1.0)
|
17
|
+
jwt (2.2.2)
|
18
|
+
multi_json (1.15.0)
|
19
|
+
multi_xml (0.6.0)
|
20
|
+
multipart-post (2.1.1)
|
21
|
+
oauth2 (1.4.7)
|
22
|
+
faraday (>= 0.8, < 2.0)
|
23
|
+
jwt (>= 1.0, < 3.0)
|
24
|
+
multi_json (~> 1.3)
|
25
|
+
multi_xml (~> 0.5)
|
26
|
+
rack (>= 1.2, < 3)
|
27
|
+
omniauth (2.0.4)
|
28
|
+
hashie (>= 3.4.6)
|
29
|
+
rack (>= 1.6.2, < 3)
|
30
|
+
rack-protection
|
31
|
+
omniauth-oauth2 (1.7.1)
|
32
|
+
oauth2 (~> 1.4)
|
33
|
+
omniauth (>= 1.9, < 3)
|
34
|
+
rack (2.2.3)
|
35
|
+
rack-protection (2.1.0)
|
36
|
+
rack
|
37
|
+
rake (10.5.0)
|
38
|
+
rspec (3.10.0)
|
39
|
+
rspec-core (~> 3.10.0)
|
40
|
+
rspec-expectations (~> 3.10.0)
|
41
|
+
rspec-mocks (~> 3.10.0)
|
42
|
+
rspec-core (3.10.1)
|
43
|
+
rspec-support (~> 3.10.0)
|
44
|
+
rspec-expectations (3.10.1)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.10.0)
|
47
|
+
rspec-mocks (3.10.2)
|
48
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
49
|
+
rspec-support (~> 3.10.0)
|
50
|
+
rspec-support (3.10.2)
|
51
|
+
ruby2_keywords (0.0.4)
|
52
|
+
|
53
|
+
PLATFORMS
|
54
|
+
ruby
|
55
|
+
x86_64-darwin-20
|
56
|
+
|
57
|
+
DEPENDENCIES
|
58
|
+
bundler (~> 2.0)
|
59
|
+
omniauth_fresh_account!
|
60
|
+
rake (~> 10.0)
|
61
|
+
rspec (~> 3.0)
|
62
|
+
|
63
|
+
BUNDLED WITH
|
64
|
+
2.2.15
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require "bundler/setup"
|
4
|
-
require "omniauth/fresh_account"
|
4
|
+
require "omniauth/strategies/fresh_account"
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "omniauth/fresh_account/version"
|
2
|
+
require 'omniauth-oauth2'
|
3
|
+
|
4
|
+
class OmniAuth::Strategies::FreshAccount < OmniAuth::Strategies::OAuth2
|
5
|
+
# change the class name and the :name option to match your application name
|
6
|
+
option :name, :fresh_account
|
7
|
+
option :callback_path, '/users/auth/fresh_account/callback'
|
8
|
+
|
9
|
+
option :client_options, {
|
10
|
+
:site => "https://next.freshaccount.co.zw",
|
11
|
+
:authorize_url => "https://next.freshaccount.co.zw/oauth/authorize"
|
12
|
+
}
|
13
|
+
|
14
|
+
uid { raw_info["id"] }
|
15
|
+
|
16
|
+
info do
|
17
|
+
{
|
18
|
+
:email => raw_info["email"],
|
19
|
+
:name => raw_info["name"],
|
20
|
+
:avatar_url => raw_info["avatar_url"]
|
21
|
+
# and anything else you want to return to your API consumers
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
extra do
|
26
|
+
skip_info? ? {} : { :raw_info => raw_info }
|
27
|
+
end
|
28
|
+
|
29
|
+
def raw_info
|
30
|
+
@raw_info ||= access_token.get('/api/v1/me.json').parsed
|
31
|
+
end
|
32
|
+
|
33
|
+
# https://github.com/intridea/omniauth-oauth2/issues/81
|
34
|
+
def callback_url
|
35
|
+
full_host + script_name + callback_path
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
@@ -28,7 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
30
|
spec.add_dependency "omniauth-oauth2", "~> 1.7.1"
|
31
|
-
spec.add_dependency "omniauth", [">= 2", "< 3"]
|
32
31
|
|
33
32
|
spec.add_development_dependency "bundler", "~> 2.0"
|
34
33
|
spec.add_development_dependency "rake", "~> 10.0"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth_fresh_account
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kudakwashe Paradzayi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -24,26 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 1.7.1
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: omniauth
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2'
|
34
|
-
- - "<"
|
35
|
-
- !ruby/object:Gem::Version
|
36
|
-
version: '3'
|
37
|
-
type: :runtime
|
38
|
-
prerelease: false
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: '2'
|
44
|
-
- - "<"
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '3'
|
47
27
|
- !ruby/object:Gem::Dependency
|
48
28
|
name: bundler
|
49
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -97,12 +77,14 @@ files:
|
|
97
77
|
- ".rspec"
|
98
78
|
- ".travis.yml"
|
99
79
|
- Gemfile
|
80
|
+
- Gemfile.lock
|
100
81
|
- README.md
|
101
82
|
- Rakefile
|
102
83
|
- bin/console
|
103
84
|
- bin/setup
|
104
|
-
- lib/omniauth/fresh_account.rb
|
105
85
|
- lib/omniauth/fresh_account/version.rb
|
86
|
+
- lib/omniauth/strategies/fresh_account.rb
|
87
|
+
- lib/omniauth_fresh_account.rb
|
106
88
|
- omniauth-progic_id-0.1.5.gem
|
107
89
|
- omniauth_fresh_account.gemspec
|
108
90
|
homepage: https://github.com/kudapara/omniauth_fresh_account
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require "omniauth/fresh_account/version"
|
2
|
-
require 'omniauth-oauth2'
|
3
|
-
|
4
|
-
module OmniAuth
|
5
|
-
module Strategies
|
6
|
-
class FreshAccount < OmniAuth::Strategies::OAuth2
|
7
|
-
# change the class name and the :name option to match your application name
|
8
|
-
option :name, :fresh_account
|
9
|
-
|
10
|
-
option :client_options, {
|
11
|
-
:site => "http://localhost:5000",
|
12
|
-
:authorize_url => "/oauth/authorize"
|
13
|
-
}
|
14
|
-
|
15
|
-
uid { raw_info["id"] }
|
16
|
-
|
17
|
-
info do
|
18
|
-
{
|
19
|
-
:email => raw_info["email"],
|
20
|
-
:name => raw_info["name"],
|
21
|
-
:avatar_url => raw_info["avatar_url"]
|
22
|
-
# and anything else you want to return to your API consumers
|
23
|
-
}
|
24
|
-
end
|
25
|
-
|
26
|
-
extra do
|
27
|
-
skip_info? ? {} : { :raw_info => raw_info }
|
28
|
-
end
|
29
|
-
|
30
|
-
def raw_info
|
31
|
-
@raw_info ||= access_token.get('/api/v1/me.json').parsed
|
32
|
-
end
|
33
|
-
|
34
|
-
# https://github.com/intridea/omniauth-oauth2/issues/81
|
35
|
-
def callback_url
|
36
|
-
full_host + script_name + callback_path
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|