web47core 2.3.4 → 3.0.0

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: 31b38813fc7d1c16603801b25f7d492224f3886386461a50d4f8e91a3ff51b3e
4
- data.tar.gz: de115bf54fdcde3b96a6b92323e1f05b17905223e076bb68cd7348486e17084e
3
+ metadata.gz: 566b3144e56826da109dad9c9aae596d8ae7f875d92d253f846dda027a44911b
4
+ data.tar.gz: 1e3688dcb0aea6d837b27a9417f085f6c0243577c2cc012cb65946ae22a3564f
5
5
  SHA512:
6
- metadata.gz: c3f63eab087e86cf2f580788ad7fcfe9fcfd19809e35c251d66fc180d788a4c68f0ee1a42e5829906f1e2980d324e5c139de73495725982f4164814ee9c060df
7
- data.tar.gz: 1cfa9fca62355cca99ea8673fd63ea73899ac529ca613db84b30e2e2022a9f572346f4cdfcae17576289b6d84cc89853b3710c92c997825115b6146689777928
6
+ metadata.gz: d355f655ffa529310e5b482b9cf24aec78dee43058214b48804f71db4aab8998bca051f5a6bff384dc5e3d4aa3f593b0ef65d6ff345598cb9dc2b03cdf556240
7
+ data.tar.gz: 2b57edd50900933a14f46bc39c8e382d5562cc422e542a5380b357544789972a2af1d3bbc636a5c118b17210086cc20fc1276613930d3b09dfacbe9a5adea7c9
data/README.md CHANGED
@@ -188,9 +188,7 @@ The following routes should be added to the correct namespace for your applicait
188
188
  #
189
189
  # System configuration
190
190
  #
191
- resource :system_configurations, only: %i[edit update show] do
192
- get :sync
193
- end
191
+ resource :system_configurations, only: %i[edit update show]
194
192
  #
195
193
  # Delayed jobs
196
194
  #
@@ -96,7 +96,13 @@ class StatusController < ActionController::Base
96
96
  #
97
97
  def delayed_jobs_status
98
98
  count = Delayed::Backend::Mongoid::Job.count
99
- report_success "#{count} Jobs", count: count
99
+ oldest = Delayed::Backend::Mongoid::Job.asc(:_id).limit(1).first
100
+ job_age = if oldest.present?
101
+ Time.now.utc.to_i - oldest.created_at.to_i
102
+ else
103
+ 0
104
+ end
105
+ report_success "#{count} Jobs", count: count, job_age: job_age
100
106
  rescue StandardError => error
101
107
  report_error(error)
102
108
  end
@@ -7,7 +7,6 @@
7
7
  .card-title=SystemConfiguration.environment.titleize
8
8
  .card-tray
9
9
  = edit_link_tag(SystemConfiguration, class_action_path(:edit))
10
- = replay_link_tag(SystemConfiguration, class_action_path(:sync))
11
10
  .card
12
11
  .card-content.section-data-tables
13
12
  %table.highlight.striped.data-table
@@ -16,7 +15,7 @@
16
15
  =table_header_tag :field
17
16
  =table_header_tag :value
18
17
  %tbody
19
- - SystemConfiguration.allowed_param_names.sort.each do |field|
18
+ - SystemConfiguration.allowed_param_names.each do |field|
20
19
  %tr
21
20
  %td=field
22
21
  %td=mask_system_configuration(field)
@@ -10,26 +10,15 @@ module CoreSystemConfigurationsController
10
10
  # Edit the system configuration
11
11
  #
12
12
  def edit
13
- system_configuration
14
- end
15
-
16
- # @abstract Cause the system configuration to be synced with the switchboard server
17
- def sync
18
- raise 'System Configuration not configured to sync' unless SystemConfiguration.switchboard_configured?
19
-
20
- Cron::SwitchboardSyncConfiguration.perform_later
21
- flash[:info] = 'System Configuration Refreshing in the Background'
22
- redirect_to index_path
23
- rescue StandardError => error
24
- log_controller_error error, true
25
- redirect_to index_path
13
+ load_configuration
26
14
  end
27
15
 
28
16
  #
29
17
  # Update and log the system configuration changes
30
18
  #
31
19
  def update
32
- system_configuration.update! system_configuration_params
20
+ # @system_configuration.update_attributes_and_log! @current_admin_user, system_configuration_params
21
+ SystemConfiguration.configuration.update! system_configuration_params
33
22
  if SystemConfiguration.switchboard_configured?
34
23
  flash[:info] = 'System Configuration Updated, sync job running in the background'
35
24
  Cron::SwitchboardSyncConfiguration.perform_later
@@ -39,7 +28,7 @@ module CoreSystemConfigurationsController
39
28
  redirect_to index_path
40
29
  rescue StandardError => error
41
30
  log_controller_error error
42
- system_configuration
31
+ load_configuration
43
32
  render :edit
44
33
  end
45
34
 
@@ -55,7 +44,7 @@ module CoreSystemConfigurationsController
55
44
  #
56
45
  # Load the current system configuration
57
46
  #
58
- def system_configuration
47
+ def load_configuration
59
48
  @system_configuration = SystemConfiguration.configuration
60
49
  end
61
50
  end
@@ -13,7 +13,6 @@ class ApplicationJob < ActiveJob::Base
13
13
  # Standard approach to running jobs
14
14
  #
15
15
  def perform(payload = {})
16
- Rails.cache.reconnect
17
16
  @started_at = Time.now.utc
