securial 2.0.0 → 2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cd71b4330338b3487c337e3345a294c964c21b7ac34e3e5092ebb53e09db858
4
- data.tar.gz: 8869be54802c27b6f31ec6ea4cd3e8c1c304014617e35195d6864c748a4cadde
3
+ metadata.gz: 5935f6936b886c221154aa2509102a9abeb05e3ff69102fa915ce522cbb77c55
4
+ data.tar.gz: fb51df105ce9224dc4dbe115424920deed702cf7a5c0ec5c6939fdbadc669661
5
5
  SHA512:
6
- metadata.gz: 58922b45d9f99983f45d9003f35e7236ea881010050b91ae3fc834737537fdd8e0bda7d601f9a9c6b99440b70daf2550638c92f5dddc7c8af3eb82ee5e7b5693
7
- data.tar.gz: 014ed5fafc13d0d94b81c8036a8d76bcb69bf3475ff100b8198d1743a238eac7cd5f3b8662799b88d759ed6c9b3bcdf790180345b08ff44b4f2f10e3bf21637f
6
+ metadata.gz: 53a75f18d1036097543661e55be3c4bb76a1949ee9ad36c7c3dddfac3a4bedd645d4d31d590a7c723536376f21b9c8cf8df14f5dd784e9de890fea60a9c3d072
7
+ data.tar.gz: f0d404b3564696c6052f4b9a92b39bb9833d507f83ec67fdf97703b3e7c9489afb8e7f78576518c7651624ee4d1199a70d2a425d3dbe590927bafbf3a72ae0db
@@ -62,7 +62,7 @@ module Securial
62
62
  controller_specs: true,
63
63
  request_specs: true,
64
64
  model_specs: true
65
- g.fixture_replacement :factory_bot, dir: "lib/securial/factories"
65
+ g.fixture_replacement :factory_bot
66
66
  g.template_engine :jbuilder
67
67
  end
68
68
  end
@@ -9,13 +9,6 @@ module Securial
9
9
  ]
10
10
  end
11
11
 
12
- initializer "securial.factory_bot", after: "factory_bot.set_factory_paths" do
13
- if defined?(FactoryBot)
14
- FactoryBot.definition_file_paths << Engine.root.join("lib", "securial", "factories")
15
- require_relative "../generators/factory_bot/model/model_generator"
16
- end
17
- end
18
-
19
12
  initializer "securial.security.request_rate_limiter" do |app|
20
13
  if Securial.configuration.rate_limiting_enabled
21
14
  Securial::Security::RequestRateLimiter.apply!
@@ -6,5 +6,5 @@ module Securial
6
6
  #
7
7
  # @see https://semver.org/ Semantic Versioning 2.0.0
8
8
  # @return [String] the current version in the format "major.minor.patch"
9
- VERSION = "2.0.0".freeze
9
+ VERSION = "2.1.0".freeze
10
10
  end
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: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aly Badawy
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-07-08 00:00:00.000000000 Z
10
+ date: 2025-07-09 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails
@@ -149,8 +149,6 @@ files:
149
149
  - db/migrate/20250604123805_create_securial_role_assignments.rb
150
150
  - db/migrate/20250604184841_create_securial_sessions.rb
151
151
  - db/migrate/20250606182648_seed_roles_and_users.rb
152
- - lib/generators/factory_bot/model/model_generator.rb
153
- - lib/generators/factory_bot/templates/factory.erb
154
152
  - lib/generators/securial/install/install_generator.rb
155
153
  - lib/generators/securial/install/templates/securial_initializer.erb
156
154
  - lib/generators/securial/install/views_generator.rb
@@ -179,10 +177,6 @@ files:
179
177
  - lib/securial/error/auth.rb
180
178
  - lib/securial/error/base_securial_error.rb
181
179
  - lib/securial/error/config.rb
182
- - lib/securial/factories/securial/role_assignments.rb
183
- - lib/securial/factories/securial/roles.rb
184
- - lib/securial/factories/securial/sessions.rb
185
- - lib/securial/factories/securial/users.rb
186
180
  - lib/securial/helpers.rb
