omniauth-base 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5b64e0571dae73894b3d9dfad5c261a89dac896a
4
+ data.tar.gz: 7070db6d4ecd589544f2c89b53a8a71de1a91577
5
+ SHA512:
6
+ metadata.gz: 067c0341c72d96b30257f9b70b8d7f5888d6098094b2b5385c76fc3b7275e2aee66ea5936ff680cbe635aea2a23daeae48ff0686b04b671a72817e94e003d04e
7
+ data.tar.gz: 2c9517db5ee68e25f61dd1e32ec237f3d2582913ca7bf715a6d5fddfe5cae801df911f6e7d663e7f18d9c6f7bfe8b9eb6ee358a2371480895fa2d61291e4a4d8
data/README.md ADDED
@@ -0,0 +1,19 @@
1
+ # OmniAuth Base
2
+
3
+ OmniAuth strategy for [getbase.com](http://getbase.com/).
4
+
5
+ ## Basic Usage
6
+
7
+ use OmniAuth::Builder do
8
+ provider :base, ENV['BASE_KEY'], ENV['BASE_SECRET']
9
+ end
10
+
11
+ ## License
12
+
13
+ Copyright (c) 2015 François de Metz
14
+
15
+ 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:
16
+
17
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
18
+
19
+ 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-base/version"
2
+ require 'omniauth/strategies/base'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Base
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 Base < OmniAuth::Strategies::OAuth2
6
+ option :name, "base"
7
+
8
+ option :client_options, {
9
+ :site => "https://api.getbase.com",
10
+ :authorize_url => 'https://api.getbase.com/oauth2/authorize',
11
+ :token_url => 'https://api.getbase.com/oauth2/token'
12
+ }
13
+
14
+ uid{ raw_info['data']['id'] }
15
+
16
+ info do
17
+ {
18
+ :name => raw_info['data']['name'],
19
+ :email => raw_info['data']['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('/v2/users/self').parsed
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/omniauth-base/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{OmniAuth strategy for Base.}
8
+ gem.summary = %q{OmniAuth strategy for Base.}
9
+ gem.homepage = "https://github.com/stormz/omniauth-base"
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-base"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = OmniAuth::Base::VERSION
17
+
18
+ gem.add_dependency 'omniauth-oauth2', '~> 1.1'
19
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-base
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - François de Metz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-10 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.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.1'
27
+ description: OmniAuth strategy for Base.
28
+ email:
29
+ - francois@stormz.me
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - README.md
35
+ - lib/omniauth-base.rb
36
+ - lib/omniauth-base/version.rb
37
+ - lib/omniauth/strategies/base.rb
38
+ - omniauth-base.gemspec
39
+ homepage: https://github.com/stormz/omniauth-base
40
+ licenses: []
41
+ metadata: {}
42
+ post_install_message:
43
+ rdoc_options: []
44
+ require_paths:
45
+ - lib
46
+ required_ruby_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ required_rubygems_version: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 2.4.6
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: OmniAuth strategy for Base.
62
+ test_files: []