omniauth-chatwork 0.1.0.beta1 → 0.1.3

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
- SHA1:
3
- metadata.gz: b283578d6148059a0bf0d23632db6ec3adfbb1d1
4
- data.tar.gz: 655378c2a5ba57312af63d63db237d23057b774c
2
+ SHA256:
3
+ metadata.gz: a5f990b2a6945c6364fb40f8bf3ccda87d45ef7f159dafb2fbf6fd54de83bef0
4
+ data.tar.gz: 33be9fb9400ec0c71ca86b768ce493b80818e81b1b81591d3c0eda2d6f61580e
5
5
  SHA512:
6
- metadata.gz: 4c1570a1f2339e71fcf37be3a5395e6dbce826deb757d3390ccaec88a09a69d73ae36d36c5fe65446bf944ef982011d0c13f677b7913defae35712a269152877
7
- data.tar.gz: b1bcab061bd52c4c8887cffa1820b5eebfd4ad93b5c4008c664f9ba5c59eae269a0cd73758a7c03cf2e9071f47443d51495af3f2f2a448ad3b1ac7bf69d6577d
6
+ metadata.gz: 1dbe89fd8e0421c61bd07fe1af19833e923d4cddf07fea4abf727a9af3589e37f7ebac648d4518fad556813bc0693aaaf9d41b1110e748f33e3b963ccebff579
7
+ data.tar.gz: 525f4983e370ca24a036d8c3056faaa1ac30b432827c993d6e26244869d35a044a5361c2d98230dc04ceb6586369df1f1fec2255d082530ef66204a3f15742f8
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ repo_token: M0E4JNU6ZTd6SI2oGqpLTvH8hq5sQWfVm
data/.env.example CHANGED
@@ -1,6 +1,2 @@
1
1
  CLIENT_ID=
2
2
  CLIENT_SECRET=
3
-
4
- # verbose logging for faraday
5
- # ref. https://github.com/intridea/oauth2/blob/v1.4.0/lib/oauth2/client.rb#L95
6
- # OAUTH_DEBUG=true
@@ -0,0 +1,114 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+
19
+ container: ${{ matrix.ruby }}
20
+
21
+ env:
22
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
23
+
24
+ strategy:
25
+ fail-fast: false
26
+
27
+ matrix:
28
+ ruby:
29
+ - ruby:2.2
30
+ - ruby:2.3
31
+ - ruby:2.4
32
+ - ruby:2.5
33
+ - ruby:2.6
34
+ - ruby:2.7
35
+ - ruby:3.0
36
+ - ruby:3.1
37
+ - rubylang/ruby:master-nightly-bionic
38
+ gemfile:
39
+ - omniauth_1
40
+ - omniauth_2
41
+ include:
42
+ - ruby: rubylang/ruby:master-nightly-bionic
43
+ allow_failures: "true"
44
+
45
+ steps:
46
+ - uses: actions/checkout@v2
47
+
48
+ - name: Cache vendor/bundle
49
+ uses: actions/cache@v1
50
+ id: cache_gem
51
+ with:
52
+ path: vendor/bundle
53
+ key: v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ github.sha }}
54
+ restore-keys: |
55
+ v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.gemfile }}-
56
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
57
+
58
+ - name: bundle update
59
+ run: |
60
+ set -xe
61
+ bundle config path vendor/bundle
62
+ bundle update --jobs $(nproc) --retry 3
63
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
64
+
65
+ - name: Setup Code Climate Test Reporter
66
+ uses: aktions/codeclimate-test-reporter@v1
67
+ with:
68
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
69
+ command: before-build
70
+ if: matrix.ruby >= 'ruby:2.4'
71
+ continue-on-error: true
72
+
73
+ - name: Run test
74
+ run: |
75
+ set -xe
76
+ bundle exec rspec
77
+ continue-on-error: ${{ matrix.allow_failures == 'true' }}
78
+
79
+ - name: Teardown Code Climate Test Reporter
80
+ uses: aktions/codeclimate-test-reporter@v1
81
+ with:
82
+ codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
83
+ command: after-build
84
+ if: matrix.ruby >= 'ruby:2.4' && always()
85
+ continue-on-error: true
86
+
87
+ - name: Slack Notification (not success)
88
+ uses: lazy-actions/slatify@master
89
+ if: "! success()"
90
+ continue-on-error: true
91
+ with:
92
+ job_name: ${{ format('*build* ({0})', matrix.ruby) }}
93
+ type: ${{ job.status }}
94
+ icon_emoji: ":octocat:"
95
+ url: ${{ secrets.SLACK_WEBHOOK }}
96
+ token: ${{ secrets.GITHUB_TOKEN }}
97
+
98
+ notify:
99
+ needs:
100
+ - test
101
+
102
+ runs-on: ubuntu-latest
103
+
104
+ steps:
105
+ - name: Slack Notification (success)
106
+ uses: lazy-actions/slatify@master
107
+ if: always()
108
+ continue-on-error: true
109
+ with:
110
+ job_name: '*build*'
111
+ type: ${{ job.status }}
112
+ icon_emoji: ":octocat:"
113
+ url: ${{ secrets.SLACK_WEBHOOK }}
114
+ token: ${{ secrets.GITHUB_TOKEN }}
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
- --format documentation
2
1
  --color
