omniauth-qnyp 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c8de43583ac023f7ea812b4d251cd14845d6a19
4
- data.tar.gz: 62c3c596f1878686b795ddad3f5a1a1e7a036bb1
3
+ metadata.gz: f9571a01002a18a49881d5aa6320fa26654c1848
4
+ data.tar.gz: 2c4467ac20965157464b16f0844e60cbff339776
5
5
  SHA512:
6
- metadata.gz: 919682a07b2578fb53c6302dcedd025b6f0b86b10c6112d8c5cccb4b6fdb31b1189d282fdb0979dc2144979e3de6b99d2afde59a4399f584923a6088c336c876
7
- data.tar.gz: b3f1aec336e47d2847b163f3b5d6b7b41113fc1b2e06c4ecece2df951366dbcdc594ebb9572d19878406c433ef30db6b8399be829ce297e78c886523b0fe7ee6
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
@@ -0,0 +1,10 @@
1
+ # Changelog
2
+
3
+ ## 1.0.1 (2017-04-26)
4
+
5
+ - Introduce environment variables to customize URLs in client_options
6
+
7
+ ## 1.0.0 (2017-04-24)
8
+
9
+ - First release
10
+
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Qnyp
3
- VERSION = '1.0.0'.freeze
3
+ VERSION = '1.0.1'.freeze
4
4
  end
5
5
  end
@@ -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
- option :name, 'qnyp'
7
- option :scope, ''
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 :client_options, {
10
- site: 'https://api.qnyp.com',
11
- authorize_url: 'https://qnyp.com/oauth/authorize',
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
- def raw_info
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.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-24 00:00:00.000000000 Z
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