auther 0.3.0 → 1.0.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +27 -14
- data/app/assets/stylesheets/auther/application.scss +1 -0
- data/app/assets/stylesheets/auther/auther.scss +12 -0
- data/app/helpers/auther/foundation_helper.rb +8 -0
- data/app/views/auther/session/new.html.slim +37 -30
- data/lib/auther/version.rb +1 -1
- metadata +8 -6
- metadata.gz.sig +0 -0
- data/app/helpers/auther/application_helper.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2ae43fc51d37f75faf9fa729587498f09194c1b
|
4
|
+
data.tar.gz: 26b8e79adab7feaa6d2eee41bd80a03e4a214ed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad47869986c5cf8d48157656433b8b48474e6e745a5858e36d3f9e5263647a6d75e7309520a006684262846570b122e249ea235687accc503086a147ada3376c
|
7
|
+
data.tar.gz: 7ae485b60d8155f5c211c3b43af3a9bb5886089dc7dd44415f6d8c800b4184610bf5e917b9e8e976cb8d350dff5319c6212c645060e952ecd8e4523427f19594
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -1,23 +1,27 @@
|
|
1
1
|
# Overview
|
2
2
|
|
3
|
-
Provides simple, form-based authentication for apps that need security but don't want to use the clunky UI of
|
4
|
-
HTTP Basic Authentication and/or want to be compatible with password managers.
|
5
|
-
|
6
3
|
[](http://badge.fury.io/rb/auther)
|
7
4
|
[](https://codeclimate.com/github/bkuhlmann/auther)
|
8
5
|
[](http://travis-ci.org/bkuhlmann/auther)
|
9
6
|
|
7
|
+
Provides simple, form-based authentication for apps that need security but don't want to deal with the clunky UI
|
8
|
+
of HTTP Basic Authentication or something as heavyweight as [Devise](https://github.com/plataformatec/devise). It
|
9
|
+
doesn't require a database and is compatible with password managers like [1Password](https://agilebits.com/onepassword)
|
10
|
+
making for a pleasent user experience.
|
11
|
+
|
10
12
|
# Features
|
11
13
|
|
12
14
|
* Form-based authentication compatible with password managers like [1Password](https://agilebits.com/onepassword).
|
13
15
|
|
14
|
-
[](https://github.com/bkuhlmann/auther)
|
16
|
+
[](https://github.com/bkuhlmann/auther)
|
17
|
+
[](https://github.com/bkuhlmann/auther)
|
15
18
|
|
16
|
-
* Encrypted
|
19
|
+
* Encrypted account credentials.
|
17
20
|
* Multiple account support with account specific blacklisted paths.
|
21
|
+
* Log filtering for account credentials (login and password).
|
18
22
|
* Auto-redirection to requested path (once credentials have been verified).
|
19
|
-
* Customizable
|
20
|
-
* Customizable
|
23
|
+
* Customizable view.
|
24
|
+
* Customizable controller.
|
21
25
|
|
22
26
|
# Requirements
|
23
27
|
|
@@ -67,10 +71,16 @@ Edit your application.rb as follows:
|
|
67
71
|
end
|
68
72
|
end
|
69
73
|
|
70
|
-
|
74
|
+
The purpose of each setting is as follows:
|
71
75
|
|
72
|
-
*
|
73
|
-
*
|
76
|
+
* *title* - The HTML page title (as rendered within a browser tab).
|
77
|
+
* *label* - The page label (what would appear above the form).
|
78
|
+
* *accounts* - The array of accounts with different or similar access to the application.
|
79
|
+
* *login* - The encrypted account login. For example, the above decrypts to: *test@test.com*.
|
80
|
+
* *password* - The encrypted account password. For example, the above decrypts to: *password*.
|
81
|
+
* *paths* - The array of blacklisted paths for which only this account has access to.
|
82
|
+
* *secret* - The secret passphrase used to encrypt/decrypt account credentials.
|
83
|
+
* *auth_url* - The URL to redirect to when enforcing authentication to a blacklisted path.
|
74
84
|
|
75
85
|
# Usage
|
76
86
|
|
@@ -95,9 +105,9 @@ To encrypt/decrypt account credentials, launch a rails console and type the foll
|
|
95
105
|
## Model
|
96
106
|
|
97
107
|
The [Auther::Account](app/models/auther/account.rb) is a plain old Ruby object that uses ActiveRecord validations
|
98
|
-
to aid in form/credential validation. This model could potentially be replaced with a database-backed object
|
99
|
-
|
100
|
-
|
108
|
+
to aid in form/credential validation. This model could potentially be replaced with a database-backed object
|
109
|
+
(would require controller customization)...but you might want to question if you have outgrown the use of this
|
110
|
+
gem and need a different solution altogether if it comes to that.
|
101
111
|
|
102
112
|
## Views
|
103
113
|
|
@@ -106,11 +116,14 @@ default Auther::SessionController implementation is sufficient):
|
|
106
116
|
|
107
117
|
app/views/auther/session/new.html
|
108
118
|
|
119
|
+
The form can be stylized by attaching new styles to the .authorization class (see
|
120
|
+
[auther.scss](app/assets/stylesheets/auther/auther.scss) for details).
|
121
|
+
|
109
122
|
## Controller
|
110
123
|
|
111
124
|
The [Auther::SessionController](app/controllers/auther/session_controller.rb) inherits from the
|
112
125
|
[Auther::BaseController](app/controllers/auther/base_controller.rb). To customize, it is recommended that
|
113
|
-
you add a controller to your app that
|
126
|
+
you add a controller to your app that inherits from the Auther::BaseController. Example:
|
114
127
|
|
115
128
|
# Example Path: app/controllers/session_controller.rb
|
116
129
|
class SessionController < Auther::BaseController
|
@@ -1,36 +1,43 @@
|
|
1
1
|
- content_for(:title) { @title }
|
2
2
|
|
3
|
-
=
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
- error_keys = @account.errors.keys
|
4
|
+
- login_error = error_keys.include?(:login)
|
5
|
+
- password_error = error_keys.include?(:password)
|
6
|
+
- name_error = error_keys.include?(:name)
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
.small-6.columns
|
14
|
-
= form.text_field :login
|
8
|
+
.authorization
|
9
|
+
= form_for @account, as: :account, url: "/auther/session" do |form|
|
10
|
+
.small-12
|
11
|
+
.row
|
12
|
+
h1.authorization-label = @label
|
15
13
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
14
|
+
.row
|
15
|
+
.small-8
|
16
|
+
.row
|
17
|
+
= content_tag :div, class: render_foundation_error(login_error, classes: %w(small-6 columns))
|
18
|
+
= form.label :login, "Login:", class: "inline right"
|
19
|
+
= content_tag :div, class: render_foundation_error(login_error, classes: %w(small-6 columns))
|
20
|
+
= form.text_field :login
|
21
|
+
= content_tag(:small, @account.errors.full_messages.first) if login_error
|
22
|
+
.row
|
23
|
+
.small-8
|
24
|
+
.row
|
25
|
+
= content_tag :div, class: render_foundation_error(password_error, classes: %w(small-6 columns))
|
26
|
+
= form.label :password, "Password:", class: "inline right"
|
27
|
+
= content_tag :div, class: render_foundation_error(password_error, classes: %w(small-6 columns))
|
28
|
+
= form.password_field :password
|
29
|
+
= content_tag(:small, @account.errors.full_messages.first) if password_error
|
23
30
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
+
.row
|
32
|
+
.small-8
|
33
|
+
.row
|
34
|
+
.small-6.columns
|
35
|
+
= form.label :name, "Account:", class: "inline right"
|
36
|
+
.small-6.columns
|
37
|
+
= form.select :name, @name_options
|
31
38
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
39
|
+
.row
|
40
|
+
.small-8
|
41
|
+
.row
|
42
|
+
.small-6.right
|
43
|
+
= form.submit "Login", class: "button round expand"
|
data/lib/auther/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auther
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
SJpzzzZ8gO6BKn4fhd+ENNQ333Qy3nuNk07TVIaNnlgeHhowUDuD9T7Z8Lka0pt3
|
31
31
|
4PteiTppsf0SSVAM9zSO5IuFngXMRwWgvjOfXE70f43RDuUVTCSyylc=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-01-
|
33
|
+
date: 2014-01-24 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rails
|
@@ -284,8 +284,8 @@ dependencies:
|
|
284
284
|
- - ">="
|
285
285
|
- !ruby/object:Gem::Version
|
286
286
|
version: '0'
|
287
|
-
description:
|
288
|
-
|
287
|
+
description: Enhances Rails with multi-account, form-based, database-less, application-wide
|
288
|
+
authentication as a Rails Engine.
|
289
289
|
email:
|
290
290
|
- brooke@redalchemist.com
|
291
291
|
executables: []
|
@@ -298,10 +298,11 @@ files:
|
|
298
298
|
- README.md
|
299
299
|
- app/assets/javascripts/auther/application.js
|
300
300
|
- app/assets/stylesheets/auther/application.scss
|
301
|
+
- app/assets/stylesheets/auther/auther.scss
|
301
302
|
- app/assets/stylesheets/auther/foundation_and_overrides.scss
|
302
303
|
- app/controllers/auther/base_controller.rb
|
303
304
|
- app/controllers/auther/session_controller.rb
|
304
|
-
- app/helpers/auther/
|
305
|
+
- app/helpers/auther/foundation_helper.rb
|
305
306
|
- app/models/auther/account.rb
|
306
307
|
- app/views/auther/session/new.html.slim
|
307
308
|
- app/views/layouts/auther/auth.html.slim
|
@@ -336,6 +337,7 @@ rubyforge_project:
|
|
336
337
|
rubygems_version: 2.2.1
|
337
338
|
signing_key:
|
338
339
|
specification_version: 4
|
339
|
-
summary:
|
340
|
+
summary: Enhances Rails with multi-account, form-based, database-less, application-wide
|
341
|
+
authentication.
|
340
342
|
test_files: []
|
341
343
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|