user_mgmt 0.0.62 → 0.0.511
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -8
- data/Gemfile +2 -12
- data/README.md +2 -10
- data/Rakefile +0 -35
- data/app/controllers/user_mgmt_controller.rb +4 -0
- data/app/views/user_mgmt/registrations/_user_form.html.haml +6 -3
- data/app/views/user_mgmt/registrations/new.html.haml +7 -18
- data/lib/generators/templates/README +2 -18
- data/lib/generators/templates/user_mgmt.rb +1 -28
- data/lib/generators/user_mgmt/install_generator.rb +0 -6
- data/lib/user_mgmt/configurator.rb +8 -0
- data/lib/user_mgmt/engine.rb +5 -28
- data/lib/user_mgmt/version.rb +1 -1
- data/lib/user_mgmt.rb +13 -8
- data/user_mgmt.gemspec +24 -40
- metadata +19 -298
- data/Gemfile.lock +0 -171
- data/MIT-LICENSE +0 -20
- data/app/assets/images/user_mgmt/.keep +0 -0
- data/app/assets/javascripts/user_mgmt/application.js +0 -13
- data/app/assets/javascripts/user_mgmt/registrations.js +0 -2
- data/app/assets/javascripts/user_mgmt/sessions.js +0 -2
- data/app/assets/stylesheets/user_mgmt/application.css.scss +0 -14
- data/app/assets/stylesheets/user_mgmt/registrations.css +0 -34
- data/app/assets/stylesheets/user_mgmt/sessions.css +0 -4
- data/app/controllers/user_mgmt/application_controller.rb +0 -101
- data/app/controllers/user_mgmt/registrations_controller.rb +0 -32
- data/app/controllers/user_mgmt/sessions_controller.rb +0 -81
- data/app/helpers/user_mgmt/application_helper.rb +0 -9
- data/app/helpers/user_mgmt/registrations_helper.rb +0 -4
- data/app/helpers/user_mgmt/sessions_helper.rb +0 -4
- data/app/models/user_mgmt/user.rb +0 -15
- data/app/views/layouts/user_mgmt/application.html.haml +0 -17
- data/app/views/user_mgmt/registrations/edit.html.haml +0 -5
- data/app/views/user_mgmt/sessions/new.html.haml +0 -30
- data/app/views/user_mgmt/sessions/oauth_email.html.haml +0 -11
- data/bin/rails +0 -8
- data/config/routes.rb +0 -16
- data/lib/tasks/user_mgmt_tasks.rake +0 -4
- data/test/controllers/user_mgmt/registrations_controller_test.rb +0 -16
- data/test/controllers/user_mgmt/sessions_controller_test.rb +0 -21
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/Rakefile +0 -6
- data/test/dummy/app/assets/images/.keep +0 -0
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/assets/javascripts/simulate.js +0 -2
- data/test/dummy/app/assets/stylesheets/application.css +0 -13
- data/test/dummy/app/assets/stylesheets/simulate.css +0 -4
- data/test/dummy/app/controllers/application_controller.rb +0 -8
- data/test/dummy/app/controllers/concerns/.keep +0 -0
- data/test/dummy/app/controllers/simulate_controller.rb +0 -5
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/helpers/simulate_helper.rb +0 -2
- data/test/dummy/app/mailers/.keep +0 -0
- data/test/dummy/app/models/.keep +0 -0
- data/test/dummy/app/models/concerns/.keep +0 -0
- data/test/dummy/app/views/layouts/application.html.haml +0 -17
- data/test/dummy/app/views/simulate/index.html.haml +0 -12
- data/test/dummy/bin/bundle +0 -3
- data/test/dummy/bin/rails +0 -4
- data/test/dummy/bin/rake +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/boot.rb +0 -5
- data/test/dummy/config/database.yml +0 -25
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -29
- data/test/dummy/config/environments/production.rb +0 -80
- data/test/dummy/config/environments/test.rb +0 -36
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/secret_token.rb +0 -12
- data/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/dummy/config/initializers/user_mgmt.rb +0 -37
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -23
- data/test/dummy/config/routes.rb +0 -7
- data/test/dummy/config.ru +0 -4
- data/test/dummy/lib/assets/.keep +0 -0
- data/test/dummy/log/.keep +0 -0
- data/test/dummy/public/404.html +0 -58
- data/test/dummy/public/422.html +0 -58
- data/test/dummy/public/500.html +0 -57
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/test/controllers/simulate_controller_test.rb +0 -9
- data/test/dummy/test/helpers/simulate_helper_test.rb +0 -4
- data/test/helpers/user_mgmt/registrations_helper_test.rb +0 -6
- data/test/helpers/user_mgmt/sessions_helper_test.rb +0 -6
- data/test/integration/navigation_test.rb +0 -10
- data/test/test_helper.rb +0 -15
- data/test/user_mgmt_test.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86334c3e262291f46da3acbb06ad1b9b278c3a5c
|
4
|
+
data.tar.gz: f92fc29e0754fc0174328f9caf7355685b2febe3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f33a5faacbdb533857873abeb981fbbb08f7c46875505afd0e73d739654cc8b6a7004714430ad1d201489e5c44e926e361a478965eda0e4ef409bf704cc41355
|
7
|
+
data.tar.gz: 2cf4886d53302f74c76a297b5aa39cf06fa448c9b45227d48b61a15d07d9b495bfb78693cc511042fe084a6afbb8cb1925f6a7971c78abecd4ac2db77d2a292f
|
data/.gitignore
CHANGED
@@ -1,13 +1,6 @@
|
|
1
|
-
.bundle/
|
2
|
-
log/*.log
|
3
|
-
pkg/
|
4
|
-
test/dummy/db/*.sqlite3
|
5
|
-
test/dummy/db/*.sqlite3-journal
|
6
|
-
test/dummy/log/*.log
|
7
|
-
test/dummy/tmp/
|
8
|
-
test/dummy/.sass-cache
|
9
1
|
*.gem
|
10
2
|
*.rbc
|
3
|
+
.bundle
|
11
4
|
.config
|
12
5
|
.yardoc
|
13
6
|
Gemfile.lock
|
@@ -16,6 +9,7 @@ _yardoc
|
|
16
9
|
coverage
|
17
10
|
doc/
|
18
11
|
lib/bundler/man
|
12
|
+
pkg
|
19
13
|
rdoc
|
20
14
|
spec/reports
|
21
15
|
test/tmp
|
data/Gemfile
CHANGED
@@ -1,14 +1,4 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
#
|
4
|
-
# Bundler will treat runtime dependencies like base dependencies, and
|
5
|
-
# development dependencies will be added by default to the :development group.
|
3
|
+
# Specify your gem's dependencies in user_mgmt.gemspec
|
6
4
|
gemspec
|
7
|
-
|
8
|
-
# Declare any dependencies that are still in development here instead of in
|
9
|
-
# your gemspec. These might include edge Rails or gems from your path or
|
10
|
-
# Git. Remember to move these dependencies to your gemspec before releasing
|
11
|
-
# your gem to rubygems.org.
|
12
|
-
|
13
|
-
# To use debugger
|
14
|
-
# gem 'debugger'
|
data/README.md
CHANGED
@@ -16,19 +16,11 @@ Then you have to run the generator:
|
|
16
16
|
|
17
17
|
rails generate user_mgmt:install
|
18
18
|
|
19
|
-
This generator will install an initializer which describes all the gem's configuration options and you must take a look at it.
|
19
|
+
This generator will install an initializer which describes all the gem's configuration options and you must take a look at it.
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
In order to use the gem's views, you have to refer to them by:
|
26
|
-
|
27
|
-
user_mgmt.<route path>
|
28
|
-
|
29
|
-
Which can be "log_in_path", "sign_up_path" and "log_out_path" (more to be added in the future), e.g:
|
30
|
-
|
31
|
-
user_mgmt.log_in_path
|
23
|
+
TODO: Write usage instructions here
|
32
24
|
|
33
25
|
## Contributing
|
34
26
|
|
data/Rakefile
CHANGED
@@ -1,38 +1,3 @@
|
|
1
|
-
# begin
|
2
|
-
# require 'bundler/setup'
|
3
|
-
# rescue LoadError
|
4
|
-
# puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
# end
|
6
|
-
|
7
|
-
# require 'rdoc/task'
|
8
|
-
|
9
|
-
# RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
# rdoc.rdoc_dir = 'rdoc'
|
11
|
-
# rdoc.title = 'UserMgmt'
|
12
|
-
# rdoc.options << '--line-numbers'
|
13
|
-
# rdoc.rdoc_files.include('README.rdoc')
|
14
|
-
# rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
# end
|
16
|
-
|
17
|
-
# APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
-
# load 'rails/tasks/engine.rake'
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
# Bundler::GemHelper.install_tasks
|
23
|
-
|
24
|
-
# require 'rake/testtask'
|
25
|
-
|
26
|
-
# Rake::TestTask.new(:test) do |t|
|
27
|
-
# t.libs << 'lib'
|
28
|
-
# t.libs << 'test'
|
29
|
-
# t.pattern = 'test/**/*_test.rb'
|
30
|
-
# t.verbose = false
|
31
|
-
# end
|
32
|
-
|
33
|
-
|
34
|
-
# task default: :test
|
35
|
-
|
36
1
|
#explained at http://railscasts.com/episodes/301-extracting-a-ruby-gem?view=asciicast
|
37
2
|
require "bundler/gem_tasks"
|
38
3
|
require 'rspec/core/rake_task'
|
@@ -6,10 +6,13 @@
|
|
6
6
|
/ %li= error
|
7
7
|
|
8
8
|
%div
|
9
|
-
=
|
9
|
+
= label :user, :email, 'Email'
|
10
|
+
= text_field :user, 'Email'
|
10
11
|
|
11
12
|
%div
|
12
|
-
=
|
13
|
+
= label :user, :password, 'Password'
|
14
|
+
= text_field :user, 'Password'
|
13
15
|
|
14
16
|
%div
|
15
|
-
=
|
17
|
+
= label :user, :password_confirmation, 'Password Confirmation'
|
18
|
+
= text_field :user, 'Password Confirmation'
|
@@ -1,18 +1,7 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
= link_to "Log in with Facebook", "auth/facebook"
|
9
|
-
%li
|
10
|
-
= link_to "Log in with Twitter", "auth/twitter"
|
11
|
-
%li
|
12
|
-
= link_to "Log in with Outlook", "auth/windowslive"
|
13
|
-
%li
|
14
|
-
= link_to "Log in with LinkedIn", "auth/linkedin"
|
15
|
-
%li
|
16
|
-
= link_to "Log in with Yahoo", "auth/yahoo"
|
17
|
-
%li
|
18
|
-
= link_to "Log in with GMail", "auth/google_oauth2"
|
1
|
+
%h2 Sign up
|
2
|
+
/ = form_tag @@external_database_URI, :method => :post do
|
3
|
+
/ = render :partial => 'user_form'
|
4
|
+
/ = submit_tag 'submit'
|
5
|
+
|
6
|
+
%div po
|
7
|
+
/a{}
|
@@ -3,24 +3,8 @@
|
|
3
3
|
Some setup you must do manually if you haven't yet:
|
4
4
|
|
5
5
|
1. Ensure you have defined your external database URI, in
|
6
|
-
config/initializers/user_mgmt.rb
|
7
|
-
For example:
|
6
|
+
config/initializers/user_mgmt.rb:
|
8
7
|
|
9
|
-
config.external_database_URI = "
|
10
|
-
|
11
|
-
2. Ensure you have defined root_url to *something* in your config/routes.rb.
|
12
|
-
For example:
|
13
|
-
|
14
|
-
root :to => "home#index"
|
15
|
-
|
16
|
-
3. Ensure you have flash messages in app/views/layouts/application.html.haml.
|
17
|
-
For example:
|
18
|
-
|
19
|
-
%body
|
20
|
-
#main
|
21
|
-
- if flash[:notice]
|
22
|
-
#notice.message= flash[:notice]
|
23
|
-
- elsif flash[:warning]
|
24
|
-
#warning.message= flash[:warning]
|
8
|
+
config.external_database_URI = "yourexternaldatabaseuri.com"
|
25
9
|
|
26
10
|
===============================================================================
|
@@ -4,33 +4,6 @@ UserMgmt.setup do |config|
|
|
4
4
|
|
5
5
|
# Ensure you defined default external database URI, otherwise
|
6
6
|
# authentication won't be possible to happen
|
7
|
-
config.external_database_URI = "
|
7
|
+
config.external_database_URI = "yourexternaldatabaseuri.com"
|
8
8
|
|
9
9
|
end
|
10
|
-
|
11
|
-
# Edit your strategy keys:
|
12
|
-
|
13
|
-
ENV['TWITTER_KEY'] = ""
|
14
|
-
ENV['TWITTER_SECRET'] = ""
|
15
|
-
|
16
|
-
ENV['FACEBOOK_KEY'] = ""
|
17
|
-
ENV['FACEBOOK_SECRET'] = ""
|
18
|
-
|
19
|
-
ENV['LINKEDIN_KEY'] = ""
|
20
|
-
ENV['LINKEDIN_SECRET'] = ""
|
21
|
-
|
22
|
-
ENV['WINDOWSLIVE_KEY'] = ""
|
23
|
-
ENV['WINDOWSLIVE_SECRET'] = ""
|
24
|
-
|
25
|
-
ENV['YAHOO_KEY'] = ""
|
26
|
-
ENV['YAHOO_SECRET'] = ""
|
27
|
-
|
28
|
-
ENV['GOOGLE_KEY'] = ""
|
29
|
-
ENV['GOOGLE_SECRET'] = ""
|
30
|
-
|
31
|
-
# The code below include the view helpers from user_mgmt in the main app.
|
32
|
-
# NOTE: Do not change this code.
|
33
|
-
ActiveSupport.on_load :action_controller do
|
34
|
-
helper UserMgmt::ApplicationHelper
|
35
|
-
end
|
36
|
-
|
@@ -14,15 +14,9 @@ module UserMgmt
|
|
14
14
|
# copy_file "../../../config/locales/en.yml", "config/locales/user_mgmt.en.yml"
|
15
15
|
# end
|
16
16
|
|
17
|
-
def add_user_mgmt_routes
|
18
|
-
user_mgmt_route = "mount UserMgmt::Engine => '/user'"
|
19
|
-
route user_mgmt_route
|
20
|
-
end
|
21
|
-
|
22
17
|
def show_readme
|
23
18
|
readme "README" if behavior == :invoke
|
24
19
|
end
|
25
|
-
|
26
20
|
end
|
27
21
|
end
|
28
22
|
end
|
data/lib/user_mgmt/engine.rb
CHANGED
@@ -1,28 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
require 'omniauth-twitter'
|
7
|
-
require 'omniauth-linkedin'
|
8
|
-
require 'omniauth-windowslive'
|
9
|
-
require 'omniauth-yahoo'
|
10
|
-
require "omniauth-google-oauth2"
|
11
|
-
|
12
|
-
|
13
|
-
class Engine < ::Rails::Engine
|
14
|
-
isolate_namespace UserMgmt
|
15
|
-
|
16
|
-
#http://stackoverflow.com/questions/8304225/omniauth-route-issue-related-to-ruby-version
|
17
|
-
middleware.use OmniAuth::Builder do
|
18
|
-
# provider :developer unless Rails.env.production?
|
19
|
-
provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
|
20
|
-
provider :facebook, ENV['FACEBOOK_KEY'], ENV['FACEBOOK_SECRET']
|
21
|
-
provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET'], :scope => 'r_fullprofile r_emailaddress r_network'
|
22
|
-
provider :windowslive, ENV['WINDOWSLIVE_KEY'], ENV['WINDOWSLIVE_SECRET'], :scope => 'wl.basic'
|
23
|
-
provider :yahoo, ENV['YAHOO_KEY'], ENV['YAHOO_SECRET']
|
24
|
-
provider :google_oauth2, ENV["GOOGLE_KEY"], ENV["GOOGLE_SECRET"]
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
1
|
+
require 'rails'
|
2
|
+
module UserMgmt
|
3
|
+
class Engine < Rails::Engine
|
4
|
+
end
|
5
|
+
end
|
data/lib/user_mgmt/version.rb
CHANGED
data/lib/user_mgmt.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require "user_mgmt/engine"
|
2
1
|
require "user_mgmt/version"
|
3
2
|
require "rails"
|
4
3
|
|
@@ -6,13 +5,19 @@ module UserMgmt
|
|
6
5
|
|
7
6
|
# URI of the external database where authentication happens and gets its data stored at
|
8
7
|
mattr_accessor :external_database_URI
|
9
|
-
@@external_database_URI =
|
8
|
+
@@external_database_URI = nil
|
10
9
|
|
10
|
+
# The parent controller all UserMgmt controllers inherits from.
|
11
|
+
# Defaults to ApplicationController. This should be set early
|
12
|
+
# in the initialization process and should be set to a string.
|
13
|
+
mattr_accessor :parent_controller
|
14
|
+
@@parent_controller = "ApplicationController"
|
11
15
|
|
12
|
-
# Default way to setup UserMgmt. Run rails generate user_mgmt:install to create
|
13
|
-
# a fresh initializer with all configuration values.
|
14
|
-
def self.setup
|
15
|
-
yield self
|
16
|
-
end
|
17
16
|
|
18
|
-
|
17
|
+
# Default way to setup UserMgmt. Run rails generate user_mgmt:install to create
|
18
|
+
# a fresh initializer with all configuration values.
|
19
|
+
def self.setup
|
20
|
+
yield self
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/user_mgmt.gemspec
CHANGED
@@ -1,44 +1,28 @@
|
|
1
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'user_mgmt/version'
|
2
5
|
|
3
|
-
|
4
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "user_mgmt"
|
8
|
+
spec.version = UserMgmt::VERSION
|
9
|
+
spec.authors = ["Danilo Faria, Fernando Gorodscy, Josh Leslie"]
|
10
|
+
spec.email = ["su_critic@hotmail.com"]
|
11
|
+
spec.description = %q{Includes functionality for site-specific registration and third-party authentication strategies such as social networks (Facebook, Twitter and Linkedin) and freemail providers (Yahoo, Windows Live and Gmail) with support for external database authentication.}
|
12
|
+
spec.summary = %q{Various authentication options in an outside database.}
|
13
|
+
spec.homepage = "https://github.com/Methos2013/user_mgmt_gem"
|
14
|
+
spec.license = "MIT"
|
15
|
+
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
5
19
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
s.email = ["su_critic@hotmail.com"]
|
12
|
-
s.description = %q{Includes functionality for site-specific registration and third-party authentication strategies such as social networks (Facebook, Twitter and Linkedin) and freemail providers (Yahoo, Windows Live and Gmail) with support for external database authentication.}
|
13
|
-
s.summary = %q{Various authentication options in an outside database.}
|
14
|
-
s.homepage = "https://github.com/Methos2013/user_mgmt_gem"
|
15
|
-
s.license = "MIT"
|
16
|
-
|
17
|
-
s.files = `git ls-files`.split($/) - `git ls-files -d`.split($/)
|
18
|
-
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
-
s.test_files = s.files.grep(%r{^(test|s|features)/})
|
20
|
-
s.require_paths = ["lib"]
|
21
|
-
|
22
|
-
s.add_development_dependency "sqlite3"
|
23
|
-
|
24
|
-
s.add_development_dependency "rspec"
|
25
|
-
s.add_development_dependency "genspec"
|
26
|
-
s.add_development_dependency "rake"
|
27
|
-
s.add_development_dependency "bundler", "~> 1.3"
|
28
|
-
|
29
|
-
s.add_runtime_dependency "rails"
|
30
|
-
s.add_development_dependency "haml"
|
31
|
-
# For some reason that I coudn't figure out, I get an error if I dont add 'haml' as a development dependency as well as a runtime dependecy.
|
32
|
-
s.add_runtime_dependency "haml"
|
33
|
-
s.add_runtime_dependency "haml-rails"
|
34
|
-
s.add_runtime_dependency 'sass-rails'#, '~> 3.2'
|
35
|
-
s.add_runtime_dependency 'bootstrap-sass'#, '~> 2.3.2.1'
|
36
|
-
s.add_runtime_dependency 'omniauth'
|
37
|
-
s.add_runtime_dependency 'omniauth-facebook'
|
38
|
-
s.add_runtime_dependency 'omniauth-twitter'
|
39
|
-
s.add_runtime_dependency 'omniauth-linkedin'
|
40
|
-
s.add_runtime_dependency 'omniauth-windowslive'
|
41
|
-
s.add_runtime_dependency 'omniauth-yahoo'
|
42
|
-
s.add_runtime_dependency "omniauth-google-oauth2"
|
20
|
+
spec.add_development_dependency "rspec"
|
21
|
+
spec.add_development_dependency "genspec"
|
22
|
+
spec.add_development_dependency "rails"
|
23
|
+
spec.add_development_dependency "warden"
|
24
|
+
spec.add_development_dependency "haml"
|
43
25
|
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
27
|
+
spec.add_development_dependency "rake"
|
44
28
|
end
|