omniauth-eachscape-oauth2 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cc3d556de3e3ec704ca78ab81c0b53c7d8555bad
4
+ data.tar.gz: a96a9e15064ddb05360d1fece811deb463d38001
5
+ SHA512:
6
+ metadata.gz: 40713ce4dee8000c6ad24c45132e8e5e11f490d44062d236294b8846b4d577dac2a0165a6cd20a22a76674da77232e98bff1ebc4f8462e834b6c8649eeb7e8fb
7
+ data.tar.gz: 24b387e52e43eed08691deb362303cb3b13d163be66c4e14f0d8192573db0aa28c269f7eeebc35a9669f59d8a5ae192d01e958fb29fdc4e5f2204b267c78516f
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in omniauth-linkedin-oauth2.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 eachscape
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,12 @@
1
+ # OmniAuth::Strategies::EachScape
2
+
3
+ An EachScape OAuth2 strategy for OmniAuth (https://builder.eachscape.com).
4
+
5
+ ## Usage
6
+
7
+ ```ruby
8
+ # config/initializers/omniauth.rb
9
+ Rails.application.config.middleware.use OmniAuth::Builder do
10
+ provider :eachscape, ENV['EACHSCAPE_CLIENT_ID'], ENV['EACHSCAPE_CLIENT_SECRET']
11
+ end
12
+ ```
@@ -0,0 +1 @@
1
+ require File.join('omniauth', 'strategies', 'eachscape')
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module EachScape
3
+ VERSION = '1.0.1'
4
+ end
5
+ end
@@ -0,0 +1,47 @@
1
+ require 'omniauth/strategies/oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class EachScape < OmniAuth::Strategies::OAuth2
6
+
7
+ # Available scopes: read_permissions, editor
8
+ DEFAULT_SCOPE = 'read_permissions'
9
+
10
+ option :name, 'eachscape'
11
+
12
+ option :client_options, {
13
+ site: ENV['EACHSCAPE_HOST'] || 'https://builder.eachscape.com',
14
+ authorize_url: '/api/oauth2/authorize',
15
+ token_url: '/api/oauth2/token',
16
+ }
17
+
18
+
19
+ uid { raw_info['id'] }
20
+
21
+ info do
22
+ {
23
+ name: raw_info['name'],
24
+ email: raw_info['email'],
25
+ }
26
+ end
27
+
28
+ extra do
29
+ { raw_info: raw_info }
30
+ end
31
+
32
+
33
+ def authorize_params
34
+ super.tap do |params|
35
+ params[:scope] ||= DEFAULT_SCOPE
36
+ end
37
+ end
38
+
39
+ def raw_info
40
+ @raw_info ||= access_token.get('/api/v1/me').parsed
41
+ end
42
+
43
+ end
44
+ end
45
+ end
46
+
47
+ OmniAuth.config.add_camelization('eachscape', 'EachScape')
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'omniauth/eachscape/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = 'omniauth-eachscape-oauth2'
8
+ gem.version = OmniAuth::EachScape::VERSION
9
+ gem.authors = ['Jon Botelho'],
10
+ gem.email = ['jon@eachscape.com']
11
+ gem.description = %q{An EachScape OAuth2 strategy for OmniAuth.}
12
+ gem.summary = %q{An EachScape OAuth2 strategy for OmniAuth.}
13
+ gem.homepage = 'https://github.com/decioferreira/omniauth-linkedin-oauth2'
14
+ gem.license = 'MIT'
15
+
16
+ gem.files = `git ls-files`.split($/)
17
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
+ gem.require_paths = ['lib']
20
+
21
+ gem.add_runtime_dependency 'omniauth', '~> 1.0'
22
+ gem.add_runtime_dependency 'omniauth-oauth2'
23
+
24
+ gem.add_development_dependency 'bundler'
25
+ gem.add_development_dependency 'rake'
26
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-eachscape-oauth2
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jon Botelho
8
+ - jon@eachscape.com
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2014-01-02 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: omniauth
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '1.0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: '1.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: omniauth-oauth2
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: bundler
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ description: An EachScape OAuth2 strategy for OmniAuth.
71
+ email:
72
+ - jon@eachscape.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - Gemfile
79
+ - LICENSE
80
+ - README.md
81
+ - lib/omniauth-eachscape-oauth2.rb
82
+ - lib/omniauth/eachscape/version.rb
83
+ - lib/omniauth/strategies/eachscape.rb
84
+ - omniauth-eachscape-oauth2.gemspec
85
+ homepage: https://github.com/decioferreira/omniauth-linkedin-oauth2
86
+ licenses:
87
+ - MIT
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.0.3
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: An EachScape OAuth2 strategy for OmniAuth.
109
+ test_files: []