omniauth-contactually 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.rspec +3 -0
- data/.rubocop.yml +177 -0
- data/.travis.yml +24 -0
- data/Gemfile +4 -0
- data/LICENSE.md +19 -0
- data/README.md +39 -0
- data/Rakefile +18 -0
- data/example/Gemfile +4 -0
- data/example/README.md +32 -0
- data/example/app.rb +27 -0
- data/example/config.ru +11 -0
- data/lib/omniauth-contactually.rb +3 -0
- data/lib/omniauth-contactually/version.rb +5 -0
- data/lib/omniauth/strategies/contactually.rb +55 -0
- data/omniauth-contactually.gemspec +25 -0
- data/spec/omniauth/strategies/contactually_spec.rb +39 -0
- data/spec/spec_helper.rb +11 -0
- metadata +133 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 68c7c3aefcfbd88974c1ecd2abe83edcdd561ffe
|
4
|
+
data.tar.gz: 0918d9018e778e84f340d6ab9583c98a161208af
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a2c8a1e1338184db35a7c57b3e2557a530701e919bb1c44d444d2ea181febe6608e3b09fbadb4c4e6079d6f9473719a39bb704200f578b2c70b157eef8d1d289
|
7
|
+
data.tar.gz: 9711eafcdbe2800829d37c5c9f124a3509ce38df1150dd6eb0f0decffe8267d05af0ea4e16d6ec8fb07d0de96ed23b48c250dd2b617acc3a8eb4fde96147fa76
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,177 @@
|
|
1
|
+
Style/AlignParameters:
|
2
|
+
# Alignment of parameters in multi-line method calls.
|
3
|
+
#
|
4
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
5
|
+
# column as the first parameter.
|
6
|
+
#
|
7
|
+
# method_call(a,
|
8
|
+
# b)
|
9
|
+
#
|
10
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
11
|
+
# level of indentation relative to the start of the line with the method call.
|
12
|
+
#
|
13
|
+
# method_call(a,
|
14
|
+
# b)
|
15
|
+
EnforcedStyle: with_fixed_indentation
|
16
|
+
SupportedStyles:
|
17
|
+
- with_first_parameter
|
18
|
+
- with_fixed_indentation
|
19
|
+
|
20
|
+
Style/BracesAroundHashParameters:
|
21
|
+
EnforcedStyle: context_dependent
|
22
|
+
SupportedStyles:
|
23
|
+
# The `braces` style enforces braces around all method parameters that are
|
24
|
+
# hashes.
|
25
|
+
- braces
|
26
|
+
# The `no_braces` style checks that the last parameter doesn't have braces
|
27
|
+
# around it.
|
28
|
+
- no_braces
|
29
|
+
# The `context_dependent` style checks that the last parameter doesn't have
|
30
|
+
# braces around it, but requires braces if the second to last parameter is
|
31
|
+
# also a hash literal.
|
32
|
+
- context_dependent
|
33
|
+
|
34
|
+
# Indentation of `when`.
|
35
|
+
Style/CaseIndentation:
|
36
|
+
IndentWhenRelativeTo: end
|
37
|
+
SupportedStyles:
|
38
|
+
- case
|
39
|
+
- end
|
40
|
+
IndentOneStep: false
|
41
|
+
|
42
|
+
Style/ClassAndModuleChildren:
|
43
|
+
# Checks the style of children definitions at classes and modules.
|
44
|
+
#
|
45
|
+
# Basically there are two different styles:
|
46
|
+
#
|
47
|
+
# `nested` - have each child on a separate line
|
48
|
+
# class Foo
|
49
|
+
# class Bar
|
50
|
+
# end
|
51
|
+
# end
|
52
|
+
#
|
53
|
+
# `compact` - combine definitions as much as possible
|
54
|
+
# class Foo::Bar
|
55
|
+
# end
|
56
|
+
#
|
57
|
+
# The compact style is only forced, for classes / modules with one child.
|
58
|
+
EnforcedStyle: nested
|
59
|
+
SupportedStyles:
|
60
|
+
- nested
|
61
|
+
- compact
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Style/CommandLiteral:
|
65
|
+
EnforcedStyle: mixed
|
66
|
+
# backticks: Always use backticks.
|
67
|
+
# percent_x: Always use %x.
|
68
|
+
# mixed: Use backticks on single-line commands, and %x on multi-line commands.
|
69
|
+
SupportedStyles:
|
70
|
+
- backticks
|
71
|
+
- percent_x
|
72
|
+
- mixed
|
73
|
+
# If false, the cop will always recommend using %x if one or more backticks
|
74
|
+
# are found in the command string.
|
75
|
+
AllowInnerBackticks: false
|
76
|
+
|
77
|
+
Style/HashSyntax:
|
78
|
+
EnforcedStyle: hash_rockets
|
79
|
+
SupportedStyles:
|
80
|
+
- ruby19
|
81
|
+
- hash_rockets
|
82
|
+
|
83
|
+
# Checks the indentation of the first element in an array literal.
|
84
|
+
Style/IndentArray:
|
85
|
+
# The value `special_inside_parentheses` means that array literals with
|
86
|
+
# brackets that have their opening bracket on the same line as a surrounding
|
87
|
+
# opening round parenthesis, shall have their first element indented relative
|
88
|
+
# to the first position inside the parenthesis.
|
89
|
+
#
|
90
|
+
# The value `consistent` means that the indentation of the first element shall
|
91
|
+
# always be relative to the first position of the line where the opening
|
92
|
+
# bracket is.
|
93
|
+
#
|
94
|
+
# The value `align_brackets` means that the indentation of the first element
|
95
|
+
# shall always be relative to the position of the opening bracket.
|
96
|
+
EnforcedStyle: consistent
|
97
|
+
SupportedStyles:
|
98
|
+
- special_inside_parentheses
|
99
|
+
- consistent
|
100
|
+
- align_brackets
|
101
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
102
|
+
# But it can be overridden by setting this parameter
|
103
|
+
IndentationWidth: ~
|
104
|
+
|
105
|
+
# Checks the indentation of the first key in a hash literal.
|
106
|
+
Style/IndentHash:
|
107
|
+
# The value `special_inside_parentheses` means that hash literals with braces
|
108
|
+
# that have their opening brace on the same line as a surrounding opening
|
109
|
+
# round parenthesis, shall have their first key indented relative to the
|
110
|
+
# first position inside the parenthesis.
|
111
|
+
# The value `consistent` means that the indentation of the first key shall
|
112
|
+
# always be relative to the first position of the line where the opening
|
113
|
+
# brace is.
|
114
|
+
EnforcedStyle: consistent
|
115
|
+
SupportedStyles:
|
116
|
+
- special_inside_parentheses
|
117
|
+
- consistent
|
118
|
+
|
119
|
+
Style/MultilineMethodCallIndentation:
|
120
|
+
EnforcedStyle: indented
|
121
|
+
SupportedStyles:
|
122
|
+
- aligned
|
123
|
+
- indented
|
124
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
125
|
+
# But it can be overridden by setting this parameter
|
126
|
+
IndentationWidth: ~
|
127
|
+
|
128
|
+
Style/MultilineOperationIndentation:
|
129
|
+
EnforcedStyle: indented
|
130
|
+
SupportedStyles:
|
131
|
+
- aligned
|
132
|
+
- indented
|
133
|
+
|
134
|
+
Style/SymbolProc:
|
135
|
+
IgnoredMethods:
|
136
|
+
- proc
|
137
|
+
- respond_to
|
138
|
+
|
139
|
+
# Enforces: "Provide an exception class and message as arguments to raise."
|
140
|
+
# Overly restrictive when testing ActiveRecord errors
|
141
|
+
# EG: ActiveRecord::RecordInvalid.new(model_with_errs) doesn't take a message
|
142
|
+
Style/RaiseArgs:
|
143
|
+
Enabled: false
|
144
|
+
|
145
|
+
##################### Metrics #############################
|
146
|
+
|
147
|
+
Metrics/ClassLength:
|
148
|
+
CountComments: false # count full line comments?
|
149
|
+
Max: 100
|
150
|
+
Enabled: false
|
151
|
+
|
152
|
+
Metrics/MethodLength:
|
153
|
+
CountComments: false # count full line comments?
|
154
|
+
Max: 10
|
155
|
+
Enabled: false
|
156
|
+
|
157
|
+
Metrics/LineLength:
|
158
|
+
Max: 120
|
159
|
+
|
160
|
+
##################### Lint ################################
|
161
|
+
|
162
|
+
Lint/AssignmentInCondition:
|
163
|
+
Description: "Don't use assignment in conditions."
|
164
|
+
Enabled: false
|
165
|
+
|
166
|
+
##################### Performance #########################
|
167
|
+
|
168
|
+
# Performance improvement is negligible and the readability is poor. See:
|
169
|
+
# https://github.com/bbatsov/rubocop/issues/2614
|
170
|
+
Performance/Casecmp:
|
171
|
+
Enabled: false
|
172
|
+
|
173
|
+
##################### Rails ###############################
|
174
|
+
|
175
|
+
Rails/ActionFilter:
|
176
|
+
Description: 'Enforces consistent use of action filter methods.'
|
177
|
+
Enabled: false
|
data/.travis.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
before_install: gem install bundler
|
2
|
+
env:
|
3
|
+
global:
|
4
|
+
- JRUBY_OPTS="$JRUBY_OPTS --debug"
|
5
|
+
language: ruby
|
6
|
+
rvm:
|
7
|
+
- 1.8.7
|
8
|
+
- 1.9.3
|
9
|
+
- 2.0.0
|
10
|
+
- 2.1
|
11
|
+
- 2.2
|
12
|
+
- jruby-18mode
|
13
|
+
- jruby-19mode
|
14
|
+
- jruby-head
|
15
|
+
- rbx-2
|
16
|
+
- ruby-head
|
17
|
+
matrix:
|
18
|
+
allow_failures:
|
19
|
+
- rvm: 1.8.7
|
20
|
+
- rvm: jruby-18mode
|
21
|
+
- rvm: jruby-head
|
22
|
+
- rvm: ruby-head
|
23
|
+
fast_finish: true
|
24
|
+
sudo: false
|
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (C) 2016 Zvi Band and Contactually, Inc
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# OmniAuth Contactually
|
2
|
+
|
3
|
+
[![Gem Version](http://img.shields.io/gem/v/omniauth-contactually.svg)][gem]
|
4
|
+
[![Build Status](http://img.shields.io/travis/contactually/omniauth-contactually.svg)][travis]
|
5
|
+
[![Code Climate](http://img.shields.io/codeclimate/github/contactually/omniauth-contactually.svg)][codeclimate]
|
6
|
+
|
7
|
+
[gem]: https://rubygems.org/gems/omniauth-contactually
|
8
|
+
[travis]: http://travis-ci.org/contactually/omniauth-contactually
|
9
|
+
[codeclimate]: https://codeclimate.com/github/contactually/omniauth-contactually
|
10
|
+
|
11
|
+
Gem to authenticate applications to Contactually via OAuth2.
|
12
|
+
|
13
|
+
# Background
|
14
|
+
Contactually has a full API (docs at https://developers.contactually.com), and as of Q1 2016, has switched to OAuth2 for authentication (https://developers.contactually.com/docs/auth).
|
15
|
+
|
16
|
+
To aid in the development of applications that provide value by connecting to Contactually, we've provided this OmniAuth strategy. You see existing integrations and add your own at http://marketplace.contactually.com/
|
17
|
+
|
18
|
+
# Setup
|
19
|
+
Register for your OAuth2 credentials by creating an application at https://www.contactually.com/developer/applications (you'll need a Contactually account - contact us at api@contactually.com if you want it converted to a free developer account).
|
20
|
+
|
21
|
+
You can see what scope(s) your application will require at https://developers.contactually.com/docs/auth/. Limiting your application to only access necessary information will instill better user trust with your application.
|
22
|
+
|
23
|
+
## Standard setup:
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
# Add to your initializers/omniauth.rb
|
27
|
+
|
28
|
+
use OmniAuth::Builder do
|
29
|
+
provider :contactually, ENV['CONTACTUALLY_APP_ID'], ENV['CONTACTUALLY_APP_SECRET'], :scope=>"all:manage"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
## Setup with Devise:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
# Add to your devise.rb
|
37
|
+
|
38
|
+
config.omniauth :contactually, ENV['CONTACTUALLY_APP_ID'], ENV['CONTACTUALLY_APP_SECRET'], :scope=>"all:manage"
|
39
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rspec/core/rake_task'
|
4
|
+
|
5
|
+
RSpec::Core::RakeTask.new
|
6
|
+
|
7
|
+
task :test => :spec
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'rubocop/rake_task'
|
11
|
+
RuboCop::RakeTask.new
|
12
|
+
rescue LoadError
|
13
|
+
task :rubocop do
|
14
|
+
$stderr.puts 'RuboCop is disabled'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
task :default => [:spec, :rubocop]
|
data/example/Gemfile
ADDED
data/example/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Example App
|
2
|
+
|
3
|
+
This folder contains a sample Sinatra app to test the Contactually OAuth2 flow.
|
4
|
+
|
5
|
+
## Setup
|
6
|
+
|
7
|
+
Ensure your Contactually App ID and Secret are available in the environment:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
export CONTACTUALLY_APP_ID=YOUR_APP_ID_HERE
|
11
|
+
export CONTACTUALLY_APP_SECRET=YOUR_APP_SECRET_HERE
|
12
|
+
```
|
13
|
+
|
14
|
+
Run bundle install from the command line:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
bundle install
|
18
|
+
```
|
19
|
+
|
20
|
+
## Usage
|
21
|
+
|
22
|
+
Run the app:
|
23
|
+
|
24
|
+
```bash
|
25
|
+
rackup -p 4567
|
26
|
+
```
|
27
|
+
|
28
|
+
NOTE: Since Contactually requires SSL, you'll probably need to set up a tunnel using a service like ngrok:
|
29
|
+
|
30
|
+
```bash
|
31
|
+
ngrok http -subdomain=some-custom-subdomain 4567
|
32
|
+
```
|
data/example/app.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'sinatra'
|
2
|
+
|
3
|
+
# Configure sinatra
|
4
|
+
set :run, false
|
5
|
+
set :raise_errors, true
|
6
|
+
set :protection, :except => [:json_csrf]
|
7
|
+
|
8
|
+
# Setup logging to file
|
9
|
+
log = File.new('app.log', 'a+')
|
10
|
+
$stdout.reopen(log)
|
11
|
+
$stderr.reopen(log)
|
12
|
+
$stderr.sync = true
|
13
|
+
$stdout.sync = true
|
14
|
+
|
15
|
+
get '/' do
|
16
|
+
redirect '/auth/contactually'
|
17
|
+
end
|
18
|
+
|
19
|
+
get '/auth/:provider/callback' do
|
20
|
+
content_type 'application/json'
|
21
|
+
MultiJson.encode(request.env)
|
22
|
+
end
|
23
|
+
|
24
|
+
get '/auth/failure' do
|
25
|
+
content_type 'application/json'
|
26
|
+
MultiJson.encode(request.env)
|
27
|
+
end
|
data/example/config.ru
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'omniauth-contactually'
|
3
|
+
require './app.rb'
|
4
|
+
|
5
|
+
use Rack::Session::Cookie, :secret => 'abc123'
|
6
|
+
|
7
|
+
use OmniAuth::Builder do
|
8
|
+
provider :contactually, ENV['CONTACTUALLY_APP_ID'], ENV['CONTACTUALLY_APP_SECRET'], :scope => 'all:manage'
|
9
|
+
end
|
10
|
+
|
11
|
+
run Sinatra::Application
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
# Authentication strategy for connecting with the Contactually API.
|
6
|
+
class Contactually < OmniAuth::Strategies::OAuth2
|
7
|
+
# Give your strategy a name.
|
8
|
+
option :name, 'contactually'
|
9
|
+
|
10
|
+
# This is where you pass the options you would pass when
|
11
|
+
# initializing your consumer from the OAuth gem.
|
12
|
+
option :client_options, :site => 'https://api.contactually.com/',
|
13
|
+
:authorize_url => 'https://auth.contactually.com/oauth2/authorize',
|
14
|
+
:token_url => 'https://auth.contactually.com/oauth2/token'
|
15
|
+
|
16
|
+
# These are called after authentication has succeeded. If
|
17
|
+
# possible, you should try to set the UID without making
|
18
|
+
# additional calls (if the user id is returned with the token
|
19
|
+
# or as a URI parameter). This may not be possible with all
|
20
|
+
# providers.
|
21
|
+
uid { raw_info['id'] }
|
22
|
+
|
23
|
+
# https://github.com/intridea/omniauth/wiki/Auth-Hash-Schema#schema-10-and-later
|
24
|
+
info do
|
25
|
+
{
|
26
|
+
:name => name_from_raw_info,
|
27
|
+
:email => raw_info['email'],
|
28
|
+
:first_name => raw_info['first_name'],
|
29
|
+
:last_name => raw_info['last_name'],
|
30
|
+
:image => raw_info['avatar_url']
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
extra do
|
35
|
+
{
|
36
|
+
'raw_info' => raw_info
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
def raw_info
|
41
|
+
@raw_info ||= access_token.get('/v2/me').parsed['data']
|
42
|
+
end
|
43
|
+
|
44
|
+
private
|
45
|
+
|
46
|
+
def name_from_raw_info
|
47
|
+
if raw_info['first_name'] || raw_info['last_name']
|
48
|
+
"#{raw_info['first_name']} #{raw_info['last_name']}".strip
|
49
|
+
else
|
50
|
+
raw_info['email']
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.expand_path('../lib/omniauth-contactually/version', __FILE__)
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.authors = 'Contactually'
|
5
|
+
gem.email = 'api@contactually.com'
|
6
|
+
gem.description = 'OmniAuth OAuth2 strategy for Contactually.'
|
7
|
+
gem.summary = gem.description
|
8
|
+
gem.homepage = 'https://github.com/contactually/omniauth-contactually'
|
9
|
+
gem.licenses = %w(MIT)
|
10
|
+
|
11
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.name = 'omniauth-contactually'
|
15
|
+
gem.require_paths = %w(lib)
|
16
|
+
gem.version = OmniAuth::Contactually::VERSION
|
17
|
+
|
18
|
+
# Lock at 1.3.x due to https://github.com/intridea/omniauth-oauth2/issues/81
|
19
|
+
gem.add_dependency 'omniauth-oauth2', '~> 1.3.1'
|
20
|
+
|
21
|
+
gem.add_development_dependency 'rack-test'
|
22
|
+
gem.add_development_dependency 'rake'
|
23
|
+
gem.add_development_dependency 'rspec'
|
24
|
+
gem.add_development_dependency 'rubocop'
|
25
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe OmniAuth::Strategies::OAuth2 do
|
4
|
+
def app
|
5
|
+
->(_env) { [200, {}, ['Hello.']] }
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:strategy) do
|
9
|
+
OmniAuth::Strategies::Contactually.new(nil, @options || {}).tap do |strategy|
|
10
|
+
allow(strategy).to receive(:request) { @request }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
before do
|
15
|
+
@request = double('Request')
|
16
|
+
allow(@request).to receive(:params) { {} }
|
17
|
+
OmniAuth.config.test_mode = true
|
18
|
+
end
|
19
|
+
|
20
|
+
after do
|
21
|
+
OmniAuth.config.test_mode = false
|
22
|
+
end
|
23
|
+
|
24
|
+
context 'client options' do
|
25
|
+
subject { strategy.options.client_options }
|
26
|
+
|
27
|
+
it 'has correct api site' do
|
28
|
+
expect(subject.site).to eq('https://api.contactually.com/')
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'has correct access token path' do
|
32
|
+
expect(subject.token_url).to eq('https://auth.contactually.com/oauth2/token')
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'has correct authorize url' do
|
36
|
+
expect(subject.authorize_url).to eq('https://auth.contactually.com/oauth2/authorize')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
$LOAD_PATH.unshift File.expand_path('..', __FILE__)
|
2
|
+
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
|
4
|
+
require 'rspec'
|
5
|
+
require 'rack/test'
|
6
|
+
require 'omniauth-contactually'
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
10
|
+
config.include Rack::Test::Methods
|
11
|
+
end
|
metadata
ADDED
@@ -0,0 +1,133 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-contactually
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Contactually
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-16 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: rack-test
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
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
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: OmniAuth OAuth2 strategy for Contactually.
|
84
|
+
email: api@contactually.com
|
85
|
+
executables: []
|
86
|
+
extensions: []
|
87
|
+
extra_rdoc_files: []
|
88
|
+
files:
|
89
|
+
- ".gitignore"
|
90
|
+
- ".rspec"
|
91
|
+
- ".rubocop.yml"
|
92
|
+
- ".travis.yml"
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.md
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- example/Gemfile
|
98
|
+
- example/README.md
|
99
|
+
- example/app.rb
|
100
|
+
- example/config.ru
|
101
|
+
- lib/omniauth-contactually.rb
|
102
|
+
- lib/omniauth-contactually/version.rb
|
103
|
+
- lib/omniauth/strategies/contactually.rb
|
104
|
+
- omniauth-contactually.gemspec
|
105
|
+
- spec/omniauth/strategies/contactually_spec.rb
|
106
|
+
- spec/spec_helper.rb
|
107
|
+
homepage: https://github.com/contactually/omniauth-contactually
|
108
|
+
licenses:
|
109
|
+
- MIT
|
110
|
+
metadata: {}
|
111
|
+
post_install_message:
|
112
|
+
rdoc_options: []
|
113
|
+
require_paths:
|
114
|
+
- lib
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
requirements: []
|
126
|
+
rubyforge_project:
|
127
|
+
rubygems_version: 2.4.5.1
|
128
|
+
signing_key:
|
129
|
+
specification_version: 4
|
130
|
+
summary: OmniAuth OAuth2 strategy for Contactually.
|
131
|
+
test_files:
|
132
|
+
- spec/omniauth/strategies/contactually_spec.rb
|
133
|
+
- spec/spec_helper.rb
|