18
17
  @payload = payload
19
18
  parse_payload
@@ -18,7 +18,7 @@ module Cron
18
18
  # Fields
19
19
  #
20
20
  field :name, type: String
21
- field :enabled, type: Boolean, default: true
21
+ field :enabled, type: Mongoid::Boolean, default: true
22
22
  field :min, type: String, default: 0
23
23
  field :hour, type: String, default: 0
24
24
  field :wday, type: String, default: WILDCARD
@@ -11,7 +11,7 @@ module ApiTokenable
11
11
  # store api token
12
12
  field :api_token, type: String
13
13
  # if the api token should be reset
14
- field :reset_api_token, type: Boolean, default: true
14
+ field :reset_api_token, type: Mongoid::Boolean, default: true
15
15
  field :last_authenticated_at, type: Time
16
16
  field :last_authenticated_ip, type: String
17
17
  # call back to reset the api token.
@@ -15,7 +15,6 @@ module AwsConfiguration
15
15
  field :aws_access_key_id, type: String
16
16
  field :aws_secret_access_key, type: String
17
17
  field :aws_auto_scaling_group_name, type: String
18
- field :aws_bucket_name, type: String
19
18
  end
20
19
  end
21
20
 
@@ -23,7 +22,7 @@ module AwsConfiguration
23
22
  # Make sure the password doesn't get blanked out on an update
24
23
  #
25
24
  def secure_fields
26
- super + %i[aws_secret_access_key]
25
+ super + %i[aws_access_secret]
27
26
  end
28
27
 
29
28
  #
@@ -39,31 +38,4 @@ module AwsConfiguration
39
38
  def aws_auto_scaling_configured?
40
39
  aws_configured? && aws_auto_scaling_group_name.present?
41
40
  end
42
-
43
- def aws_credentials
44
- @aws_credentials ||= Aws::Credentials.new(aws_access_key_id,
45
- aws_secret_access_key)
46
- end
47
-
48
- #
49
- # AWS client.
50
- #
51
- def aws_ec2_client
52
- return nil unless aws_configured?
53
-
54
- @aws_ec2_client ||= Aws::EC2::Client.new(region: aws_region, credentials: aws_credentials);
55
- end
56
-
57
- #
58
- # S3 Client
59
- #
60
- def aws_s3_client
61
- return nil unless aws_configured?
62
-
63
- # We want this to remake itself each time because it is possible that the
64
- # => user would change the access keys in between actions. Huh?
65
- @aws_s3_client ||= Aws::S3::Client.new(region: aws_region,
66
- access_key_id: aws_access_key_id,
67
- secret_access_key: aws_secret_access_key)
68
- end
69
41
  end
@@ -17,9 +17,14 @@
17
17
  #
18
18
  module CdnUrl
19
19
  extend ActiveSupport::Concern
20
+ #
21
+ # Constants
22
+ #
23
+ STYLE_S3_FILE_PATH = ':class/:attachment/:id/:style.:extension' unless defined? STYLE_S3_FILE_PATH
24
+ STYLE_FILE_PATH = 'public/system/:class/:attachment/:id/:style.:extension' unless defined? STYLE_FILE_PATH
25
+ STYLE_S3_FILE_URL = ':s3_domain_url' unless defined? STYLE_S3_FILE_URL
26
+ STYLE_FILE_URL = ':rails_root/public/system/:class/:attachment/:id/:style.:extension' unless defined? STYLE_FILE_URL
20
27
 
21
- # @abstract Catch methods started with `cdn_` and respond to those requests if there is a
22
- # matching method ending in `_url`
23
28
  def method_missing(method, *args)
24
29
  if method.to_s.start_with? 'cdn_'
25
30
  url = if args.blank?
@@ -19,7 +19,7 @@ module CoreSmtpConfiguration
19
19
  field :smtp_port, type: Integer, default: 587
20
20
  field :smtp_user_name, type: String
21
21
  field :smtp_password, type: String
22
- field :smtp_enable_starttls_auto, type: Boolean, default: false
22
+ field :smtp_enable_starttls_auto, type: Mongoid::Boolean, default: false
23
23
  field :mailgun_api_key, type: String
24
24
  field :email_notification_ttl, type: Integer, default: 180
25
25
  end
@@ -14,11 +14,6 @@
14
14
  #
15
15
  module CoreSystemConfiguration
16
16
  extend ActiveSupport::Concern
17
- EMAIL_PROVIDER_SMTP_TYPE = 'smtp'.freeze unless defined? EMAIL_PROVIDER_SMTP_TYPE
18
- EMAIL_PROVIDER_SES_TYPE = 'ses'.freeze unless defined? EMAIL_PROVIDER_SES_TYPE
19
- unless defined? ALL_EMAIL_PROVIDER_TYPES
20
- ALL_EMAIL_PROVIDER_TYPES = [EMAIL_PROVIDER_SMTP_TYPE, EMAIL_PROVIDER_SES_TYPE].freeze
21
- end
22
17
 
23
18
  def self.included(base)
24
19
  base.class_eval do
@@ -28,14 +23,13 @@ module CoreSystemConfiguration
28
23
  # Fields
29
24
  #
30
25
  field :environment, type: String, default: 'test'
31
- field :fips_mode, type: Boolean, default: false
26
+ field :fips_mode, type: Mongoid::Boolean, default: false
32
27
  field :fav_icon_path, { type: String, default: '/favicon.ico' }
