auther 7.0.0 → 7.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
- data/README.md +2 -2
- data/app/controllers/auther/base_controller.rb +4 -1
- data/app/controllers/auther/session_controller.rb +1 -1
- data/app/models/auther/account.rb +1 -0
- data/app/presenters/auther/account.rb +4 -4
- data/config/routes.rb +1 -1
- data/lib/auther/engine.rb +1 -1
- data/lib/auther/gatekeeper.rb +1 -0
- data/lib/auther/identity.rb +1 -1
- data/lib/auther/keymaster.rb +4 -4
- data/lib/auther/settings.rb +2 -1
- metadata +4 -26
- checksums.yaml.gz.sig +0 -3
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58723a40896b8a889ace2dcb4da89faefd810959
|
4
|
+
data.tar.gz: 9c44b675c2f1084bce2bb390168d2a69c47b0085
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc3dfee201a469b1aeafb4d722280d88931a5c53351a8720deb8ea508462df27486093b2b0f50323d8ba0815ab801fba4ef739c9e65914879b221d943404fa7c
|
7
|
+
data.tar.gz: af33a40a3ee921ec1f00a22e30806dc8d04cd62c2e63ab7e6dc437d227d060e8032b1741c26f0f1a8ccbc84068f010bb304b21de9045775f29746b5f036a0fd8
|
data/README.md
CHANGED
@@ -251,9 +251,9 @@ To test, run:
|
|
251
251
|
|
252
252
|
Read [Semantic Versioning](http://semver.org) for details. Briefly, it means:
|
253
253
|
|
254
|
-
- Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
|
255
|
-
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
256
254
|
- Major (X.y.z) - Incremented for any backwards incompatible public API changes.
|
255
|
+
- Minor (x.Y.z) - Incremented for new, backwards compatible, public API enhancements/fixes.
|
256
|
+
- Patch (x.y.Z) - Incremented for small, backwards compatible, bug fixes.
|
257
257
|
|
258
258
|
# Code of Conduct
|
259
259
|
|
@@ -3,6 +3,8 @@
|
|
3
3
|
module Auther
|
4
4
|
# Abstract controller for session management.
|
5
5
|
class BaseController < ActionController::Base
|
6
|
+
protect_from_forgery with: :exception
|
7
|
+
|
6
8
|
def show
|
7
9
|
redirect_to settings.auth_url
|
8
10
|
end
|
@@ -11,8 +13,9 @@ module Auther
|
|
11
13
|
@account = Auther::Presenter::Account.new
|
12
14
|
end
|
13
15
|
|
16
|
+
# rubocop:disable Metrics/AbcSize
|
14
17
|
def create
|
15
|
-
@account = Auther::Presenter::Account.new account_params
|
18
|
+
@account = Auther::Presenter::Account.new account_params.to_h.symbolize_keys
|
16
19
|
account = Auther::Account.new settings.find_account(@account.name)
|
17
20
|
authenticator = Auther::Authenticator.new settings.secret, account, @account
|
18
21
|
|
@@ -12,10 +12,10 @@ module Auther
|
|
12
12
|
|
13
13
|
validates :name, :login, :password, presence: true
|
14
14
|
|
15
|
-
def initialize
|
16
|
-
@name =
|
17
|
-
@login =
|
18
|
-
@password =
|
15
|
+
def initialize name: "", login: "", password: ""
|
16
|
+
@name = name
|
17
|
+
@login = login
|
18
|
+
@password = password
|
19
19
|
end
|
20
20
|
|
21
21
|
def error? key
|
data/config/routes.rb
CHANGED
data/lib/auther/engine.rb
CHANGED
@@ -19,7 +19,7 @@ module Auther
|
|
19
19
|
|
20
20
|
initializer "auther.initialize" do |app|
|
21
21
|
app.config.app_middleware.use Gatekeeper, app.config.auther_settings
|
22
|
-
app.config.filter_parameters += [
|
22
|
+
app.config.filter_parameters += %i[login password]
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/auther/gatekeeper.rb
CHANGED
@@ -89,6 +89,7 @@ module Auther
|
|
89
89
|
blacklisted_paths.select { |blacklisted_path| path.include? blacklisted_path }
|
90
90
|
end
|
91
91
|
|
92
|
+
# rubocop:disable Metrics/AbcSize
|
92
93
|
def account_authenticated? account
|
93
94
|
keymaster = Auther::Keymaster.new account.fetch(:name)
|
94
95
|
cipher = Auther::Cipher.new settings.secret
|
data/lib/auther/identity.rb
CHANGED
data/lib/auther/keymaster.rb
CHANGED
@@ -9,8 +9,8 @@ module Auther
|
|
9
9
|
"auther"
|
10
10
|
end
|
11
11
|
|
12
|
-
def self.redirect_url_key
|
13
|
-
[namespace, "redirect", "url"] *
|
12
|
+
def self.redirect_url_key delimiter: "_"
|
13
|
+
[namespace, "redirect", "url"] * delimiter
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.get_account_name session = {}
|
@@ -38,8 +38,8 @@ module Auther
|
|
38
38
|
|
39
39
|
private
|
40
40
|
|
41
|
-
def build_key key_name,
|
42
|
-
[self.class.namespace, account_name, key_name].compact *
|
41
|
+
def build_key key_name, delimiter: "_"
|
42
|
+
[self.class.namespace, account_name, key_name].compact * delimiter
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
data/lib/auther/settings.rb
CHANGED
@@ -5,6 +5,7 @@ module Auther
|
|
5
5
|
class Settings
|
6
6
|
attr_reader :title, :label, :secret, :accounts, :auth_url, :logger
|
7
7
|
|
8
|
+
# rubocop:disable Metrics/ParameterLists
|
8
9
|
def initialize title: "Authorization",
|
9
10
|
label: "Authorization",
|
10
11
|
secret: "",
|
@@ -21,7 +22,7 @@ module Auther
|
|
21
22
|
end
|
22
23
|
|
23
24
|
def find_account name
|
24
|
-
accounts.
|
25
|
+
accounts.find { |account| account.fetch(:name) == name }
|
25
26
|
end
|
26
27
|
end
|
27
28
|
end
|
metadata
CHANGED
@@ -1,36 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auther
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke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XxTukEO7VC1pndccUsxdbziGsAOiuHET3Aq
|
27
|
-
ygLvrfdYrN88/w+qxncW5bxbO3a6UGkuhIFUPM8zRSE/rh6bCcJljTJrExVt42eV
|
28
|
-
aYCb7WJNsx3eNXHn3uQodq3tD+lmNJzz2bFeT3smGSKEnALBjqorO/2mpDh4FJ3S
|
29
|
-
4CcDYsJ1ywep8LDJDBBGdKz9moL+axryzpeTpgTT/fFYFzRzWrURPyDvPOikh9TX
|
30
|
-
n/LUZ1dKhIHzfKx1B4+TEIefArObGfkLIDM8+Dq1RX7TF1k81Men7iu4MgE9bYBn
|
31
|
-
3dE+xI3FdB5gWcdWxdtgRCmWjtXeYYyb4z6NQQ==
|
32
|
-
-----END CERTIFICATE-----
|
33
|
-
date: 2017-01-22 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-02-26 00:00:00.000000000 Z
|
34
12
|
dependencies:
|
35
13
|
- !ruby/object:Gem::Dependency
|
36
14
|
name: rails
|
@@ -384,7 +362,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
384
362
|
version: '0'
|
385
363
|
requirements: []
|
386
364
|
rubyforge_project:
|
387
|
-
rubygems_version: 2.6.
|
365
|
+
rubygems_version: 2.6.10
|
388
366
|
signing_key:
|
389
367
|
specification_version: 4
|
390
368
|
summary: Enhances Rails with multi-account, form-based, database-less, application-wide
|
checksums.yaml.gz.sig
DELETED
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|