nyauth 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +1 -0
  4. data/Rakefile +26 -0
  5. data/app/assets/javascripts/nyauth/application.js +13 -0
  6. data/app/assets/stylesheets/nyauth/application.css +15 -0
  7. data/app/controllers/concerns/nyauth/session_concern.rb +71 -0
  8. data/app/controllers/nyauth/confirmation_requests_controller.rb +28 -0
  9. data/app/controllers/nyauth/confirmations_controller.rb +19 -0
  10. data/app/controllers/nyauth/new_password_requests_controller.rb +28 -0
  11. data/app/controllers/nyauth/new_passwords_controller.rb +26 -0
  12. data/app/controllers/nyauth/passwords_controller.rb +26 -0
  13. data/app/controllers/nyauth/registrations_controller.rb +26 -0
  14. data/app/controllers/nyauth/sessions_controller.rb +31 -0
  15. data/app/helpers/nyauth/application_helper.rb +4 -0
  16. data/app/mailers/nyauth/user_mailer.rb +15 -0
  17. data/app/models/concerns/nyauth/authenticatable.rb +18 -0
  18. data/app/models/concerns/nyauth/confirmable.rb +34 -0
  19. data/app/models/concerns/nyauth/new_password_ability.rb +35 -0
  20. data/app/models/concerns/nyauth/password_digest_ability.rb +40 -0
  21. data/app/responders/nyauth/app_responder.rb +6 -0
  22. data/app/responders/nyauth/confirmation_responder.rb +14 -0
  23. data/app/services/nyauth/confirmation_request_service.rb +15 -0
  24. data/app/services/nyauth/session_service.rb +21 -0
  25. data/app/views/layouts/nyauth/mailer.html.erb +1 -0
  26. data/app/views/layouts/nyauth/mailer.text.erb +1 -0
  27. data/app/views/nyauth/confirmation_requests/new.html.slim +5 -0
  28. data/app/views/nyauth/confirmations/edit.html.slim +5 -0
  29. data/app/views/nyauth/group_requests/edit.html.slim +0 -0
  30. data/app/views/nyauth/group_requests/new.html.slim +14 -0
  31. data/app/views/nyauth/groups/show.html.slim +0 -0
  32. data/app/views/nyauth/layouts/application.html.slim +15 -0
  33. data/app/views/nyauth/layouts/mailer.html.slim +1 -0
  34. data/app/views/nyauth/layouts/mailer.text.slim +1 -0
  35. data/app/views/nyauth/new_password_requests/new.html.slim +5 -0
  36. data/app/views/nyauth/new_passwords/edit.html.slim +11 -0
  37. data/app/views/nyauth/passwords/edit.html.slim +11 -0
  38. data/app/views/nyauth/registrations/new.html.slim +12 -0
  39. data/app/views/nyauth/sessions/new.html.slim +15 -0
  40. data/app/views/nyauth/user_mailer/request_confirmation.html.slim +2 -0
  41. data/app/views/nyauth/user_mailer/request_confirmation.text.erb +3 -0
  42. data/app/views/nyauth/user_mailer/request_new_password.html.slim +2 -0
  43. data/app/views/nyauth/user_mailer/request_new_password.text.erb +3 -0
  44. data/config/application.yml +1 -0
  45. data/config/locales/en.yml +46 -0
  46. data/config/routes.rb +10 -0
  47. data/lib/nyauth/encryptor.rb +26 -0
  48. data/lib/nyauth/engine.rb +21 -0
  49. data/lib/nyauth/version.rb +3 -0
  50. data/lib/nyauth.rb +5 -0
  51. data/lib/tasks/nyauth_tasks.rake +4 -0
  52. data/spec/controllers/application_controller_spec.rb +5 -0
  53. data/spec/dummy/README.rdoc +28 -0
  54. data/spec/dummy/Rakefile +6 -0
  55. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  56. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  57. data/spec/dummy/app/controllers/application_controller.rb +7 -0
  58. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  59. data/spec/dummy/app/models/user.rb +5 -0
  60. data/spec/dummy/app/views/layouts/application.html.erb +20 -0
  61. data/spec/dummy/bin/bundle +3 -0
  62. data/spec/dummy/bin/rails +4 -0
  63. data/spec/dummy/bin/rake +4 -0
  64. data/spec/dummy/bin/setup +29 -0
  65. data/spec/dummy/config/application.rb +32 -0
  66. data/spec/dummy/config/boot.rb +5 -0
  67. data/spec/dummy/config/database.yml +25 -0
  68. data/spec/dummy/config/environment.rb +5 -0
  69. data/spec/dummy/config/environments/development.rb +42 -0
  70. data/spec/dummy/config/environments/production.rb +79 -0
  71. data/spec/dummy/config/environments/test.rb +46 -0
  72. data/spec/dummy/config/initializers/assets.rb +11 -0
  73. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  74. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  75. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  76. data/spec/dummy/config/initializers/inflections.rb +16 -0
  77. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  78. data/spec/dummy/config/initializers/session_store.rb +3 -0
  79. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  80. data/spec/dummy/config/locales/en.yml +23 -0
  81. data/spec/dummy/config/routes.rb +3 -0
  82. data/spec/dummy/config/secrets.yml +22 -0
  83. data/spec/dummy/config.ru +4 -0
  84. data/spec/dummy/db/development.sqlite3 +0 -0
  85. data/spec/dummy/db/migrate/20150303135922_create_users.rb +18 -0
  86. data/spec/dummy/db/schema.rb +32 -0
  87. data/spec/dummy/db/test.sqlite3 +0 -0
  88. data/spec/dummy/log/development.log +1906 -0
  89. data/spec/dummy/log/test.log +6719 -0
  90. data/spec/dummy/public/404.html +67 -0
  91. data/spec/dummy/public/422.html +67 -0
  92. data/spec/dummy/public/500.html +66 -0
  93. data/spec/dummy/public/favicon.ico +0 -0
  94. data/spec/factories/users.rb +21 -0
  95. data/spec/featrues/nyauth/confirmation_requests_spec.rb +35 -0
  96. data/spec/featrues/nyauth/new_password_requests_spec.rb +43 -0
  97. data/spec/featrues/nyauth/passwords_spec.rb +27 -0
  98. data/spec/featrues/nyauth/registrations_spec.rb +24 -0
  99. data/spec/featrues/nyauth/sessions_spec.rb +36 -0
  100. data/spec/models/user_spec.rb +9 -0
  101. data/spec/rails_helper.rb +41 -0
  102. data/spec/spec_helper.rb +9 -0
  103. data/spec/support/controllers/nyauth/session_concern.rb +39 -0
  104. data/spec/support/macros/controller_macros.rb +3 -0
  105. data/spec/support/macros/feature_macros.rb +8 -0
  106. data/spec/support/models/nyauth/authenticatable.rb +36 -0
  107. data/spec/support/models/nyauth/confirmable.rb +27 -0
  108. data/spec/support/models/nyauth/new_password_ability.rb +13 -0
  109. data/spec/support/models/nyauth/password_digest_ability.rb +18 -0
  110. metadata +280 -0
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
10
+
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -0,0 +1,23 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ mount Nyauth::Engine => "/"
3
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 8a22167098dd38d399b57de449d2209af30e1983e4084893c03bd986505346a85d8e8e6541e8e7d6017932af86415c0e6c5fffd3b54b1ab5c177588852b62f44
15
+
16
+ test:
17
+ secret_key_base: 3f2b2cefdb77a3a977a563857dacb4eb7aa5c1948c66c29d33d80630f2e8a886e2932066f49dfb0c95a5ebe5376469421be5158b25b7ed35f6bb5bfe628153db
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -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
Binary file
@@ -0,0 +1,18 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.string :email, null: false
5
+ t.string :password_digest, null: false
6
+ t.string :password_salt, null: false
7
+ t.string :nickname
8
+ t.datetime :confirmed_at
9
+ t.string :confirmation_key
10
+ t.datetime :confirmation_key_expired_at
11
+ t.string :new_password_key
12
+ t.datetime :new_password_key_expired_at
13
+
14
+ t.timestamps null: false
15
+ end
16
+ add_index :users, :email, unique: true
17
+ end
18
+ end
@@ -0,0 +1,32 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20150303135922) do
15
+
16
+ create_table "users", force: :cascade do |t|
17
+ t.string "email", null: false
18
+ t.string "password_digest", null: false
19
+ t.string "password_salt", null: false
20
+ t.string "nickname"
21
+ t.datetime "confirmed_at"
22
+ t.string "confirmation_key"
23
+ t.datetime "confirmation_key_expired_at"
24
+ t.string "new_password_key"
25
+ t.datetime "new_password_key_expired_at"
26
+ t.datetime "created_at", null: false
27
+ t.datetime "updated_at", null: false
28
+ end
29
+
30
+ add_index "users", ["email"], name: "index_users_on_email", unique: true
31
+
32
+ end
Binary file