auth_eng 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.
- data/MIT-LICENSE +20 -0
- data/README.md +12 -0
- data/Rakefile +40 -0
- data/app/assets/javascripts/auth_eng/application.js +15 -0
- data/app/assets/javascripts/auth_eng/users.js +2 -0
- data/app/assets/stylesheets/auth_eng/application.css +13 -0
- data/app/assets/stylesheets/auth_eng/users.css +4 -0
- data/app/controllers/auth_eng/application_controller.rb +4 -0
- data/app/controllers/auth_eng/confirmations_controller.rb +69 -0
- data/app/controllers/auth_eng/users_controller.rb +77 -0
- data/app/helpers/auth_eng/application_helper.rb +4 -0
- data/app/helpers/auth_eng/users_helper.rb +4 -0
- data/app/models/auth_eng/user.rb +45 -0
- data/app/views/auth_eng/confirmations/show.html.haml +12 -0
- data/app/views/auth_eng/devise/confirmations/new.html.erb +12 -0
- data/app/views/auth_eng/devise/confirmations/show.html.haml +12 -0
- data/app/views/auth_eng/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/auth_eng/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/auth_eng/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/auth_eng/devise/passwords/edit.html.erb +16 -0
- data/app/views/auth_eng/devise/passwords/new.html.erb +12 -0
- data/app/views/auth_eng/devise/registrations/edit.html.erb +25 -0
- data/app/views/auth_eng/devise/registrations/new.html.erb +18 -0
- data/app/views/auth_eng/devise/sessions/new.html.erb +16 -0
- data/app/views/auth_eng/devise/shared/_links.erb +25 -0
- data/app/views/auth_eng/devise/unlocks/new.html.erb +12 -0
- data/app/views/auth_eng/users/_form.html.erb +25 -0
- data/app/views/auth_eng/users/edit.html.erb +6 -0
- data/app/views/auth_eng/users/index.html.erb +29 -0
- data/app/views/auth_eng/users/new.html.erb +5 -0
- data/app/views/auth_eng/users/show.html.erb +25 -0
- data/app/views/layouts/auth_eng/application.html.erb +15 -0
- data/config/initializers/devise.rb +232 -0
- data/config/locales/devise.en.yml +58 -0
- data/config/routes.rb +21 -0
- data/db/migrate/20120921104821_devise_create_auth_eng_users.rb +49 -0
- data/db/migrate/20120924150140_create_delayed_jobs.rb +22 -0
- data/lib/auth_eng.rb +4 -0
- data/lib/auth_eng/engine.rb +5 -0
- data/lib/auth_eng/version.rb +3 -0
- data/lib/tasks/auth_eng_tasks.rake +4 -0
- data/test/auth_eng_test.rb +7 -0
- data/test/fixtures/auth_eng/users.yml +11 -0
- data/test/functional/auth_eng/users_controller_test.rb +41 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/auth_eng/user_test.rb +9 -0
- data/test/unit/helpers/auth_eng/users_helper_test.rb +6 -0
- metadata +132 -0
data/config/routes.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
AuthEng::Engine.routes.draw do
|
2
|
+
|
3
|
+
devise_for :users, :class_name => "AuthEng::User",
|
4
|
+
:controllers => { :sessions => 'devise/sessions',
|
5
|
+
:registrations => 'devise/registrations',
|
6
|
+
:passwords => 'devise/passwords',
|
7
|
+
:confirmations => 'auth_eng/confirmations'},
|
8
|
+
:path_names => { :sign_out => 'logout',
|
9
|
+
:sign_in => 'login',
|
10
|
+
:sign_up => 'register' }
|
11
|
+
|
12
|
+
devise_scope :user do
|
13
|
+
match '/user/confirmation' => 'confirmations#update', :via => :put, :as => :update_user_confirmation
|
14
|
+
end
|
15
|
+
|
16
|
+
resources :users
|
17
|
+
|
18
|
+
|
19
|
+
root :to => "users#index"
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
class DeviseCreateAuthEngUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table(:auth_eng_users) do |t|
|
4
|
+
|
5
|
+
t.string :name
|
6
|
+
|
7
|
+
## Database authenticatable
|
8
|
+
t.string :email, :null => false, :default => ""
|
9
|
+
t.string :encrypted_password, :default => ""
|
10
|
+
|
11
|
+
## Recoverable
|
12
|
+
t.string :reset_password_token
|
13
|
+
t.datetime :reset_password_sent_at
|
14
|
+
|
15
|
+
## Rememberable
|
16
|
+
t.datetime :remember_created_at
|
17
|
+
|
18
|
+
## Trackable
|
19
|
+
t.integer :sign_in_count, :default => 0
|
20
|
+
t.datetime :current_sign_in_at
|
21
|
+
t.datetime :last_sign_in_at
|
22
|
+
t.string :current_sign_in_ip
|
23
|
+
t.string :last_sign_in_ip
|
24
|
+
|
25
|
+
## Confirmable
|
26
|
+
t.string :confirmation_token
|
27
|
+
t.datetime :confirmed_at
|
28
|
+
t.datetime :confirmation_sent_at
|
29
|
+
# t.string :unconfirmed_email # Only if using reconfirmable
|
30
|
+
|
31
|
+
## Lockable
|
32
|
+
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
33
|
+
# t.string :unlock_token # Only if unlock strategy is :email or :both
|
34
|
+
# t.datetime :locked_at
|
35
|
+
|
36
|
+
## Token authenticatable
|
37
|
+
# t.string :authentication_token
|
38
|
+
|
39
|
+
t.datetime :deleted_at
|
40
|
+
t.timestamps
|
41
|
+
end
|
42
|
+
|
43
|
+
add_index :auth_eng_users, :email, :unique => true
|
44
|
+
add_index :auth_eng_users, :reset_password_token, :unique => true
|
45
|
+
add_index :auth_eng_users, :confirmation_token, :unique => true
|
46
|
+
# add_index :auth_eng_users, :unlock_token, :unique => true
|
47
|
+
# add_index :auth_eng_users, :authentication_token, :unique => true
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateDelayedJobs < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :delayed_jobs, :force => true do |table|
|
4
|
+
table.integer :priority, :default => 0 # Allows some jobs to jump to the front of the queue
|
5
|
+
table.integer :attempts, :default => 0 # Provides for retries, but still fail eventually.
|
6
|
+
table.text :handler # YAML-encoded string of the object that will do work
|
7
|
+
table.text :last_error # reason for last failure (See Note below)
|
8
|
+
table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
|
9
|
+
table.datetime :locked_at # Set when a client is working on this object
|
10
|
+
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
|
11
|
+
table.string :locked_by # Who is working on this object (if locked)
|
12
|
+
table.string :queue # The name of the queue this job is in
|
13
|
+
table.timestamps
|
14
|
+
end
|
15
|
+
|
16
|
+
add_index :delayed_jobs, [:priority, :run_at], :name => 'delayed_jobs_priority'
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.down
|
20
|
+
drop_table :delayed_jobs
|
21
|
+
end
|
22
|
+
end
|
data/lib/auth_eng.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
|
2
|
+
|
3
|
+
# This model initially had no columns defined. If you add columns to the
|
4
|
+
# model remove the '{}' from the fixture names and add the columns immediately
|
5
|
+
# below each fixture, per the syntax in the comments below
|
6
|
+
#
|
7
|
+
one: {}
|
8
|
+
# column: value
|
9
|
+
#
|
10
|
+
two: {}
|
11
|
+
# column: value
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module AuthEng
|
4
|
+
class UsersControllerTest < ActionController::TestCase
|
5
|
+
test "should get index" do
|
6
|
+
get :index
|
7
|
+
assert_response :success
|
8
|
+
end
|
9
|
+
|
10
|
+
test "should get new" do
|
11
|
+
get :new
|
12
|
+
assert_response :success
|
13
|
+
end
|
14
|
+
|
15
|
+
test "should get create" do
|
16
|
+
get :create
|
17
|
+
assert_response :success
|
18
|
+
end
|
19
|
+
|
20
|
+
test "should get edit" do
|
21
|
+
get :edit
|
22
|
+
assert_response :success
|
23
|
+
end
|
24
|
+
|
25
|
+
test "should get update" do
|
26
|
+
get :update
|
27
|
+
assert_response :success
|
28
|
+
end
|
29
|
+
|
30
|
+
test "should get show" do
|
31
|
+
get :show
|
32
|
+
assert_response :success
|
33
|
+
end
|
34
|
+
|
35
|
+
test "should get destroy" do
|
36
|
+
get :destroy
|
37
|
+
assert_response :success
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
# Load fixtures from the engine
|
13
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
14
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: auth_eng
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Gustavo Lobo
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-24 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.2.8
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.2.8
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sqlite3
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
description: AuthEng is just Devise only with a different flow.
|
47
|
+
email:
|
48
|
+
- gustavolobo90@gmail.com
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- app/assets/javascripts/auth_eng/application.js
|
54
|
+
- app/assets/javascripts/auth_eng/users.js
|
55
|
+
- app/assets/stylesheets/auth_eng/application.css
|
56
|
+
- app/assets/stylesheets/auth_eng/users.css
|
57
|
+
- app/controllers/auth_eng/application_controller.rb
|
58
|
+
- app/controllers/auth_eng/confirmations_controller.rb
|
59
|
+
- app/controllers/auth_eng/users_controller.rb
|
60
|
+
- app/helpers/auth_eng/application_helper.rb
|
61
|
+
- app/helpers/auth_eng/users_helper.rb
|
62
|
+
- app/models/auth_eng/user.rb
|
63
|
+
- app/views/auth_eng/confirmations/show.html.haml
|
64
|
+
- app/views/auth_eng/devise/confirmations/new.html.erb
|
65
|
+
- app/views/auth_eng/devise/confirmations/show.html.haml
|
66
|
+
- app/views/auth_eng/devise/mailer/confirmation_instructions.html.erb
|
67
|
+
- app/views/auth_eng/devise/mailer/reset_password_instructions.html.erb
|
68
|
+
- app/views/auth_eng/devise/mailer/unlock_instructions.html.erb
|
69
|
+
- app/views/auth_eng/devise/passwords/edit.html.erb
|
70
|
+
- app/views/auth_eng/devise/passwords/new.html.erb
|
71
|
+
- app/views/auth_eng/devise/registrations/edit.html.erb
|
72
|
+
- app/views/auth_eng/devise/registrations/new.html.erb
|
73
|
+
- app/views/auth_eng/devise/sessions/new.html.erb
|
74
|
+
- app/views/auth_eng/devise/shared/_links.erb
|
75
|
+
- app/views/auth_eng/devise/unlocks/new.html.erb
|
76
|
+
- app/views/auth_eng/users/_form.html.erb
|
77
|
+
- app/views/auth_eng/users/edit.html.erb
|
78
|
+
- app/views/auth_eng/users/index.html.erb
|
79
|
+
- app/views/auth_eng/users/new.html.erb
|
80
|
+
- app/views/auth_eng/users/show.html.erb
|
81
|
+
- app/views/layouts/auth_eng/application.html.erb
|
82
|
+
- config/initializers/devise.rb
|
83
|
+
- config/locales/devise.en.yml
|
84
|
+
- config/routes.rb
|
85
|
+
- db/migrate/20120921104821_devise_create_auth_eng_users.rb
|
86
|
+
- db/migrate/20120924150140_create_delayed_jobs.rb
|
87
|
+
- lib/auth_eng/engine.rb
|
88
|
+
- lib/auth_eng/version.rb
|
89
|
+
- lib/auth_eng.rb
|
90
|
+
- lib/tasks/auth_eng_tasks.rake
|
91
|
+
- MIT-LICENSE
|
92
|
+
- Rakefile
|
93
|
+
- README.md
|
94
|
+
- test/auth_eng_test.rb
|
95
|
+
- test/fixtures/auth_eng/users.yml
|
96
|
+
- test/functional/auth_eng/users_controller_test.rb
|
97
|
+
- test/integration/navigation_test.rb
|
98
|
+
- test/test_helper.rb
|
99
|
+
- test/unit/auth_eng/user_test.rb
|
100
|
+
- test/unit/helpers/auth_eng/users_helper_test.rb
|
101
|
+
homepage: http://github.com/gustavolobo/AuthEng
|
102
|
+
licenses: []
|
103
|
+
post_install_message:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
106
|
+
- lib
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ! '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
requirements: []
|
120
|
+
rubyforge_project:
|
121
|
+
rubygems_version: 1.8.24
|
122
|
+
signing_key:
|
123
|
+
specification_version: 3
|
124
|
+
summary: Authentication Engine
|
125
|
+
test_files:
|
126
|
+
- test/auth_eng_test.rb
|
127
|
+
- test/fixtures/auth_eng/users.yml
|
128
|
+
- test/functional/auth_eng/users_controller_test.rb
|
129
|
+
- test/integration/navigation_test.rb
|
130
|
+
- test/test_helper.rb
|
131
|
+
- test/unit/auth_eng/user_test.rb
|
132
|
+
- test/unit/helpers/auth_eng/users_helper_test.rb
|