omniauth-tanita 0.1.0 → 0.2.3
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/.github/workflows/gem-push.yml +36 -0
- data/.github/workflows/test.yml +21 -0
- data/CHANGELOG.md +13 -1
- data/README.md +22 -3
- data/lib/omniauth-tanita/version.rb +1 -1
- data/lib/omniauth/strategies/tanita.rb +5 -5
- data/omniauth-tanita.gemspec +4 -1
- metadata +36 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eef96d05035d109a2a91b80964ace3e02d41e407b0cc54dd019616b1c2905b0
|
4
|
+
data.tar.gz: 74c4056c1cdbeb9e9feb37b4b52fb9e378dd1bbe04b9384a5a535a841365765a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fa761375b19f482f14914f641547e1eb1e9d756d322e73fb0ecb6fb95b3bb3a82b73d22d5423eda921f12cd7534b2b5ac13c8b4915e7bb8e64c245322b6327d
|
7
|
+
data.tar.gz: 2bcba2d681d74554a6138102bb626659377c11c9ca5c0e8142c2dc57fe2be8f46e1f80d0472125bc1964eb343eb2fd8a8526fbac1768a1246aa5497a0f223747
|
@@ -0,0 +1,36 @@
|
|
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
|
+
env:
|
36
|
+
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/CHANGELOG.md
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
+
# 0.2.3
|
2
|
+
|
3
|
+
- refs #1 setup GitHub Actions for rspec and pushing to RubyGems.
|
4
|
+
- measure code coverage
|
5
|
+
|
6
|
+
# 0.2.0
|
7
|
+
|
8
|
+
- set default `provider_ignores_state` to true
|
9
|
+
|
10
|
+
# 0.1.1
|
11
|
+
|
12
|
+
- Update dependent library 'tanita-api-client' to v0.2.3
|
1
13
|
|
2
14
|
# 0.1.0
|
3
15
|
|
4
|
-
|
16
|
+
- Initial release
|
data/README.md
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
# OmniAuth::Tanita
|
2
2
|
|
3
|
+
[](https://github.com/koshilife/omniauth-tanita/actions?query=workflow%3ATest)
|
4
|
+
[](https://codecov.io/gh/koshilife/omniauth-tanita)
|
3
5
|
[](http://badge.fury.io/rb/omniauth-tanita)
|
6
|
+
[](https://github.com/koshilife/omniauth-tanita/blob/master/LICENSE.txt)
|
4
7
|
|
5
8
|
This gem contains the Tanita Health Planet strategy for OmniAuth.
|
6
9
|
|
7
|
-
|
8
10
|
## Before You Begin
|
9
11
|
|
10
12
|
You should have already installed OmniAuth into your app; if not, read the [OmniAuth README](https://github.com/intridea/omniauth) to get started.
|
11
13
|
|
12
14
|
Now sign into the [Health Planet API Settings page](https://www.healthplanet.jp/apis_account.do) and create an application. Take note of your API keys.
|
13
15
|
|
14
|
-
|
15
16
|
## Using This Strategy
|
16
17
|
|
17
18
|
First start by adding this gem to your Gemfile:
|
@@ -33,8 +34,8 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
|
33
34
|
provider :tanita, "API_KEY", "API_SECRET"
|
34
35
|
end
|
35
36
|
```
|
36
|
-
Replace `"API_KEY"` and `"API_SECRET"` with the appropriate values you obtained [earlier](https://www.healthplanet.jp/apis_account.do).
|
37
37
|
|
38
|
+
Replace `"API_KEY"` and `"API_SECRET"` with the appropriate values you obtained [earlier](https://www.healthplanet.jp/apis_account.do).
|
38
39
|
|
39
40
|
## Scopes
|
40
41
|
|
@@ -58,6 +59,24 @@ Rails.application.config.middleware.use OmniAuth::Builder do
|
|
58
59
|
end
|
59
60
|
```
|
60
61
|
|
62
|
+
## Auth Hash Example
|
63
|
+
|
64
|
+
The auth hash `request.env['omniauth.auth']` would look like this:
|
65
|
+
|
66
|
+
```js
|
67
|
+
{
|
68
|
+
"provider": "tanita",
|
69
|
+
"uid": null, // uid will be empty, because there is no apis to get.
|
70
|
+
"credentials": {
|
71
|
+
"token": "ACCESS_TOKEN",
|
72
|
+
"refresh_token": "REFRESH_TOKEN",
|
73
|
+
"expires_at": 1581419031,
|
74
|
+
"expires": true
|
75
|
+
},
|
76
|
+
"extra": {}
|
77
|
+
}
|
78
|
+
```
|
79
|
+
|
61
80
|
## Contributing
|
62
81
|
|
63
82
|
Bug reports and pull requests are welcome on [GitHub](https://github.com/koshilife/omniauth-tanita). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
@@ -11,17 +11,17 @@ module OmniAuth
|
|
11
11
|
option :name, 'tanita'
|
12
12
|
|
13
13
|
option :skip_info, true
|
14
|
+
option :provider_ignores_state, true
|
15
|
+
option :scope, TANITA::Scope::INNERSCAN
|
14
16
|
|
15
17
|
option :client_options, :site => TANITA::BASE_URL,
|
16
18
|
:authorize_url => TANITA::AUTH_URL_PATH,
|
17
19
|
:token_url => TANITA::TOKEN_URL_PATH
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
def callback_url
|
22
|
+
full_host + script_name + callback_path
|
23
|
+
end
|
22
24
|
|
23
|
-
option :token_options, %i[client_id client_secret redirect_uri grant_type]
|
24
|
-
option :grant_type, 'authorization_code'
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/omniauth-tanita.gemspec
CHANGED
@@ -17,6 +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-tanita'
|
19
19
|
spec.metadata['changelog_uri'] = "#{spec.metadata['source_code_uri']}/blob/master/CHANGELOG.md"
|
20
|
+
spec.metadata['documentation_uri'] = "https://www.rubydoc.info/gems/omniauth-tanita/#{spec.version}"
|
20
21
|
|
21
22
|
# Specify which files should be added to the gem when it is released.
|
22
23
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -27,10 +28,12 @@ Gem::Specification.new do |spec|
|
|
27
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
29
|
spec.require_paths = ['lib']
|
29
30
|
|
30
|
-
spec.add_runtime_dependency 'tanita-api-client', '~> 0.2.
|
31
|
+
spec.add_runtime_dependency 'tanita-api-client', '~> 0.2.3'
|
31
32
|
spec.add_runtime_dependency 'omniauth-oauth2', '~> 1.6.0'
|
32
33
|
|
33
34
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
35
|
+
spec.add_development_dependency 'codecov', '~> 0.1.17'
|
34
36
|
spec.add_development_dependency 'rake', '~> 12.0'
|
35
37
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
38
|
+
spec.add_development_dependency 'simplecov', '~> 0.18.5'
|
36
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-tanita
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.3
|
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-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tanita-api-client
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.2.
|
19
|
+
version: 0.2.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.2.
|
26
|
+
version: 0.2.3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: omniauth-oauth2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: codecov
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.1.17
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.1.17
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +94,20 @@ dependencies:
|
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: simplecov
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.18.5
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.18.5
|
83
111
|
description: ''
|
84
112
|
email:
|
85
113
|
- koshikawa2009@gmail.com
|
@@ -87,6 +115,8 @@ executables: []
|
|
87
115
|
extensions: []
|
88
116
|
extra_rdoc_files: []
|
89
117
|
files:
|
118
|
+
- ".github/workflows/gem-push.yml"
|
119
|
+
- ".github/workflows/test.yml"
|
90
120
|
- ".gitignore"
|
91
121
|
- ".rspec"
|
92
122
|
- ".rubocop.yml"
|
@@ -110,6 +140,7 @@ metadata:
|
|
110
140
|
homepage_uri: https://github.com/koshilife/omniauth-tanita
|
111
141
|
source_code_uri: https://github.com/koshilife/omniauth-tanita
|
112
142
|
changelog_uri: https://github.com/koshilife/omniauth-tanita/blob/master/CHANGELOG.md
|
143
|
+
documentation_uri: https://www.rubydoc.info/gems/omniauth-tanita/0.2.3
|
113
144
|
post_install_message:
|
114
145
|
rdoc_options: []
|
115
146
|
require_paths:
|
@@ -125,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
156
|
- !ruby/object:Gem::Version
|
126
157
|
version: '0'
|
127
158
|
requirements: []
|
128
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.0.3
|
129
160
|
signing_key:
|
130
161
|
specification_version: 4
|
131
162
|
summary: OmniAuth strategy for Tanita Health Planet
|