omniauth-moneybutton 0.1.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: cd69a58f516e87b82c63872d819c7bfa6393eea53c4cd80384727d364c09f4db
4
+ data.tar.gz: c225381d01b25edebb80e52527c8aefbdd871af3d6b77e585412e3a5a2378f89
5
+ SHA512:
6
+ metadata.gz: 496177fe75c620bd1ec87a2baed06ac56be1a6708ce2e1670bb258e69c3b558b9a9b3dc56262ca1db479d0a754d5cd359461fdbff6c72264880ebb6f41da1ad4
7
+ data.tar.gz: 4964e3a64cc08aa4d1761415de4223857197de761f1e06393580a7ca76572f90b8d46a1742d5098814422fcbfdcfe902772ff8890456e64fd7dac4dda10610d0
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/Gemfile ADDED
@@ -0,0 +1,6 @@
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-moneybutton.gemspec
6
+ gemspec
@@ -0,0 +1,56 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-moneybutton (0.1.0)
5
+ omniauth-oauth2 (~> 1.6)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ diff-lcs (1.3)
11
+ faraday (0.15.4)
12
+ multipart-post (>= 1.2, < 3)
13
+ hashie (3.6.0)
14
+ jwt (2.2.1)
15
+ multi_json (1.13.1)
16
+ multi_xml (0.6.0)
17
+ multipart-post (2.1.1)
18
+ oauth2 (1.4.1)
19
+ faraday (>= 0.8, < 0.16.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.0)
25
+ hashie (>= 3.4.6, < 3.7.0)
26
+ rack (>= 1.6.2, < 3)
27
+ omniauth-oauth2 (1.6.0)
28
+ oauth2 (~> 1.1)
29
+ omniauth (~> 1.9)
30
+ rack (2.0.7)
31
+ rake (10.5.0)
32
+ rspec (3.8.0)
33
+ rspec-core (~> 3.8.0)
34
+ rspec-expectations (~> 3.8.0)
35
+ rspec-mocks (~> 3.8.0)
36
+ rspec-core (3.8.2)
37
+ rspec-support (~> 3.8.0)
38
+ rspec-expectations (3.8.4)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.8.0)
41
+ rspec-mocks (3.8.1)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.8.0)
44
+ rspec-support (3.8.2)
45
+
46
+ PLATFORMS
47
+ ruby
48
+
49
+ DEPENDENCIES
50
+ bundler (~> 1.17)
51
+ omniauth-moneybutton!
52
+ rake (~> 10.0)
53
+ rspec (~> 3.0)
54
+
55
+ BUNDLED WITH
56
+ 1.17.2
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Ryan Wold
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.
@@ -0,0 +1,57 @@
1
+ # Omniauth::Moneybutton
2
+
3
+ Welcome to the omniauth-moneybutton gem.
4
+
5
+ Get started by signing up at https://moneybutton.com.
6
+ Then, on https://www.moneybutton.com/settings, click `Create new app`.
7
+
8
+ Note the following variables in your Money Button app.
9
+
10
+ * Client Identifier
11
+ * Client Secret
12
+ * Webhook URL
13
+ * Webhook Secret
14
+ * OAuth Identifier
15
+ * OAuth Redirect URL
16
+
17
+ ## Installation
18
+
19
+ Add the .gem in your application's Gemfile:
20
+
21
+ ```ruby
22
+ gem 'omniauth-moneybutton'
23
+ ```
24
+
25
+ And then execute:
26
+
27
+ $ bundle
28
+
29
+ Or install it yourself as:
30
+
31
+ $ gem install omniauth-moneybutton
32
+
33
+ ## Usage
34
+
35
+ In a Rails app:
36
+
37
+ ```ruby
38
+ Rails.application.config.middleware.use OmniAuth::Builder do
39
+ provider :moneybutton, {
40
+ client_id: "OAUTH-ID-FROM-MONEYBUTTON",
41
+ redirect_uri: "https://YOUR-APP-URL/OAUTH/CALLBACK-PATH",
42
+ scope: "SCOPE1 SCOPE2"
43
+ }
44
+ end
45
+ ```
46
+
47
+ ## Development
48
+
49
+ 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).
50
+
51
+ ## Contributing
52
+
53
+ Bug reports and pull requests are welcome on GitHub at https://github.com/afomi/omniauth-moneybutton.
54
+
55
+ ## License
56
+
57
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,2 @@
1
+ require "omniauth/moneybutton/version"
2
+ require "omniauth/strategies/moneybutton"
@@ -0,0 +1,5 @@
1
+ module Omniauth
2
+ module Moneybutton
3
+ VERSION = "0.1.1"
4
+ end
5
+ end
@@ -0,0 +1,38 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Moneybutton < OmniAuth::Strategies::OAuth2
6
+
7
+ option :client_options, {
8
+ site: 'https://www.moneybutton.com',
9
+ authorize_url: 'https://www.moneybutton.com/oauth/v1/authorize?response_type=code',
10
+ token_url: 'https://www.moneybutton.com/oauth/v1/token'
11
+ }
12
+
13
+ info do
14
+ {
15
+ id: raw_info["data"]["attributes"]["id"],
16
+ name: raw_info["data"]["attributes"]["name"],
17
+ provider: name
18
+ }
19
+ end
20
+
21
+ def raw_info
22
+ @raw_info ||= MultiJson.load(access_token.get(identity_path).body)
23
+ end
24
+
25
+ def identity_path
26
+ '/api/v1/auth/user_identity'
27
+ end
28
+
29
+
30
+ private
31
+
32
+ def callback_url
33
+ full_host + script_name + callback_path
34
+ end
35
+
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,29 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "omniauth/moneybutton/version"
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "omniauth-moneybutton"
8
+ gem.version = Omniauth::Moneybutton::VERSION
9
+ gem.authors = ["Ryan Wold"]
10
+ gem.email = ["wold@afomi.com"]
11
+
12
+ gem.summary = %q{OmniAuth strategy for Money Button}
13
+ gem.description = %q{OmniAuth strategy for Money Button}
14
+ gem.homepage = "https://github.com/afomi/omniauth-moneybutton"
15
+ gem.license = "MIT"
16
+
17
+ # Specify which files should be added to the gem when it is released.
18
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
+ gem.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
+ end
22
+ gem.executables = gem.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
+ gem.require_paths = ["lib"]
24
+
25
+ gem.add_dependency "omniauth-oauth2", "~> 1.6"
26
+ gem.add_development_dependency "bundler", "~> 1.17"
27
+ gem.add_development_dependency "rake", "~> 10.0"
28
+ gem.add_development_dependency "rspec", "~> 3.0"
29
+ end
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-moneybutton
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Ryan Wold
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-09-11 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.6'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.17'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.17'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description: OmniAuth strategy for Money Button
70
+ email:
71
+ - wold@afomi.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - lib/omniauth/moneybutton.rb
84
+ - lib/omniauth/moneybutton/version.rb
85
+ - lib/omniauth/strategies/moneybutton.rb
86
+ - omniauth-moneybutton.gemspec
87
+ homepage: https://github.com/afomi/omniauth-moneybutton
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubygems_version: 3.0.3
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: OmniAuth strategy for Money Button
110
+ test_files: []