cnfs-iam 0.0.1.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +75 -0
  4. data/Rakefile +24 -0
  5. data/app/controllers/concerns/is_tenant_scoped.rb +21 -0
  6. data/app/controllers/credentials_controller.rb +23 -0
  7. data/app/controllers/groups_controller.rb +4 -0
  8. data/app/controllers/iam/application_controller.rb +6 -0
  9. data/app/controllers/iam/confirmations_controller.rb +51 -0
  10. data/app/controllers/iam/passwords_controller.rb +56 -0
  11. data/app/controllers/iam/sessions_controller.rb +21 -0
  12. data/app/controllers/policies_controller.rb +4 -0
  13. data/app/controllers/public_keys_controller.rb +4 -0
  14. data/app/controllers/roots/sessions_controller.rb +16 -0
  15. data/app/controllers/roots_controller.rb +4 -0
  16. data/app/controllers/users/confirmations_controller.rb +21 -0
  17. data/app/controllers/users/passwords_controller.rb +25 -0
  18. data/app/controllers/users/sessions_controller.rb +19 -0
  19. data/app/controllers/users_controller.rb +17 -0
  20. data/app/mailers/account_mailer.rb +74 -0
  21. data/app/models/action.rb +6 -0
  22. data/app/models/credential.rb +47 -0
  23. data/app/models/group.rb +15 -0
  24. data/app/models/group_policy_join.rb +25 -0
  25. data/app/models/iam/application_record.rb +7 -0
  26. data/app/models/policy.rb +10 -0
  27. data/app/models/policy_action.rb +6 -0
  28. data/app/models/public_key.rb +17 -0
  29. data/app/models/role.rb +11 -0
  30. data/app/models/role_policy_join.rb +6 -0
  31. data/app/models/root.rb +26 -0
  32. data/app/models/root_credential.rb +7 -0
  33. data/app/models/tenant.rb +68 -0
  34. data/app/models/user.rb +69 -0
  35. data/app/models/user_credential.rb +8 -0
  36. data/app/models/user_group.rb +25 -0
  37. data/app/models/user_policy_join.rb +21 -0
  38. data/app/models/user_role.rb +6 -0
  39. data/app/operations/blackcomb_user_create.rb +49 -0
  40. data/app/operations/user_create.rb +53 -0
  41. data/app/policies/action_policy.rb +3 -0
  42. data/app/policies/credential_policy.rb +3 -0
  43. data/app/policies/group_policy.rb +3 -0
  44. data/app/policies/iam/application_policy.rb +6 -0
  45. data/app/policies/policy_policy.rb +3 -0
  46. data/app/policies/public_key_policy.rb +4 -0
  47. data/app/policies/root_policy.rb +3 -0
  48. data/app/policies/tenant_policy.rb +5 -0
  49. data/app/policies/user_policy.rb +33 -0
  50. data/app/resources/action_resource.rb +16 -0
  51. data/app/resources/credential_resource.rb +13 -0
  52. data/app/resources/group_resource.rb +8 -0
  53. data/app/resources/iam/application_resource.rb +7 -0
  54. data/app/resources/policy_resource.rb +9 -0
  55. data/app/resources/public_key_resource.rb +6 -0
  56. data/app/resources/root_resource.rb +14 -0
  57. data/app/resources/tenant_resource.rb +21 -0
  58. data/app/resources/user_resource.rb +25 -0
  59. data/app/views/layouts/mailer.html.erb +4 -0
  60. data/app/views/user_mailer/confirmation_instructions.html.erb +5 -0
  61. data/app/views/user_mailer/email_changed.html.erb +7 -0
  62. data/app/views/user_mailer/password_change.html.erb +3 -0
  63. data/app/views/user_mailer/reset_password_instructions.html.erb +106 -0
  64. data/app/views/user_mailer/team_welcome.html.erb +107 -0
  65. data/app/views/user_mailer/unlock_instructions.html.erb +7 -0
  66. data/config/environment.rb +0 -0
  67. data/config/initializers/devise.rb +311 -0
  68. data/config/locales/devise.en.yml +65 -0
  69. data/config/routes.rb +17 -0
  70. data/config/sidekiq.yml +5 -0
  71. data/config/spring.rb +3 -0
  72. data/db/migrate/20190101000001_create_policies.rb +11 -0
  73. data/db/migrate/20190101000002_create_actions.rb +13 -0
  74. data/db/migrate/20190101000003_create_policy_actions.rb +13 -0
  75. data/db/migrate/20190215214352_create_roots.rb +43 -0
  76. data/db/migrate/20190215214353_update_tenants.rb +10 -0
  77. data/db/migrate/20190215214355_create_credentials.rb +14 -0
  78. data/db/migrate/20190215214407_create_users.rb +50 -0
  79. data/db/migrate/20190215214409_create_user_credentials.rb +12 -0
  80. data/db/migrate/20190215214410_create_user_policy_joins.rb +12 -0
  81. data/db/migrate/20190215214411_create_groups.rb +11 -0
  82. data/db/migrate/20190215214412_create_user_groups.rb +12 -0
  83. data/db/migrate/20190215214413_create_group_policy_joins.rb +12 -0
  84. data/db/migrate/20190215214415_create_roles.rb +11 -0
  85. data/db/migrate/20190215214416_create_user_roles.rb +12 -0
  86. data/db/migrate/20190215214421_create_role_policy_joins.rb +12 -0
  87. data/db/migrate/20190924091536_add_display_properties_to_tenants.rb +5 -0
  88. data/db/migrate/20191021220135_create_public_keys.rb +10 -0
  89. data/db/migrate/20191120083154_add_confirmable_email_to_user.rb +9 -0
  90. data/db/seeds/development/tenants.seeds.rb +41 -0
  91. data/db/seeds/development/users.seeds.rb +67 -0
  92. data/lib/ros/api_token_strategy.rb +24 -0
  93. data/lib/ros/iam.rb +18 -0
  94. data/lib/ros/iam/console.rb +13 -0
  95. data/lib/ros/iam/engine.rb +51 -0
  96. data/lib/ros/iam/version.rb +7 -0
  97. data/lib/tasks/ros/iam_tasks.rake +51 -0
  98. metadata +209 -0
