auth_master 0.0.1 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2459f5e3eaff23f81d3e403ded07d9b78577472a011d856b15a5365f189094f
4
- data.tar.gz: de3257727b34b730c0ec6c0af1366c5723d5e99ff9c119677570f9ec9dae0d73
3
+ metadata.gz: 1363f58683049a2b3b1c729e7dd49cd6e3dd660308da0edc5bdb6959a56ac4cd
4
+ data.tar.gz: 2d54954c9b106e59a0693503a524affcf547c270c73764661b66decdc2f9682d
5
5
  SHA512:
6
- metadata.gz: aaf6f1e9ef4cb6c7e8c0f25641ac735b3d3b1e9c60380df3e5c1c176414be2707a6a46022067dd75da8b35c25aacdf2b3bbb8e7bb93e5b6f5bda73b572d08650
7
- data.tar.gz: f496418e033c0986041a7216d937aaadee56c9bf51576eadd2a76ffacc92a9a83118fb3c7a9b2208ef0596dba84fc5fd1ff587e6854f75d3414cedaa5e095eb5
6
+ metadata.gz: d801bac756973c1c96a44ba403c8e2c163e4b73805bb59b7e5ab8d2c8ebc9294035737c70a035a19fdc8f577f6d5457e25686e7f9c9600f78f62b290a5de3f9e
7
+ data.tar.gz: 55e9962df8c4d9279296d37f654109f2a2fc339b46769f25002529247e2d5a1f94009fe508b8f28abbb8e0bab5eb485ba8b274f7b3c3a939441b99d9ac118216
data/README.md CHANGED
@@ -21,8 +21,27 @@ Or install it yourself as:
21
21
  $ gem install auth_master
22
22
  ```
23
23
 
24
+ Install database migrations:
25
+ ```bash
26
+ $ bin/rails auth_master:install:migrations
27
+ ```
28
+
29
+ Run migrations:
30
+ ```bash
31
+ $ bin/rails db:migrate
32
+ ```
33
+
24
34
  ## Contributing
25
- Contribution directions go here.
35
+
36
+ Build gem:
37
+ ```bash
38
+ $ rake build
39
+ ```
40
+
41
+ Push to RubyGems.org:
42
+ ```bash
43
+ $ gem push auth_master-x.y.z.gem
44
+ ```
26
45
 
27
46
  ## License
28
47
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -18,7 +18,6 @@ module AuthMaster
18
18
  end
19
19
 
20
20
  def link
21
-
22
21
  end
23
22
 
24
23
  private
@@ -1,5 +1,7 @@
1
1
  module AuthMaster
2
2
  class Session < ApplicationRecord
3
3
  belongs_to :target, polymorphic: true
4
+
5
+ enum :status, [ :inactive, :active ], default: :inactive
4
6
  end
5
7
  end
@@ -8,4 +8,4 @@ module AuthMaster
8
8
  AuthMaster::SessionService.send_link!(auth_master_session) if auth_master_session.present?
9
9
  end
10
10
  end
11
- end
11
+ end
@@ -1,4 +1,4 @@
1
- require 'token_guard'
1
+ require "token_guard"
2
2
 
3
3
  module AuthMaster
4
4
  class SessionService
@@ -54,4 +54,4 @@ module AuthMaster
54
54
  end
55
55
  end
56
56
  end
57
- end
57
+ end
@@ -1,7 +1,8 @@
1
1
  class CreateAuthMasterSessions < ActiveRecord::Migration[8.0]
2
2
  def change
3
3
  create_table :auth_master_sessions, id: :uuid do |t|
4
- t.references :target, polymorphic: true, null: false, type: :uuid
4
+ t.references :target, polymorphic: true, null: false, type: :uuid
5
+ t.integer :status, limit: 2, null: false
5
6
 
6
7
  t.timestamps
7
8
  end
@@ -1,5 +1,13 @@
1
1
  module AuthMaster
2
2
  class Engine < ::Rails::Engine
3
+ DEFAULT_LAYOUT = "application"
4
+
3
5
  isolate_namespace AuthMaster
6
+
7
+ config.to_prepare do
8
+ ApplicationController.layout ->(controller) {
9
+ AuthMaster.targets[params[:target].to_sym][:layout] || DEFAULT_LAYOUT
10
+ }
11
+ end
4
12
  end
5
13
  end
@@ -1,3 +1,3 @@
1
1
  module AuthMaster
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/auth_master.rb CHANGED
@@ -2,7 +2,7 @@ require "auth_master/version"
2
2
  require "auth_master/engine"
3
3
 
4
4
  module AuthMaster
5
- mattr_accessor :targets, :timing_attack_interval
5
+ mattr_accessor :targets, :timing_attack_interval
6
6
 
7
7
  def self.configure
8
8
  yield self
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - vickodin
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-20 00:00:00.000000000 Z
10
+ date: 2025-03-27 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -65,7 +64,6 @@ files:
65
64
  - app/services/auth_master/session_service.rb
66
65
  - app/views/auth_master/sessions/new.html.erb
67
66
  - app/views/auth_master/sessions/sent.html.erb
68
- - app/views/layouts/auth_master/application.html.erb
69
67
  - config/routes.rb
70
68
  - db/migrate/20250313120723_create_auth_master_sessions.rb
71
69
  - lib/auth_master.rb
@@ -79,7 +77,6 @@ metadata:
79
77
  allowed_push_host: https://rubygems.org
80
78
  homepage_uri: https://github.com/vickodin/auth_master
81
79
  source_code_uri: https://github.com/vickodin/auth_master
82
- post_install_message:
83
80
  rdoc_options: []
84
81
  require_paths:
85
82
  - lib
@@ -94,8 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
91
  - !ruby/object:Gem::Version
95
92
  version: '0'
96
93
  requirements: []
97
- rubygems_version: 3.4.1
98
- signing_key:
94
+ rubygems_version: 3.6.2
99
95
  specification_version: 4
100
96
  summary: Authentication engine for projects built with Rails (Ruby on Rails)
101
97
  test_files: []
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Auth master</title>
5
- <%= csrf_meta_tags %>
6
- <%= csp_meta_tag %>
7
-
8
- <%= yield :head %>
9
-
10
- <%= stylesheet_link_tag "auth_master/application", media: "all" %>
11
- </head>
12
- <body>
13
-
14
- <%= yield %>
15
-
16
- </body>
17
- </html>