web47core 1.0.6 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/app/controllers/concerns/core_delayed_jobs_controller.rb +1 -1
- data/lib/app/jobs/cron/server.rb +1 -1
- data/lib/app/jobs/cron/trim_collection.rb +8 -1
- data/lib/app/models/concerns/{secure_password.rb → encrypted_password.rb} +4 -4
- data/lib/app/models/concerns/standard_model.rb +1 -0
- data/lib/app/models/user_model_audit_log.rb +1 -0
- data/lib/web47core.rb +1 -1
- data/lib/web47core/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02dd58fcec06a9063b40e442d1d4c038d6674a2a3ca7f8a4376bd8794f596b35
|
4
|
+
data.tar.gz: 47dbe5284b761b4200719157c6df9d46eb6871e2891a5c7de466616bf47a13fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 386b08bbb4ecdddac06239df45e88b2fa55013a2494238d130ac03c9ca81f060a6aa679168601d0adf59ee24c1ad66ff38edc97c84343a2bbca0b519b93ccc31
|
7
|
+
data.tar.gz: eb46d666048b0f2157c705a942b968b5c1e8a211842baca1e92d25d2e13a5bbbcee44a1aea2e7021b28e9d81fa54fc6bfb4d0afaf56b1281a3be1373bf40bb0e
|
@@ -10,7 +10,7 @@ module CoreDelayedJobsController
|
|
10
10
|
#
|
11
11
|
def index
|
12
12
|
authorize! :read, Delayed::Backend::Mongoid::Job
|
13
|
-
@delayed_jobs = Delayed::Backend::Mongoid::Job.asc(%i[priority run_at]).limit(100)
|
13
|
+
@delayed_jobs = Delayed::Backend::Mongoid::Job.asc(%i[locked_by priority run_at]).limit(100)
|
14
14
|
end
|
15
15
|
|
16
16
|
def show
|
data/lib/app/jobs/cron/server.rb
CHANGED
@@ -185,7 +185,7 @@ module Cron
|
|
185
185
|
# Returns the AutoScalingGroup associated with the account
|
186
186
|
#
|
187
187
|
def auto_scaling_group
|
188
|
-
filter = { auto_scaling_group_names: [sys_config.
|
188
|
+
filter = { auto_scaling_group_names: [sys_config.aws_auto_scaling_group_name] }
|
189
189
|
@auto_scaling_group ||= client.describe_auto_scaling_groups(filter).auto_scaling_groups.first
|
190
190
|
end
|
191
191
|
|
@@ -31,12 +31,19 @@ module Cron
|
|
31
31
|
# Test if this should be archived
|
32
32
|
#
|
33
33
|
def archive?(item)
|
34
|
-
item.
|
34
|
+
item.send(comparison_field) < allowed_time_for_item(item)
|
35
35
|
rescue StandardError => error
|
36
36
|
App47Logger.log_warn "Unable to archive item #{item.inspect}", error
|
37
37
|
false
|
38
38
|
end
|
39
39
|
|
40
|
+
#
|
41
|
+
# Return which field to use for comparison when trimming objects
|
42
|
+
#
|
43
|
+
def comparison_field
|
44
|
+
:updated_at
|
45
|
+
end
|
46
|
+
|
40
47
|
#
|
41
48
|
# Try to get a TTL from System configuration, otherwise return the default
|
42
49
|
#
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# The security will lie in the key that is offered by the object. By default it will be the ID of the object
|
5
5
|
# however it should really use be combined with some other known value like account.id or something
|
6
6
|
#
|
7
|
-
module
|
7
|
+
module EncryptedPassword
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
#
|
10
10
|
# Base class extension
|
@@ -23,7 +23,7 @@ module SecurePassword
|
|
23
23
|
# Retrieve the password
|
24
24
|
#
|
25
25
|
def password
|
26
|
-
cipher.decrypt_and_verify(encrypted_password)
|
26
|
+
encrypted_password.present? ? cipher.decrypt_and_verify(encrypted_password) : ''
|
27
27
|
rescue StandardError => error
|
28
28
|
App47Logger.log_warn("Unable to retrieve password for #{inspect}", error)
|
29
29
|
nil
|
@@ -32,8 +32,8 @@ module SecurePassword
|
|
32
32
|
#
|
33
33
|
# Set the password
|
34
34
|
#
|
35
|
-
def password=(
|
36
|
-
set encrypted_password: cipher.encrypt_and_sign(
|
35
|
+
def password=(pass)
|
36
|
+
set encrypted_password: cipher.encrypt_and_sign(pass)
|
37
37
|
rescue StandardError => error
|
38
38
|
App47Logger.log_error("Unable to store password for #{inspect}", error)
|
39
39
|
nil
|
@@ -312,6 +312,7 @@ module StandardModel
|
|
312
312
|
#
|
313
313
|
def log_deletion(user, model)
|
314
314
|
Web47core::Config.audit_model_log_class.create!(Web47core::Config.audit_model => user,
|
315
|
+
deleted_oid: model.id,
|
315
316
|
model: model,
|
316
317
|
action: AuditLog::DELETE_ACTION,
|
317
318
|
changed_values: App47Logger.clean_params(attributes).to_json)
|
data/lib/web47core.rb
CHANGED
@@ -11,7 +11,7 @@ require 'app/models/concerns/switchboard_able'
|
|
11
11
|
require 'app/models/concerns/core_system_configuration'
|
12
12
|
require 'app/models/concerns/core_account'
|
13
13
|
require 'app/models/concerns/secure_fields'
|
14
|
-
require 'app/models/concerns/
|
14
|
+
require 'app/models/concerns/encrypted_password'
|
15
15
|
require 'app/models/delayed_job'
|
16
16
|
require 'app/models/redis_configuration'
|
17
17
|
require 'app/models/notification'
|
data/lib/web47core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web47core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Schroeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -637,10 +637,10 @@ files:
|
|
637
637
|
- lib/app/models/concerns/core_account.rb
|
638
638
|
- lib/app/models/concerns/core_system_configuration.rb
|
639
639
|
- lib/app/models/concerns/email_able.rb
|
640
|
+
- lib/app/models/concerns/encrypted_password.rb
|
640
641
|
- lib/app/models/concerns/role_able.rb
|
641
642
|
- lib/app/models/concerns/search_able.rb
|
642
643
|
- lib/app/models/concerns/secure_fields.rb
|
643
|
-
- lib/app/models/concerns/secure_password.rb
|
644
644
|
- lib/app/models/concerns/standard_model.rb
|
645
645
|
- lib/app/models/concerns/switchboard_able.rb
|
646
646
|
- lib/app/models/concerns/time_zone_able.rb
|