omniauth-timetree 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-push.yml +37 -0
- data/.github/workflows/test.yml +21 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +69 -0
- data/CHANGELOG.md +20 -0
- data/README.md +5 -4
- data/lib/omniauth-timetree/version.rb +3 -3
- data/lib/omniauth/strategies/timetree.rb +11 -7
- data/omniauth-timetree.gemspec +8 -2
- metadata +77 -6
- data/.travis.yml +0 -6
- data/Gemfile.lock +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 292fd5cf9dfe3805f15a0e4ab947d7463bb2569a90a49ba7b58ca7947fa67ed3
|
4
|
+
data.tar.gz: b54f9805d0cc54384a4fa4c894ec2da8b7ec1dcf0fbdadee7ecde690b61e2d90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc1721a16bbcfb4f4aa5cda9eef8e34b51a2786d439d4be6d64ab5ae17e6603ba698fe406175f328743d783ce74bad7cf4eb4087633add396c24cd4721f468b0
|
7
|
+
data.tar.gz: c9c2f7090527b63cbf4f9b75505b91584ec3b6b40ede6a62f707a70b064b9bc36712a28e0f7328aa5a6b1b6eadc01a314044befdcc1ecbcee9e2e89fb49215f3
|
@@ -0,0 +1,37 @@
|
|
1
|
+
name: Ruby Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [master]
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
name: Build + Publish
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
|
12
|
+
steps:
|
13
|
+
- uses: actions/checkout@v2
|
14
|
+
- name: Set up Ruby 2.6
|
15
|
+
uses: actions/setup-ruby@v1
|
16
|
+
with:
|
17
|
+
ruby-version: 2.6
|
18
|
+
|
19
|
+
- name: Build and test
|
20
|
+
run: |
|
21
|
+
gem install bundler
|
22
|
+
bundle install --jobs 4 --retry 3
|
23
|
+
bundle exec rspec
|
24
|
+
env:
|
25
|
+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
|
26
|
+
|
27
|
+
- name: Publish to RubyGems
|
28
|
+
run: |
|
29
|
+
mkdir -p $HOME/.gem
|
30
|
+
touch $HOME/.gem/credentials
|
31
|
+
chmod 0600 $HOME/.gem/credentials
|
32
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
33
|
+
gem build *.gemspec
|
34
|
+
gem push *.gem
|
35
|
+
continue-on-error: true
|
36
|
+
env:
|
37
|
+
GEM_HOST_API_KEY: ${{secrets.RUBYGEMS_AUTH_TOKEN}}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
name: Test
|
2
|
+
|
3
|
+
on: pull_request
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
steps:
|
10
|
+
- uses: actions/checkout@v2
|
11
|
+
- name: Set up Ruby
|
12
|
+
uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
ruby-version: 2.6
|
15
|
+
- name: Build and test
|
16
|
+
run: |
|
17
|
+
gem install bundler
|
18
|
+
bundle install --jobs 4 --retry 3
|
19
|
+
bundle exec rspec
|
20
|
+
env:
|
21
|
+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.6
|
3
|
+
|
4
|
+
Layout/AccessModifierIndentation:
|
5
|
+
EnforcedStyle: outdent
|
6
|
+
|
7
|
+
Layout/HashAlignment:
|
8
|
+
Enabled: false
|
9
|
+
|
10
|
+
Layout/DotPosition:
|
11
|
+
EnforcedStyle: trailing
|
12
|
+
|
13
|
+
Layout/SpaceInsideHashLiteralBraces:
|
14
|
+
EnforcedStyle: no_space
|
15
|
+
|
16
|
+
Lint/SuppressedException:
|
17
|
+
Enabled: false
|
18
|
+
|
19
|
+
Metrics/BlockLength:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Metrics/BlockNesting:
|
23
|
+
Max: 2
|
24
|
+
|
25
|
+
Layout/LineLength:
|
26
|
+
AllowURI: true
|
27
|
+
Enabled: false
|
28
|
+
|
29
|
+
Metrics/MethodLength:
|
30
|
+
CountComments: false
|
31
|
+
Max: 15
|
32
|
+
|
33
|
+
Metrics/ParameterLists:
|
34
|
+
Max: 4
|
35
|
+
CountKeywordArgs: true
|
36
|
+
|
37
|
+
Metrics/AbcSize:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Style/CollectionMethods:
|
41
|
+
PreferredMethods:
|
42
|
+
map: 'collect'
|
43
|
+
reduce: 'inject'
|
44
|
+
find: 'detect'
|
45
|
+
find_all: 'select'
|
46
|
+
|
47
|
+
Style/Documentation:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Style/DoubleNegation:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Style/EachWithObject:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Style/Encoding:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Style/ExpandPathArguments:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Style/HashSyntax:
|
63
|
+
EnforcedStyle: hash_rockets
|
64
|
+
|
65
|
+
Style/Lambda:
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
Style/RaiseArgs:
|
69
|
+
EnforcedStyle: compact
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
# 0.2.0
|
2
|
+
|
3
|
+
- do refactor.
|
4
|
+
- rename `OmniAuth::TimeTree` module from `Omniauth::Timetree`.
|
5
|
+
- improve tests with Rack::Test.
|
6
|
+
- update gem-push GitHub Actions settings in order to ignore error for same version.
|
7
|
+
|
8
|
+
# 0.1.3
|
9
|
+
|
10
|
+
- refs #1 setup GitHub Actions for rspec and pushing to RubyGems.
|
11
|
+
- measure code coverage
|
12
|
+
|
13
|
+
# 0.1.2
|
14
|
+
|
15
|
+
- fixed a bug for empty uid
|
16
|
+
|
17
|
+
# 0.1.1
|
18
|
+
|
19
|
+
- fixed a bug for mistakes of TimeTree API URL after exchanging token
|
20
|
+
|
1
21
|
# 0.1.0
|
2
22
|
|
3
23
|
- Initial release
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
#
|
1
|
+
# OmniAuth::TimeTree
|
2
2
|
|
3
|
+
[![Test](https://github.com/koshilife/omniauth-timetree/workflows/Test/badge.svg)](https://github.com/koshilife/omniauth-timetree/actions?query=workflow%3ATest)
|
4
|
+
[![codecov](https://codecov.io/gh/koshilife/omniauth-timetree/branch/master/graph/badge.svg)](https://codecov.io/gh/koshilife/omniauth-timetree)
|
3
5
|
[![Gem Version](https://badge.fury.io/rb/omniauth-timetree.svg)](http://badge.fury.io/rb/omniauth-timetree)
|
6
|
+
[![license](https://img.shields.io/github/license/koshilife/omniauth-timetree)](https://github.com/koshilife/omniauth-timetree/blob/master/LICENSE.txt)
|
4
7
|
|
5
8
|
This gem contains the [TimeTree](https://timetreeapp.com/) strategy for OmniAuth.
|
6
9
|
|
@@ -44,9 +47,7 @@ The auth hash `request.env['omniauth.auth']` would look like this:
|
|
44
47
|
"uid": "12345",
|
45
48
|
"credentials": {
|
46
49
|
"token": "ACCESS_TOKEN",
|
47
|
-
"
|
48
|
-
"expires_at": 1581419031,
|
49
|
-
"expires": true
|
50
|
+
"expires": false
|
50
51
|
},
|
51
52
|
"extra": {
|
52
53
|
"id": "12345",
|
@@ -4,20 +4,24 @@ require 'omniauth-oauth2'
|
|
4
4
|
|
5
5
|
module OmniAuth
|
6
6
|
module Strategies
|
7
|
-
class
|
7
|
+
class TimeTree < OmniAuth::Strategies::OAuth2
|
8
8
|
option :name, 'timetree'
|
9
|
-
option :client_options, site
|
10
|
-
authorize_url: '/oauth/authorize',
|
11
|
-
token_url: '/oauth/token'
|
9
|
+
option :client_options, :site => 'https://timetreeapp.com'
|
12
10
|
|
13
|
-
uid { raw_info[
|
11
|
+
uid { raw_info['id'] }
|
14
12
|
|
15
13
|
extra do
|
16
|
-
{
|
14
|
+
{:raw_info => raw_info}
|
17
15
|
end
|
18
16
|
|
17
|
+
private
|
18
|
+
|
19
19
|
def raw_info
|
20
|
-
@raw_info
|
20
|
+
return @raw_info if defined?(@raw_info)
|
21
|
+
|
22
|
+
endpoint = 'https://timetreeapis.com/user'
|
23
|
+
options = {:headers => {'Accept' => 'application/vnd.timetree.v1+json'}}
|
24
|
+
@raw_info = access_token.get(endpoint, options).parsed
|
21
25
|
end
|
22
26
|
|
23
27
|
def callback_url
|
data/omniauth-timetree.gemspec
CHANGED
@@ -4,7 +4,7 @@ require_relative 'lib/omniauth-timetree/version'
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'omniauth-timetree'
|
7
|
-
spec.version =
|
7
|
+
spec.version = OmniAuth::TimeTree::VERSION
|
8
8
|
spec.authors = ['Kenji Koshikawa']
|
9
9
|
spec.email = ['koshikawa2009@gmail.com']
|
10
10
|
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.metadata['homepage_uri'] = spec.homepage
|
18
18
|
spec.metadata['source_code_uri'] = 'https://github.com/koshilife/omniauth-timetree'
|
19
19
|
spec.metadata['changelog_uri'] = "#{spec.metadata['source_code_uri']}/blob/master/CHANGELOG.md"
|
20
|
-
spec.metadata['documentation_uri'] =
|
20
|
+
spec.metadata['documentation_uri'] = "https://www.rubydoc.info/gems/omniauth-timetree/#{spec.version}"
|
21
21
|
|
22
22
|
# Specify which files should be added to the gem when it is released.
|
23
23
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -29,7 +29,13 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.require_paths = ['lib']
|
30
30
|
|
31
31
|
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.6.0'
|
32
|
+
|
32
33
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
34
|
+
spec.add_development_dependency 'codecov', '~> 0.1.17'
|
35
|
+
spec.add_development_dependency 'omniauth', '~> 1.9.1'
|
36
|
+
spec.add_development_dependency 'rack-test', '~> 1.1.0'
|
33
37
|
spec.add_development_dependency 'rake', '~> 12.0'
|
34
38
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
39
|
+
spec.add_development_dependency 'simplecov', '~> 0.18.5'
|
40
|
+
spec.add_development_dependency 'webmock', '~> 3.7.6'
|
35
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-timetree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenji Koshikawa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-oauth2
|
@@ -38,6 +38,48 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '2.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: codecov
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.1.17
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.1.17
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: omniauth
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.9.1
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.9.1
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack-test
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.1.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.1.0
|
41
83
|
- !ruby/object:Gem::Dependency
|
42
84
|
name: rake
|
43
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +108,34 @@ dependencies:
|
|
66
108
|
- - "~>"
|
67
109
|
- !ruby/object:Gem::Version
|
68
110
|
version: '3.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: simplecov
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.18.5
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 0.18.5
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: webmock
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 3.7.6
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - "~>"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 3.7.6
|
69
139
|
description: ''
|
70
140
|
email:
|
71
141
|
- koshikawa2009@gmail.com
|
@@ -73,13 +143,14 @@ executables: []
|
|
73
143
|
extensions: []
|
74
144
|
extra_rdoc_files: []
|
75
145
|
files:
|
146
|
+
- ".github/workflows/gem-push.yml"
|
147
|
+
- ".github/workflows/test.yml"
|
76
148
|
- ".gitignore"
|
77
149
|
- ".rspec"
|
78
|
-
- ".
|
150
|
+
- ".rubocop.yml"
|
79
151
|
- CHANGELOG.md
|
80
152
|
- CODE_OF_CONDUCT.md
|
81
153
|
- Gemfile
|
82
|
-
- Gemfile.lock
|
83
154
|
- LICENSE.txt
|
84
155
|
- README.md
|
85
156
|
- Rakefile
|
@@ -96,7 +167,7 @@ metadata:
|
|
96
167
|
homepage_uri: https://github.com/koshilife/omniauth-timetree
|
97
168
|
source_code_uri: https://github.com/koshilife/omniauth-timetree
|
98
169
|
changelog_uri: https://github.com/koshilife/omniauth-timetree/blob/master/CHANGELOG.md
|
99
|
-
documentation_uri: https://www.rubydoc.info/gems/omniauth-timetree/
|
170
|
+
documentation_uri: https://www.rubydoc.info/gems/omniauth-timetree/0.2.0
|
100
171
|
post_install_message:
|
101
172
|
rdoc_options: []
|
102
173
|
require_paths:
|
@@ -112,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
183
|
- !ruby/object:Gem::Version
|
113
184
|
version: '0'
|
114
185
|
requirements: []
|
115
|
-
rubygems_version: 3.
|
186
|
+
rubygems_version: 3.0.3
|
116
187
|
signing_key:
|
117
188
|
specification_version: 4
|
118
189
|
summary: OmniAuth strategy for TimeTree
|
data/.travis.yml
DELETED
data/Gemfile.lock
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
omniauth-timetree (0.1.0)
|
5
|
-
omniauth-oauth2 (~> 1.6.0)
|
6
|
-
|
7
|
-
GEM
|
8
|
-
remote: https://rubygems.org/
|
9
|
-
specs:
|
10
|
-
diff-lcs (1.3)
|
11
|
-
faraday (1.0.1)
|
12
|
-
multipart-post (>= 1.2, < 3)
|
13
|
-
hashie (4.1.0)
|
14
|
-
jwt (2.2.1)
|
15
|
-
multi_json (1.14.1)
|
16
|
-
multi_xml (0.6.0)
|
17
|
-
multipart-post (2.1.1)
|
18
|
-
oauth2 (1.4.4)
|
19
|
-
faraday (>= 0.8, < 2.0)
|
20
|
-
jwt (>= 1.0, < 3.0)
|
21
|
-
multi_json (~> 1.3)
|
22
|
-
multi_xml (~> 0.5)
|
23
|
-
rack (>= 1.2, < 3)
|
24
|
-
omniauth (1.9.1)
|
25
|
-
hashie (>= 3.4.6)
|
26
|
-
rack (>= 1.6.2, < 3)
|
27
|
-
omniauth-oauth2 (1.6.0)
|
28
|
-
oauth2 (~> 1.1)
|
29
|
-
omniauth (~> 1.9)
|
30
|
-
rack (2.2.2)
|
31
|
-
rake (12.3.3)
|
32
|
-
rspec (3.9.0)
|
33
|
-
rspec-core (~> 3.9.0)
|
34
|
-
rspec-expectations (~> 3.9.0)
|
35
|
-
rspec-mocks (~> 3.9.0)
|
36
|
-
rspec-core (3.9.1)
|
37
|
-
rspec-support (~> 3.9.1)
|
38
|
-
rspec-expectations (3.9.0)
|
39
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
-
rspec-support (~> 3.9.0)
|
41
|
-
rspec-mocks (3.9.1)
|
42
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
-
rspec-support (~> 3.9.0)
|
44
|
-
rspec-support (3.9.2)
|
45
|
-
|
46
|
-
PLATFORMS
|
47
|
-
ruby
|
48
|
-
|
49
|
-
DEPENDENCIES
|
50
|
-
bundler (~> 2.0)
|
51
|
-
omniauth-timetree!
|
52
|
-
rake (~> 12.0)
|
53
|
-
rspec (~> 3.0)
|
54
|
-
|
55
|
-
BUNDLED WITH
|
56
|
-
2.1.4
|