33
28
  field :stack_logo_path, { type: String, default: 'ui-company-logo.png' }
34
29
  field :primary_stylesheet, { type: String, default: 'app47' }
35
30
  field :short_cache, { type: Integer, default: 1 }
36
31
  field :medium_cache, { type: Integer, default: 5 }
37
32
  field :long_cache, { type: Integer, default: 15 }
38
- field :stack_email_provider, type: String, default: EMAIL_PROVIDER_SMTP_TYPE
39
33
  # URLs
40
34
  field :base_url, type: String
41
35
  field :cdn_url, type: String
@@ -49,7 +43,6 @@ module CoreSystemConfiguration
49
43
  #
50
44
  validates :environment, presence: true, uniqueness: true
51
45
  validates :default_time_zone, presence: true
52
- validates :stack_email_provider, inclusion: { in: ALL_EMAIL_PROVIDER_TYPES }
53
46
  end
54
47
  base.extend ClassMethods
55
48
  end
@@ -65,9 +58,9 @@ module CoreSystemConfiguration
65
58
  #
66
59
  # NOTE: Currently ignored Codacy issue: When using 'method_missing', fall back on 'super'
67
60
  #
68
- def method_missing(method, *args, &block)
61
+ def method_missing(method, ...)
69
62
  if configuration.respond_to?(method)
70
- configuration.send(method, *args, &block)
63
+ configuration.send(method, ...)
71
64
  else
72
65
  super
73
66
  end
@@ -82,14 +75,6 @@ module CoreSystemConfiguration
82
75
  end
83
76
  end
84
77
 
85
- def stack_ses_provider?
86
- EMAIL_PROVIDER_SES_TYPE.eql?(stack_email_provider)
87
- end
88
-
89
- def stack_smtp_provider?
90
- EMAIL_PROVIDER_SMTP_TYPE.eql?(stack_email_provider)
91
- end
92
-
93
78
  #
94
79
  # Cache times in minutes
95
80
  #
@@ -13,7 +13,7 @@ module DelayedJobConfiguration
13
13
  #
14
14
  field :delayed_job_max_allowed_method, type: String, default: 'max'
15
15
  field :delayed_job_max_allowed_factor, type: Integer, default: 5
16
- field :delayed_job_restart_orphaned, type: Boolean, default: false
16
+ field :delayed_job_restart_orphaned, type: Mongoid::Boolean, default: false
17
17
  #
18
18
  # Validations
19
19
  #
@@ -17,7 +17,7 @@ module EmailAble
17
17
  field :email_bounced_at, type: Time
18
18
  field :email_bounce_reason, type: String
19
19
  field :unconfirmed_email, type: String
20
- field :email_enabled, type: Boolean, default: true
20
+ field :email_enabled, type: Mongoid::Boolean, default: true
21
21
  #
22
22
  # Validations
23
23
  #
@@ -13,7 +13,7 @@ module ServerProcessAble
13
13
  #
14
14
  field :host_name, type: String
15
15
  field :pid, type: Integer
16
- field :running, type: Boolean, default: false
16
+ field :running, type: Mongoid::Boolean, default: false
17
17
  field :last_check_in_at, type: Time
18
18
  #
19
19
  # Validations
@@ -69,7 +69,7 @@ module StandardModel
69
69
  names = field_names(filter_names)
70
70
  names += associations if include_relationships
71
71
  names.delete_if { |name| filter_names.include?(name) }
72
- rescue StandardError
72
+ rescue StandardError => error
73
73
  attribute_names.delete_if { |name| filter_names.include?(name) }
74
74
  end
75
75
 
@@ -87,12 +87,8 @@ module StandardModel
87
87
  #
88
88
  def many_to_many_associations
89
89
  associations = []
90
- reflect_on_all_associations.each do |association|
91
- if Mongoid::Compatibility::Version.mongoid7_or_newer?
92
- next unless association.relation == Mongoid::Association::Referenced::HasAndBelongsToMany::Proxy
93
- else
94
- next unless association.macro == :has_and_belongs_to_many
95
- end
90
+ reflect_on_all_associations(:has_and_belongs_to_many).each do |association|
91
+ next unless association.relation == Mongoid::Association::Referenced::HasAndBelongsToMany::Proxy
96
92
 
97
93
  associations << { association.key => [] }
98
94
  end
@@ -11,7 +11,7 @@ module Delayed
11
11
  #
12
12
  # Relationships
13
13
  #
14
- has_many :runs, class_name: 'Delayed::Jobs::Run', dependent: :restrict
14
+ has_many :runs, class_name: 'Delayed::Jobs::Run', dependent: :restrict_with_exception
15
15
 
16
16
  #
17
17
  # Record a job relative to the worker
@@ -36,62 +36,60 @@ class EmailNotification < Notification
36
36
  field :cc, type: String
37
37
  # The subject
38
38
  field :subject, type: String
39
- field :message_id, type: String
40
39
  #
41
40
  # Validations
42
41
  #
43
42
  validates :subject, presence: true
44
43
  validates :to, presence: true
45
- # Callbacks
46
- before_save :ensure_headers
44
+
45
+ # has_many :attachments, class_name: 'EmailNotificationAttachment', dependent: :destroy
47
46
 
48
47
  def from_template(template_name, locals = {})
49
48
  super
50
49
  self.subject = subject_from_template(template_name, locals)
51
50
  end
52
51
 
