omniauth-galvanize 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 58c2af53f9f51153f78d2594b3db1d85252df598
4
+ data.tar.gz: 201691b8977843bc27bc6fb7eb60420428f25875
5
+ SHA512:
6
+ metadata.gz: c6b8709b79d11936c41c2333b5174db06a42e887940f99106ecf515c7a048c2f3021553ebab777293aec5adfcbcb682f5948c3dd992967b09f62c19ee465af75
7
+ data.tar.gz: d4201052347f3147181a25c7161c3b32ba16e50d660db95df103a87b1b635425a2d7c1a4ce3b86108a067c22ab78a9251147f32707f6d587d414b562825b4f1a
data/.gitignore ADDED
@@ -0,0 +1,20 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ !/log/.keep
17
+ /tmp
18
+
19
+ /.idea
20
+ projectFilesBackup1/.idea/omniauth-galv.iml
data/.idea/.generators ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Reorder generators
5
+ 2. Remove generators
6
+ 3. Add installed generators
7
+ To add new installed generators automatically delete this file and reload the project.
8
+ --><GeneratorsGroup><Generator name="active_record:migration" /><Generator name="active_record:model" /><Generator name="active_record:observer" /><Generator name="active_record:session_migration" /><Generator name="controller" /><Generator name="erb:controller" /><Generator name="erb:mailer" /><Generator name="erb:scaffold" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="mailer" /><Generator name="metal" /><Generator name="migration" /><Generator name="model" /><Generator name="model_subclass" /><Generator name="observer" /><Generator name="performance_test" /><Generator name="plugin" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="session_migration" /><Generator name="stylesheets" /><Generator name="test_unit:controller" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:observer" /><Generator name="test_unit:performance" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /></GeneratorsGroup></Settings>
data/.idea/.name ADDED
@@ -0,0 +1 @@
1
+ omniauth-galv
data/.idea/.rakeTasks ADDED
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Settings><!--This file was automatically generated by Ruby plugin.
3
+ You are allowed to:
4
+ 1. Remove rake task
5
+ 2. Add existing rake tasks
6
+ To add existing rake tasks automatically delete this file and reload the project.
7
+ --><RakeGroup description="" fullCmd="" taksId="rake" /></Settings>
data/.idea/misc.xml ADDED
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectLevelVcsManager" settingsEditedManually="false">
4
+ <OptionsSetting value="true" id="Add" />
5
+ <OptionsSetting value="true" id="Remove" />
6
+ <OptionsSetting value="true" id="Checkout" />
7
+ <OptionsSetting value="true" id="Update" />
8
+ <OptionsSetting value="true" id="Status" />
9
+ <OptionsSetting value="true" id="Edit" />
10
+ <ConfirmationsSetting value="0" id="Add" />
11
+ <ConfirmationsSetting value="0" id="Remove" />
12
+ </component>
13
+ <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.1.5" project-jdk-type="RUBY_SDK" />
14
+ </project>
data/.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/omniauth-galv.iml" filepath="$PROJECT_DIR$/.idea/omniauth-galv.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
data/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="" />
5
+ </component>
6
+ </project>
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '4.2.4'
4
+ gem 'jbuilder', '~> 2.0'
5
+ gem 'sdoc', '~> 0.4.0', group: :doc
6
+
7
+ gemspec
8
+
data/Gemfile.lock ADDED
@@ -0,0 +1,138 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omniauth-galvanize (0.0.3)
5
+ multi_json (~> 1.2)
6
+ omniauth (~> 1.2)
7
+ omniauth-oauth2
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actionmailer (4.2.4)
13
+ actionpack (= 4.2.4)
14
+ actionview (= 4.2.4)
15
+ activejob (= 4.2.4)
16
+ mail (~> 2.5, >= 2.5.4)
17
+ rails-dom-testing (~> 1.0, >= 1.0.5)
18
+ actionpack (4.2.4)
19
+ actionview (= 4.2.4)
20
+ activesupport (= 4.2.4)
21
+ rack (~> 1.6)
22
+ rack-test (~> 0.6.2)
23
+ rails-dom-testing (~> 1.0, >= 1.0.5)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
25
+ actionview (4.2.4)
26
+ activesupport (= 4.2.4)
27
+ builder (~> 3.1)
28
+ erubis (~> 2.7.0)
29
+ rails-dom-testing (~> 1.0, >= 1.0.5)
30
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
+ activejob (4.2.4)
32
+ activesupport (= 4.2.4)
33
+ globalid (>= 0.3.0)
34
+ activemodel (4.2.4)
35
+ activesupport (= 4.2.4)
36
+ builder (~> 3.1)
37
+ activerecord (4.2.4)
38
+ activemodel (= 4.2.4)
39
+ activesupport (= 4.2.4)
40
+ arel (~> 6.0)
41
+ activesupport (4.2.4)
42
+ i18n (~> 0.7)
43
+ json (~> 1.7, >= 1.7.7)
44
+ minitest (~> 5.1)
45
+ thread_safe (~> 0.3, >= 0.3.4)
46
+ tzinfo (~> 1.1)
47
+ arel (6.0.3)
48
+ builder (3.2.2)
49
+ erubis (2.7.0)
50
+ faraday (0.9.0)
51
+ multipart-post (>= 1.2, < 3)
52
+ globalid (0.3.6)
53
+ activesupport (>= 4.1.0)
54
+ hashie (3.3.1)
55
+ i18n (0.7.0)
56
+ jbuilder (2.3.1)
57
+ activesupport (>= 3.0.0, < 5)
58
+ multi_json (~> 1.2)
59
+ json (1.8.3)
60
+ jwt (1.0.0)
61
+ loofah (2.0.3)
62
+ nokogiri (>= 1.5.9)
63
+ mail (2.6.3)
64
+ mime-types (>= 1.16, < 3)
65
+ mime-types (2.6.1)
66
+ mini_portile (0.6.2)
67
+ minitest (5.8.0)
68
+ multi_json (1.11.2)
69
+ multi_xml (0.5.5)
70
+ multipart-post (2.0.0)
71
+ nokogiri (1.6.6.2)
72
+ mini_portile (~> 0.6.0)
73
+ oauth2 (1.0.0)
74
+ faraday (>= 0.8, < 0.10)
75
+ jwt (~> 1.0)
76
+ multi_json (~> 1.3)
77
+ multi_xml (~> 0.5)
78
+ rack (~> 1.2)
79
+ omniauth (1.2.2)
80
+ hashie (>= 1.2, < 4)
81
+ rack (~> 1.0)
82
+ omniauth-oauth2 (1.2.0)
83
+ faraday (>= 0.8, < 0.10)
84
+ multi_json (~> 1.3)
85
+ oauth2 (~> 1.0)
86
+ omniauth (~> 1.2)
87
+ rack (1.6.4)
88
+ rack-test (0.6.3)
89
+ rack (>= 1.0)
90
+ rails (4.2.4)
91
+ actionmailer (= 4.2.4)
92
+ actionpack (= 4.2.4)
93
+ actionview (= 4.2.4)
94
+ activejob (= 4.2.4)
95
+ activemodel (= 4.2.4)
96
+ activerecord (= 4.2.4)
97
+ activesupport (= 4.2.4)
98
+ bundler (>= 1.3.0, < 2.0)
99
+ railties (= 4.2.4)
100
+ sprockets-rails
101
+ rails-deprecated_sanitizer (1.0.3)
102
+ activesupport (>= 4.2.0.alpha)
103
+ rails-dom-testing (1.0.7)
104
+ activesupport (>= 4.2.0.beta, < 5.0)
105
+ nokogiri (~> 1.6.0)
106
+ rails-deprecated_sanitizer (>= 1.0.1)
107
+ rails-html-sanitizer (1.0.2)
108
+ loofah (~> 2.0)
109
+ railties (4.2.4)
110
+ actionpack (= 4.2.4)
111
+ activesupport (= 4.2.4)
112
+ rake (>= 0.8.7)
113
+ thor (>= 0.18.1, < 2.0)
114
+ rake (10.4.2)
115
+ rdoc (4.2.0)
116
+ json (~> 1.4)
117
+ sdoc (0.4.1)
118
+ json (~> 1.7, >= 1.7.7)
119
+ rdoc (~> 4.0)
120
+ sprockets (3.3.4)
121
+ rack (~> 1.0)
122
+ sprockets-rails (2.3.3)
123
+ actionpack (>= 3.0)
124
+ activesupport (>= 3.0)
125
+ sprockets (>= 2.8, < 4.0)
126
+ thor (0.19.1)
127
+ thread_safe (0.3.5)
128
+ tzinfo (1.2.2)
129
+ thread_safe (~> 0.1)
130
+
131
+ PLATFORMS
132
+ ruby
133
+
134
+ DEPENDENCIES
135
+ jbuilder (~> 2.0)
136
+ omniauth-galvanize!
137
+ rails (= 4.2.4)
138
+ sdoc (~> 0.4.0)
data/README.rdoc ADDED
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
data/config.ru ADDED
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,4 @@
1
+ require "omniauth-galvanize/version"
2
+ require 'omniauth/strategies/galvanize_local'
3
+ require 'omniauth/strategies/galvanize_stage'
4
+ require 'omniauth/strategies/galvanize'
@@ -0,0 +1,5 @@
1
+ module OmniAuth
2
+ module Galvanize
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,40 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class Galvanize < OmniAuth::Strategies::OAuth2
6
+ option :name, 'galvanize'
7
+
8
+ option :client_options, {
9
+ :site => 'https://members.galvanize.com',
10
+ :authorize_url => '/accounts/authorize',
11
+ :token_url => '/accounts/token'
12
+ }
13
+
14
+ uid{ raw_info['results'][0]['id'] }
15
+
16
+ info do
17
+ {
18
+ :email => raw_info['results'][0]['email'],
19
+ :name => raw_info['results'][0]['name'],
20
+ :first_name => raw_info['results'][0]['first_name'],
21
+ :last_name => raw_info['results'][0]['last_name'],
22
+ :galvanize_id => raw_info['results'][0]['id'],
23
+ :about => raw_info['results'][0]['about'],
24
+ :photo => raw_info['results'][0]['photo']
25
+
26
+ }
27
+ end
28
+
29
+ extra do
30
+ {
31
+ 'raw_info' => raw_info
32
+ }
33
+ end
34
+
35
+ def raw_info
36
+ @raw_info ||= access_token.get('/api/v2/me').parsed
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class GalvanizeLocal < OmniAuth::Strategies::OAuth2
6
+ option :name, 'galvanize_local'
7
+
8
+ option :client_options, {
9
+ :site => 'http://localhost:4000',
10
+ :authorize_url => '/accounts/authorize',
11
+ :token_url => '/accounts/token'
12
+ }
13
+
14
+ uid{ raw_info['results'][0]['id'] }
15
+
16
+ info do
17
+ {
18
+ :email => raw_info['results'][0]['email'],
19
+ :name => raw_info['results'][0]['name'],
20
+ :first_name => raw_info['results'][0]['first_name'],
21
+ :last_name => raw_info['results'][0]['last_name'],
22
+ :galvanize_id => raw_info['results'][0]['id'],
23
+ :about => raw_info['results'][0]['about'],
24
+ :photo => raw_info['results'][0]['photo']
25
+
26
+ }
27
+ end
28
+
29
+ extra do
30
+ {
31
+ 'raw_info' => raw_info
32
+ }
33
+ end
34
+
35
+ def raw_info
36
+ @raw_info ||= access_token.get('/api/v2/me').parsed
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,40 @@
1
+ require 'omniauth-oauth2'
2
+
3
+ module OmniAuth
4
+ module Strategies
5
+ class GalvanizeStage < OmniAuth::Strategies::OAuth2
6
+ option :name, 'galvanize_stage'
7
+
8
+ option :client_options, {
9
+ :site => 'https://muslin.galvanize.com/',
10
+ :authorize_url => '/accounts/authorize',
11
+ :token_url => '/accounts/token'
12
+ }
13
+
14
+ uid{ raw_info['results'][0]['id'] }
15
+
16
+ info do
17
+ {
18
+ :email => raw_info['results'][0]['email'],
19
+ :name => raw_info['results'][0]['name'],
20
+ :first_name => raw_info['results'][0]['first_name'],
21
+ :last_name => raw_info['results'][0]['last_name'],
22
+ :galvanize_id => raw_info['results'][0]['id'],
23
+ :about => raw_info['results'][0]['about'],
24
+ :photo => raw_info['results'][0]['photo']
25
+
26
+ }
27
+ end
28
+
29
+ extra do
30
+ {
31
+ 'raw_info' => raw_info
32
+ }
33
+ end
34
+
35
+ def raw_info
36
+ @raw_info ||= access_token.get('/api/v2/me').parsed
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,23 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'omniauth-galvanize/version'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.add_dependency 'omniauth', '~> 1.2'
7
+ gem.add_dependency 'multi_json', '~> 1.2'
8
+ gem.add_dependency 'omniauth-oauth2', '~> 1.3'
9
+
10
+ gem.authors = ['Chris Cunningham']
11
+ gem.email = ['chris.cunningham@galvanize.com']
12
+ gem.description = %q{Galvanize adapter for OmniAuth.}
13
+ gem.summary = gem.description
14
+ gem.homepage = 'https://github.com/irishkurisu'
15
+ gem.license = 'MIT'
16
+
17
+ gem.executables = `git ls-files -- bin/*`.split("\n").collect { |f| File.basename(f) }
18
+ gem.files = `git ls-files`.split("\n")
19
+ gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ gem.name = 'omniauth-galvanize'
21
+ gem.require_paths = ['lib']
22
+ gem.version = OmniAuth::Galvanize::VERSION
23
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: omniauth-galvanize
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Chris Cunningham
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-09-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: omniauth
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: multi_json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: omniauth-oauth2
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ description: Galvanize adapter for OmniAuth.
56
+ email:
57
+ - chris.cunningham@galvanize.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".idea/.generators"
64
+ - ".idea/.name"
65
+ - ".idea/.rakeTasks"
66
+ - ".idea/misc.xml"
67
+ - ".idea/modules.xml"
68
+ - ".idea/vcs.xml"
69
+ - Gemfile
70
+ - Gemfile.lock
71
+ - README.rdoc
72
+ - Rakefile
73
+ - config.ru
74
+ - lib/omniauth-galvanize.rb
75
+ - lib/omniauth-galvanize/version.rb
76
+ - lib/omniauth/strategies/galvanize.rb
77
+ - lib/omniauth/strategies/galvanize_local.rb
78
+ - lib/omniauth/strategies/galvanize_stage.rb
79
+ - omniauth-galvanize.gemspec
80
+ homepage: https://github.com/irishkurisu
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubyforge_project:
100
+ rubygems_version: 2.4.6
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Galvanize adapter for OmniAuth.
104
+ test_files: []