securial 0.2.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.

Potentially problematic release.


This version of securial might be problematic. Click here for more details.

checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e22e132a47996962dd118e5bb2103f8d60bc5f9e2d7af9ee3b8c99baca20060a
4
+ data.tar.gz: b20fc748fbbc987af627ff8fe30cbdaf67a7c0db168e1d29355065f8b2b09650
5
+ SHA512:
6
+ metadata.gz: a4015b2bfc0bb403d3816688e1a3d0481c9b40b750d5cdf6ac898abcf2ab352dfcbee308fe68b2dd799a7452d2717a21aa7c7553a5f73a54720b88bd286baaf7
7
+ data.tar.gz: 37d63d4212228b654ea528da4ed7b717e1980c4b71d248bac6a8370250d4593a84b8b80fd70d74d2fd21e7a4742cbd837be346d8db112dac309125ab3f5d2f5d
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright Aly Badawy
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # Securial
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem "securial"
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install securial
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module Securial
2
+ class ApplicationController < ActionController::Base
3
+ end
4
+ end
@@ -0,0 +1,51 @@
1
+ module Securial
2
+ class RolesController < ApplicationController
3
+ before_action :set_role, only: %i[ show update destroy ]
4
+
5
+ # GET /roles
6
+ def index
7
+ @roles = Role.all
8
+ end
9
+
10
+ # GET /roles/1
11
+ def show
12
+ end
13
+
14
+ # POST /roles
15
+ def create
16
+ @role = Role.new(role_params)
17
+
18
+ if @role.save
19
+ render :show, status: :created, location: @role
20
+ else
21
+ render json: @role.errors, status: :unprocessable_entity
22
+ end
23
+ end
24
+
25
+ # PATCH/PUT /roles/1
26
+ def update
27
+ if @role.update(role_params)
28
+ render :show, status: :ok, location: @role
29
+ else
30
+ render json: @role.errors, status: :unprocessable_entity
31
+ end
32
+ end
33
+
34
+ # DELETE /roles/1
35
+ def destroy
36
+ @role.destroy!
37
+ end
38
+
39
+ private
40
+
41
+ # Use callbacks to share common setup or constraints between actions.
42
+ def set_role
43
+ @role = Role.find(params.expect(:id))
44
+ end
45
+
46
+ # Only allow a list of trusted parameters through.
47
+ def role_params
48
+ params.expect(role: [ :role_name ])
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,4 @@
1
+ module Securial
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Securial
2
+ module RolesHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module Securial
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module Securial
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: "from@example.com"
4
+ layout "mailer"
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module Securial
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module Securial
2
+ class Role < ApplicationRecord
3
+ normalizes :role_name, with: ->(e) { e.strip.titleize }
4
+
5
+ validates :role_name, presence: true, uniqueness: true
6
+ end
7
+ end
@@ -0,0 +1,3 @@
1
+ json.extract! role, :id, :role_name
2
+ json.extract! role, :created_at, :updated_at # TODO: hide if not admin
3
+ json.url role_url(role, format: :json)
@@ -0,0 +1 @@
1
+ json.array! @roles, partial: "securial/roles/role", as: :role
@@ -0,0 +1 @@
1
+ json.partial! "securial/roles/role", role: @role
data/config/routes.rb ADDED
@@ -0,0 +1,5 @@
1
+ Securial::Engine.routes.draw do
2
+ defaults format: :json do
3
+ resources :roles
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ class CreateSecurialRoles < ActiveRecord::Migration[8.0]
2
+ def change
3
+ create_table :securial_roles do |t|
4
+ t.string :role_name
5
+
6
+ t.timestamps
7
+ end
8
+
9
+ add_index :securial_roles, :role_name, unique: true
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module Securial
2
+ class Engine < ::Rails::Engine
3
+ isolate_namespace Securial
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Securial
2
+ VERSION = "0.2.0"
3
+ end
data/lib/securial.rb ADDED
@@ -0,0 +1,6 @@
1
+ require "securial/version"
2
+ require "securial/engine"
3
+
4
+ module Securial
5
+ # Your code goes here...
6
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :securial do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,284 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: securial
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Aly Badawy
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-05-11 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rails
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '8.0'
19
+ - - ">="
20
+ - !ruby/object:Gem::Version
21
+ version: 8.0.2
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - "~>"
27
+ - !ruby/object:Gem::Version
28
+ version: '8.0'
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ version: 8.0.2
32
+ - !ruby/object:Gem::Dependency
33
+ name: jbuilder
34
+ requirement: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - "~>"
37
+ - !ruby/object:Gem::Version
38
+ version: '2.13'
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - "~>"
44
+ - !ruby/object:Gem::Version
45
+ version: '2.13'
46
+ - !ruby/object:Gem::Dependency
47
+ name: rspec-rails
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ type: :development
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ - !ruby/object:Gem::Dependency
61
+ name: capybara
62
+ requirement: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
67
+ type: :development
68
+ prerelease: false
69
+ version_requirements: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ - !ruby/object:Gem::Dependency
75
+ name: database_cleaner
76
+ requirement: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - ">="
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ type: :development
82
+ prerelease: false
83
+ version_requirements: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ - !ruby/object:Gem::Dependency
89
+ name: dotenv-rails
90
+ requirement: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ type: :development
96
+ prerelease: false
97
+ version_requirements: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ - !ruby/object:Gem::Dependency
103
+ name: factory_bot_rails
104
+ requirement: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ type: :development
110
+ prerelease: false
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
116
+ - !ruby/object:Gem::Dependency
117
+ name: faker
118
+ requirement: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ - !ruby/object:Gem::Dependency
131
+ name: pry-byebug
132
+ requirement: !ruby/object:Gem::Requirement
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: '0'
137
+ type: :development
138
+ prerelease: false
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: '0'
144
+ - !ruby/object:Gem::Dependency
145
+ name: pry-rails
146
+ requirement: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
151
+ type: :development
152
+ prerelease: false
153
+ version_requirements: !ruby/object:Gem::Requirement
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: shoulda-matchers
160
+ requirement: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ type: :development
166
+ prerelease: false
167
+ version_requirements: !ruby/object:Gem::Requirement
168
+ requirements:
169
+ - - ">="
170
+ - !ruby/object:Gem::Version
171
+ version: '0'
172
+ - !ruby/object:Gem::Dependency
173
+ name: simplecov
174
+ requirement: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ type: :development
180
+ prerelease: false
181
+ version_requirements: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ - !ruby/object:Gem::Dependency
187
+ name: rubocop
188
+ requirement: !ruby/object:Gem::Requirement
189
+ requirements:
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: '0'
193
+ type: :development
194
+ prerelease: false
195
+ version_requirements: !ruby/object:Gem::Requirement
196
+ requirements:
197
+ - - ">="
198
+ - !ruby/object:Gem::Version
199
+ version: '0'
200
+ - !ruby/object:Gem::Dependency
201
+ name: fasterer
202
+ requirement: !ruby/object:Gem::Requirement
203
+ requirements:
204
+ - - ">="
205
+ - !ruby/object:Gem::Version
206
+ version: '0'
207
+ type: :development
208
+ prerelease: false
209
+ version_requirements: !ruby/object:Gem::Requirement
210
+ requirements:
211
+ - - ">="
212
+ - !ruby/object:Gem::Version
213
+ version: '0'
214
+ - !ruby/object:Gem::Dependency
215
+ name: overcommit
216
+ requirement: !ruby/object:Gem::Requirement
217
+ requirements:
218
+ - - ">="
219
+ - !ruby/object:Gem::Version
220
+ version: '0'
221
+ type: :development
222
+ prerelease: false
223
+ version_requirements: !ruby/object:Gem::Requirement
224
+ requirements:
225
+ - - ">="
226
+ - !ruby/object:Gem::Version
227
+ version: '0'
228
+ description: Securial is a mountable Rails engine that provides robust, extensible
229
+ authentication and access control for Rails applications. It supports JWT, API tokens,
230
+ session-based auth, and is designed for easy integration with modern web and mobile
231
+ apps.
232
+ email:
233
+ - 1198568+AlyBadawy@users.noreply.github.com
234
+ executables: []
235
+ extensions: []
236
+ extra_rdoc_files: []
237
+ files:
238
+ - MIT-LICENSE
239
+ - README.md
240
+ - Rakefile
241
+ - app/assets/stylesheets/securial/application.css
242
+ - app/controllers/securial/application_controller.rb
243
+ - app/controllers/securial/roles_controller.rb
244
+ - app/helpers/securial/application_helper.rb
245
+ - app/helpers/securial/roles_helper.rb
246
+ - app/jobs/securial/application_job.rb
247
+ - app/mailers/securial/application_mailer.rb
248
+ - app/models/securial/application_record.rb
249
+ - app/models/securial/role.rb
250
+ - app/views/securial/roles/_role.json.jbuilder
251
+ - app/views/securial/roles/index.json.jbuilder
252
+ - app/views/securial/roles/show.json.jbuilder
253
+ - config/routes.rb
254
+ - db/migrate/20250511095806_create_securial_roles.rb
255
+ - lib/securial.rb
256
+ - lib/securial/engine.rb
257
+ - lib/securial/version.rb
258
+ - lib/tasks/securial_tasks.rake
259
+ homepage: https://github.com/AlyBadawy/Securial
260
+ licenses:
261
+ - MIT
262
+ metadata:
263
+ allowed_push_host: https://rubygems.org
264
+ homepage_uri: https://github.com/AlyBadawy/Securial
265
+ source_code_uri: https://github.com/AlyBadawy/Securial
266
+ changelog_uri: https://github.com/AlyBadawy/Securial/blob/main/CHANGELOG.md
267
+ rdoc_options: []
268
+ require_paths:
269
+ - lib
270
+ required_ruby_version: !ruby/object:Gem::Requirement
271
+ requirements:
272
+ - - ">="
273
+ - !ruby/object:Gem::Version
274
+ version: 3.4.1
275
+ required_rubygems_version: !ruby/object:Gem::Requirement
276
+ requirements:
277
+ - - ">="
278
+ - !ruby/object:Gem::Version
279
+ version: '0'
280
+ requirements: []
281
+ rubygems_version: 3.6.2
282
+ specification_version: 4
283
+ summary: Authentication and access control Rails engine for your API.
284
+ test_files: []