52
+ #
53
+ # Add a file as an attachment to this email notification.
54
+ #
55
+ # Expecting a path to the file, not the file or data itself.
56
+ # TODO consider how to handle a file object or data object.
57
+ #
58
+ # Once you have called this method, the file is stored via PaperClip and
59
+ # does not need to stay persistant through email delivery.
60
+ # You can delete it after telling the EmailNotification to send
61
+ # the notification.
62
+ #
63
+ # def add_file(file)
64
+ # # Make sure we are saved
65
+ # save! unless persisted?
66
+ # attachment = EmailNotificationAttachment.new email_notification: self
67
+ # attachment.file = open(file)
68
+ # attachment.save!
69
+ # end
53
70
  def deliver_message!
54
- if account.present? && account.fetch_smtp_configuration.use?
55
- deliver_smtp_message!
56
- elsif SystemConfiguration.stack_smtp_provider?
57
- deliver_smtp_message!
58
- elsif SystemConfiguration.ses_configured?
59
- deliver_ses_message!
60
- else
61
- fail "Invalid configuration in stack for sending emails"
62
- end
63
- end
64
-
65
- def deliver_ses_message!
66
- config = SystemConfiguration.configuration
67
- client = config.aws_ses_client
68
- payload = { destination: { to_addresses: [to] },
69
- message: {
70
- body: { html: { data: build_message } },
71
- subject: { data: subject } },
72
- source: from }
73
- payload[:reply_to_addresses] = [reply_to] if reply_to.present?
74
- resp = client.send_email(payload)
75
- self.message_id = resp[:message_id]
76
- end
77
-
78
- def deliver_smtp_message!
79
71
  mail = Mail.new
80
72
  # Set the from line
81
- mail.from = from
73
+ address = from_address
74
+ mail.from = address
75
+ self.from = address
82
76
  # Set the sender line
83
- mail.sender = sender
77
+ address = sender_address
78
+ mail.sender = address
79
+ self.sender = address
84
80
  # Set the reply to
85
- if reply_to_address.present?
86
- mail.reply_to = reply_to_address
87
- mail.sender = reply_to_address
81
+ address = reply_to_address
82
+ if address.present?
83
+ self.reply_to = address
84
+ mail.reply_to = address
85
+ mail.sender = address
88
86
  end
89
87
 
90
88
  # Set the to address
91
89
  mail.to = to
92
90
 
93
91
  # Set the cc line
94
- mail.cc = cc if cc.present?
92
+ mail.cc = cc unless cc.nil?
95
93
 
96
94
  # Set the subject line
97
95
  mail.subject = subject
@@ -103,6 +101,9 @@ class EmailNotification < Notification
103
101
  body html_message
104
102
  end
105
103
 
104
+ # Add the attachments, if there are any. If not, none are added.
105
+ add_attachments(attachments) if defined?(attachments)
106
+
106
107
  # Setup the delivery method for this message only.
107
108
  if 'test'.eql?(ENV['RAILS_ENV'])
108
109
  mail.delivery_method :test
@@ -120,12 +121,19 @@ class EmailNotification < Notification
120
121
  FileUtils.remove_entry_secure(tmp_dir) if defined?(tmp_dir) && tmp_dir.present?
121
122
  end
122
123
 
123
- # @abstract Ensure the headers of the message are set regardless if we are using
124
- # ses or smtp
125
- def ensure_headers
126
- self.from = from_address
127
- self.sender = sender_address
128
- self.reply_to = reply_to_address
124
+ def add_attachments(attachments = nil)
125
+ tmp_dir = Dir.mktmpdir
126
+ attachments.each do |attachment|
127
+ # Create a temp directory, it'll get cleaned up in the rescue.
128
+ tmp_file_path = "#{tmp_dir}/#{attachment.file_file_name}"
129
+ File.open(tmp_file_path, 'w') do |f|
130
+ f.write(URI.parse(attachment.file_url).open.read.force_encoding('utf-16').encode)
131
+ end
132
+ mail.attachments[attachment.file_file_name] = {
133
+ mime_type: attachment.file_content_type,
134
+ content: File.open(tmp_file_path).read.force_encoding('utf-16').encode
135
+ }
136
+ end
129
137
  end
130
138
 
131
139
  #
@@ -7,7 +7,7 @@ class NotificationTemplate < Template
7
7
  #
8
8
  # Fields
9
9
  #
10
- field :draft, type: Boolean, default: true
10
+ field :draft, type: Mongoid::Boolean, default: true
11
11
  #
12
12
  # Relationships
13
13
  #
@@ -10,10 +10,10 @@ class SmtpConfiguration
10
10
  field :port, type: Integer, default: 587
11
11
  field :authentication_method, type: String
12
12
  field :confirmation_token, type: String
13
- field :confirmed, type: Boolean, default: false
13
+ field :confirmed, type: Mongoid::Boolean, default: false
14
14
  field :verification_message, type: String
15
- field :active, type: Boolean, default: false
16
- field :ssl, type: Boolean, default: false
15
+ field :active, type: Mongoid::Boolean, default: false
16
+ field :ssl, type: Mongoid::Boolean, default: false
17
17
  field :server_name, type: String
18
18
  field :username, type: String
19
19
  field :password, type: String
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Web47core
4
- VERSION = '2.3.4'
4
+ VERSION = '3.0.0'
5
5
  end
data/lib/web47core.rb CHANGED
@@ -9,8 +9,6 @@ require 'app/models/concerns/cdn_url'
9
9
  require 'app/models/concerns/delayed_job_configuration'
10
10
  require 'app/models/concerns/email_able'