@@ -0,0 +1,107 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
7
+
8
+ <title>PERX Welcome!</title>
9
+
10
+ <link href="https://fonts.googleapis.com/css?family=Roboto:400,500" rel="stylesheet" type="text/css">
11
+ <style type="text/css">
12
+ </style>
13
+ </head>
14
+ <body style="margin:0; padding:0; background-color:#F2F6FC;">
15
+ <center>
16
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F6FC">
17
+ <tr>
18
+ <td align="center" height="100%" valign="top" width="100%">
19
+ <!--[if (gte mso 9)|(IE)]>
20
+ <table align="center" border="0" cellspacing="24" cellpadding="0" width="600">
21
+ <tr>
22
+ <td align="center" valign="top" width="600">
23
+ <![endif]-->
24
+ <table align="center" border="0" cellpadding="0" cellspacing="24" width="100%" style="max-width:600px;" bgcolor="#ffffff">
25
+ <tr>
26
+ <td align="left">
27
+ <img alt="Perx" src="https://cdn.uat.whistler.perxtech.io/dev1/global/assets/email/logo.png" width="96" height="34" style="width: 100%; max-width: 96px; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-weight: 500; font-size: 24px; line-height: 24px; letter-spacing: 0.18px; color: #2664ed; text-transform: lowercase; display: block; border: 0px;" border="0">
28
+ </td>
29
+ </tr>
30
+ <tr>
31
+ <td align="center">
32
+ <img alt="Illustration of user unlocking account" src="https://cdn.uat.whistler.perxtech.io/dev1/global/assets/email/email-figure.png" width="268" style="width: 100%; max-width: 268px; font-family: 'Roboto', Helvetica, Arial, sans-serif; font-weight: 400; font-size: 12px; line-height: 16px; letter-spacing: 0.4px; color: #7b7b7b; display: block; border: 0px;" border="0">
33
+ </td>
34
+ </tr>
35
+ <tr>
36
+ <td align="left" valign="top" style="font-family: 'Roboto', Helvetica, Arial, sans-serif; font-weight: 400; font-size: 24px; line-height: 24px; letter-spacing: 0.18px; color: #333333;">
37
+ Welcome <%= @resource.username %>,
38
+ </td>
39
+ </tr>
40
+ <tr>
41
+ <td align="left" valign="top" style="font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; letter-spacing: 0.15px; color: #7b7b7b;">
42
+ Thanks for joining Perx, where you can create wonderful campaigns easily.
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <td align="center">
47
+ <table width="100%" border="0" cellspacing="0" cellpadding="0">
48
+ <tr>
49
+ <td align="center">
50
+ <table border="0" cellspacing="0" cellpadding="0" width="268" style="width: 100%; max-width: 268px;">
51
+ <tr>
52
+ <td align="center" width="100%" style="width: 100%; border-radius: 4px;" bgcolor="#2664ED"><a href="<%= @reset_url %>" target="_blank" style="font-size: 14px; letter-spacing: 0.75px; font-family: 'Roboto', Helvetica, Arial, sans-serif; color: #ffffff; font-weight: 500; text-decoration: none; border-radius: 4px; padding: 12px 24px; border: 1px solid #2664ED; display: block;"><!--[if mso]>&nbsp;<![endif]-->Join <%= @account_name %> Team!<!--[if mso]>&nbsp;<![endif]--></a></td>
53
+ </tr>
54
+ </table>
55
+ </td>
56
+ </tr>
57
+ </table>
58
+ </td>
59
+ </tr>
60
+ <tr>
61
+ <td align="left" valign="top" style="font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; letter-spacing: 0.15px; color: #7b7b7b;">
62
+ <b style="font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; letter-spacing: 0.15px; color: #333333; font-weight: 500;">
63
+ What is Perx Whistler?
64
+ </b><br />
65
+ Information promoting whistler/perx
66
+ </td>
67
+ </tr>
68
+ <tr>
69
+ <td align="left" valign="top" style="font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; letter-spacing: 0.15px; color: #7b7b7b;">
70
+ Learn how Whistler can help you and your team
71
+ </td>
72
+ </tr>
73
+ <tr>
74
+ <td align="left" valign="top" style="font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; letter-spacing: 0.15px; color: #7b7b7b;">
75
+ Thank you, <br />
76
+ Team Perx
77
+ </td>
78
+ </tr>
79
+ <tr>
80
+ <td height="1" style="font-size:1px; line-height:1px;">&nbsp;</td>
81
+ </tr>
82
+ <tr>
83
+ <td height="1" style="font-size:1px; line-height:1px;" bgcolor="#e8e8e8">&nbsp;</td>
84
+ </tr>
85
+ <tr>
86
+ <td height="1" style="font-size:1px; line-height:1px;">&nbsp;</td>
87
+ </tr>
88
+ <tr>
89
+ <td align="left" valign="top" style="font-family: 'Roboto', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 16px; letter-spacing: 0.4px; color: #7b7b7b;">
90
+ &copy; 2019 Perx Technologies. All rights reserved.<br /><br />
91
+ 20 Maxwell Road #02-01 <br />
92
+ Maxwell House, 069113
93
+ </td>
94
+ </tr>
95
+
96
+ </table>
97
+ <!--[if (gte mso 9)|(IE)]>
98
+ </td>
99
+ </tr>
100
+ </table>
101
+ <![endif]-->
102
+ </td>
103
+ </tr>
104
+ </table>
105
+ </center>
106
+ </body>
107
+ </html>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
4
+
5
+ <p>Click the link below to unlock your account:</p>
6
+
7
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
File without changes
@@ -0,0 +1,311 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Use this hook to configure devise mailer, warden hooks and so forth.
4
+ # Many of these configuration options can be set straight in your model.
5
+ # rubocop:disable Metrics/LineLength
6
+ Devise.setup do |config|
7
+ config.warden do |manager|
8
+ manager.failure_app = Ros::FailureApp
9
+ end
10
+
11
+ # config.jwt do |jwt|
12
+ # # jwt.secret = Rails.application.credentials.dig(:jwt, :encryption_key) || 'test1234' # ENV['DEVISE_JWT_SECRET_KEY']
13
+ # binding.pry
14
+ # jwt.secret = 'test1234' # ENV['DEVISE_JWT_SECRET_KEY']
15
+ # end
16
+ # The secret key used by Devise. Devise uses this key to generate
17
+ # random tokens. Changing this key will render invalid all existing
18
+ # confirmation, reset password and unlock tokens in the database.
19
+ # Devise will use the `secret_key_base` as its `secret_key`
20
+ # by default. You can change it below and use your own secret key.
21
+ # config.secret_key = 'd3a45fe2e1abd8d6ce283daa1c1651b48a0e4cbf276d9df6c3ca2c695fac7f6a55928859f1ae7e802f290e71ccccb99dfe1b40197619321415ae66d2ecd0562a'
22
+
23
+ # ==> Controller configuration
24
+ # Configure the parent class to the devise controllers.
25
+ # config.parent_controller = 'DeviseController'
26
+
27
+ # ==> Mailer Configuration
28
+ # Configure the e-mail address which will be shown in Devise::Mailer,
29
+ # note that it will be overwritten if you use your own mailer class
30
+ # with default "from" parameter.
31
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
32
+
33
+ # Configure the class responsible to send e-mails.
34
+ config.mailer = 'AccountMailer'
35
+
36
+ # Configure the parent class responsible to send e-mails.
37
+ # config.parent_mailer = 'ActionMailer::Base'
38
+
39
+ # ==> ORM configuration
40
+ # Load and configure the ORM. Supports :active_record (default) and
41
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
42
+ # available as additional gems.
43
+ require 'devise/orm/active_record'
44
+
45
+ # ==> Configuration for any authentication mechanism
46
+ # Configure which keys are used when authenticating a user. The default is
47
+ # just :email. You can configure it to use [:username, :subdomain], so for
48
+ # authenticating a user, both parameters are required. Remember that those
49
+ # parameters are used only when authenticating and not when retrieving from
50
+ # session. If you need permissions, you should implement that in a before filter.
51
+ # You can also supply a hash where the value is a boolean determining whether
52
+ # or not authentication should be aborted when the value is not present.
53
+ config.authentication_keys = [:username]
54
+ # config.authentication_keys = [:access_key_id]
55
+
56
+ # Configure parameters from the request object used for authentication. Each entry
57
+ # given should be a request method and it will automatically be passed to the
58
+ # find_for_authentication method and considered in your model lookup. For instance,
59
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
60
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
61
+ # config.request_keys = []
62
+
63
+ # Configure which authentication keys should be case-insensitive.
64
+ # These keys will be downcased upon creating or modifying a user and when used
65
+ # to authenticate or find a user. Default is :email.
66
+ config.case_insensitive_keys = [:email]
67
+
68
+ # Configure which authentication keys should have whitespace stripped.
69
+ # These keys will have whitespace before and after removed upon creating or
70
+ # modifying a user and when used to authenticate or find a user. Default is :email.
71
+ config.strip_whitespace_keys = [:email]
72
+
73
+ # Tell if authentication through request.params is enabled. True by default.
74
+ # It can be set to an array that will enable params authentication only for the
75
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
76
+ # enable it only for database (email + password) authentication.
77
+ # config.params_authenticatable = true
78
+
79
+ # Tell if authentication through HTTP Auth is enabled. False by default.
80
+ # It can be set to an array that will enable http authentication only for the
81
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
82
+ # enable it only for database authentication. The supported strategies are:
83
+ # :database = Support basic authentication with authentication key + password
84
+ # config.http_authenticatable = false
85
+
86
+ # If 401 status code should be returned for AJAX requests. True by default.
87
+ # config.http_authenticatable_on_xhr = true
88
+
89
+ # The realm used in Http Basic Authentication. 'Application' by default.
90
+ # config.http_authentication_realm = 'Application'
91
+
92
+ # It will change confirmation, password recovery and other workflows
93
+ # to behave the same regardless if the e-mail provided was right or wrong.
94
+ # Does not affect registerable.
95
+ # config.paranoid = true
96
+
97
+ # By default Devise will store the user in session. You can skip storage for
98
+ # particular strategies by setting this option.
99
+ # Notice that if you are skipping storage for all authentication paths, you
100
+ # may want to disable generating routes to Devise's sessions controller by
101
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
102
+ config.skip_session_storage = [:http_auth]
103
+
104
+ # By default, Devise cleans up the CSRF token on authentication to
105
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
106
+ # requests for sign in and sign up, you need to get a new CSRF token
107
+ # from the server. You can disable this option at your own risk.
108
+ # config.clean_up_csrf_token_on_authentication = true
109
+
110
+ # When false, Devise will not attempt to reload routes on eager load.
111
+ # This can reduce the time taken to boot the app but if your application
112
+ # requires the Devise mappings to be loaded during boot time the application
113
+ # won't boot properly.
114
+ # config.reload_routes = true
115
+
116
+ # ==> Configuration for :database_authenticatable
117
+ # For bcrypt, this is the cost for hashing the password and defaults to 11. If
118
+ # using other algorithms, it sets how many times you want the password to be hashed.
119
+ #
120
+ # Limiting the stretches to just one in testing will increase the performance of
121
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
122
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
123
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
124
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
125
+ config.stretches = Rails.env.test? ? 1 : 11
126
+
127
+ # Set up a pepper to generate the hashed password.
128
+ # config.pepper = '3ba6206f68998f2a3949b709536920af21910940d995fd8be2d4cfd6357df5ce1ff91bd2a0a66ffeb244b75e750c7721c3979720b80d506b4781b1ba82b86beb'
129
+
130
+ # Send a notification to the original email when the user's email is changed.
131
+ # config.send_email_changed_notification = false
132
+
133
+ # Send a notification email when the user's password is changed.
134
+ # config.send_password_change_notification = false
135
+
136
+ # ==> Configuration for :confirmable
137
+ # A period that the user is allowed to access the website even without
138
+ # confirming their account. For instance, if set to 2.days, the user will be
139
+ # able to access the website for two days without confirming their account,
140
+ # access will be blocked just in the third day.
141
+ # You can also set it to nil, which will allow the user to access the website
142
+ # without confirming their account.
143
+ # Default is 0.days, meaning the user cannot access the website without
144
+ # confirming their account.
145
+ # config.allow_unconfirmed_access_for = 2.days
146
+
147
+ # A period that the user is allowed to confirm their account before their
148
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
149
+ # their account within 3 days after the mail was sent, but on the fourth day
150
+ # their account can't be confirmed with the token any more.
151
+ # Default is nil, meaning there is no restriction on how long a user can take
152
+ # before confirming their account.
153
+ # config.confirm_within = 3.days
154
+
155
+ # If true, requires any email changes to be confirmed (exactly the same way as
156
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
157
+ # db field (see migrations). Until confirmed, new email is stored in
158
+ # unconfirmed_email column, and copied to email column on successful confirmation.
159
+ config.reconfirmable = true
160
+
161
+ # Defines which key will be used when confirming an account
162
+ # config.confirmation_keys = [:email]
163
+
164
+ # ==> Configuration for :rememberable
165
+ # The time the user will be remembered without asking for credentials again.
166
+ # config.remember_for = 2.weeks
167
+
168
+ # Invalidates all the remember me tokens when the user signs out.
169
+ config.expire_all_remember_me_on_sign_out = true
170
+
171
+ # If true, extends the user's remember period when remembered via cookie.
172
+ # config.extend_remember_period = false
173
+
174
+ # Options to be passed to the created cookie. For instance, you can set
175
+ # secure: true in order to force SSL only cookies.
176
+ # config.rememberable_options = {}
177
+
178
+ # ==> Configuration for :validatable
179
+ # Range for password length.
180
+ config.password_length = 6..128
181
+
182
+ # Email regex used to validate email formats. It simply asserts that
183
+ # one (and only one) @ exists in the given string. This is mainly
184
+ # to give user feedback and not to assert the e-mail validity.
185
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
186
+
187
+ # ==> Configuration for :timeoutable
188
+ # The time you want to timeout the user session without activity. After this
189
+ # time the user will be asked for credentials again. Default is 30 minutes.
190
+ # config.timeout_in = 30.minutes
191
+
192
+ # ==> Configuration for :lockable
193
+ # Defines which strategy will be used to lock an account.
194
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
195
+ # :none = No lock strategy. You should handle locking by yourself.
196
+ # config.lock_strategy = :failed_attempts
197
+
198
+ # Defines which key will be used when locking and unlocking an account
199
+ # config.unlock_keys = [:email]
200
+
201
+ # Defines which strategy will be used to unlock an account.
202
+ # :email = Sends an unlock link to the user email
203
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
204
+ # :both = Enables both strategies
205
+ # :none = No unlock strategy. You should handle unlocking by yourself.
206
+ # config.unlock_strategy = :both
207
+
208
+ # Number of authentication tries before locking an account if lock_strategy
209
+ # is failed attempts.
210
+ # config.maximum_attempts = 20
211
+
212
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
213
+ # config.unlock_in = 1.hour
214
+
215
+ # Warn on the last attempt before the account is locked.
216
+ # config.last_attempt_warning = true
217
+
218
+ # ==> Configuration for :recoverable
219
+ #
220
+ # Defines which key will be used when recovering the password for an account
221
+ # config.reset_password_keys = [:email]
222
+
223
+ # Time interval you can reset your password with a reset password key.
224
+ # Don't put a too small interval or your users won't have the time to
225
+ # change their passwords.
226
+ config.reset_password_within = 6.hours
227
+
228
+ # When set to false, does not sign a user in automatically after their password is
229
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
230
+ # config.sign_in_after_reset_password = true
231
+
232
+ # ==> Configuration for :encryptable
233
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
234
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
235
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
236
+ # for default behavior) and :restful_authentication_sha1 (then you should set
237
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
238
+ #
239
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
240
+ # config.encryptor = :sha512
241
+
242
+ # ==> Scopes configuration
243
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
244
+ # "users/sessions/new". It's turned off by default because it's slower if you
245
+ # are using only default views.
246
+ # config.scoped_views = false
247
+
248
+ # Configure the default scope given to Warden. By default it's the first
249
+ # devise role declared in your routes (usually :user).
250
+ # config.default_scope = :user
251
+
252
+ # Set this configuration to false if you want /users/sign_out to sign out
253
+ # only the current scope. By default, Devise signs out all scopes.
254
+ # config.sign_out_all_scopes = true
255
+
256
+ # ==> Navigation configuration
257
+ # Lists the formats that should be treated as navigational. Formats like
258
+ # :html, should redirect to the sign in page when the user does not have
259
+ # access, but formats like :xml or :json, should return 401.
260
+ #
261
+ # If you have any extra navigational formats, like :iphone or :mobile, you
262
+ # should add them to the navigational formats lists.
263
+ #
264
+ # The "*/*" below is required to match Internet Explorer requests.
265
+ # config.navigational_formats = ['*/*', :html]
266
+
267
+ # The default HTTP method used to sign out a resource. Default is :delete.
268
+ config.sign_out_via = :delete
269
+
270
+ # ==> OmniAuth
271
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
272
+ # up on your models and hooks.
273
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
274
+
275
+ # ==> Warden configuration
276
+ # If you want to use other strategies, that are not supported by Devise, or
277
+ # change the failure app, you can configure them inside the config.warden block.
278
+ #
279
+ # config.warden do |manager|
280
+ # manager.intercept_401 = false
281
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
282
+ # end
283
+
284
+ # ==> Mountable engine configurations
285
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
286
+ # is mountable, there are some extra configurations to be taken into account.
287
+ # The following options are available, assuming the engine is mounted as:
288
+ #
289
+ # mount MyEngine, at: '/my_engine'
290
+ #
291
+ # The router that invoked `devise_for`, in the example above, would be:
292
+ # config.router_name = :my_engine
293
+ #
294
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
295
+ # so you need to do it manually. For the users scope, it would be:
296
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
297
+
298
+ # ==> Turbolinks configuration
299
+ # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
300
+ #
301
+ # ActiveSupport.on_load(:devise_failure_app) do
302
+ # include Turbolinks::Controller
303
+ # end
304
+
305
+ # ==> Configuration for :registerable
306
+
307
+ # When set to false, does not sign a user in automatically after their password is
308
+ # changed. Defaults to true, so a user is signed in automatically after changing a password.
309
+ # config.sign_in_after_change_password = true
310
+ end
311
+ # rubocop:enable Metrics/LineLength
@@ -0,0 +1,65 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ email_changed:
27
+ subject: "Email Changed"
28
+ password_change:
29
+ subject: "Password Changed"
30
+ omniauth_callbacks:
31
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32
+ success: "Successfully authenticated from %{kind} account."
33
+ passwords:
34
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
35
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
37
+ updated: "Your password has been changed successfully. You are now signed in."
38
+ updated_not_active: "Your password has been changed successfully."
39
+ registrations:
40
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41
+ signed_up: "Welcome! You have signed up successfully."
42
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
45
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
46
+ updated: "Your account has been updated successfully."
47
+ updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again"
48
+ sessions:
49
+ signed_in: "Signed in successfully."
50
+ signed_out: "Signed out successfully."
51
+ already_signed_out: "Signed out successfully."
52
+ unlocks:
53
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56
+ errors:
57
+ messages:
58
+ already_confirmed: "was already confirmed, please try signing in"
59
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60
+ expired: "has expired, please request a new one"
61
+ not_found: "not found"
62
+ not_locked: "was not locked"
63
+ not_saved:
64
+ one: "1 error prohibited this %{resource} from being saved:"
65
+ other: "%{count} errors prohibited this %{resource} from being saved:"