omniauth-joinme 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/workflows/ci.yml +24 -0
- data/.gitignore +10 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +63 -0
- data/Rakefile +10 -0
- data/lib/omniauth/strategies/joinme.rb +62 -0
- data/lib/omniauth-joinme/version.rb +5 -0
- data/lib/omniauth-joinme.rb +2 -0
- data/omniauth-joinme.gemspec +32 -0
- metadata +112 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d932b22704a1ffa362e622637bb589eef2834108e9ee51f18fac2aa41cd6921c
|
4
|
+
data.tar.gz: 777fb7ca1571db9a01603e9c2278cd70c25213e37f38f54030a0f20a64a42a30
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9e282d8845519b04116fb55390044f81c42af79fb0b55de127279887be0d35fabc2f6df34fb4f9c66f8596a2f3d318c406b58fcd1c3e978af2283a4655eef831
|
7
|
+
data.tar.gz: 1bf713b28809db9ad38e1fa60ce3ab29bb5684fd2013d172c4acc8e6e251a3a5f6bbb1e14a3c1f254517a28ccbfd72c9380a2bc16618f2dc0468c11a60c14900
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
fail-fast: false
|
11
|
+
matrix:
|
12
|
+
ruby: [ 2.6, 2.7, 3.0, 3.1 ]
|
13
|
+
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v3
|
16
|
+
|
17
|
+
- name: Setup Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
ruby-version: ${{ matrix.ruby }}
|
21
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
22
|
+
|
23
|
+
- name: Build and test with Minitest
|
24
|
+
run: bin/rake
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 DocSend
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
# OmniAuth join.me Strategy
|
2
|
+
|
3
|
+
A join.me OAuth2 strategy for OmniAuth
|
4
|
+
|
5
|
+
For more details, read the join.me documentation: [https://developer.join.me/docs](https://developer.join.me/docs)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'omniauth-joinme'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install omniauth-joinme
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Register your application with join.me to receive an API key: [https://developer.join.me/member/register](https://developer.join.me/member/register)
|
26
|
+
|
27
|
+
This is an example that you might put into a Rails initializer at `config/initializers/omniauth.rb`:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
31
|
+
provider :joinme, ENV['JOINME_CLIENT_ID'], ENV['JOINME_SECRET']
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
You can now access the OmniAuth join.me OAuth2 URL: `/auth/joinme`.
|
36
|
+
|
37
|
+
|
38
|
+
## Granting Additional Permissions to Your Application
|
39
|
+
|
40
|
+
With the join.me API, you have the ability to specify which permissions you want users to grant your application.
|
41
|
+
For more details, read the join.me documentation: https://developer.join.me/docs
|
42
|
+
|
43
|
+
By default, omniauth-joinme requests the following permissions:
|
44
|
+
|
45
|
+
'user_info'
|
46
|
+
|
47
|
+
You can configure the scope option:
|
48
|
+
|
49
|
+
```ruby
|
50
|
+
provider :joinme, ENV['JOINME_CLIENT_ID'], ENV['JOINME_SECRET'], :scope => 'user_info start_meeting'
|
51
|
+
```
|
52
|
+
|
53
|
+
## Contributing
|
54
|
+
|
55
|
+
1. Fork it
|
56
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
57
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
58
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
59
|
+
5. Create new Pull Request
|
60
|
+
|
61
|
+
## License
|
62
|
+
|
63
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
require "omniauth-oauth2"
|
2
|
+
require "omniauth/strategies/oauth2"
|
3
|
+
|
4
|
+
module OmniAuth
|
5
|
+
module Strategies
|
6
|
+
class Joinme < OmniAuth::Strategies::OAuth2
|
7
|
+
option :name, "joinme"
|
8
|
+
option :scope, "user_info"
|
9
|
+
option :client_options, {
|
10
|
+
site: "https://api.join.me/v1",
|
11
|
+
authorize_url: "https://secure.join.me/api/public/v1/auth/oauth2",
|
12
|
+
token_url: "https://secure.join.me/api/public/v1/auth/token"
|
13
|
+
}
|
14
|
+
|
15
|
+
uid { raw_info["email"] }
|
16
|
+
|
17
|
+
info do
|
18
|
+
{
|
19
|
+
name: raw_info["full_name"],
|
20
|
+
email: raw_info["email"],
|
21
|
+
conference_settings: raw_info["conference_settings"]
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
extra do
|
26
|
+
{"raw_info" => raw_info}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Merge the refresh_token into the credentials hash
|
30
|
+
# even if join.me doesn't return an expiration in its /token response
|
31
|
+
credentials do
|
32
|
+
hash = {"token" => access_token.token}
|
33
|
+
hash["refresh_token"] = access_token.refresh_token if access_token.refresh_token
|
34
|
+
hash
|
35
|
+
end
|
36
|
+
|
37
|
+
def raw_info
|
38
|
+
@raw_info ||= keys_to_underscore(MultiJson.decode(access_token.get("user").body))
|
39
|
+
end
|
40
|
+
|
41
|
+
# Exclude query string in callback_url to prevent redirect_uri mismatch
|
42
|
+
def callback_url
|
43
|
+
options[:callback_url] || (full_host + script_name + callback_path)
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def keys_to_underscore(hash)
|
49
|
+
new_hash = {}
|
50
|
+
hash.each do |key, value|
|
51
|
+
value = keys_to_underscore(value) if value.is_a?(Hash)
|
52
|
+
new_key = key.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
53
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
54
|
+
.tr("-", "_")
|
55
|
+
.downcase
|
56
|
+
new_hash[new_key] = value
|
57
|
+
end
|
58
|
+
new_hash
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "omniauth-joinme/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "omniauth-joinme"
|
7
|
+
spec.version = OmniAuth::Joinme::VERSION
|
8
|
+
spec.authors = ["Matt Agra"]
|
9
|
+
spec.email = ["matt@docsend.com"]
|
10
|
+
|
11
|
+
spec.summary = "An OmniAuth strategy for join.me"
|
12
|
+
spec.description = "An OmniAuth strategy for join.me"
|
13
|
+
spec.homepage = "https://github.com/docsend/omniauth-joinme"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.metadata = {
|
17
|
+
"homepage_uri" => spec.homepage,
|
18
|
+
"source_code_uri" => spec.homepage,
|
19
|
+
"bug_tracker_uri" => "#{spec.homepage}/issues"
|
20
|
+
}
|
21
|
+
|
22
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(bin|test|spec|features)/}) }
|
23
|
+
spec.bindir = "exe"
|
24
|
+
spec.executables = []
|
25
|
+
spec.require_paths = ["lib"]
|
26
|
+
|
27
|
+
spec.add_runtime_dependency "omniauth-oauth2", ">= 1.3.1"
|
28
|
+
|
29
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
30
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
31
|
+
spec.add_development_dependency "mocha", "~> 2.0"
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,112 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-joinme
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matt Agra
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-11-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: omniauth-oauth2
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.3.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.3.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '13.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '13.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mocha
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
69
|
+
description: An OmniAuth strategy for join.me
|
70
|
+
email:
|
71
|
+
- matt@docsend.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".github/workflows/ci.yml"
|
77
|
+
- ".gitignore"
|
78
|
+
- Gemfile
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
81
|
+
- Rakefile
|
82
|
+
- lib/omniauth-joinme.rb
|
83
|
+
- lib/omniauth-joinme/version.rb
|
84
|
+
- lib/omniauth/strategies/joinme.rb
|
85
|
+
- omniauth-joinme.gemspec
|
86
|
+
homepage: https://github.com/docsend/omniauth-joinme
|
87
|
+
licenses:
|
88
|
+
- MIT
|
89
|
+
metadata:
|
90
|
+
homepage_uri: https://github.com/docsend/omniauth-joinme
|
91
|
+
source_code_uri: https://github.com/docsend/omniauth-joinme
|
92
|
+
bug_tracker_uri: https://github.com/docsend/omniauth-joinme/issues
|
93
|
+
post_install_message:
|
94
|
+
rdoc_options: []
|
95
|
+
require_paths:
|
96
|
+
- lib
|
97
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
requirements: []
|
108
|
+
rubygems_version: 3.3.7
|
109
|
+
signing_key:
|
110
|
+
specification_version: 4
|
111
|
+
summary: An OmniAuth strategy for join.me
|
112
|
+
test_files: []
|