11
11
  require 'app/models/concerns/encrypted_password'
12
- require 'app/models/concerns/google_sso_configuration'
13
- require 'app/models/concerns/ses_configuration'
14
12
  require 'app/models/concerns/search_able'
15
13
  require 'app/models/concerns/role_able'
16
14
  require 'app/models/concerns/time_zone_able'
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: 2.3.4
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schroeder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-08 00:00:00.000000000 Z
11
+ date: 2022-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -44,120 +44,70 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.52'
48
- - - "<"
49
- - !ruby/object:Gem::Version
50
- version: '2'
51
- type: :runtime
52
- prerelease: false
53
- version_requirements: !ruby/object:Gem::Requirement
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- version: '1.52'
58
- - - "<"
59
- - !ruby/object:Gem::Version
60
- version: '2'
61
- - !ruby/object:Gem::Dependency
62
- name: aws-sdk-ses
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- version: '1.55'
68
- - - "<"
69
- - !ruby/object:Gem::Version
70
- version: '2'
47
+ version: '0'
71
48
  type: :runtime
72
49
  prerelease: false
73
50
  version_requirements: !ruby/object:Gem::Requirement
74
51
  requirements:
75
52
  - - ">="
76
53
  - !ruby/object:Gem::Version
77
- version: '1.55'
78
- - - "<"
79
- - !ruby/object:Gem::Version
80
- version: '2'
54
+ version: '0'
81
55
  - !ruby/object:Gem::Dependency
82
56
  name: cancancan
83
57
  requirement: !ruby/object:Gem::Requirement
84
58
  requirements:
85
59
  - - ">="
86
60
  - !ruby/object:Gem::Version
87
- version: '3'
88
- - - "<"
89
- - !ruby/object:Gem::Version
90
- version: '4'
61
+ version: '0'
91
62
  type: :runtime
92
63
  prerelease: false
93
64
  version_requirements: !ruby/object:Gem::Requirement
94
65
  requirements:
95
66
  - - ">="
96
67
  - !ruby/object:Gem::Version
97
- version: '3'
98
- - - "<"
99
- - !ruby/object:Gem::Version
100
- version: '4'
68
+ version: '0'
101
69
  - !ruby/object:Gem::Dependency
102
70
  name: daemons
103
71
  requirement: !ruby/object:Gem::Requirement
104
72
  requirements:
105
73
  - - ">="
106
74
  - !ruby/object:Gem::Version
107
- version: 1.3.1
108
- - - "<"
109
- - !ruby/object:Gem::Version
110
- version: '2'
75
+ version: '0'
111
76
  type: :runtime
112
77
  prerelease: false
113
78
  version_requirements: !ruby/object:Gem::Requirement
114
79
  requirements:
115
80
  - - ">="
116
81
  - !ruby/object:Gem::Version
117
- version: 1.3.1
118
- - - "<"
119
- - !ruby/object:Gem::Version
120
- version: '2'
82
+ version: '0'
121
83
  - !ruby/object:Gem::Dependency
122
84
  name: delayed_job_mongoid
123
85
  requirement: !ruby/object:Gem::Requirement
124
86
  requirements:
125
87
  - - ">="
126
88
  - !ruby/object:Gem::Version
127
- version: '2.3'
128
- - - "<"
129
- - !ruby/object:Gem::Version
130
- version: '3'
89
+ version: '0'
131
90
  type: :runtime
132
91
  prerelease: false
133
92
  version_requirements: !ruby/object:Gem::Requirement
134
93
  requirements:
135
94
  - - ">="
136
95
  - !ruby/object:Gem::Version
137
- version: '2.3'
138
- - - "<"
139
- - !ruby/object:Gem::Version
140
- version: '3'
96
+ version: '0'
141
97
  - !ruby/object:Gem::Dependency
142
98
  name: email_format
143
99
  requirement: !ruby/object:Gem::Requirement
144
100
  requirements:
145
101
  - - ">="
146
102
  - !ruby/object:Gem::Version
147
- version: '1'
148
- - - "<"
149
- - !ruby/object:Gem::Version
150
- version: '2'
103
+ version: '0'
151
104
  type: :runtime
152
105
  prerelease: false
153
106
  version_requirements: !ruby/object:Gem::Requirement
154
107
  requirements:
155
108
  - - ">="
156
109
  - !ruby/object:Gem::Version
157
- version: '1'
158
- - - "<"
159
- - !ruby/object:Gem::Version
160
- version: '2'
110
+ version: '0'
161
111
  - !ruby/object:Gem::Dependency
162
112
  name: haml
163
113
  requirement: !ruby/object:Gem::Requirement
@@ -178,94 +128,70 @@ dependencies:
178
128
  requirements:
179
129
  - - ">="
180
130
  - !ruby/object:Gem::Version
181
- version: 2.2.0
182
- - - "<"
183
- - !ruby/object:Gem::Version
184
- version: '3'
131
+ version: '0'
185
132
  type: :runtime
186
133
  prerelease: false
187
134
  version_requirements: !ruby/object:Gem::Requirement
188
135
  requirements:
189
136
  - - ">="
190
137
  - !ruby/object:Gem::Version
191
- version: 2.2.0
192
- - - "<"
193
- - !ruby/object:Gem::Version
194
- version: '3'
138
+ version: '0'
195
139
  - !ruby/object:Gem::Dependency
196
140
  name: liquid
197
141
  requirement: !ruby/object:Gem::Requirement
198
142
  requirements:
