auther 15.0.2 → 16.1.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/README.adoc +11 -10
- data/app/assets/stylesheets/auther/application.css +96 -0
- data/app/controllers/auther/base_controller.rb +5 -15
- data/app/controllers/auther/session_controller.rb +1 -3
- data/app/models/auther/account.rb +1 -3
- data/app/presenters/auther/account.rb +1 -3
- data/app/views/auther/session/new.html.erb +29 -0
- data/app/views/layouts/auther/auth.html.erb +20 -0
- data/auther.gemspec +4 -6
- data/lib/auther/authenticator.rb +2 -4
- data/lib/auther/cipher.rb +3 -9
- data/lib/auther/engine.rb +2 -2
- data/lib/auther/gatekeeper.rb +3 -11
- data/lib/auther/keymaster.rb +4 -12
- data/lib/auther/settings.rb +3 -5
- data/lib/auther.rb +5 -2
- data/lib/generators/auther/templates/config/initializers/auther.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +11 -44
- metadata.gz.sig +0 -0
- data/app/assets/stylesheets/auther/application.scss +0 -1
- data/app/assets/stylesheets/auther/auther.scss +0 -112
- data/app/views/auther/session/new.html.slim +0 -22
- data/app/views/layouts/auther/auth.html.slim +0 -11
- data/lib/auther/null_logger.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9510a1d442536ba4f3f374754c36021592bc6b2d24b3b78d349f89a40da05c1
|
4
|
+
data.tar.gz: 2c2a4f310507a53bb87282195ef09190776808ec4e5faf18a5e578383573e027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7dc8cfcc02948e1d5e97c2a612854177301e96b74559da63d6a552ae605acee7ea006eff2fbffef0058135b0a64ea56b70d79ec434aa1984f1ecd66c34ea7da8
|
7
|
+
data.tar.gz: f8d0d5d72ec90e93f711584c2282cc4bfe94e72738961c1d4c382cc44b8775ca33119552351e0eb321b5061b2480af26b19cbe21ed9ccc0f3545dce01f9ac731
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -13,7 +13,7 @@ toc::[]
|
|
13
13
|
== Features
|
14
14
|
|
15
15
|
* Supports form-based authentication compatible with password managers like link:https://bitwarden.com[Bitwarden].
|
16
|
-
* Uses CSS
|
16
|
+
* Uses pure CSS for styling.
|
17
17
|
* Uses encrypted account credentials to keep sensitive information secure.
|
18
18
|
* Supports multiple accounts with optional path exclude lists.
|
19
19
|
* Supports customizable routes, models, presenters, views, controllers, and loggers.
|
@@ -69,17 +69,18 @@ Run the credentials generator to generate credentials for your application:
|
|
69
69
|
rails generate auther:credentials
|
70
70
|
----
|
71
71
|
|
72
|
-
|
72
|
+
Example:
|
73
|
+
|
74
|
+
image::https://alchemists.io/images/projects/auther/screenshots/credentials_generator.png[Credentials Generator Screenshot,width=768,height=288,role=focal_point]
|
75
|
+
|
76
|
+
If using link:https://direnv.net[direnv], copy and paste the generated credentials -- as shown above -- into your `.envrc` file (💡 don't forget to add `export` before each key). Ensure you've applied these credentials to your environment and then run the install generator to configure and initialize your application:
|
73
77
|
|
74
78
|
[source,bash]
|
75
79
|
----
|
76
80
|
rails generate auther:install
|
77
81
|
----
|
78
82
|
|
79
|
-
If
|
80
|
-
credentials into your `.envrc` file. Example:
|
81
|
-
|
82
|
-
image::https://alchemists.io/images/projects/auther/screenshots/credentials_generator.png[Credentials Generator Screenshot,width=768,height=288,role=focal_point]
|
83
|
+
💡 If you ran the generator before applying your credentials to the environment, you can re-run the generator to fix.
|
83
84
|
|
84
85
|
== Usage
|
85
86
|
|
@@ -94,7 +95,7 @@ initializer comes installed with the following settings:
|
|
94
95
|
|
95
96
|
[source,ruby]
|
96
97
|
----
|
97
|
-
Rails.application.config.
|
98
|
+
Rails.application.config.auther = {
|
98
99
|
accounts: [
|
99
100
|
{
|
100
101
|
name: "admin",
|
@@ -111,7 +112,7 @@ To encrypt/decrypt account credentials, launch a rails console and run the follo
|
|
111
112
|
|
112
113
|
[source,ruby]
|
113
114
|
----
|
114
|
-
# The secret as defined in `
|
115
|
+
# The secret as defined in `Rails.application.config.auther` and/or produced by the credentials generator.
|
115
116
|
secret = SecureRandom.hex 16 # "426a7f46548a1a4518676a8e246517d8"
|
116
117
|
|
117
118
|
# The cipher for encrypting/decrypting values.
|
@@ -146,7 +147,7 @@ The initializer can be customized as follows:
|
|
146
147
|
*** The auth URL.
|
147
148
|
* `url` - Optional. The URL to redirect to when enforcing authentication. Default: `"/login"`.
|
148
149
|
* `logger` - Optional. The logger used to log path/account authorization messages. Default:
|
149
|
-
`
|
150
|
+
`Logger.new nil`.
|
150
151
|
|
151
152
|
=== Routes
|
152
153
|
|
@@ -208,7 +209,7 @@ As mentioned in the setup above, the logger can be customized as follows:
|
|
208
209
|
[source,ruby]
|
209
210
|
----
|
210
211
|
# This is the default logger silences all logging attempts.
|
211
|
-
|
212
|
+
Logger.new nil
|
212
213
|
|
213
214
|
# Can be used to log to the environment log.
|
214
215
|
ActiveSupport::Logger.new "log/#{Rails.env}.log"
|
@@ -0,0 +1,96 @@
|
|
1
|
+
.auther {
|
2
|
+
--blue-light: hsla(215, 55%, 54%, 1.00);
|
3
|
+
--blue-dark: hsla(214, 58%, 38%, 1.00);
|
4
|
+
--red: hsla(9, 87%, 54%, 1.00);
|
5
|
+
--white: hsla(0, 0%, 100%, 1.00);
|
6
|
+
--grey-light: hsla(0, 0%, 65%, 1.00);
|
7
|
+
--grey-dark: hsla(240, 1%, 30%, 1.00);
|
8
|
+
--font-family: "Verdana", sans-serif;
|
9
|
+
|
10
|
+
align-content: center;
|
11
|
+
display: flex;
|
12
|
+
font-family: var(--font-family);
|
13
|
+
justify-content: center;
|
14
|
+
|
15
|
+
.body {
|
16
|
+
display: flex;
|
17
|
+
flex-direction: column;
|
18
|
+
}
|
19
|
+
|
20
|
+
.label {
|
21
|
+
font-size: 2em;
|
22
|
+
font-weight: 400;
|
23
|
+
text-align: center;
|
24
|
+
}
|
25
|
+
|
26
|
+
.form {
|
27
|
+
display: flex;
|
28
|
+
flex-direction: column;
|
29
|
+
|
30
|
+
.section {
|
31
|
+
display: flex;
|
32
|
+
flex-direction: column;
|
33
|
+
margin: 0 0 0.5rem 0;
|
34
|
+
}
|
35
|
+
|
36
|
+
.group {
|
37
|
+
display: flex;
|
38
|
+
flex-direction: column;
|
39
|
+
}
|
40
|
+
|
41
|
+
.input {
|
42
|
+
color: var(--grey-dark);
|
43
|
+
border: 0.09rem solid var(--grey-light);
|
44
|
+
border-radius: 0.3rem;
|
45
|
+
display: flex;
|
46
|
+
font-size: 0.9rem;
|
47
|
+
padding: 0.5rem;
|
48
|
+
outline: none;
|
49
|
+
}
|
50
|
+
|
51
|
+
.select {
|
52
|
+
background: transparent;
|
53
|
+
border-radius: 0.3rem;
|
54
|
+
color: var(--grey-dark);
|
55
|
+
display: flex;
|
56
|
+
font-size: 1rem;
|
57
|
+
height: 2rem;
|
58
|
+
outline: none;
|
59
|
+
}
|
60
|
+
|
61
|
+
.message {
|
62
|
+
background: var(--red);
|
63
|
+
color: var(--white);
|
64
|
+
display: none;
|
65
|
+
padding: 0.3em 0.7em;
|
66
|
+
}
|
67
|
+
|
68
|
+
.button {
|
69
|
+
color: var(--white);
|
70
|
+
cursor: pointer;
|
71
|
+
background-color: var(--blue-light);
|
72
|
+
border: none;
|
73
|
+
font-size: 1rem;
|
74
|
+
padding: 0.5rem;
|
75
|
+
margin: 1rem 0 0 0;
|
76
|
+
outline: none;
|
77
|
+
width: 100%;
|
78
|
+
|
79
|
+
&:active {
|
80
|
+
background-color: var(--blue-dark);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
.error {
|
85
|
+
.input {
|
86
|
+
border-color: var(--red);
|
87
|
+
border-bottom-right-radius: 0;
|
88
|
+
border-bottom-left-radius: 0;
|
89
|
+
}
|
90
|
+
|
91
|
+
.message {
|
92
|
+
display: flex;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
@@ -5,9 +5,7 @@ module Auther
|
|
5
5
|
class BaseController < ActionController::Base
|
6
6
|
protect_from_forgery with: :exception
|
7
7
|
|
8
|
-
def show
|
9
|
-
redirect_to settings.url
|
10
|
-
end
|
8
|
+
def show = redirect_to settings.url
|
11
9
|
|
12
10
|
def new
|
13
11
|
@account = Auther::Presenter::Account.new
|
@@ -37,13 +35,9 @@ module Auther
|
|
37
35
|
|
38
36
|
private
|
39
37
|
|
40
|
-
def account_params
|
41
|
-
params.require(:account).permit(:name, :login, :password)
|
42
|
-
end
|
38
|
+
def account_params = params.require(:account).permit(:name, :login, :password)
|
43
39
|
|
44
|
-
def settings
|
45
|
-
Auther::Settings.new Rails.application.config.auther_settings
|
46
|
-
end
|
40
|
+
def settings = Auther::Settings.new Rails.application.config.auther
|
47
41
|
|
48
42
|
def load_title
|
49
43
|
@title = settings.title
|
@@ -64,13 +58,9 @@ module Auther
|
|
64
58
|
fail NotImplementedError, "The method, #new_template_path, is not implemented."
|
65
59
|
end
|
66
60
|
|
67
|
-
def authorized_url account
|
68
|
-
session["auther_redirect_url"] || account.authorized_url || "/"
|
69
|
-
end
|
61
|
+
def authorized_url(account) = session["auther_redirect_url"] || account.authorized_url || "/"
|
70
62
|
|
71
|
-
def deauthorized_url account
|
72
|
-
account.deauthorized_url || settings.url
|
73
|
-
end
|
63
|
+
def deauthorized_url(account) = account.deauthorized_url || settings.url
|
74
64
|
|
75
65
|
def store_credentials account
|
76
66
|
keymaster = Auther::Keymaster.new account.name
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<% content_for(:title) { @title } %>
|
2
|
+
|
3
|
+
<div class="auther">
|
4
|
+
<div class="body">
|
5
|
+
<h1 class="label">Authorization</h1>
|
6
|
+
|
7
|
+
<%= form_for @account, as: :account, url: "/auther/session", html: {class: :form} do |form| %>
|
8
|
+
<%= content_tag :div, class: %(section #{"error" if @account.error?(:login)}) do %>
|
9
|
+
<div class="group">
|
10
|
+
<%= form.text_field :login, class: "input", placeholder: "Login" %>
|
11
|
+
<small class="message"><%= @account.error_message(:login) %></small>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= content_tag :div, class: %(section #{"error" if @account.error?(:password)}) do %>
|
16
|
+
<div class="group">
|
17
|
+
<%= form.password_field :password, class: "input", placeholder: "Password" %>
|
18
|
+
<small class="message"><%= @account.error_message(:password) %></small>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<div class="section">
|
23
|
+
<%= form.select :name, @account_options, {}, class: "select" %>
|
24
|
+
</div>
|
25
|
+
|
26
|
+
<%= form.submit "Login", class: "button" %>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html lang="en">
|
4
|
+
<head>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
6
|
+
|
7
|
+
<title><%= yield :title %></title>
|
8
|
+
|
9
|
+
<meta charset="utf-8">
|
10
|
+
<meta name="description" content="A demo site.">
|
11
|
+
<meta name="author" content="Alchemists">
|
12
|
+
|
13
|
+
<%= stylesheet_link_tag "auther/application", media: "all" %>
|
14
|
+
<%= csrf_meta_tags %>
|
15
|
+
</head>
|
16
|
+
|
17
|
+
<body>
|
18
|
+
<%= yield %>
|
19
|
+
</body>
|
20
|
+
</html>
|
data/auther.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "auther"
|
5
|
-
spec.version = "
|
5
|
+
spec.version = "16.1.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/auther"
|
@@ -23,11 +23,9 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.signing_key = Gem.default_key_path
|
24
24
|
spec.cert_chain = [Gem.default_cert_path]
|
25
25
|
|
26
|
-
spec.required_ruby_version =
|
27
|
-
spec.add_dependency "rails", "~> 7.
|
28
|
-
spec.add_dependency "refinements", "~>
|
29
|
-
spec.add_dependency "sass-rails", "~> 6.0"
|
30
|
-
spec.add_dependency "slim-rails", "~> 3.5"
|
26
|
+
spec.required_ruby_version = "~> 3.3"
|
27
|
+
spec.add_dependency "rails", "~> 7.1"
|
28
|
+
spec.add_dependency "refinements", "~> 12.1"
|
31
29
|
|
32
30
|
spec.files = Dir["*.gemspec", "app/**/*", "config/**/*", "lib/**/*"]
|
33
31
|
spec.extra_rdoc_files = Dir["README*", "LICENSE*"]
|
data/lib/auther/authenticator.rb
CHANGED
@@ -4,7 +4,7 @@ module Auther
|
|
4
4
|
# Manages account authentication.
|
5
5
|
class Authenticator
|
6
6
|
# rubocop:disable Metrics/ParameterLists
|
7
|
-
def initialize secret, account_model, account_presenter, logger:
|
7
|
+
def initialize secret, account_model, account_presenter, logger: LOGGER
|
8
8
|
@cipher = Auther::Cipher.new secret
|
9
9
|
@account_model = account_model
|
10
10
|
@account_presenter = account_presenter
|
@@ -41,9 +41,7 @@ module Auther
|
|
41
41
|
false
|
42
42
|
end
|
43
43
|
|
44
|
-
def authentic_name?
|
45
|
-
account_presenter.name == account_model.name
|
46
|
-
end
|
44
|
+
def authentic_name? = account_presenter.name == account_model.name
|
47
45
|
|
48
46
|
def authentic_login?
|
49
47
|
authentic? account_model.encrypted_login, account_presenter.login, "login"
|
data/lib/auther/cipher.rb
CHANGED
@@ -12,21 +12,15 @@ module Auther
|
|
12
12
|
{secret:, login: cipher.encrypt(login), password: cipher.encrypt(password)}
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.key_length
|
16
|
-
ActiveSupport::MessageEncryptor.key_len
|
17
|
-
end
|
15
|
+
def self.key_length = ActiveSupport::MessageEncryptor.key_len
|
18
16
|
|
19
17
|
def initialize secret
|
20
18
|
@encryptor = ActiveSupport::MessageEncryptor.new secret
|
21
19
|
end
|
22
20
|
|
23
|
-
def encrypt data
|
24
|
-
encryptor.encrypt_and_sign data
|
25
|
-
end
|
21
|
+
def encrypt(data) = encryptor.encrypt_and_sign data
|
26
22
|
|
27
|
-
def decrypt data
|
28
|
-
encryptor.decrypt_and_verify data
|
29
|
-
end
|
23
|
+
def decrypt(data) = encryptor.decrypt_and_verify data
|
30
24
|
|
31
25
|
private
|
32
26
|
|
data/lib/auther/engine.rb
CHANGED
@@ -5,7 +5,7 @@ module Auther
|
|
5
5
|
class Engine < ::Rails::Engine
|
6
6
|
isolate_namespace Auther
|
7
7
|
|
8
|
-
config.
|
8
|
+
config.auther = {}
|
9
9
|
config.action_view.field_error_proc = proc { |html_tag, _| html_tag.html_safe }
|
10
10
|
|
11
11
|
config.to_prepare do
|
@@ -16,7 +16,7 @@ module Auther
|
|
16
16
|
|
17
17
|
initializer "auther.initialize" do |app|
|
18
18
|
app.config.assets.precompile.append "auther/application.css" unless Rails.env.test?
|
19
|
-
app.config.app_middleware.use Gatekeeper, app.config.
|
19
|
+
app.config.app_middleware.use Gatekeeper, app.config.auther
|
20
20
|
app.config.filter_parameters += %i[login password]
|
21
21
|
end
|
22
22
|
end
|
data/lib/auther/gatekeeper.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
module Auther
|
4
4
|
# Rack middleware that guards access to sensitive routes.
|
5
|
-
# rubocop:disable Metrics/ClassLength
|
6
5
|
class Gatekeeper
|
7
6
|
attr_reader :application, :environment, :settings
|
8
7
|
|
@@ -28,13 +27,9 @@ module Auther
|
|
28
27
|
|
29
28
|
private
|
30
29
|
|
31
|
-
def session
|
32
|
-
environment.fetch "rack.session"
|
33
|
-
end
|
30
|
+
def session = environment.fetch "rack.session"
|
34
31
|
|
35
|
-
def request
|
36
|
-
Rack::Request.new environment
|
37
|
-
end
|
32
|
+
def request = Rack::Request.new environment
|
38
33
|
|
39
34
|
def response
|
40
35
|
status, headers, body = application.call environment
|
@@ -77,9 +72,7 @@ module Auther
|
|
77
72
|
account
|
78
73
|
end
|
79
74
|
|
80
|
-
def clean_paths paths
|
81
|
-
paths.map { |path| path.chomp "/" }
|
82
|
-
end
|
75
|
+
def clean_paths(paths) = paths.map { |path| path.chomp "/" }
|
83
76
|
|
84
77
|
def excluded_paths
|
85
78
|
paths = settings.accounts.map { |account| clean_paths account.fetch(:paths) }
|
@@ -134,5 +127,4 @@ module Auther
|
|
134
127
|
end
|
135
128
|
end
|
136
129
|
end
|
137
|
-
# rubocop:enable Metrics/ClassLength
|
138
130
|
end
|
data/lib/auther/keymaster.rb
CHANGED
@@ -5,13 +5,9 @@ module Auther
|
|
5
5
|
class Keymaster
|
6
6
|
attr_reader :account_name
|
7
7
|
|
8
|
-
def self.namespace
|
9
|
-
"auther"
|
10
|
-
end
|
8
|
+
def self.namespace = "auther"
|
11
9
|
|
12
|
-
def self.redirect_url_key
|
13
|
-
[namespace, "redirect", "url"] * delimiter
|
14
|
-
end
|
10
|
+
def self.redirect_url_key(delimiter: "_") = [namespace, "redirect", "url"] * delimiter
|
15
11
|
|
16
12
|
def self.get_account_name session = {}
|
17
13
|
matching_keys = session.keys.select { |key| key.to_s =~ /auther.+login/ }
|
@@ -28,13 +24,9 @@ module Auther
|
|
28
24
|
@account_name = account_name
|
29
25
|
end
|
30
26
|
|
31
|
-
def login_key
|
32
|
-
build_key "login"
|
33
|
-
end
|
27
|
+
def login_key = build_key "login"
|
34
28
|
|
35
|
-
def password_key
|
36
|
-
build_key "password"
|
37
|
-
end
|
29
|
+
def password_key = build_key "password"
|
38
30
|
|
39
31
|
private
|
40
32
|
|
data/lib/auther/settings.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
module Auther
|
4
4
|
# Represents Auther settings.
|
5
5
|
Settings = Struct.new :title, :label, :secret, :accounts, :url, :logger, keyword_init: true do
|
6
|
-
def initialize
|
6
|
+
def initialize(*)
|
7
7
|
super
|
8
8
|
|
9
9
|
self[:title] ||= "Authorization"
|
@@ -11,11 +11,9 @@ module Auther
|
|
11
11
|
self[:secret] ||= ""
|
12
12
|
self[:accounts] ||= []
|
13
13
|
self[:url] ||= "/login"
|
14
|
-
self[:logger] ||=
|
14
|
+
self[:logger] ||= LOGGER
|
15
15
|
end
|
16
16
|
|
17
|
-
def find_account name
|
18
|
-
accounts.find { |account| account.fetch(:name) == name }
|
19
|
-
end
|
17
|
+
def find_account(name) = accounts.find { |account| account.fetch(:name) == name }
|
20
18
|
end
|
21
19
|
end
|
data/lib/auther.rb
CHANGED
@@ -5,6 +5,9 @@ require "auther/cipher"
|
|
5
5
|
require "auther/engine"
|
6
6
|
require "auther/gatekeeper"
|
7
7
|
require "auther/keymaster"
|
8
|
-
require "auther/null_logger"
|
9
8
|
require "auther/settings"
|
10
|
-
require "
|
9
|
+
require "logger"
|
10
|
+
|
11
|
+
module Auther
|
12
|
+
LOGGER = Logger.new(nil).freeze
|
13
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
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:
|
4
|
+
version: 16.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
|
36
36
|
gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2024-03-03 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rails
|
@@ -43,56 +43,28 @@ dependencies:
|
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '7.
|
46
|
+
version: '7.1'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '7.
|
53
|
+
version: '7.1'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
name: refinements
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '12.1'
|
61
61
|
type: :runtime
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
name: sass-rails
|
70
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '6.0'
|
75
|
-
type: :runtime
|
76
|
-
prerelease: false
|
77
|
-
version_requirements: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '6.0'
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: slim-rails
|
84
|
-
requirement: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '3.5'
|
89
|
-
type: :runtime
|
90
|
-
prerelease: false
|
91
|
-
version_requirements: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '3.5'
|
67
|
+
version: '12.1'
|
96
68
|
description:
|
97
69
|
email:
|
98
70
|
- brooke@alchemists.io
|
@@ -104,14 +76,13 @@ extra_rdoc_files:
|
|
104
76
|
files:
|
105
77
|
- LICENSE.adoc
|
106
78
|
- README.adoc
|
107
|
-
- app/assets/stylesheets/auther/application.
|
108
|
-
- app/assets/stylesheets/auther/auther.scss
|
79
|
+
- app/assets/stylesheets/auther/application.css
|
109
80
|
- app/controllers/auther/base_controller.rb
|
110
81
|
- app/controllers/auther/session_controller.rb
|
111
82
|
- app/models/auther/account.rb
|
112
83
|
- app/presenters/auther/account.rb
|
113
|
-
- app/views/auther/session/new.html.
|
114
|
-
- app/views/layouts/auther/auth.html.
|
84
|
+
- app/views/auther/session/new.html.erb
|
85
|
+
- app/views/layouts/auther/auth.html.erb
|
115
86
|
- auther.gemspec
|
116
87
|
- config/routes.rb
|
117
88
|
- lib/auther.rb
|
@@ -120,7 +91,6 @@ files:
|
|
120
91
|
- lib/auther/engine.rb
|
121
92
|
- lib/auther/gatekeeper.rb
|
122
93
|
- lib/auther/keymaster.rb
|
123
|
-
- lib/auther/null_logger.rb
|
124
94
|
- lib/auther/settings.rb
|
125
95
|
- lib/generators/auther/credentials/credentials_generator.rb
|
126
96
|
- lib/generators/auther/install/install_generator.rb
|
@@ -142,10 +112,7 @@ require_paths:
|
|
142
112
|
- lib
|
143
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
114
|
requirements:
|
145
|
-
- - "
|
146
|
-
- !ruby/object:Gem::Version
|
147
|
-
version: '3.2'
|
148
|
-
- - "<="
|
115
|
+
- - "~>"
|
149
116
|
- !ruby/object:Gem::Version
|
150
117
|
version: '3.3'
|
151
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -154,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
121
|
- !ruby/object:Gem::Version
|
155
122
|
version: '0'
|
156
123
|
requirements: []
|
157
|
-
rubygems_version: 3.
|
124
|
+
rubygems_version: 3.5.6
|
158
125
|
signing_key:
|
159
126
|
specification_version: 4
|
160
127
|
summary: Enhances Rails with multi-account, form-based, database-less, application-wide
|
metadata.gz.sig
CHANGED
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
@import "auther";
|
@@ -1,112 +0,0 @@
|
|
1
|
-
$auther-blue-light: hsla(215, 55%, 54%, 1.00);
|
2
|
-
$auther-blue-dark: hsla(214, 58%, 38%, 1.00);
|
3
|
-
$auther-red: hsla(9, 87%, 54%, 1.00);
|
4
|
-
$auther-white: hsla(0, 0%, 100%, 1.00);
|
5
|
-
$auther-grey-light: hsla(0, 0%, 65%, 1.00);
|
6
|
-
$auther-grey-dark: hsla(240, 1%, 30%, 1.00);
|
7
|
-
|
8
|
-
$auther-font-family: "Verdana", sans-serif;
|
9
|
-
|
10
|
-
@mixin border_radius($value: 0.3rem) {
|
11
|
-
border-top-left-radius: $value;
|
12
|
-
border-top-right-radius: $value;
|
13
|
-
border-bottom-right-radius: $value;
|
14
|
-
border-bottom-left-radius: $value;
|
15
|
-
}
|
16
|
-
|
17
|
-
.auther-page {
|
18
|
-
display: flex;
|
19
|
-
font-family: $auther-font-family;
|
20
|
-
}
|
21
|
-
|
22
|
-
.auther-body {
|
23
|
-
align-content: center;
|
24
|
-
display: flex;
|
25
|
-
justify-content: center;
|
26
|
-
height: 100%;
|
27
|
-
width: 100%;
|
28
|
-
}
|
29
|
-
|
30
|
-
.auther-content {
|
31
|
-
display: flex;
|
32
|
-
flex-direction: column;
|
33
|
-
}
|
34
|
-
|
35
|
-
.auther-label {
|
36
|
-
font-size: 2em;
|
37
|
-
font-weight: 400;
|
38
|
-
text-align: center;
|
39
|
-
}
|
40
|
-
|
41
|
-
.auther-form {
|
42
|
-
display: flex;
|
43
|
-
flex-direction: column;
|
44
|
-
}
|
45
|
-
|
46
|
-
.auther-form-section {
|
47
|
-
display: flex;
|
48
|
-
flex-direction: column;
|
49
|
-
margin: 0 0 0.5rem 0;
|
50
|
-
}
|
51
|
-
|
52
|
-
.auther-form-group {
|
53
|
-
display: flex;
|
54
|
-
flex-direction: column;
|
55
|
-
}
|
56
|
-
|
57
|
-
.auther-form-input {
|
58
|
-
@include border_radius();
|
59
|
-
|
60
|
-
color: $auther-grey-dark;
|
61
|
-
border: 0.09rem solid $auther-grey-light;
|
62
|
-
display: flex;
|
63
|
-
font-size: 0.9rem;
|
64
|
-
padding: 0.5rem;
|
65
|
-
outline: none;
|
66
|
-
}
|
67
|
-
|
68
|
-
.auther-form-select {
|
69
|
-
@include border_radius();
|
70
|
-
|
71
|
-
background: transparent;
|
72
|
-
color: $auther-grey-dark;
|
73
|
-
display: flex;
|
74
|
-
font-size: 1rem;
|
75
|
-
height: 2rem;
|
76
|
-
outline: none;
|
77
|
-
}
|
78
|
-
|
79
|
-
.auther-button {
|
80
|
-
color: $auther-white;
|
81
|
-
cursor: pointer;
|
82
|
-
background-color: $auther-blue-light;
|
83
|
-
border: none;
|
84
|
-
font-size: 1rem;
|
85
|
-
padding: 0.5rem;
|
86
|
-
margin: 1rem 0 0 0;
|
87
|
-
outline: none;
|
88
|
-
width: 100%;
|
89
|
-
|
90
|
-
&:active {
|
91
|
-
background-color: $auther-blue-dark;
|
92
|
-
}
|
93
|
-
}
|
94
|
-
|
95
|
-
.auther-error-message {
|
96
|
-
background: $auther-red;
|
97
|
-
color: $auther-white;
|
98
|
-
display: none;
|
99
|
-
padding: 0.3em 0.7em;
|
100
|
-
}
|
101
|
-
|
102
|
-
.auther-error {
|
103
|
-
.auther-form-input {
|
104
|
-
border-color: $auther-red;
|
105
|
-
border-bottom-right-radius: 0;
|
106
|
-
border-bottom-left-radius: 0;
|
107
|
-
}
|
108
|
-
|
109
|
-
.auther-error-message {
|
110
|
-
display: flex;
|
111
|
-
}
|
112
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
- content_for(:title) { @title }
|
2
|
-
|
3
|
-
.auther-page
|
4
|
-
.auther-body
|
5
|
-
.auther-content
|
6
|
-
h1.auther-label = "Authorization"
|
7
|
-
|
8
|
-
= form_for @account, as: :account, url: "/auther/session", html: {class: "auther-form"} do |form|
|
9
|
-
div class=%(auther-form-section #{"auther-error" if @account.error?(:login)})
|
10
|
-
.auther-form-group
|
11
|
-
= form.text_field :login, class: "auther-form-input", placeholder: "Login"
|
12
|
-
small.auther-error-message = @account.error_message(:login)
|
13
|
-
|
14
|
-
div class=%(auther-form-section #{"auther-error" if @account.error?(:password)})
|
15
|
-
.auther-form-group
|
16
|
-
= form.password_field :password, class: "auther-form-input", placeholder: "Password"
|
17
|
-
small.auther-error-message = @account.error_message(:password)
|
18
|
-
|
19
|
-
.auther-form-section
|
20
|
-
= form.select :name, @account_options, {}, class: "auther-form-select"
|
21
|
-
|
22
|
-
= form.submit "Login", class: "auther-button"
|
data/lib/auther/null_logger.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Auther
|
4
|
-
# The default logger which purposefully does nothing at all.
|
5
|
-
class NullLogger
|
6
|
-
# rubocop:disable Style/RedundantInitialize
|
7
|
-
def initialize _parameters
|
8
|
-
end
|
9
|
-
# rubocop:enable Style/RedundantInitialize
|
10
|
-
|
11
|
-
def info _message
|
12
|
-
end
|
13
|
-
|
14
|
-
def warn _message
|
15
|
-
end
|
16
|
-
|
17
|
-
def error _message
|
18
|
-
end
|
19
|
-
|
20
|
-
def fatal _message
|
21
|
-
end
|
22
|
-
|
23
|
-
def debug _message
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|