omniauth-getdrip 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +18 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +42 -0
- data/Rakefile +1 -0
- data/lib/omniauth-getdrip.rb +2 -0
- data/lib/omniauth-getdrip/version.rb +5 -0
- data/lib/omniauth/strategies/getdrip.rb +44 -0
- data/omniauth-getdrip.gemspec +23 -0
- metadata +96 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1729222fbe5d73519a02a9a2a765db854fe81fb6
|
4
|
+
data.tar.gz: 9b9fe126791f3ba6f6424ee261b12e7ac19df6f1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2d96194589381907c2549e78f4768a7174259c70de64132de73aaedbc894c947ba4b1f88f4b502763aa28aead075b36d9c288a52183fd9aca746af1639c95f35
|
7
|
+
data.tar.gz: 1097e876f170979c613d06107ffb037059aa7970b5b8ad6a1fa546ece54dc47d82579fa924f7a48522da4f32484a940f12b7c76844a3b20732101b8daeda0e61
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 j-mcnally
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Omniauth::Getdrip
|
2
|
+
|
3
|
+
This Gem contains the Getdrip strategy for OmniAuth.
|
4
|
+
|
5
|
+
## Before You Begin
|
6
|
+
|
7
|
+
You should have already installed OmniAuth into your app; if not, read the [OmniAuth README](https://github.com/intridea/omniauth) to get started.
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
## Using This Strategy
|
12
|
+
|
13
|
+
First start by adding this gem to your Gemfile:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
gem 'omniauth-getdrip'
|
17
|
+
```
|
18
|
+
|
19
|
+
If you need to use the latest HEAD version, you can do so with:
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
gem 'omniauth-getdrip', github: 'kmrshntr/omniauth-slack'
|
23
|
+
```
|
24
|
+
|
25
|
+
Next, tell OmniAuth about this provider. For a Rails app, your `config/initializers/omniauth.rb` file should look like this:
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
29
|
+
provider :getdrip, "API_KEY", "API_SECRET"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
## Contributing
|
36
|
+
|
37
|
+
1. Fork it
|
38
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
39
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
40
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
41
|
+
5. Create new Pull Request
|
42
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'omniauth/strategies/oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Getdrip < OmniAuth::Strategies::OAuth2
|
6
|
+
|
7
|
+
option :name, "getdrip"
|
8
|
+
|
9
|
+
option :access_token_options, {
|
10
|
+
:header_format => 'Bearer %s',
|
11
|
+
:param_name => 'token'
|
12
|
+
}
|
13
|
+
|
14
|
+
option :client_options, {
|
15
|
+
site: "https://api.getdrip.com",
|
16
|
+
authorize_url: "https://www.getdrip.com/oauth/authorize",
|
17
|
+
token_url: "https://www.getdrip.com/oauth/token"
|
18
|
+
}
|
19
|
+
|
20
|
+
uid { access_token.client.id }
|
21
|
+
|
22
|
+
info do
|
23
|
+
{
|
24
|
+
email: user_info["users"][0]["email"]
|
25
|
+
}
|
26
|
+
end
|
27
|
+
|
28
|
+
extra do
|
29
|
+
{
|
30
|
+
accounts: raw_info["accounts"]
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
def user_info
|
35
|
+
@user_info ||= JSON.parse(access_token.get("/v2/user").body)
|
36
|
+
end
|
37
|
+
|
38
|
+
def raw_info
|
39
|
+
@raw_info ||= JSON.parse(access_token.get("/v2/accounts").body)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require File.expand_path('../lib/omniauth-getdrip/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |spec|
|
5
|
+
spec.name = "omniauth-getdrip"
|
6
|
+
spec.version = Omniauth::Getdrip::VERSION
|
7
|
+
spec.authors = ["j-mcnally"]
|
8
|
+
spec.email = ["justin@waitlisted.co"]
|
9
|
+
spec.description = %q{OmniAuth strategy for Getdrip}
|
10
|
+
spec.summary = %q{OmniAuth strategy for Getdrip.com}
|
11
|
+
spec.homepage = "https://github.com/j-mcnally/omniauth-getdrip.git"
|
12
|
+
spec.license = "MIT"
|
13
|
+
|
14
|
+
spec.files = `git ls-files`.split($/)
|
15
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
16
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
|
+
spec.require_paths = ["lib"]
|
18
|
+
|
19
|
+
spec.add_runtime_dependency 'omniauth-oauth2', "~> 1.2"
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-getdrip
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- j-mcnally
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-07-17 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.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.2'
|
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.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: OmniAuth strategy for Getdrip
|
56
|
+
email:
|
57
|
+
- justin@waitlisted.co
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- lib/omniauth-getdrip.rb
|
68
|
+
- lib/omniauth-getdrip/version.rb
|
69
|
+
- lib/omniauth/strategies/getdrip.rb
|
70
|
+
- omniauth-getdrip.gemspec
|
71
|
+
homepage: https://github.com/j-mcnally/omniauth-getdrip.git
|
72
|
+
licenses:
|
73
|
+
- MIT
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.2.2
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: OmniAuth strategy for Getdrip.com
|
95
|
+
test_files: []
|
96
|
+
has_rdoc:
|