securial 0.5.0 → 0.7.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 +17 -26
- data/app/controllers/concerns/securial/identity.rb +4 -12
- data/app/controllers/securial/sessions_controller.rb +20 -8
- data/app/controllers/securial/status_controller.rb +1 -1
- data/app/models/concerns/securial/password_resettable.rb +15 -0
- data/app/models/securial/role.rb +1 -1
- data/app/models/securial/session.rb +2 -2
- data/app/models/securial/user.rb +3 -3
- data/app/views/securial/users/_securial_user.json.jbuilder +2 -0
- data/config/routes.rb +0 -1
- data/db/migrate/20250517155521_create_securial_users.rb +10 -7
- data/lib/generators/securial/install/templates/securial_initializer.erb +44 -14
- data/lib/generators/securial/install/views_generator.rb +25 -0
- data/lib/securial/auth/auth_encoder.rb +53 -0
- data/lib/securial/auth/errors.rb +15 -0
- data/lib/securial/auth/session_creator.rb +21 -0
- data/lib/securial/auth.rb +10 -0
- data/lib/securial/config/configuration.rb +50 -30
- data/lib/securial/config/errors.rb +2 -1
- data/lib/securial/config/validation.rb +96 -26
- data/lib/securial/config.rb +10 -0
- data/lib/securial/engine.rb +50 -35
- data/lib/securial/helpers/normalizing_helper.rb +11 -9
- data/lib/securial/helpers/regex_helper.rb +12 -10
- data/lib/securial/helpers.rb +9 -0
- data/lib/securial/inspectors/route_inspector.rb +11 -11
- data/lib/securial/inspectors.rb +8 -0
- data/lib/securial/key_transformer.rb +32 -0
- data/lib/securial/logger/broadcaster.rb +48 -0
- data/lib/securial/logger/builder.rb +60 -0
- data/lib/securial/logger/colors.rb +14 -0
- data/lib/securial/logger.rb +4 -67
- data/lib/securial/middlewares/request_logger_tag.rb +19 -0
- data/lib/securial/middlewares/transform_request_keys.rb +33 -0
- data/lib/securial/middlewares/transform_response_keys.rb +52 -0
- data/lib/securial/middlewares.rb +10 -0
- data/lib/securial/security/request_rate_limiter.rb +68 -0
- data/lib/securial/security.rb +8 -0
- data/lib/securial/version.rb +1 -1
- data/lib/securial/version_checker.rb +31 -0
- data/lib/securial.rb +12 -1
- metadata +38 -153
- data/db/migrate/20250524210207_add_password_reset_fields_to_securial_users.rb +0 -6
- data/lib/securial/config/_index.rb +0 -3
- data/lib/securial/helpers/_index.rb +0 -2
- data/lib/securial/inspectors/_index.rb +0 -1
- data/lib/securial/middleware/request_logger_tag.rb +0 -18
- data/lib/securial/sessions/_index.rb +0 -2
- data/lib/securial/sessions/errors.rb +0 -15
- data/lib/securial/sessions/session_encoder.rb +0 -56
@@ -0,0 +1,14 @@
|
|
1
|
+
module Securial
|
2
|
+
module Logger
|
3
|
+
COLORS = {
|
4
|
+
"DEBUG" => "\e[36m", # cyan
|
5
|
+
"INFO" => "\e[32m", # green
|
6
|
+
"WARN" => "\e[33m", # yellow
|
7
|
+
"ERROR" => "\e[31m", # red
|
8
|
+
"FATAL" => "\e[35m", # magenta
|
9
|
+
"UNKNOWN" => "\e[37m", # white
|
10
|
+
}.freeze
|
11
|
+
CLEAR = "\e[0m"
|
12
|
+
SEVERITY_WIDTH = 5
|
13
|
+
end
|
14
|
+
end
|
data/lib/securial/logger.rb
CHANGED
@@ -1,71 +1,8 @@
|
|
1
|
-
|
2
|
-
require "active_support/logger"
|
3
|
-
require "active_support/tagged_logging"
|
1
|
+
require_relative "logger/builder"
|
4
2
|
|
5
3
|
module Securial
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
unless Securial.configuration.log_to_file == false
|
11
|
-
log_file = Rails.root.join("log", "securial.log").open("a")
|
12
|
-
log_file.sync = true
|
13
|
-
outputs << log_file
|
14
|
-
end
|
15
|
-
|
16
|
-
unless Securial.configuration.log_to_stdout == false
|
17
|
-
outputs << STDOUT
|
18
|
-
end
|
19
|
-
|
20
|
-
if outputs.empty?
|
21
|
-
null_logger = ::Logger.new(IO::NULL)
|
22
|
-
return ActiveSupport::TaggedLogging.new(null_logger)
|
23
|
-
end
|
24
|
-
|
25
|
-
logger = ActiveSupport::Logger.new(MultiIO.new(*outputs))
|
26
|
-
logger.level = resolve_log_level
|
27
|
-
logger.formatter = ::Logger::Formatter.new
|
28
|
-
|
29
|
-
ActiveSupport::TaggedLogging.new(logger)
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.resolve_log_level
|
33
|
-
file_level = Securial.configuration.log_file_level
|
34
|
-
stdout_level = Securial.configuration.log_stdout_level
|
35
|
-
|
36
|
-
# Use the lower (more verbose) level of the two
|
37
|
-
levels = [file_level, stdout_level].compact.map do |lvl|
|
38
|
-
begin
|
39
|
-
::Logger.const_get(lvl.to_s.upcase)
|
40
|
-
rescue NameError
|
41
|
-
nil
|
42
|
-
end
|
43
|
-
end.compact
|
44
|
-
|
45
|
-
levels.min || ::Logger::INFO
|
46
|
-
end
|
47
|
-
|
48
|
-
private
|
49
|
-
|
50
|
-
class MultiIO
|
51
|
-
def initialize(*targets)
|
52
|
-
@targets = targets
|
53
|
-
end
|
54
|
-
|
55
|
-
def write(*args)
|
56
|
-
@targets.each { |t| t.write(*args) }
|
57
|
-
end
|
58
|
-
|
59
|
-
def close
|
60
|
-
@targets.each do |t|
|
61
|
-
next if [STDOUT, STDERR].include?(t)
|
62
|
-
t.close
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
def flush
|
67
|
-
@targets.each { |t| t.flush if t.respond_to?(:flush) }
|
68
|
-
end
|
69
|
-
end
|
4
|
+
module Logger
|
5
|
+
# This module serves as a namespace for logging functionality.
|
6
|
+
# It requires the Logger::Builder to provide logger building capabilities.
|
70
7
|
end
|
71
8
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Securial
|
2
|
+
module Middlewares
|
3
|
+
class RequestLoggerTag
|
4
|
+
def initialize(app)
|
5
|
+
@app = app
|
6
|
+
end
|
7
|
+
|
8
|
+
def call(env)
|
9
|
+
request_id = env["action_dispatch.request_id"] || env["HTTP_X_REQUEST_ID"]
|
10
|
+
tags = ["Securial"]
|
11
|
+
tags << request_id if request_id
|
12
|
+
|
13
|
+
logger = Securial.logger || Rails.logger || ::Logger.new(IO::NULL)
|
14
|
+
tagged_logger = logger.is_a?(ActiveSupport::TaggedLogging) ? logger : ActiveSupport::TaggedLogging.new(logger)
|
15
|
+
tagged_logger.tagged(*tags) { @app.call(env) }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# lib/securial/middlewares/transform_request_keys.rb
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
module Securial
|
5
|
+
module Middlewares
|
6
|
+
class TransformRequestKeys
|
7
|
+
def initialize(app)
|
8
|
+
@app = app
|
9
|
+
end
|
10
|
+
|
11
|
+
def call(env)
|
12
|
+
if env["CONTENT_TYPE"]&.include?("application/json") && Securial.configuration.response_keys_format != :snake_case
|
13
|
+
req = Rack::Request.new(env)
|
14
|
+
if (req.body&.size || 0) > 0
|
15
|
+
raw = req.body.read
|
16
|
+
req.body.rewind
|
17
|
+
begin
|
18
|
+
parsed = JSON.parse(raw)
|
19
|
+
transformed = Securial::KeyTransformer.deep_transform_keys(parsed) do |key|
|
20
|
+
Securial::KeyTransformer.underscore(key)
|
21
|
+
end
|
22
|
+
env["rack.input"] = StringIO.new(JSON.dump(transformed))
|
23
|
+
env["rack.input"].rewind
|
24
|
+
rescue JSON::ParserError
|
25
|
+
# noop
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
@app.call(env)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require "json"
|
2
|
+
|
3
|
+
module Securial
|
4
|
+
module Middlewares
|
5
|
+
class TransformResponseKeys
|
6
|
+
def initialize(app)
|
7
|
+
@app = app
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(env)
|
11
|
+
status, headers, response = @app.call(env)
|
12
|
+
|
13
|
+
if json_response?(headers)
|
14
|
+
body = extract_body(response)
|
15
|
+
|
16
|
+
if body.present?
|
17
|
+
format = Securial.configuration.response_keys_format
|
18
|
+
|
19
|
+
# Only transform if not snake_case
|
20
|
+
if format != :snake_case
|
21
|
+
begin
|
22
|
+
transformed = Securial::KeyTransformer.deep_transform_keys(JSON.parse(body)) do |key|
|
23
|
+
Securial::KeyTransformer.camelize(key, format)
|
24
|
+
end
|
25
|
+
|
26
|
+
new_body = [JSON.generate(transformed)]
|
27
|
+
headers["Content-Length"] = new_body.first.bytesize.to_s
|
28
|
+
return [status, headers, new_body]
|
29
|
+
rescue JSON::ParserError
|
30
|
+
# If not valid JSON, fall through and return original response
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
[status, headers, response]
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def json_response?(headers)
|
42
|
+
headers["Content-Type"]&.include?("application/json")
|
43
|
+
end
|
44
|
+
|
45
|
+
def extract_body(response)
|
46
|
+
response_body = ""
|
47
|
+
response.each { |part| response_body << part }
|
48
|
+
response_body
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require_relative "middlewares/transform_request_keys"
|
2
|
+
require_relative "middlewares/transform_response_keys"
|
3
|
+
require_relative "middlewares/request_logger_tag"
|
4
|
+
|
5
|
+
module Securial
|
6
|
+
module Middleware
|
7
|
+
# This module serves as a namespace for middlewares.
|
8
|
+
# It requires the necessary middleware files to provide functionality.
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require "rack/attack"
|
2
|
+
require "securial/config"
|
3
|
+
require "securial/logger"
|
4
|
+
|
5
|
+
module Securial
|
6
|
+
module Security
|
7
|
+
module RequestRateLimiter
|
8
|
+
module_function
|
9
|
+
|
10
|
+
def apply! # rubocop:disable Metrics/MethodLength
|
11
|
+
resp_status = Securial.configuration.rate_limit_response_status
|
12
|
+
resp_message = Securial.configuration.rate_limit_response_message
|
13
|
+
# Throttle login attempts by IP
|
14
|
+
Rack::Attack.throttle("securial/logins/ip",
|
15
|
+
limit: ->(_req) { Securial.configuration.rate_limit_requests_per_minute },
|
16
|
+
period: 1.minute
|
17
|
+
) do |req|
|
18
|
+
if req.path.include?("sessions/login") && req.post?
|
19
|
+
req.ip
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# Throttle login attempts by username/email
|
24
|
+
Rack::Attack.throttle("securial/logins/email",
|
25
|
+
limit: ->(_req) { Securial.configuration.rate_limit_requests_per_minute },
|
26
|
+
period: 1.minute
|
27
|
+
) do |req|
|
28
|
+
if req.path.include?("sessions/login") && req.post?
|
29
|
+
req.params["email_address"].to_s.downcase.strip
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Throttle password reset requests by IP
|
34
|
+
Rack::Attack.throttle("securial/password_resets/ip",
|
35
|
+
limit: ->(_req) { Securial.configuration.rate_limit_requests_per_minute },
|
36
|
+
period: 1.minute
|
37
|
+
) do |req|
|
38
|
+
if req.path.include?("password/forgot") && req.post?
|
39
|
+
req.ip
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# Throttle password reset requests by email
|
44
|
+
Rack::Attack.throttle("securial/password_resets/email",
|
45
|
+
limit: ->(_req) { Securial.configuration.rate_limit_requests_per_minute },
|
46
|
+
period: 1.minute
|
47
|
+
) do |req|
|
48
|
+
if req.path.include?("password/forgot") && req.post?
|
49
|
+
req.params["email_address"].to_s.downcase.strip
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
# Custom response for throttled requests
|
54
|
+
Rack::Attack.throttled_responder = lambda do |request|
|
55
|
+
retry_after = (request.env["rack.attack.match_data"] || {})[:period]
|
56
|
+
[
|
57
|
+
resp_status,
|
58
|
+
{
|
59
|
+
"Content-Type" => "application/json",
|
60
|
+
"Retry-After" => retry_after.to_s,
|
61
|
+
},
|
62
|
+
[{ error: resp_message }.to_json]
|
63
|
+
]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/lib/securial/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require "net/http"
|
2
|
+
require "json"
|
3
|
+
|
4
|
+
module Securial
|
5
|
+
module VersionChecker
|
6
|
+
module_function
|
7
|
+
|
8
|
+
def check_latest_version
|
9
|
+
begin
|
10
|
+
rubygems_api_url = "https://rubygems.org/api/v1/versions/securial/latest.json"
|
11
|
+
uri = URI(rubygems_api_url)
|
12
|
+
http = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https", open_timeout: 5, read_timeout: 5)
|
13
|
+
response = http.request(Net::HTTP::Get.new(uri))
|
14
|
+
latest = JSON.parse(response.body)["version"]
|
15
|
+
|
16
|
+
current = Securial::VERSION
|
17
|
+
if Gem::Version.new(latest) > Gem::Version.new(current)
|
18
|
+
Securial.logger.info "A newer version (#{latest}) of Securial is available. You are using #{current}."
|
19
|
+
Securial.logger.info "Please consider updating!"
|
20
|
+
Securial.logger.debug "You can update Securial by running the following command in your terminal:"
|
21
|
+
Securial.logger.debug "`bundle update securial`"
|
22
|
+
else
|
23
|
+
Securial.logger.info "You are using the latest version of Securial (#{current})."
|
24
|
+
Securial.logger.debug "No updates available at this time."
|
25
|
+
end
|
26
|
+
rescue => e
|
27
|
+
Securial.logger.debug("Version check failed: #{e.message}")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/securial.rb
CHANGED
@@ -1,20 +1,31 @@
|
|
1
1
|
require "securial/version"
|
2
2
|
require "securial/engine"
|
3
|
+
require "securial/logger"
|
3
4
|
|
4
5
|
require "jbuilder"
|
5
6
|
|
6
7
|
module Securial
|
7
8
|
class << self
|
8
|
-
|
9
|
+
attr_accessor :configuration
|
10
|
+
attr_accessor :logger
|
9
11
|
|
10
12
|
def configuration
|
11
13
|
@configuration ||= Securial::Config::Configuration.new
|
12
14
|
end
|
13
15
|
|
16
|
+
def configuration=(config)
|
17
|
+
@configuration = config
|
18
|
+
Securial::Config::Validation.validate_all!(configuration)
|
19
|
+
end
|
20
|
+
|
14
21
|
def configure
|
15
22
|
yield(configuration)
|
16
23
|
end
|
17
24
|
|
25
|
+
def logger
|
26
|
+
@logger ||= Securial::Logger.build
|
27
|
+
end
|
28
|
+
|
18
29
|
# Returns the pluralized form of the admin role.
|
19
30
|
# This behavior is intentional and aligns with the project's routing conventions.
|
20
31
|
def admin_namespace
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: securial
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aly Badawy
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-06-01 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rails
|
@@ -80,61 +80,19 @@ dependencies:
|
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: '0.6'
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
84
|
-
requirement: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '3.40'
|
89
|
-
type: :development
|
90
|
-
prerelease: false
|
91
|
-
version_requirements: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '3.40'
|
96
|
-
- !ruby/object:Gem::Dependency
|
97
|
-
name: coveralls-lcov
|
98
|
-
requirement: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '1.7'
|
103
|
-
type: :development
|
104
|
-
prerelease: false
|
105
|
-
version_requirements: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '1.7'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: database_cleaner
|
83
|
+
name: rack-attack
|
112
84
|
requirement: !ruby/object:Gem::Requirement
|
113
85
|
requirements:
|
114
86
|
- - "~>"
|
115
87
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
117
|
-
type: :
|
118
|
-
prerelease: false
|
119
|
-
version_requirements: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '2.1'
|
124
|
-
- !ruby/object:Gem::Dependency
|
125
|
-
name: factory_bot_rails
|
126
|
-
requirement: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '6.4'
|
131
|
-
type: :development
|
88
|
+
version: '6.7'
|
89
|
+
type: :runtime
|
132
90
|
prerelease: false
|
133
91
|
version_requirements: !ruby/object:Gem::Requirement
|
134
92
|
requirements:
|
135
93
|
- - "~>"
|
136
94
|
- !ruby/object:Gem::Version
|
137
|
-
version: '6.
|
95
|
+
version: '6.7'
|
138
96
|
- !ruby/object:Gem::Dependency
|
139
97
|
name: faker
|
140
98
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,117 +108,61 @@ dependencies:
|
|
150
108
|
- !ruby/object:Gem::Version
|
151
109
|
version: '3.5'
|
152
110
|
- !ruby/object:Gem::Dependency
|
153
|
-
name:
|
154
|
-
requirement: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - "~>"
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '0.10'
|
159
|
-
type: :development
|
160
|
-
prerelease: false
|
161
|
-
version_requirements: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: '0.10'
|
166
|
-
- !ruby/object:Gem::Dependency
|
167
|
-
name: overcommit
|
168
|
-
requirement: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '0.67'
|
173
|
-
type: :development
|
174
|
-
prerelease: false
|
175
|
-
version_requirements: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '0.67'
|
180
|
-
- !ruby/object:Gem::Dependency
|
181
|
-
name: rubocop
|
182
|
-
requirement: !ruby/object:Gem::Requirement
|
183
|
-
requirements:
|
184
|
-
- - "~>"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '1.75'
|
187
|
-
type: :development
|
188
|
-
prerelease: false
|
189
|
-
version_requirements: !ruby/object:Gem::Requirement
|
190
|
-
requirements:
|
191
|
-
- - "~>"
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: '1.75'
|
194
|
-
- !ruby/object:Gem::Dependency
|
195
|
-
name: rubocop-config-prettier
|
196
|
-
requirement: !ruby/object:Gem::Requirement
|
197
|
-
requirements:
|
198
|
-
- - "~>"
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: 0.1.13
|
201
|
-
type: :development
|
202
|
-
prerelease: false
|
203
|
-
version_requirements: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - "~>"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: 0.1.13
|
208
|
-
- !ruby/object:Gem::Dependency
|
209
|
-
name: rubocop-performance
|
111
|
+
name: capybara
|
210
112
|
requirement: !ruby/object:Gem::Requirement
|
211
113
|
requirements:
|
212
114
|
- - "~>"
|
213
115
|
- !ruby/object:Gem::Version
|
214
|
-
version: '
|
116
|
+
version: '3.40'
|
215
117
|
type: :development
|
216
118
|
prerelease: false
|
217
119
|
version_requirements: !ruby/object:Gem::Requirement
|
218
120
|
requirements:
|
219
121
|
- - "~>"
|
220
122
|
- !ruby/object:Gem::Version
|
221
|
-
version: '
|
123
|
+
version: '3.40'
|
222
124
|
- !ruby/object:Gem::Dependency
|
223
|
-
name:
|
125
|
+
name: database_cleaner
|
224
126
|
requirement: !ruby/object:Gem::Requirement
|
225
127
|
requirements:
|
226
128
|
- - "~>"
|
227
129
|
- !ruby/object:Gem::Version
|
228
|
-
version: '2.
|
130
|
+
version: '2.1'
|
229
131
|
type: :development
|
230
132
|
prerelease: false
|
231
133
|
version_requirements: !ruby/object:Gem::Requirement
|
232
134
|
requirements:
|
233
135
|
- - "~>"
|
234
136
|
- !ruby/object:Gem::Version
|
235
|
-
version: '2.
|
137
|
+
version: '2.1'
|
236
138
|
- !ruby/object:Gem::Dependency
|
237
|
-
name:
|
139
|
+
name: factory_bot_rails
|
238
140
|
requirement: !ruby/object:Gem::Requirement
|
239
141
|
requirements:
|
240
142
|
- - "~>"
|
241
143
|
- !ruby/object:Gem::Version
|
242
|
-
version: '
|
144
|
+
version: '6.4'
|
243
145
|
type: :development
|
244
146
|
prerelease: false
|
245
147
|
version_requirements: !ruby/object:Gem::Requirement
|
246
148
|
requirements:
|
247
149
|
- - "~>"
|
248
150
|
- !ruby/object:Gem::Version
|
249
|
-
version: '
|
151
|
+
version: '6.4'
|
250
152
|
- !ruby/object:Gem::Dependency
|
251
|
-
name:
|
153
|
+
name: generator_spec
|
252
154
|
requirement: !ruby/object:Gem::Requirement
|
253
155
|
requirements:
|
254
156
|
- - "~>"
|
255
157
|
- !ruby/object:Gem::Version
|
256
|
-
version: '
|
158
|
+
version: '0.10'
|
257
159
|
type: :development
|
258
160
|
prerelease: false
|
259
161
|
version_requirements: !ruby/object:Gem::Requirement
|
260
162
|
requirements:
|
261
163
|
- - "~>"
|
262
164
|
- !ruby/object:Gem::Version
|
263
|
-
version: '
|
165
|
+
version: '0.10'
|
264
166
|
- !ruby/object:Gem::Dependency
|
265
167
|
name: rspec-rails
|
266
168
|
requirement: !ruby/object:Gem::Requirement
|
@@ -289,34 +191,6 @@ dependencies:
|
|
289
191
|
- - "~>"
|
290
192
|
- !ruby/object:Gem::Version
|
291
193
|
version: '6.5'
|
292
|
-
- !ruby/object:Gem::Dependency
|
293
|
-
name: simplecov
|
294
|
-
requirement: !ruby/object:Gem::Requirement
|
295
|
-
requirements:
|
296
|
-
- - "~>"
|
297
|
-
- !ruby/object:Gem::Version
|
298
|
-
version: '0.22'
|
299
|
-
type: :development
|
300
|
-
prerelease: false
|
301
|
-
version_requirements: !ruby/object:Gem::Requirement
|
302
|
-
requirements:
|
303
|
-
- - "~>"
|
304
|
-
- !ruby/object:Gem::Version
|
305
|
-
version: '0.22'
|
306
|
-
- !ruby/object:Gem::Dependency
|
307
|
-
name: simplecov-lcov
|
308
|
-
requirement: !ruby/object:Gem::Requirement
|
309
|
-
requirements:
|
310
|
-
- - "~>"
|
311
|
-
- !ruby/object:Gem::Version
|
312
|
-
version: 0.8.0
|
313
|
-
type: :development
|
314
|
-
prerelease: false
|
315
|
-
version_requirements: !ruby/object:Gem::Requirement
|
316
|
-
requirements:
|
317
|
-
- - "~>"
|
318
|
-
- !ruby/object:Gem::Version
|
319
|
-
version: 0.8.0
|
320
194
|
description: Securial is a mountable Rails engine that provides robust, extensible
|
321
195
|
authentication and access control for Rails applications. It supports JWT, API tokens,
|
322
196
|
session-based auth, and is designed for easy integration with modern web and mobile
|
@@ -373,11 +247,11 @@ files:
|
|
373
247
|
- db/migrate/20250517155521_create_securial_users.rb
|
374
248
|
- db/migrate/20250518122749_create_securial_role_assignments.rb
|
375
249
|
- db/migrate/20250519075407_create_securial_sessions.rb
|
376
|
-
- db/migrate/20250524210207_add_password_reset_fields_to_securial_users.rb
|
377
250
|
- lib/generators/factory_bot/model/model_generator.rb
|
378
251
|
- lib/generators/factory_bot/templates/factory.erb
|
379
252
|
- lib/generators/securial/install/install_generator.rb
|
380
253
|
- lib/generators/securial/install/templates/securial_initializer.erb
|
254
|
+
- lib/generators/securial/install/views_generator.rb
|
381
255
|
- lib/generators/securial/jbuilder/jbuilder_generator.rb
|
382
256
|
- lib/generators/securial/jbuilder/templates/_resource.json.erb
|
383
257
|
- lib/generators/securial/jbuilder/templates/index.json.erb
|
@@ -388,7 +262,11 @@ files:
|
|
388
262
|
- lib/generators/securial/scaffold/templates/routes.erb
|
389
263
|
- lib/generators/securial/scaffold/templates/routing_spec.erb
|
390
264
|
- lib/securial.rb
|
391
|
-
- lib/securial/
|
265
|
+
- lib/securial/auth.rb
|
266
|
+
- lib/securial/auth/auth_encoder.rb
|
267
|
+
- lib/securial/auth/errors.rb
|
268
|
+
- lib/securial/auth/session_creator.rb
|
269
|
+
- lib/securial/config.rb
|
392
270
|
- lib/securial/config/configuration.rb
|
393
271
|
- lib/securial/config/errors.rb
|
394
272
|
- lib/securial/config/validation.rb
|
@@ -397,23 +275,30 @@ files:
|
|
397
275
|
- lib/securial/factories/securial/roles.rb
|
398
276
|
- lib/securial/factories/securial/sessions.rb
|
399
277
|
- lib/securial/factories/securial/users.rb
|
400
|
-
- lib/securial/helpers
|
278
|
+
- lib/securial/helpers.rb
|
401
279
|
- lib/securial/helpers/normalizing_helper.rb
|
402
280
|
- lib/securial/helpers/regex_helper.rb
|
403
|
-
- lib/securial/inspectors
|
281
|
+
- lib/securial/inspectors.rb
|
404
282
|
- lib/securial/inspectors/route_inspector.rb
|
283
|
+
- lib/securial/key_transformer.rb
|
405
284
|
- lib/securial/logger.rb
|
406
|
-
- lib/securial/
|
407
|
-
- lib/securial/
|
408
|
-
- lib/securial/
|
409
|
-
- lib/securial/
|
285
|
+
- lib/securial/logger/broadcaster.rb
|
286
|
+
- lib/securial/logger/builder.rb
|
287
|
+
- lib/securial/logger/colors.rb
|
288
|
+
- lib/securial/middlewares.rb
|
289
|
+
- lib/securial/middlewares/request_logger_tag.rb
|
290
|
+
- lib/securial/middlewares/transform_request_keys.rb
|
291
|
+
- lib/securial/middlewares/transform_response_keys.rb
|
292
|
+
- lib/securial/security.rb
|
293
|
+
- lib/securial/security/request_rate_limiter.rb
|
410
294
|
- lib/securial/version.rb
|
295
|
+
- lib/securial/version_checker.rb
|
411
296
|
- lib/tasks/securial_tasks.rake
|
412
297
|
homepage: https://github.com/AlyBadawy/Securial/wiki
|
413
298
|
licenses:
|
414
299
|
- MIT
|
415
300
|
metadata:
|
416
|
-
release_date: '2025-
|
301
|
+
release_date: '2025-06-01'
|
417
302
|
allowed_push_host: https://rubygems.org
|
418
303
|
homepage_uri: https://github.com/AlyBadawy/Securial/wiki
|
419
304
|
source_code_uri: https://github.com/AlyBadawy/Securial
|