omniauth-twingl 0.0.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.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/Gemfile +13 -0
- data/Guardfile +11 -0
- data/README.md +46 -0
- data/Rakefile +9 -0
- data/lib/omniauth-twingl.rb +2 -0
- data/lib/omniauth-twingl/version.rb +5 -0
- data/lib/omniauth/strategies/twingl.rb +30 -0
- data/omniauth-twingl.gemspec +22 -0
- data/spec/omniauth/strategies/twingl_spec.rb +20 -0
- data/spec/spec_helper.rb +10 -0
- metadata +85 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7aa9d8a318e2f34036709db6707258a9057025b2
|
4
|
+
data.tar.gz: cf7e468b8c3879816231bc15cb9d25822c0a865b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ed084de83b0e95eb2c803b5893b0f972e5e95bd9b1d3d9cf39312d31ae873d1241d1700577a0080db13950480e807e3de9447b4c83ab4fe37dfd35ab0e948f34
|
7
|
+
data.tar.gz: 82cf3cbe478e90ffc33e289be1559f8a9f9c2194b8cc7de938b5c82cfa70caf314b303206b065360517e8636f33b865cacc735f090b31ef169c257d75049ad9a
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Guardfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# OmniAuth Twingl
|
2
|
+
|
3
|
+
OmniAuth strategy for authenticating against the Twingl API
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
$ gem install omniauth-twingl
|
8
|
+
|
9
|
+
or add to your Gemfile:
|
10
|
+
|
11
|
+
gem 'omniauth-twingl'
|
12
|
+
|
13
|
+
Configuration example for a Rails app:
|
14
|
+
|
15
|
+
# /config/initializers/omniauth.rb
|
16
|
+
Rails.application.config.middleware.use OmniAuth::Builder do
|
17
|
+
provider :twingl, "your consumer key", "your secret"
|
18
|
+
end
|
19
|
+
|
20
|
+
And you're good to go! Check out the [OmniAuth
|
21
|
+
docs](https://github.com/intridea/omniauth) for more information
|
22
|
+
|
23
|
+
## License
|
24
|
+
|
25
|
+
Copyright (C) 2013 Twingl Ltd.
|
26
|
+
|
27
|
+
Based on works (omniauth-oauth2) Copyright (C) 2011 by Michael Bleigh and
|
28
|
+
Intridea, Inc.
|
29
|
+
|
30
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
31
|
+
of this software and associated documentation files (the "Software"), to deal
|
32
|
+
in the Software without restriction, including without limitation the rights
|
33
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
34
|
+
copies of the Software, and to permit persons to whom the Software is
|
35
|
+
furnished to do so, subject to the following conditions:
|
36
|
+
|
37
|
+
The above copyright notice and this permission notice shall be included in
|
38
|
+
all copies or substantial portions of the Software.
|
39
|
+
|
40
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
41
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
42
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
43
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
44
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
45
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
46
|
+
THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class Twingl < OmniAuth::Strategies::OAuth2
|
6
|
+
|
7
|
+
option :name, "twingl"
|
8
|
+
|
9
|
+
option :client_options, { :site => "http://api.twin.gl" }
|
10
|
+
|
11
|
+
uid { raw_info['id'] }
|
12
|
+
|
13
|
+
info do
|
14
|
+
{
|
15
|
+
:name => raw_info["name"]
|
16
|
+
}
|
17
|
+
end
|
18
|
+
|
19
|
+
extra do
|
20
|
+
{
|
21
|
+
:raw_info => raw_info
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def raw_info
|
26
|
+
@raw_info ||= access_token.get('/v1/users/me').parsed
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/omniauth-twingl/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.add_dependency 'omniauth-oauth2', '~> 1.0'
|
6
|
+
|
7
|
+
gem.add_development_dependency 'rspec', '~> 2.7'
|
8
|
+
|
9
|
+
gem.authors = ["Greg Signal"]
|
10
|
+
gem.email = ["greg@g-s.me"]
|
11
|
+
gem.description = %q{An OmniAuth strategy for authenticating against the Twingl API.}
|
12
|
+
gem.summary = %q{An OmniAuth strategy for authenticating against the Twingl API.}
|
13
|
+
gem.homepage = "https://github.com/twingl/omniauth-twingl"
|
14
|
+
gem.license = "MIT"
|
15
|
+
|
16
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
gem.files = `git ls-files`.split("\n")
|
18
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
gem.name = "omniauth-twingl"
|
20
|
+
gem.require_paths = ["lib"]
|
21
|
+
gem.version = OmniAuth::Twingl::VERSION
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'omniauth-twingl'
|
3
|
+
|
4
|
+
describe OmniAuth::Strategies::Twingl do
|
5
|
+
subject do
|
6
|
+
OmniAuth::Strategies::Twingl.new(nil, {})
|
7
|
+
end
|
8
|
+
|
9
|
+
describe "#client" do
|
10
|
+
it "should point to the twingl API" do
|
11
|
+
subject.client.site.should eq "http://api.twin.gl"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe "#callback_path" do
|
16
|
+
it "should have the correct callback path" do
|
17
|
+
subject.callback_path.should eq "/auth/twingl/callback"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
$:.unshift File.expand_path('..', __FILE__)
|
2
|
+
$:.unshift File.expand_path('../../lib', __FILE__)
|
3
|
+
require 'rspec'
|
4
|
+
require 'omniauth'
|
5
|
+
require 'omniauth-oauth2'
|
6
|
+
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy
|
9
|
+
end
|
10
|
+
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: omniauth-twingl
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Greg Signal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-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.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '2.7'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '2.7'
|
41
|
+
description: An OmniAuth strategy for authenticating against the Twingl API.
|
42
|
+
email:
|
43
|
+
- greg@g-s.me
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- Guardfile
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/omniauth-twingl.rb
|
54
|
+
- lib/omniauth-twingl/version.rb
|
55
|
+
- lib/omniauth/strategies/twingl.rb
|
56
|
+
- omniauth-twingl.gemspec
|
57
|
+
- spec/omniauth/strategies/twingl_spec.rb
|
58
|
+
- spec/spec_helper.rb
|
59
|
+
homepage: https://github.com/twingl/omniauth-twingl
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
metadata: {}
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubyforge_project:
|
79
|
+
rubygems_version: 2.0.8
|
80
|
+
signing_key:
|
81
|
+
specification_version: 4
|
82
|
+
summary: An OmniAuth strategy for authenticating against the Twingl API.
|
83
|
+
test_files:
|
84
|
+
- spec/omniauth/strategies/twingl_spec.rb
|
85
|
+
- spec/spec_helper.rb
|