omniauth_fresh_account 0.2.5 → 0.3.0
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/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 +1 -1
- metadata +7 -5
- 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: 913c2eb0ad807560c231297c598502265a44904c10dd063b816b6ff06eefe5c4
|
4
|
+
data.tar.gz: 7f91012d1b76b0fb6932153bd669e2ca747217273c81c440ef9227e598b27aa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ee2c7ebdb750a6467cc3398c8d40a27e452ee909550035f08324ee5083ea46b4ea8c7e7affdebe116da61e16a5095bbf80cf7ab59e319ff63f5b6ee0ffc48ea
|
7
|
+
data.tar.gz: '097b99807282138e87ef38eb97a838388ac9cff01047dba3a8e36a44be7e8ad77311dff57253e00b88c4572b4a12a4b6b08abe2c64f43f8f658225ea6b9cbc74'
|
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 => "http://localhost:3000",
|
11
|
+
:authorize_url => "http://localhost:3000/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
|
+
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_dependency "omniauth-oauth2", "~> 1.7"
|
30
|
+
spec.add_dependency "omniauth-oauth2", "~> 1.7.1"
|
31
31
|
|
32
32
|
spec.add_development_dependency "bundler", "~> 2.0"
|
33
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.0
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.7.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.7.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -77,12 +77,14 @@ files:
|
|
77
77
|
- ".rspec"
|
78
78
|
- ".travis.yml"
|
79
79
|
- Gemfile
|
80
|
+
- Gemfile.lock
|
80
81
|
- README.md
|
81
82
|
- Rakefile
|
82
83
|
- bin/console
|
83
84
|
- bin/setup
|
84
|
-
- lib/omniauth/fresh_account.rb
|
85
85
|
- lib/omniauth/fresh_account/version.rb
|
86
|
+
- lib/omniauth/strategies/fresh_account.rb
|
87
|
+
- lib/omniauth_fresh_account.rb
|
86
88
|
- omniauth-progic_id-0.1.5.gem
|
87
89
|
- omniauth_fresh_account.gemspec
|
88
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
|