199
143
  - - ">="
200
144
  - !ruby/object:Gem::Version
201
- version: '5'
202
- - - "<"
203
- - !ruby/object:Gem::Version
204
- version: '6'
145
+ version: '0'
205
146
  type: :runtime
206
147
  prerelease: false
207
148
  version_requirements: !ruby/object:Gem::Requirement
208
149
  requirements:
209
150
  - - ">="
210
151
  - !ruby/object:Gem::Version
211
- version: '5'
212
- - - "<"
213
- - !ruby/object:Gem::Version
214
- version: '6'
152
+ version: '0'
215
153
  - !ruby/object:Gem::Dependency
216
154
  name: materialize-sass
217
155
  requirement: !ruby/object:Gem::Requirement
218
156
  requirements:
219
157
  - - ">="
220
158
  - !ruby/object:Gem::Version
221
- version: 1.0.0
222
- - - "<"
223
- - !ruby/object:Gem::Version
224
- version: '2'
159
+ version: '0'
225
160
  type: :runtime
226
161
  prerelease: false
227
162
  version_requirements: !ruby/object:Gem::Requirement
228
163
  requirements:
229
164
  - - ">="
230
165
  - !ruby/object:Gem::Version
231
- version: 1.0.0
232
- - - "<"
233
- - !ruby/object:Gem::Version
234
- version: '2'
166
+ version: '0'
235
167
  - !ruby/object:Gem::Dependency
236
168
  name: mongoid
237
169
  requirement: !ruby/object:Gem::Requirement
238
170
  requirements:
239
- - - "<"
171
+ - - "~>"
240
172
  - !ruby/object:Gem::Version
241
- version: '7'
173
+ version: 7.5.2
242
174
  type: :runtime
243
175
  prerelease: false
244
176
  version_requirements: !ruby/object:Gem::Requirement
245
177
  requirements:
246
- - - "<"
178
+ - - "~>"
247
179
  - !ruby/object:Gem::Version
248
- version: '7'
180
+ version: 7.5.2
249
181
  - !ruby/object:Gem::Dependency
250
182
  name: rails
251
183
  requirement: !ruby/object:Gem::Requirement
252
184
  requirements:
253
- - - ">="
254
- - !ruby/object:Gem::Version
255
- version: '5'
256
- - - "<"
185
+ - - "~>"
257
186
  - !ruby/object:Gem::Version
258
- version: '6'
187
+ version: 6.1.7
259
188
  type: :runtime
260
189
  prerelease: false
261
190
  version_requirements: !ruby/object:Gem::Requirement
262
191
  requirements:
263
- - - ">="
264
- - !ruby/object:Gem::Version
265
- version: '5'
266
- - - "<"
192
+ - - "~>"
267
193
  - !ruby/object:Gem::Version
268
- version: '6'
194
+ version: 6.1.7
269
195
  - !ruby/object:Gem::Dependency
270
196
  name: railties
271
197
  requirement: !ruby/object:Gem::Requirement
@@ -286,60 +212,28 @@ dependencies:
286
212
  requirements:
287
213
  - - ">="
288
214
  - !ruby/object:Gem::Version
289
- version: '4.2'
290
- - - "<"
291
- - !ruby/object:Gem::Version
292
- version: '5'
293
- type: :runtime
294
- prerelease: false
295
- version_requirements: !ruby/object:Gem::Requirement
296
- requirements:
297
- - - ">="
298
- - !ruby/object:Gem::Version
299
- version: '4.2'
300
- - - "<"
301
- - !ruby/object:Gem::Version
302
- version: '5'
303
- - !ruby/object:Gem::Dependency
304
- name: redis-rails
305
- requirement: !ruby/object:Gem::Requirement
306
- requirements:
307
- - - ">="
308
- - !ruby/object:Gem::Version
309
- version: '5'
310
- - - "<"
311
- - !ruby/object:Gem::Version
312
- version: '6'
215
+ version: '0'
313
216
  type: :runtime
314
217
  prerelease: false
315
218
  version_requirements: !ruby/object:Gem::Requirement
316
219
  requirements:
317
220
  - - ">="
318
221
  - !ruby/object:Gem::Version
319
- version: '5'
320
- - - "<"
321
- - !ruby/object:Gem::Version
322
- version: '6'
222
+ version: '0'
323
223
  - !ruby/object:Gem::Dependency
324
224
  name: rest-client
325
225
  requirement: !ruby/object:Gem::Requirement
326
226
  requirements:
327
227
  - - ">="
328
228
  - !ruby/object:Gem::Version
329
- version: 2.1.0
330
- - - "<"
331
- - !ruby/object:Gem::Version
332
- version: '3'
229
+ version: '0'
333
230
  type: :runtime
334
231
  prerelease: false
335
232
  version_requirements: !ruby/object:Gem::Requirement
336
233
  requirements:
337
234
  - - ">="
338
235
  - !ruby/object:Gem::Version
339
- version: 2.1.0
340
- - - "<"
341
- - !ruby/object:Gem::Version
342
- version: '3'
236
+ version: '0'
343
237
  - !ruby/object:Gem::Dependency
344
238
  name: sass
345
239
  requirement: !ruby/object:Gem::Requirement
@@ -374,14 +268,14 @@ dependencies:
374
268
  requirements:
375
269
  - - ">="
376
270
  - !ruby/object:Gem::Version
377
- version: '5'
271
+ version: '0'
378
272
  type: :runtime
379
273
  prerelease: false
