omniauth-stormz 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,36 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-stormz (0.0.1)
5
+ omniauth-oauth2 (~> 1.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ faraday (0.8.1)
11
+ multipart-post (~> 1.1)
12
+ hashie (1.2.0)
13
+ httpauth (0.1)
14
+ jwt (0.1.5)
15
+ multi_json (>= 1.0)
16
+ multi_json (1.3.6)
17
+ multipart-post (1.1.5)
18
+ oauth2 (0.8.0)
19
+ faraday (~> 0.8)
20
+ httpauth (~> 0.1)
21
+ jwt (~> 0.1.4)
22
+ multi_json (~> 1.0)
23
+ rack (~> 1.2)
24
+ omniauth (1.1.0)
25
+ hashie (~> 1.2)
26
+ rack
27
+ omniauth-oauth2 (1.1.0)
28
+ oauth2 (~> 0.8.0)
29
+ omniauth (~> 1.0)
30
+ rack (1.4.1)
31
+
32
+ PLATFORMS
33
+ ruby
34
+
35
+ DEPENDENCIES
36
+ omniauth-stormz!
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # OmniAuth Stormz
2
+
3
+ This is the official OmniAuth strategy for authenticating to Stormz. To
4
+ use it, you'll need to sign up for an OAuth2 Application ID and Secret
5
+ on the [Stormz Applications Page](https://stormz.me/oauth/applications).
6
+
7
+ ## Basic Usage
8
+
9
+ use OmniAuth::Builder do
10
+ provider :stormz, ENV[STORMZ_KEY'], ENV['STORMZ_SECRET']
11
+ end
12
+
13
+ ## License
14
+
15
+ Copyright (c) 2012 François de Metz
16
+
17
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,2 @@
1
+ require "omniauth-stormz/version"
2
+ require 'omniauth/strategies/stormz'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Stormz
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,34 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Stormz < OmniAuth::Strategies::OAuth2
6
+ option :name, "stormz"
7
+
8
+ option :client_options, {
9
+ :site => 'https://api.stormz.me',
10
+ :authorize_url => 'https://stormz.me/oauth/authorize',
11
+ :token_url => 'https://stormz.me/oauth/token'
12
+ }
13
+
14
+ uid { raw_info['id'] }
15
+
16
+ info do
17
+ {
18
+ :name => raw_info['name'],
19
+ :email => raw_info['email']
20
+ }
21
+ end
22
+
23
+ extra do
24
+ {
25
+ 'raw_info' => raw_info
26
+ }
27
+ end
28
+
29
+ def raw_info
30
+ @raw_info ||= access_token.get('/v1/user/me').parsed
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/omniauth-stormz/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["François de Metz"]
6
+ gem.email = ["francois@stormz.me"]
7
+ gem.description = %q{Official OmniAuth strategy for Stormz.}
8
+ gem.summary = %q{Official OmniAuth strategy for Stormz.}
9
+ gem.homepage = "https://github.com/stormz/omniauth-stormz"
10
+
11
+ gem.executables = `git ls-files -- bin/*`.split("\n").map{ |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-stormz"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = OmniAuth::Stormz::VERSION
17
+
18
+ gem.add_dependency 'omniauth-oauth2', '~> 1.1'
19
+ end
metadata ADDED
@@ -0,0 +1,63 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-stormz
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - François de Metz
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-07-31 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: omniauth-oauth2
16
+ requirement: &20291080 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '1.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *20291080
25
+ description: Official OmniAuth strategy for Stormz.
26
+ email:
27
+ - francois@stormz.me
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - Gemfile
33
+ - Gemfile.lock
34
+ - README.md
35
+ - lib/omniauth-stormz.rb
36
+ - lib/omniauth-stormz/version.rb
37
+ - lib/omniauth/strategies/stormz.rb
38
+ - omniauth-stormz.gemspec
39
+ homepage: https://github.com/stormz/omniauth-stormz
40
+ licenses: []
41
+ post_install_message:
42
+ rdoc_options: []
43
+ require_paths:
44
+ - lib
45
+ required_ruby_version: !ruby/object:Gem::Requirement
46
+ none: false
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubyforge_project:
59
+ rubygems_version: 1.8.10
60
+ signing_key:
61
+ specification_version: 3
62
+ summary: Official OmniAuth strategy for Stormz.
63
+ test_files: []