auther 7.0.0 → 7.1.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: f18a67c138885193bca861c0f4e5da9e120b24a9
4
- data.tar.gz: 6a9dd5ea153ad990342de7f8a76abd1722a6cfe0
3
+ metadata.gz: 58723a40896b8a889ace2dcb4da89faefd810959
4
+ data.tar.gz: 9c44b675c2f1084bce2bb390168d2a69c47b0085
5
5
  SHA512:
6
- metadata.gz: 339180597982acb766251a3cdb0d5ea205e71146c0cc20784cec31de12b2df37150592c41df90823579f0a2afd151ee75aa525a6d98b560739dd3e72e64e89e1
7
- data.tar.gz: cc8a275ee79ae2734b7d9e3fe61f7fffc240be4f4ebf9c95ee0800dd9e217b4ad364e174f1aa59cea73c1afef5568dff5f81bc68303b2486b3c6502edaf38f71
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
 
@@ -5,7 +5,7 @@ module Auther
5
5
  class SessionController < BaseController
6
6
  layout "auther/auth"
7
7
  before_action :load_title, :load_label
8
- before_action :load_account_options, only: [:new, :create]
8
+ before_action :load_account_options, only: %i[new create]
9
9
 
10
10
  private
11
11
 
@@ -20,6 +20,7 @@ module Auther
20
20
  message: "must be an array"
21
21
  }
22
22
 
23
+ # rubocop:disable Style/OptionHash
23
24
  def initialize options = {}
24
25
  @name = options.fetch :name, nil
25
26
  @encrypted_login = options.fetch :encrypted_login, nil
@@ -12,10 +12,10 @@ module Auther
12
12
 
13
13
  validates :name, :login, :password, presence: true
14
14
 
15
- def initialize options = {}
16
- @name = options[:name]
17
- @login = options[:login]
18
- @password = options[: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
@@ -2,5 +2,5 @@
2
2
 
3
3
  Auther::Engine.routes.draw do
4
4
  root to: "session#new"
5
- resource :session, controller: "session", only: [:show, :new, :create, :destroy]
5
+ resource :session, controller: "session", only: %i[show new create destroy]
6
6
  end
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 += [:login, :password]
22
+ app.config.filter_parameters += %i[login password]
23
23
  end
24
24
  end
25
25
  end
@@ -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
@@ -12,7 +12,7 @@ module Auther
12
12
  end
13
13
 
14
14
  def self.version
15
- "7.0.0"
15
+ "7.1.0"
16
16
  end
17
17
 
18
18
  def self.version_label
@@ -9,8 +9,8 @@ module Auther
9
9
  "auther"
10
10
  end
11
11
 
12
- def self.redirect_url_key options = {}
13
- [namespace, "redirect", "url"] * options.fetch(:delimiter, "_")
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, options = {}
42
- [self.class.namespace, account_name, key_name].compact * options.fetch(:delimiter, "_")
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
@@ -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.detect { |account| account.fetch(:name) == name }
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.0.0
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
8
  autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIDeD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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.9
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
@@ -1,3 +0,0 @@
1
- wǻAO&
2
- Zb{����Ht�2��9@Oyg��wW�>�bu>E��Jq�db��*�tV-�O�wuz�#���O���ѓi�9�}h�d�w ���q���-�w!u~��l�cK����E~B��(,���k����9��V�����D ��,OSCË&�U
3
- �M�8�� ضud�JG�Y2��g4 �(��I�s���D����Q�iby��]����]Ɠ�B�ADK��|�#:����������|�_�c�� Kj�
data.tar.gz.sig DELETED
Binary file
metadata.gz.sig DELETED
Binary file