omniauth-galvanize 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/omniauth/strategies/galvanize_developer.rb +40 -0
- data/lib/omniauth-galvanize/version.rb +1 -1
- data/lib/omniauth-galvanize.rb +1 -0
- metadata +3 -8
- data/.idea/.generators +0 -8
- data/.idea/.name +0 -1
- data/.idea/.rakeTasks +0 -7
- data/.idea/misc.xml +0 -14
- data/.idea/modules.xml +0 -9
- data/.idea/vcs.xml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ebaae03d4e5690ca7d68078056165fc72dbb803
|
4
|
+
data.tar.gz: a7975bc398824f80bbdd237af8f2afca59facb30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ce2d7f0b8390bffed67e37f1b80c552dc8e0fd3b3a1ce0f86288329107c51cf130fef73f093b1d31a4d2310b59d29956b4e10cd4221290496cf25f89c7ade17
|
7
|
+
data.tar.gz: b49e929deceb65475e231db0fd3c8cf69f2de625634ce20bc601de755301da744d6c2b590b0d5437cf224784ac152044b2680a738284db9fac8a4387cc282a80
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
omniauth-galvanize (0.0.
|
4
|
+
omniauth-galvanize (0.0.4)
|
5
5
|
multi_json (~> 1.2)
|
6
6
|
omniauth (~> 1.2)
|
7
7
|
omniauth-oauth2 (~> 1.3)
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
arel (6.0.3)
|
48
48
|
builder (3.2.2)
|
49
49
|
erubis (2.7.0)
|
50
|
-
faraday (0.9.
|
50
|
+
faraday (0.9.2)
|
51
51
|
multipart-post (>= 1.2, < 3)
|
52
52
|
globalid (0.3.6)
|
53
53
|
activesupport (>= 4.1.0)
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'omniauth-oauth2'
|
2
|
+
|
3
|
+
module OmniAuth
|
4
|
+
module Strategies
|
5
|
+
class GalvanizeDeveloper
|
6
|
+
include OmniAuth::Strategy
|
7
|
+
|
8
|
+
option :name, 'galvanize_developer'
|
9
|
+
option :fields, [:first_name, :last_name, :email, :role, :galvanize_id]
|
10
|
+
option :role_fields, [:role]
|
11
|
+
option :uid_field, :galvanize_id
|
12
|
+
|
13
|
+
def request_phase
|
14
|
+
form = OmniAuth::Form.new(:title => 'User Info', :url => callback_path)
|
15
|
+
options.fields.each do |field|
|
16
|
+
form.text_field field.to_s.capitalize.gsub('_', ' '), field.to_s
|
17
|
+
end
|
18
|
+
form.button 'Sign In'
|
19
|
+
form.to_response
|
20
|
+
end
|
21
|
+
|
22
|
+
uid do
|
23
|
+
request.params[options.uid_field.to_s]
|
24
|
+
end
|
25
|
+
|
26
|
+
info do
|
27
|
+
roles_array = []
|
28
|
+
options.fields.inject({}) do |hash, field|
|
29
|
+
if options.role_fields.include?(field)
|
30
|
+
roles_array << {name: request.params[field.to_s], description: "The description for #{field.to_s}"} unless request.params[field.to_s].blank?
|
31
|
+
else
|
32
|
+
hash[field] = request.params[field.to_s]
|
33
|
+
end
|
34
|
+
hash[:roles] = roles_array
|
35
|
+
hash
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/omniauth-galvanize.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-galvanize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Cunningham
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth
|
@@ -60,12 +60,6 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
-
- ".idea/.generators"
|
64
|
-
- ".idea/.name"
|
65
|
-
- ".idea/.rakeTasks"
|
66
|
-
- ".idea/misc.xml"
|
67
|
-
- ".idea/modules.xml"
|
68
|
-
- ".idea/vcs.xml"
|
69
63
|
- Gemfile
|
70
64
|
- Gemfile.lock
|
71
65
|
- README.rdoc
|
@@ -74,6 +68,7 @@ files:
|
|
74
68
|
- lib/omniauth-galvanize.rb
|
75
69
|
- lib/omniauth-galvanize/version.rb
|
76
70
|
- lib/omniauth/strategies/galvanize.rb
|
71
|
+
- lib/omniauth/strategies/galvanize_developer.rb
|
77
72
|
- lib/omniauth/strategies/galvanize_local.rb
|
78
73
|
- lib/omniauth/strategies/galvanize_stage.rb
|
79
74
|
- omniauth-galvanize.gemspec
|
data/.idea/.generators
DELETED
@@ -1,8 +0,0 @@
|
|
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
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
omniauth-galv
|
data/.idea/.rakeTasks
DELETED
@@ -1,7 +0,0 @@
|
|
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
DELETED
@@ -1,14 +0,0 @@
|
|
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
DELETED
@@ -1,9 +0,0 @@
|
|
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
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/omniauth-galvanize.iml" filepath="$PROJECT_DIR$/.idea/omniauth-galvanize.iml" />
|
7
|
-
</modules>
|
8
|
-
</component>
|
9
|
-
</project>
|