omniauth-galvanize 0.0.3 → 0.1.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7bb148767d929d973f2890d926d3e372e5a9070
4
- data.tar.gz: 7c878e50d2664dbd96ed045a22caa663e8f1f17a
3
+ metadata.gz: 9ebaae03d4e5690ca7d68078056165fc72dbb803
4
+ data.tar.gz: a7975bc398824f80bbdd237af8f2afca59facb30
5
5
  SHA512:
6
- metadata.gz: 0943b8976ade39faca486ae98c27b66c883519167b6f635daacf638a9144388019673e5295f1c3f0fc2e698003ad9d2cccb83782ff84c7c9b69e39b563979864
7
- data.tar.gz: 0a14883d4c04bf945c98681ce2c7f57af846b98da9385b9d2724fdc27653111eac54d6bff54af2029d0a10d1c29dc2de20d2e86face75c63e78dc112026f8de3
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.2)
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.1)
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
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Galvanize
3
- VERSION = "0.0.3"
3
+ VERSION = "0.1.0"
4
4
  end
5
5
  end
@@ -1,4 +1,5 @@
1
1
  require "omniauth-galvanize/version"
2
+ require 'omniauth/strategies/galvanize_developer'
2
3
  require 'omniauth/strategies/galvanize_local'
3
4
  require 'omniauth/strategies/galvanize_stage'
4
5
  require 'omniauth/strategies/galvanize'
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.3
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-12 00:00:00.000000000 Z
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>
data/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="" />
5
- </component>
6
- </project>