187
181
  - lib/securial/helpers/key_transformer.rb
188
182
  - lib/securial/helpers/normalizing_helper.rb
@@ -207,7 +201,7 @@ licenses:
207
201
  - MIT
208
202
  metadata:
209
203
  homepage_uri: https://github.com/AlyBadawy/Securial/wiki
210
- release_date: '2025-07-08'
204
+ release_date: '2025-07-09'
211
205
  allowed_push_host: https://rubygems.org
212
206
  source_code_uri: https://github.com/AlyBadawy/Securial
213
207
  documentation_uri: https://alybadawy.github.io/Securial/_index.html
@@ -1,32 +0,0 @@
1
- require "rails/generators"
2
- require "rails/generators/named_base"
3
-
4
- # @!ignore
5
- module FactoryBot
6
- module Generators
7
- class ModelGenerator < Rails::Generators::NamedBase
8
- source_root File.expand_path("../templates", __dir__)
9
-
10
- argument :attributes, type: :array, default: [], banner: "field[:type] field[:type]"
11
-
12
- def create_factory_file
13
- template "factory.erb", File.join("lib/securial/factories/securial", "#{file_name.pluralize}.rb")
14
- end
15
-
16
- # Helper method accessible in the template
17
- def securial_attribute_defaults
18
- {
19
- string: '"MyString"',
20
- text: '"MyText"',
21
- integer: "1",
22
- float: "1.5",
23
- decimal: '"9.99"',
24
- datetime: "Time.zone.now",
25
- time: "Time.zone.now",
26
- date: "Time.zone.now",
27
- boolean: "false",
28
- }
29
- end
30
- end
31
- end
32
- end
@@ -1,7 +0,0 @@
1
- FactoryBot.define do
2
- factory :<%= "securial_#{file_name}" %>, class: "Securial::<%= class_name %>" do
3
- <% attributes.each do |attribute| -%>
4
- <%= attribute.name %> { <%= securial_attribute_defaults[attribute.type.to_sym] || 'nil' %> }
5
- <% end -%>
6
- end
7
- end
@@ -1,6 +0,0 @@
1
- FactoryBot.define do
2
- factory :securial_role_assignment, class: "Securial::RoleAssignment" do
3
- association :user, factory: :securial_user
4
- association :role, factory: :securial_role
5
- end
6
- end
@@ -1,18 +0,0 @@
1
- FactoryBot.define do
2
- factory :securial_role, class: "Securial::Role" do
3
- role_name { "MyString" }
4
- hide_from_profile { false }
5
-
6
- trait :admin do
7
- role_name { "Admin" }
8
- end
9
-
10
- trait :user do
11
- role_name { "User" }
12
- end
13
-
14
- trait :hidden do
15
- hide_from_profile { true }
16
- end
17
- end
18
- end
@@ -1,12 +0,0 @@
1
- FactoryBot.define do
2
- factory :securial_session, class: "Securial::Session" do
3
- ip_address { "127.0.0.1" }
4
- user_agent { "Ruby/RSpec" }
5
- refresh_count { 1 }
6
- refresh_token { SecureRandom.hex(64) }
7
- last_refreshed_at { Time.current }
8
- refresh_token_expires_at { 1.week.from_now }
9
- revoked { false }
10
- association :user, factory: :securial_user
11
- end
12
- end
@@ -1,17 +0,0 @@
1
- FactoryBot.define do
2
- factory :securial_user, class: "Securial::User" do
3
- email_address { Faker::Internet.email }
4
- password { "Password_.1" }
5
- password_confirmation { "Password_.1" }
6
- first_name { Faker::Name.first_name }
7
- last_name { Faker::Name.last_name }
8
- phone { Faker::PhoneNumber.cell_phone }
9
- username { Faker::Internet.username(specifier: 3..20) }
10
- bio { Faker::Lorem.paragraph }
11
-
12
- trait :admin do
13
- admin_role = Securial.configuration.admin_role.to_s.strip.titleize
14
- roles { [Securial::Role.find_or_create_by(role_name: admin_role)] }
15
- end
16
- end
17
- end