omniauth-todoist 0.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/lib/omniauth/strategies/todoist.rb +34 -35
- data/lib/omniauth/todoist/version.rb +5 -0
- data/omniauth-todoist.gemspec +27 -14
- metadata +80 -6
- data/omniauth-todoist-0.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d29816ef507d52e5326905bb48fb9dd46757d1eedaccf83f61b34e6529518cd3
|
4
|
+
data.tar.gz: 6fd8386c3f35661fe6fe03cc5e28a18c3116e69c0d2e34dbf247774592e72609
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e274c236747373710172d8d40d3815030ea187532e3d282b0fa0e5e02bba783f85c3032cf7dbd3859fd3fa663be3f2165327acff40239440610c95120341687e
|
7
|
+
data.tar.gz: 859d83e0d937540fa60c7d429bbeef0d99b4e1d3694fd2faa659321ef261736033cecadc67a4e141fb79548b82bc08ac93090777007072e69f9d266d3f219e29
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Gemfile.lock
|
@@ -5,39 +5,34 @@ require 'multi_json'
|
|
5
5
|
module OmniAuth
|
6
6
|
module Strategies
|
7
7
|
class Todoist < OmniAuth::Strategies::OAuth2
|
8
|
-
DEFAULT_SCOPE = 'data:read'
|
9
|
-
|
10
|
-
# Give your strategy a name.
|
11
8
|
option :name, "todoist"
|
12
9
|
|
13
|
-
# This is where you pass the options you would pass when
|
14
|
-
# initializing your consumer from the OAuth gem.
|
15
10
|
option :client_options, {
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
11
|
+
site: "https://todoist.com",
|
12
|
+
authorize_url: "/oauth/authorize",
|
13
|
+
token_url: "/oauth/access_token"
|
19
14
|
}
|
20
15
|
|
16
|
+
option :authorize_options, [:scope]
|
17
|
+
|
21
18
|
# These are called after authentication has succeeded. If
|
22
19
|
# possible, you should try to set the UID without making
|
23
20
|
# additional calls (if the user id is returned with the token
|
24
21
|
# or as a URI parameter). This may not be possible with all
|
25
22
|
# providers.
|
26
|
-
uid{ raw_info['id'] }
|
23
|
+
uid{ raw_info['id'].to_s }
|
27
24
|
|
28
25
|
info do
|
29
|
-
|
30
|
-
:
|
26
|
+
prune!(
|
27
|
+
name: raw_info['full_name'],
|
28
|
+
email: raw_info['email'],
|
29
|
+
image: raw_info['avatar_big'],
|
30
|
+
time_zone: raw_info['tz_info']['timezone']
|
31
|
+
)
|
31
32
|
end
|
32
|
-
|
33
|
-
extra{ raw_info }
|
34
33
|
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
def callback_phase
|
40
|
-
super
|
34
|
+
extra do
|
35
|
+
prune!(raw_info: raw_info)
|
41
36
|
end
|
42
37
|
|
43
38
|
# Bugfix for regression introduced after omniauth-oauth2 v1.3.1
|
@@ -47,25 +42,29 @@ module OmniAuth
|
|
47
42
|
end
|
48
43
|
|
49
44
|
def raw_info
|
50
|
-
|
51
|
-
|
52
|
-
body: {
|
53
|
-
token: access_token.token,
|
54
|
-
sync_token: "*",
|
55
|
-
resource_types: '["user"]' },
|
45
|
+
@raw_info ||= begin
|
46
|
+
params = {
|
56
47
|
headers: {
|
57
|
-
"Content-Type"=>"application/x-www-form-urlencoded"
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
48
|
+
"Content-Type" => "application/x-www-form-urlencoded"
|
49
|
+
},
|
50
|
+
body: {
|
51
|
+
token: access_token.token,
|
52
|
+
sync_token: "*",
|
53
|
+
resource_types: '["user"]'
|
54
|
+
}
|
55
|
+
}
|
56
|
+
access_token.post("https://api.todoist.com/sync/v9/sync", params).parsed.fetch('user', {})
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
def prune!(hash)
|
63
|
+
hash.delete_if do |_, value|
|
64
|
+
prune!(value) if value.is_a?(Hash)
|
65
|
+
value.nil? || (value.respond_to?(:empty?) && value.empty?)
|
64
66
|
end
|
65
|
-
@raw_info
|
66
67
|
end
|
67
68
|
end
|
68
69
|
end
|
69
70
|
end
|
70
|
-
|
71
|
-
|
data/omniauth-todoist.gemspec
CHANGED
@@ -1,15 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'omniauth/todoist/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = "omniauth-todoist"
|
8
|
+
s.version = Omniauth::Todoist::VERSION
|
9
|
+
s.authors = ["Bethany Soule", "Joel Van Horn"]
|
10
|
+
s.email = ["bsoule@beeminder.com", "joel@joelvanhorn.com"]
|
11
|
+
|
12
|
+
s.summary = %q{OmniAuth strategy for Todoist}
|
13
|
+
s.description = %q{OmniAuth strategy for Todoist}
|
14
|
+
s.homepage = "https://github.com/beeminder/omniauth-todoist"
|
15
|
+
s.license = "MIT"
|
16
|
+
|
17
|
+
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_runtime_dependency "omniauth", ">= 1.1.1"
|
23
|
+
s.add_runtime_dependency "omniauth-oauth2", ">= 1.3.1"
|
24
|
+
|
25
|
+
s.add_development_dependency "bundler"
|
26
|
+
s.add_development_dependency "rspec"
|
27
|
+
s.add_development_dependency "rake"
|
15
28
|
end
|
metadata
CHANGED
@@ -1,27 +1,101 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-todoist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Soule
|
8
|
+
- Joel Van Horn
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
12
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: omniauth
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 1.1.1
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 1.1.1
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: omniauth-oauth2
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 1.3.1
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 1.3.1
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: bundler
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rspec
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rake
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
13
84
|
description: OmniAuth strategy for Todoist
|
14
|
-
email:
|
85
|
+
email:
|
86
|
+
- bsoule@beeminder.com
|
87
|
+
- joel@joelvanhorn.com
|
15
88
|
executables: []
|
16
89
|
extensions: []
|
17
90
|
extra_rdoc_files: []
|
18
91
|
files:
|
92
|
+
- ".gitignore"
|
19
93
|
- Gemfile
|
20
94
|
- LICENSE.txt
|
21
95
|
- README.md
|
22
96
|
- lib/omniauth-todoist.rb
|
23
97
|
- lib/omniauth/strategies/todoist.rb
|
24
|
-
- omniauth
|
98
|
+
- lib/omniauth/todoist/version.rb
|
25
99
|
- omniauth-todoist.gemspec
|
26
100
|
homepage: https://github.com/beeminder/omniauth-todoist
|
27
101
|
licenses:
|
@@ -43,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
43
117
|
version: '0'
|
44
118
|
requirements: []
|
45
119
|
rubyforge_project:
|
46
|
-
rubygems_version: 2.
|
120
|
+
rubygems_version: 2.7.6.3
|
47
121
|
signing_key:
|
48
122
|
specification_version: 4
|
49
123
|
summary: OmniAuth strategy for Todoist
|
data/omniauth-todoist-0.1.gem
DELETED
Binary file
|