380
274
  version_requirements: !ruby/object:Gem::Requirement
381
275
  requirements:
382
276
  - - ">="
383
277
  - !ruby/object:Gem::Version
384
- version: '5'
278
+ version: '0'
385
279
  - !ruby/object:Gem::Dependency
386
280
  name: tzinfo
387
281
  requirement: !ruby/object:Gem::Requirement
@@ -402,20 +296,14 @@ dependencies:
402
296
  requirements:
403
297
  - - ">="
404
298
  - !ruby/object:Gem::Version
405
- version: '1'
406
- - - "<"
407
- - !ruby/object:Gem::Version
408
- version: '2'
299
+ version: '0'
409
300
  type: :runtime
410
301
  prerelease: false
411
302
  version_requirements: !ruby/object:Gem::Requirement
412
303
  requirements:
413
304
  - - ">="
414
305
  - !ruby/object:Gem::Version
415
- version: '1'
416
- - - "<"
417
- - !ruby/object:Gem::Version
418
- version: '2'
306
+ version: '0'
419
307
  - !ruby/object:Gem::Dependency
420
308
  name: valid_url
421
309
  requirement: !ruby/object:Gem::Requirement
@@ -448,36 +336,30 @@ dependencies:
448
336
  name: codacy-coverage
449
337
  requirement: !ruby/object:Gem::Requirement
450
338
  requirements:
451
- - - '='
339
+ - - ">="
452
340
  - !ruby/object:Gem::Version
453
- version: 2.2.1
341
+ version: '0'
454
342
  type: :development
455
343
  prerelease: false
456
344
  version_requirements: !ruby/object:Gem::Requirement
457
345
  requirements:
458
- - - '='
346
+ - - ">="
459
347
  - !ruby/object:Gem::Version
460
- version: 2.2.1
348
+ version: '0'
461
349
  - !ruby/object:Gem::Dependency
462
350
  name: database_cleaner-mongoid
463
351
  requirement: !ruby/object:Gem::Requirement
464
352
  requirements:
465
353
  - - ">="
466
354
  - !ruby/object:Gem::Version
467
- version: '2'
468
- - - "<"
469
- - !ruby/object:Gem::Version
470
- version: '3'
355
+ version: '0'
471
356
  type: :development
472
357
  prerelease: false
473
358
  version_requirements: !ruby/object:Gem::Requirement
474
359
  requirements:
475
360
  - - ">="
476
361
  - !ruby/object:Gem::Version
477
- version: '2'
478
- - - "<"
479
- - !ruby/object:Gem::Version
480
- version: '3'
362
+ version: '0'
481
363
  - !ruby/object:Gem::Dependency
482
364
  name: factory_bot
483
365
  requirement: !ruby/object:Gem::Requirement
@@ -512,20 +394,14 @@ dependencies:
512
394
  requirements:
513
395
  - - ">="
514
396
  - !ruby/object:Gem::Version
515
- version: '3'
516
- - - "<"
517
- - !ruby/object:Gem::Version
518
- version: '4'
397
+ version: '0'
519
398
  type: :development
520
399
  prerelease: false
521
400
  version_requirements: !ruby/object:Gem::Requirement
522
401
  requirements:
523
402
  - - ">="
524
403
  - !ruby/object:Gem::Version
525
- version: '3'
526
- - - "<"
527
- - !ruby/object:Gem::Version
528
- version: '4'
404
+ version: '0'
529
405
  - !ruby/object:Gem::Dependency
530
406
  name: minitest
531
407
  requirement: !ruby/object:Gem::Requirement
@@ -544,16 +420,16 @@ dependencies:
544
420
  name: minitest-rails
545
421
  requirement: !ruby/object:Gem::Requirement
546
422
  requirements:
547
- - - "~>"
423
+ - - ">="
548
424
  - !ruby/object:Gem::Version
549
- version: '3'
425
+ version: '0'
550
426
  type: :development
551
427
  prerelease: false
552
428
  version_requirements: !ruby/object:Gem::Requirement
553
429
  requirements:
554
- - - "~>"
430
+ - - ">="
555
431
  - !ruby/object:Gem::Version
556
- version: '3'
432
+ version: '0'
557
433
  - !ruby/object:Gem::Dependency
558
434
  name: minitest-reporters
559
435
  requirement: !ruby/object:Gem::Requirement
@@ -586,16 +462,16 @@ dependencies:
586
462
  name: shoulda
587
463
  requirement: !ruby/object:Gem::Requirement
588
464
  requirements:
589
- - - ">="
465
+ - - "~>"
590
466
  - !ruby/object:Gem::Version
591
- version: '0'
467
+ version: 4.0.0
592
468
  type: :development
593
469
  prerelease: false
594
470
  version_requirements: !ruby/object:Gem::Requirement
595
471
  requirements:
596
- - - ">="
472
+ - - "~>"
597
473
  - !ruby/object:Gem::Version
598
- version: '0'
474
+ version: 4.0.0
599
475
  - !ruby/object:Gem::Dependency
600
476
  name: shoulda-matchers
601
477
  requirement: !ruby/object:Gem::Requirement
@@ -611,7 +487,7 @@ dependencies:
611
487
  - !ruby/object:Gem::Version
612
488
  version: '0'
613
489
  - !ruby/object:Gem::Dependency
614
- name: simplecov
490
+ name: shoulda-context
615
491
  requirement: !ruby/object:Gem::Requirement
616
492
  requirements:
617
493
  - - ">="
