omniauth-notes 0.0.1 → 0.0.2
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/lib/omniauth/notes/version.rb +1 -1
- data/lib/omniauth/strategies/notes.rb +15 -19
- data/omniauth-notes.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6fd91b44ec687b58eda834a6de128b0f89d3119
|
4
|
+
data.tar.gz: 41d3ac1f081c5599f34587ff493285732cd058fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf216e2700d87bacf2cafa39150e3abf865b3809ccfe6195c4fd8132fe0cb9850df4f1a55dcbb89acecea176d29ff2bd31dc5f956b3772f9d41ce11ab72539d8
|
7
|
+
data.tar.gz: f99ef5ed68e50ac5b3afa6c3bd11bc909af3baf1957dc9f1ff2b2dd5884e891ddb44182c99474b00e3c557b352fbfa4f459b4e0ff66231e3a502009ffd3dee61
|
@@ -1,31 +1,27 @@
|
|
1
|
-
require 'omniauth'
|
1
|
+
require 'omniauth/strategies/oauth2'
|
2
2
|
|
3
3
|
module OmniAuth
|
4
4
|
module Strategies
|
5
|
-
class Notes
|
6
|
-
|
5
|
+
class Notes < OmniAuth::Strategies::OAuth2
|
6
|
+
option :name, :notes
|
7
7
|
|
8
|
-
option :
|
9
|
-
|
8
|
+
option :client_options, {
|
9
|
+
:site => "http://notes18.com",
|
10
|
+
:authorize_url => "/oauth/authorize"
|
11
|
+
}
|
10
12
|
|
11
|
-
uid
|
12
|
-
request.params[options.uid_field.to_s]
|
13
|
-
end
|
13
|
+
uid { raw_info["id"] }
|
14
14
|
|
15
15
|
info do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
{
|
17
|
+
email: raw_info["email"]
|
18
|
+
# and anything else you want to return to your API consumers
|
19
|
+
}
|
20
20
|
end
|
21
21
|
|
22
|
-
def
|
23
|
-
|
24
|
-
rescue ::Timeout::Error => e
|
25
|
-
fail!(:timeout, e)
|
26
|
-
rescue ::Net::HTTPFatalError, ::OpenSSL::SSL::SSLError => e
|
27
|
-
fail!(:service_unavailable, e)
|
22
|
+
def raw_info
|
23
|
+
@raw_info ||= access_token.get('/api/me.json').parsed
|
28
24
|
end
|
29
25
|
end
|
30
26
|
end
|
31
|
-
|
27
|
+
end
|
data/omniauth-notes.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-notes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andersen Fan
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: omniauth-oauth2
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: multi_json
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|