3
2
  --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ ## Unreleased
2
+ [full changelog](https://github.com/sue445/omniauth-chatwork/compare/v0.1.3...master)
3
+
4
+ ## v0.1.3
5
+ [full changelog](https://github.com/sue445/omniauth-chatwork/compare/v0.1.2...v0.1.3)
6
+
7
+ * Avoid oauth2 v1.4.8
8
+ * https://github.com/sue445/omniauth-chatwork/pull/35
9
+
10
+ ## v0.1.2
11
+ [full changelog](https://github.com/sue445/omniauth-chatwork/compare/v0.1.1...v0.1.2)
12
+
13
+ * Enable MFA requirement for gem releasing
14
+ * https://github.com/sue445/omniauth-chatwork/pull/29
15
+
16
+ ## v0.1.1
17
+ [full changelog](https://github.com/sue445/omniauth-chatwork/compare/v0.1.0...v0.1.1)
18
+
19
+ * Add `users.profile.me:read` scope to default scope
20
+ * https://github.com/sue445/omniauth-chatwork/pull/5
21
+
22
+ ## v0.1.0
23
+ * first release
data/Gemfile CHANGED
@@ -4,3 +4,5 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in omniauth-chatwork.gemspec
6
6
  gemspec
7
+
8
+ gem "webrick"
data/README.md CHANGED
@@ -1,8 +1,11 @@
1
1
  # OmniAuth::Chatwork
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/omniauth/chatwork`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ OmniAuth strategy for ChatWork
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ [![Gem Version](https://badge.fury.io/rb/omniauth-chatwork.svg)](https://badge.fury.io/rb/omniauth-chatwork)
6
+ [![Build Status](https://github.com/sue445/omniauth-chatwork/workflows/test/badge.svg?branch=master)](https://github.com/sue445/omniauth-chatwork/actions?query=workflow%3Atest)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/c28dcf54cef09425c10d/maintainability)](https://codeclimate.com/github/sue445/omniauth-chatwork/maintainability)
8
+ [![Coverage Status](https://coveralls.io/repos/github/sue445/omniauth-chatwork/badge.svg)](https://coveralls.io/github/sue445/omniauth-chatwork)
6
9
 
7
10
  ## Installation
8
11
 
@@ -29,10 +32,14 @@ use OmniAuth::Builder do
29
32
  end
30
33
  ```
31
34
 
35
+ And register `https://YOURSERVER/auth/chatwork/callback` to *Redirect URI*
36
+
37
+ ![redirect_uri](img/redirect_uri.png)
38
+
32
39
  ## Configuring
33
40
  * `scope` : `String` or `Array`
34
41
  * A list of permissions you want to request from the user
35
- * default is `["rooms.all:read_write"]`
42
+ * default is `["rooms.all:read_write", "users.profile.me:read"]`
36
43
  * see Appendix scope list of http://download.chatwork.com/ChatWork_API_Documentation.pdf (en) or http://developer.chatwork.com/ja/oauth.html#secAppendix (ja)
37
44
 
38
45
  ## Auth Hash
@@ -90,6 +97,10 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
90
97
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
91
98
 
92
99
  ### Run dummy app
100
+ At first, register `https://127.0.0.1:4567/auth/chatwork/callback` to *Redirect URI*
101
+
102
+ ![redirect_uri](img/redirect_uri.png)
103
+
93
104
  ```bash
94
105
  cp .env.example .env
95
106
  vi .env
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in omniauth-chatwork.gemspec
6
+ gemspec path: "../"
7
+
8
+ gem "omniauth", "~> 1.9"
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in omniauth-chatwork.gemspec
6
+ gemspec path: "../"
7
+
8
+ gem "omniauth", "~> 2.0"
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Chatwork
3
- VERSION = "0.1.0.beta1"
3
+ VERSION = "0.1.3"
4
4
  end
5
5
  end
@@ -4,7 +4,7 @@ require "faraday"
4
4
  module OmniAuth
5
5
  module Strategies
6
6
  class Chatwork < ::OmniAuth::Strategies::OAuth2
7
- DEFAULT_SCOPE = "rooms.all:read_write"
7
+ DEFAULT_SCOPE = "rooms.all:read_write users.profile.me:read"
8
8
 
9
9
  option :client_options, {
10
10
  site: "https://api.chatwork.com/v2",
@@ -14,20 +14,35 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/sue445/omniauth-chatwork"
15
15
  spec.license = "MIT"
16
16
 
17
+ spec.metadata["homepage_uri"] = spec.homepage
18
+ spec.metadata["source_code_uri"] = spec.homepage
19
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
20
+ spec.metadata["rubygems_mfa_required"] = "true"
21
+
17
22
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
23
  f.match(%r{^(test|spec|features)/})
19
24
  end
25
+
26
+ %w[img/].each do |exclude_dir|
27
+ spec.files.reject! { |filename| filename.start_with?(exclude_dir) }
28
+ end
29
+
20
30
  spec.bindir = "exe"
21
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
32
  spec.require_paths = ["lib"]
23
33
 
34
+ spec.add_dependency "oauth2", ">= 1.3.0", "!= 1.4.8"
24
35
  spec.add_dependency "omniauth-oauth2"
25
36
 
26
- spec.add_development_dependency "bundler", "~> 1.16"
37
+ spec.add_development_dependency "bundler", ">= 1.16"
38
+ spec.add_development_dependency "coveralls"
27
39
  spec.add_development_dependency "dotenv"
28
40
  spec.add_development_dependency "faraday_curl"
29
41
  spec.add_development_dependency "pry-byebug"
30
- spec.add_development_dependency "rake", "~> 10.0"
42
+ spec.add_development_dependency "rack-test"
43
+ spec.add_development_dependency "rake", ">= 10.0"
31
44
  spec.add_development_dependency "rspec", "~> 3.0"
45
+ spec.add_development_dependency "rspec-its"
32
46
  spec.add_development_dependency "sinatra"
47
+ spec.add_development_dependency "webmock"
33
48
  end
metadata CHANGED
@@ -1,15 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-chatwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-12 00:00:00.000000000 Z
11
+ date: 2022-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: oauth2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 1.3.0
20
+ - - "!="
21
+ - !ruby/object:Gem::Version
22
+ version: 1.4.8
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 1.3.0
30
+ - - "!="
31
+ - !ruby/object:Gem::Version
32
+ version: 1.4.8
13
33
  - !ruby/object:Gem::Dependency
14
34
  name: omniauth-oauth2
15
35
  requirement: !ruby/object:Gem::Requirement
@@ -28,16 +48,30 @@ dependencies:
28
48
  name: bundler
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
- - - "~>"
51
+ - - ">="
32
52
  - !ruby/object:Gem::Version
33
53
  version: '1.16'
34
54
  type: :development
35
55
  prerelease: false
36
56
  version_requirements: !ruby/object:Gem::Requirement
37
57
  requirements:
38
- - - "~>"
58
+ - - ">="
39
59
  - !ruby/object:Gem::Version
40
60
  version: '1.16'
61
+ - !ruby/object:Gem::Dependency
62
+ name: coveralls
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
41
75
  - !ruby/object:Gem::Dependency
42
76
  name: dotenv
43
77
  requirement: !ruby/object:Gem::Requirement
@@ -80,18 +114,32 @@ dependencies:
80
114
  - - ">="
81
115
  - !ruby/object:Gem::Version
82
116
  version: '0'
117
+ - !ruby/object:Gem::Dependency
118
+ name: rack-test
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
83
131
  - !ruby/object:Gem::Dependency
84
132
  name: rake
85
133
  requirement: !ruby/object:Gem::Requirement
86
134
  requirements:
87
- - - "~>"
135
+ - - ">="
88
136
  - !ruby/object:Gem::Version
89
137
  version: '10.0'
90
138
  type: :development
91
139
  prerelease: false
92
140
  version_requirements: !ruby/object:Gem::Requirement
93
141
  requirements:
94
- - - "~>"
142
+ - - ">="
95
143
  - !ruby/object:Gem::Version
96
144
  version: '10.0'
97
145
  - !ruby/object:Gem::Dependency
@@ -108,6 +156,20 @@ dependencies:
108
156
  - - "~>"
109
157
  - !ruby/object:Gem::Version
110
158
  version: '3.0'
159
+ - !ruby/object:Gem::Dependency
160
+ name: rspec-its
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - ">="
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
111
173
  - !ruby/object:Gem::Dependency
112
174
  name: sinatra
113
175
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +184,20 @@ dependencies:
122
184
  - - ">="
123
185
  - !ruby/object:Gem::Version
124
186
  version: '0'
187
+ - !ruby/object:Gem::Dependency
188
+ name: webmock
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
125
201
  description: OmniAuth strategy for ChatWork
126
202
  email:
127
203
  - sue445@sue445.net
@@ -129,16 +205,20 @@ executables: []
129
205
  extensions: []
130
206
  extra_rdoc_files: []
131
207
  files:
208
+ - ".coveralls.yml"
132
209
  - ".env.example"
210
+ - ".github/workflows/test.yml"
133
211
  - ".gitignore"
134
212
  - ".rspec"
135
- - ".travis.yml"
213
+ - CHANGELOG.md
136
214
  - Gemfile
137
215
  - LICENSE.txt
138
216
  - README.md
139
217
  - Rakefile
140
218
  - bin/console
141
219
  - bin/setup
220
+ - gemfiles/omniauth_1.gemfile
221
+ - gemfiles/omniauth_2.gemfile
142
222
  - lib/omniauth-chatwork.rb
143
223
  - lib/omniauth/chatwork.rb
144
224
  - lib/omniauth/chatwork/version.rb
@@ -147,8 +227,12 @@ files:
147
227
  homepage: https://github.com/sue445/omniauth-chatwork
148
228
  licenses:
149
229
  - MIT
150
- metadata: {}
151
- post_install_message:
230
+ metadata:
231
+ homepage_uri: https://github.com/sue445/omniauth-chatwork
232
+ source_code_uri: https://github.com/sue445/omniauth-chatwork
233
+ changelog_uri: https://github.com/sue445/omniauth-chatwork/blob/master/CHANGELOG.md
234
+ rubygems_mfa_required: 'true'
235
+ post_install_message:
152
236
  rdoc_options: []
153
237
  require_paths:
154
238
  - lib
@@ -159,13 +243,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
243
  version: '0'
160
244
  required_rubygems_version: !ruby/object:Gem::Requirement
161
245
  requirements:
162
- - - ">"
246
+ - - ">="
163
247
  - !ruby/object:Gem::Version
164
- version: 1.3.1
248
+ version: '0'
165
249
  requirements: []
166
- rubyforge_project:
167
- rubygems_version: 2.6.11
168
- signing_key:
250
+ rubygems_version: 3.3.3
251
+ signing_key:
169
252
  specification_version: 4
170
253
  summary: OmniAuth strategy for ChatWork
171
254
  test_files: []
data/.travis.yml DELETED
@@ -1,5 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.16.0