@@ -625,7 +501,7 @@ dependencies:
625
501
  - !ruby/object:Gem::Version
626
502
  version: '0'
627
503
  - !ruby/object:Gem::Dependency
628
- name: test-unit
504
+ name: simplecov
629
505
  requirement: !ruby/object:Gem::Requirement
630
506
  requirements:
631
507
  - - ">="
@@ -639,45 +515,33 @@ dependencies:
639
515
  - !ruby/object:Gem::Version
640
516
  version: '0'
641
517
  - !ruby/object:Gem::Dependency
642
- name: vcr
518
+ name: test-unit
643
519
  requirement: !ruby/object:Gem::Requirement
644
520
  requirements:
645
521
  - - ">="
646
522
  - !ruby/object:Gem::Version
647
- version: '6'
648
- - - "<"
649
- - !ruby/object:Gem::Version
650
- version: '7'
523
+ version: '0'
651
524
  type: :development
652
525
  prerelease: false
653
526
  version_requirements: !ruby/object:Gem::Requirement
654
527
  requirements:
655
528
  - - ">="
656
529
  - !ruby/object:Gem::Version
657
- version: '6'
658
- - - "<"
659
- - !ruby/object:Gem::Version
660
- version: '7'
530
+ version: '0'
661
531
  - !ruby/object:Gem::Dependency
662
532
  name: webmock
663
533
  requirement: !ruby/object:Gem::Requirement
664
534
  requirements:
665
535
  - - ">="
666
536
  - !ruby/object:Gem::Version
667
- version: '3.11'
668
- - - "<"
669
- - !ruby/object:Gem::Version
670
- version: '4'
537
+ version: '0'
671
538
  type: :development
672
539
  prerelease: false
673
540
  version_requirements: !ruby/object:Gem::Requirement
674
541
  requirements:
675
542
  - - ">="
676
543
  - !ruby/object:Gem::Version
677
- version: '3.11'
678
- - - "<"
679
- - !ruby/object:Gem::Version
680
- version: '4'
544
+ version: '0'
681
545
  description: Core components used in all our web products.
682
546
  email:
683
547
  - chris@app47.com
@@ -782,12 +646,10 @@ files:
782
646
  - lib/app/models/concerns/delayed_job_configuration.rb
783
647
  - lib/app/models/concerns/email_able.rb
784
648
  - lib/app/models/concerns/encrypted_password.rb
785
- - lib/app/models/concerns/google_sso_configuration.rb
786
649
  - lib/app/models/concerns/role_able.rb
787
650
  - lib/app/models/concerns/search_able.rb
788
651
  - lib/app/models/concerns/secure_fields.rb
789
652
  - lib/app/models/concerns/server_process_able.rb
790
- - lib/app/models/concerns/ses_configuration.rb
791
653
  - lib/app/models/concerns/slack_configuration.rb
792
654
  - lib/app/models/concerns/standard_model.rb
793
655
  - lib/app/models/concerns/switchboard_able.rb
@@ -833,14 +695,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
833
695
  requirements:
834
696
  - - "~>"
835
697
  - !ruby/object:Gem::Version
836
- version: '2.7'
698
+ version: 3.0.2
837
699
  required_rubygems_version: !ruby/object:Gem::Requirement
838
700
  requirements:
839
701
  - - ">="
840
702
  - !ruby/object:Gem::Version
841
703
  version: '0'
842
704
  requirements: []
843
- rubygems_version: 3.1.2
705
+ rubygems_version: 3.2.22
844
706
  signing_key:
845
707
  specification_version: 4
846
708
  summary: App47 Web Core Library.
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Google SSO Configuration
5
- #
6
- module GoogleSsoConfiguration
7
- extend ActiveSupport::Concern
8
-
9
- def self.included(base)
10
- base.class_eval do
11
- #
12
- # Fields
13
- #
14
- field :google_client_id, type: String
15
- field :google_client_secret, type: String
16
- end
17
- end
18
-
19
- #
20
- # Make sure the password doesn't get blanked out on an update
21
- #
22
- def secure_fields
23
- super + %i[google_client_secret]
24
- end
25
-
26
- #
27
- # Determine if AWS is configured
28
- #
29
- def google_sso_configured?
30
- google_client_id.present? && google_client_secret.present?
31
- end
32
- end
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # AWS SES SSO Configuration
5
- #
6
- module SesConfiguration
7
- extend ActiveSupport::Concern
8
-
9
- def self.included(base)
10
- base.class_eval do
11
- #
12
- # Fields
13
- #
14
- field :ses_source_arn_prefix, type: String
15
- field :ses_bounce_queue_name, type: String
16
- field :ses_region, type: String
17
- end
18
- end
19
-
20
- #
21
- # Determine if AWS is configured
22
- #
23
- def ses_configured?
24
- aws_configured? &&
25
- ses_source_arn_prefix.present? &&
26
- (ses_region.present? || aws_region.present?)
27
- end
28
-
29
- def ses_source_arn(source = default_email)
30
- [ses_source_arn_prefix, source].compact.join('/')
31
- end
32
-
33
- #
34
- # SES Client
35
- #
36
- def aws_ses_client
37
- return nil unless ses_configured?
38
-
39
- # We want this to remake itself each time because it is possible that the
40
- # => user would change the access keys in between actions. Huh?
41
- @aws_ses_client ||= Aws::SES::Client.new(region: ses_region.presence || aws_region, credentials: aws_credentials)
42
- end
43
- end