omniauth-discord 0.1.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +8 -1146
- data/Rakefile +4 -7
- data/lib/omniauth/discord.rb +1 -1
- data/lib/omniauth/discord/version.rb +1 -1
- data/lib/omniauth/strategies/discord.rb +9 -11
- data/omniauth-discord.gemspec +15 -16
- metadata +14 -15
data/Rakefile
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
|
-
require '
|
2
|
+
require 'rspec/core/rake_task'
|
3
3
|
|
4
|
-
|
5
|
-
task.libs << 'lib'
|
6
|
-
task.libs << 'test'
|
7
|
-
task.test_files = FileList['test/*_test.rb']
|
8
|
-
end
|
4
|
+
RSpec::Core::RakeTask.new
|
9
5
|
|
10
|
-
|
6
|
+
desc 'Run specs'
|
7
|
+
task default: :spec
|
data/lib/omniauth/discord.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require 'omniauth/discord/version'
|
2
|
-
require 'omniauth/strategies/discord'
|
2
|
+
require 'omniauth/strategies/discord'
|
@@ -3,25 +3,24 @@ require 'omniauth-oauth2'
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
5
|
class Discord < OmniAuth::Strategies::OAuth2
|
6
|
-
DEFAULT_SCOPE = 'identify'
|
6
|
+
DEFAULT_SCOPE = 'identify'.freeze
|
7
7
|
|
8
8
|
option :name, 'discord'
|
9
9
|
|
10
|
-
option :client_options,
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
10
|
+
option :client_options,
|
11
|
+
site: 'https://discordapp.com/api',
|
12
|
+
authorize_url: 'oauth2/authorize',
|
13
|
+
token_url: 'oauth2/token'
|
15
14
|
|
16
|
-
option :authorize_options, [
|
15
|
+
option :authorize_options, %i[scope permissions]
|
17
16
|
|
18
17
|
uid { raw_info['id'] }
|
19
18
|
|
20
19
|
info do
|
21
20
|
{
|
22
|
-
:
|
23
|
-
|
24
|
-
:
|
21
|
+
name: raw_info['username'],
|
22
|
+
email: raw_info['verified'] ? raw_info['email'] : nil,
|
23
|
+
image: "https://cdn.discordapp.com/avatars/#{raw_info['id']}/#{raw_info['avatar']}"
|
25
24
|
}
|
26
25
|
end
|
27
26
|
|
@@ -46,7 +45,6 @@ module OmniAuth
|
|
46
45
|
params[option] = request.params[option.to_s] if request.params[option.to_s]
|
47
46
|
end
|
48
47
|
|
49
|
-
params[:redirect_uri] = options[:redirect_uri] unless options[:redirect_uri].nil?
|
50
48
|
params[:scope] ||= DEFAULT_SCOPE
|
51
49
|
end
|
52
50
|
end
|
data/omniauth-discord.gemspec
CHANGED
@@ -1,28 +1,27 @@
|
|
1
|
-
|
2
|
-
$:.push File.expand_path('../lib', __FILE__)
|
1
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
3
2
|
require 'omniauth/discord/version'
|
4
3
|
|
5
4
|
Gem::Specification.new do |spec|
|
6
|
-
spec.name =
|
5
|
+
spec.name = 'omniauth-discord'
|
7
6
|
spec.version = Omniauth::Discord::VERSION
|
8
|
-
spec.authors = [
|
9
|
-
spec.email = [
|
7
|
+
spec.authors = ['Adão Raul']
|
8
|
+
spec.email = ['adao.raul@gmail.com']
|
10
9
|
|
11
|
-
spec.summary =
|
10
|
+
spec.summary = 'Discord OAuth2 Strategy for OmniAuth'
|
12
11
|
spec.description = spec.summary
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
12
|
+
spec.homepage = 'http://github.com/adaoraul/omniauth-discord'
|
13
|
+
spec.license = 'MIT'
|
15
14
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
17
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = [
|
18
|
+
spec.require_paths = ['lib']
|
20
19
|
|
21
|
-
spec.add_runtime_dependency 'omniauth
|
20
|
+
spec.add_runtime_dependency 'omniauth'
|
21
|
+
spec.add_runtime_dependency 'omniauth-oauth2'
|
22
22
|
|
23
|
-
spec.add_development_dependency
|
24
|
-
spec.add_development_dependency
|
25
|
-
spec.add_development_dependency
|
26
|
-
spec.add_development_dependency
|
27
|
-
spec.add_development_dependency "mocha"
|
23
|
+
spec.add_development_dependency 'rack-test'
|
24
|
+
spec.add_development_dependency 'rspec'
|
25
|
+
spec.add_development_dependency 'simplecov'
|
26
|
+
spec.add_development_dependency 'webmock'
|
28
27
|
end
|
metadata
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-discord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adão Raul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: omniauth
|
14
|
+
name: omniauth
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
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: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: omniauth-oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
|
-
type: :
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rack-test
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: webmock
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -132,8 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
|
136
|
-
rubygems_version: 2.7.6
|
135
|
+
rubygems_version: 3.0.1
|
137
136
|
signing_key:
|
138
137
|
specification_version: 4
|
139
138
|
summary: Discord OAuth2 Strategy for OmniAuth
|