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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f9275f3f097ae096f3de33a7b387e107d1a0e08fa01ae37d369a22e814db22d
4
- data.tar.gz: 3a2080a56ef021eccb2e398ec51f9c1bd474450924c00e1b8a0f82ad6fd13473
3
+ metadata.gz: 02dd58fcec06a9063b40e442d1d4c038d6674a2a3ca7f8a4376bd8794f596b35
4
+ data.tar.gz: 47dbe5284b761b4200719157c6df9d46eb6871e2891a5c7de466616bf47a13fd
5
5
  SHA512:
6
- metadata.gz: 9d7013d8e16ae68be5adfe2f8b38a9536d8acb4fda7b7907f0afe1d41c0fcda941a86bcef4c021d079211907c6a9081cdc22a5744eb6f7042fc94a9169edb0d4
7
- data.tar.gz: 36bc38a23ee63292623e95d32035d9b7962ff1070c71f91d424ea62a65393f704bdee0544c9fad97ce0f0f1f2495e700559c5b61f9a9a81401d4e02adb3b19e5
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
@@ -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.auto_scaling_group_name] }
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.updated_at < allowed_time_for_item(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 SecurePassword
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=(password)
36
- set encrypted_password: cipher.encrypt_and_sign(password)
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)
@@ -8,6 +8,7 @@ class UserModelAuditLog < UserAuditLog
8
8
  # Fields
9
9
  #
10
10
  field :changed_values, type: String
11
+ field :deleted_oid, type: BSON::ObjectId
11
12
  #
12
13
  # Relationships
13
14
  #
@@ -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/secure_password'
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'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '1.0.6'
4
+ VERSION = '1.0.12'
5
5
  end
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.6
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-08-27 00:00:00.000000000 Z
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