omniauth-qnyp 1.0.0 → 1.0.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/.rubocop.yml +43 -0
- data/CHANGELOG.md +10 -0
- data/lib/omniauth-qnyp/version.rb +1 -1
- data/lib/omniauth/strategies/qnyp.rb +16 -9
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f9571a01002a18a49881d5aa6320fa26654c1848
|
|
4
|
+
data.tar.gz: 2c4467ac20965157464b16f0844e60cbff339776
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 564eefa67dcbb379b59fe9e4f4acc26a382bc9752f5c2340eaa5341699c9c93db5c705b87ad77eedb3a0f61507727962d2249480b6922bdd4741521dd60b4ea8
|
|
7
|
+
data.tar.gz: 9bdfff1f4a6efef791279706debbd744f107faeca9e6304492ff0862fc39441e9ecea239a397769deeb76cc25df636fd0a2c9675f04c9e137f5618f58ea0a944
|
data/.rubocop.yml
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
AllCops:
|
|
2
|
+
DisplayCopNames: true
|
|
3
|
+
DisplayStyleGuide: true
|
|
4
|
+
Exclude:
|
|
5
|
+
- 'spec/**/*'
|
|
6
|
+
TargetRubyVersion: 2.4
|
|
7
|
+
UseCache: false
|
|
8
|
+
|
|
9
|
+
Lint/AmbiguousBlockAssociation:
|
|
10
|
+
Enabled: false
|
|
11
|
+
|
|
12
|
+
Metrics/AbcSize:
|
|
13
|
+
Max: 35
|
|
14
|
+
|
|
15
|
+
Metrics/ClassLength:
|
|
16
|
+
Max: 150
|
|
17
|
+
|
|
18
|
+
Metrics/LineLength:
|
|
19
|
+
Enabled: false
|
|
20
|
+
|
|
21
|
+
Metrics/MethodLength:
|
|
22
|
+
Max: 20
|
|
23
|
+
|
|
24
|
+
Style/AsciiComments:
|
|
25
|
+
Enabled: false
|
|
26
|
+
|
|
27
|
+
Style/EmptyElse:
|
|
28
|
+
EnforcedStyle: empty
|
|
29
|
+
|
|
30
|
+
Style/FrozenStringLiteralComment:
|
|
31
|
+
Enabled: false
|
|
32
|
+
|
|
33
|
+
Style/GuardClause:
|
|
34
|
+
Enabled: false
|
|
35
|
+
|
|
36
|
+
Style/MultilineMethodCallIndentation:
|
|
37
|
+
EnforcedStyle: indented
|
|
38
|
+
|
|
39
|
+
Style/MultilineOperationIndentation:
|
|
40
|
+
EnforcedStyle: indented
|
|
41
|
+
|
|
42
|
+
Style/TrailingCommaInLiteral:
|
|
43
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
|
@@ -2,14 +2,19 @@ require 'omniauth-oauth2'
|
|
|
2
2
|
|
|
3
3
|
module OmniAuth
|
|
4
4
|
module Strategies
|
|
5
|
+
# OmniAuth strategy for qnyp.com
|
|
5
6
|
class Qnyp < OmniAuth::Strategies::OAuth2
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
API_URL = ENV['QNYP_API_URL'] || 'https://api.qnyp.com'
|
|
8
|
+
SITE_URL = ENV['QNYP_SITE_URL'] || 'https://qnyp.com'
|
|
8
9
|
|
|
9
|
-
option :
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
option :scope, 'public'
|
|
11
|
+
|
|
12
|
+
option(
|
|
13
|
+
:client_options,
|
|
14
|
+
site: API_URL,
|
|
15
|
+
authorize_url: "#{SITE_URL}/oauth/authorize",
|
|
16
|
+
token_url: "#{API_URL}/oauth/token"
|
|
17
|
+
)
|
|
13
18
|
|
|
14
19
|
uid { raw_info['id'] }
|
|
15
20
|
|
|
@@ -22,14 +27,16 @@ module OmniAuth
|
|
|
22
27
|
}
|
|
23
28
|
end
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
@raw_info ||= access_token.get('/me.json').parsed
|
|
27
|
-
end
|
|
30
|
+
private
|
|
28
31
|
|
|
29
32
|
# https://github.com/intridea/omniauth-oauth2/issues/81
|
|
30
33
|
def callback_url
|
|
31
34
|
full_host + script_name + callback_path
|
|
32
35
|
end
|
|
36
|
+
|
|
37
|
+
def raw_info
|
|
38
|
+
@raw_info ||= access_token.get('/me.json').parsed
|
|
39
|
+
end
|
|
33
40
|
end
|
|
34
41
|
end
|
|
35
42
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omniauth-qnyp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Junya Ogura
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-04-
|
|
11
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -75,7 +75,9 @@ extra_rdoc_files: []
|
|
|
75
75
|
files:
|
|
76
76
|
- ".gitignore"
|
|
77
77
|
- ".rspec"
|
|
78
|
+
- ".rubocop.yml"
|
|
78
79
|
- ".travis.yml"
|
|
80
|
+
- CHANGELOG.md
|
|
79
81
|
- CODE_OF_CONDUCT.md
|
|
80
82
|
- Gemfile
|
|
81
83
|
- LICENSE.txt
|