auther 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f17e327c4dabbffda8ee383dae1ef6bdeaf24133
4
- data.tar.gz: 67bf753f588c0e086648e03797a5d2dfa8ada553
3
+ metadata.gz: f2ae43fc51d37f75faf9fa729587498f09194c1b
4
+ data.tar.gz: 26b8e79adab7feaa6d2eee41bd80a03e4a214ed1
5
5
  SHA512:
6
- metadata.gz: 6888f4b765335b231ac2209f9982a1e079eb0ba2ee5858c2818e4cffdba3020fed4795f777bd03a13db572163abab3080559a4f2115eb12a557ff7f29153773a
7
- data.tar.gz: 3ae905d11cb2351d79ffc72412265f0d2f4daa9a59f8eda196d08ad7e431e25273e150d45400530cd996c5c20ce2cba248b56e0c53f9d9b30334e05cf52d6811
6
+ metadata.gz: ad47869986c5cf8d48157656433b8b48474e6e745a5858e36d3f9e5263647a6d75e7309520a006684262846570b122e249ea235687accc503086a147ada3376c
7
+ data.tar.gz: 7ae485b60d8155f5c211c3b43af3a9bb5886089dc7dd44415f6d8c800b4184610bf5e917b9e8e976cb8d350dff5319c6212c645060e952ecd8e4523427f19594
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
  [![Gem Version](https://badge.fury.io/rb/auther.png)](http://badge.fury.io/rb/auther)
7
4
  [![Code Climate GPA](https://codeclimate.com/github/bkuhlmann/auther.png)](https://codeclimate.com/github/bkuhlmann/auther)
8
5
  [![Travis CI Status](https://secure.travis-ci.org/bkuhlmann/auther.png)](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
- [![Screenshot](https://github.com/bkuhlmann/auther/raw/master/screenshot.png)](https://github.com/bkuhlmann/auther)
16
+ [![Screenshot - Clean](https://github.com/bkuhlmann/auther/raw/master/screenshot-clean.png)](https://github.com/bkuhlmann/auther)
17
+ [![Screenshot - Error](https://github.com/bkuhlmann/auther/raw/master/screenshot-error.png)](https://github.com/bkuhlmann/auther)
15
18
 
16
- * Encrypted session account credentials.
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 session view.
20
- * Customizable session controller.
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
- NOTE: The decrypted account credentials, for example above, are as follows:
74
+ The purpose of each setting is as follows:
71
75
 
72
- * login: test@test.com
73
- * password: password
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 if
99
- desired (would require controller customization)...but, if this neccessary, you might want to question if you have
100
- outgrown the use of this gem and require a different solution altogether.
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 inherit from the Auther::BaseController. Example:
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 +1,2 @@
1
1
  @import "foundation_and_overrides";
2
+ @import "auther";
@@ -0,0 +1,12 @@
1
+ .authorization {
2
+ position: relative;
3
+ top: 25%;
4
+ -webkit-transform: translateY(25%);
5
+ -ms-transform: translateY(25%);
6
+ transform: translateY(25%);
7
+
8
+ .authorization-label {
9
+ text-align: center !important;
10
+ margin-bottom: 0.5em;
11
+ }
12
+ }
@@ -0,0 +1,8 @@
1
+ module Auther
2
+ module FoundationHelper
3
+ def render_foundation_error enabled, classes: []
4
+ classes << "error" if enabled
5
+ classes.compact * ' '
6
+ end
7
+ end
8
+ end
@@ -1,36 +1,43 @@
1
1
  - content_for(:title) { @title }
2
2
 
3
- = form_for @account, as: :account, url: "/auther/session", html: {class: "auther-form"} do |form|
4
- .small-12
5
- .row
6
- h1.text-center = @label
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
- .row
9
- .small-8
10
- .row
11
- .small-6.columns
12
- = form.label :login, "Login:", class: "inline right"
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
- .row
17
- .small-8
18
- .row
19
- .small-6.columns
20
- = form.label :password, "Password:", class: "inline right"
21
- .small-6.columns
22
- = form.password_field :password
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
- .row
25
- .small-8
26
- .row
27
- .small-6.columns
28
- = form.label :name, "Account:", class: "inline right"
29
- .small-6.columns
30
- = form.select :name, @name_options
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
- .row
33
- .small-8
34
- .row
35
- .small-6.right
36
- = form.submit "Login", class: "button round expand"
39
+ .row
40
+ .small-8
41
+ .row
42
+ .small-6.right
43
+ = form.submit "Login", class: "button round expand"
@@ -1,3 +1,3 @@
1
1
  module Auther
2
- VERSION = "0.3.0"
2
+ VERSION = "1.0.0"
3
3
  end
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.3.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-20 00:00:00.000000000 Z
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: A Rails Engine with simple, form-based authentication, session, and blacklist
288
- route support.
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/application_helper.rb
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: A Rails Engine with simple, form-based authentication support.
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
@@ -1,4 +0,0 @@
1
- module Auther
2
- module ApplicationHelper
3
- end
4
- end