web47core 3.2.3.34 → 3.2.3.40
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 +4 -4
- data/lib/app/models/concerns/aws_configuration.rb +27 -28
- data/lib/app/models/concerns/cipher_able.rb +1 -1
- data/lib/web47core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c3106bd513997d40d9af68ad8640578c820d28031c045019123c33cff38984f
|
|
4
|
+
data.tar.gz: d8d6cb5a0f0c0ce213abd8ca89948dbc242bdd694521d822991b959f446b8b16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5540f6e7610972cd51e79a377c111e46cce0bcf354fbe5dea7e0bfc2cb39ad889f77be55a131c04af555982f7989e3a1c60abce03a91a3c505aadab73be631aa
|
|
7
|
+
data.tar.gz: 89b9d953406a602fae976918bfd0244daf9242f1e6f11476bf97a413b3cab8829dd6d9c7d6392cdb7017613192096be98771a715b32f7a5ce5f4a36c649e4592
|
|
@@ -12,29 +12,32 @@ module AwsConfiguration
|
|
|
12
12
|
# Fields
|
|
13
13
|
#
|
|
14
14
|
field :aws_region, type: String
|
|
15
|
-
field :aws_access_key_id, type: String
|
|
16
|
-
field :aws_secret_access_key, type: String
|
|
17
15
|
field :aws_bucket_name, type: String
|
|
18
16
|
field :aws_min_worker_job_count, type: Integer, default: 1
|
|
19
|
-
field :aws_ecs_cluster_worker_name, type: String
|
|
20
|
-
field :aws_ecs_service_worker_name, type: String
|
|
21
17
|
|
|
22
18
|
validates :aws_min_worker_job_count, numericality: { only_integer: true, greater_than: 0 }
|
|
23
19
|
end
|
|
24
20
|
end
|
|
25
21
|
|
|
26
22
|
#
|
|
27
|
-
#
|
|
23
|
+
# ECS cluster the worker service runs in. Set on the task as ECS_CLUSTER_WORKER_NAME.
|
|
28
24
|
#
|
|
29
|
-
def
|
|
30
|
-
|
|
25
|
+
def aws_ecs_cluster_worker_name
|
|
26
|
+
ENV['ECS_CLUSTER_WORKER_NAME'].presence
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
#
|
|
30
|
+
# ECS service that runs the workers. Set on the task as ECS_SERVICE_WORKER_NAME.
|
|
31
|
+
#
|
|
32
|
+
def aws_ecs_service_worker_name
|
|
33
|
+
ENV['ECS_SERVICE_WORKER_NAME'].presence
|
|
31
34
|
end
|
|
32
35
|
|
|
33
36
|
#
|
|
34
37
|
# Determine if AWS is configured
|
|
35
38
|
#
|
|
36
39
|
def aws_configured?
|
|
37
|
-
|
|
40
|
+
aws_region.present?
|
|
38
41
|
end
|
|
39
42
|
|
|
40
43
|
#
|
|
@@ -45,42 +48,38 @@ module AwsConfiguration
|
|
|
45
48
|
end
|
|
46
49
|
|
|
47
50
|
# @abstract EC2 Client
|
|
48
|
-
# @
|
|
49
|
-
|
|
51
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
52
|
+
# @return [Aws::EC2::Client, nil]
|
|
53
|
+
def aws_ec2_client(desired_region: nil)
|
|
50
54
|
return nil unless aws_configured?
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
credentials: Aws::Credentials.new(aws_access_key_id,
|
|
54
|
-
aws_secret_access_key))
|
|
56
|
+
Aws::EC2::Client.new(region: desired_region.presence || aws_region)
|
|
55
57
|
end
|
|
56
58
|
|
|
57
59
|
# @abstract S3 Client
|
|
58
|
-
# @
|
|
59
|
-
|
|
60
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
61
|
+
# @return [Aws::S3::Client, nil]
|
|
62
|
+
def aws_s3_client(desired_region: nil)
|
|
60
63
|
return nil unless aws_configured?
|
|
61
64
|
|
|
62
|
-
|
|
63
|
-
access_key_id: aws_access_key_id,
|
|
64
|
-
secret_access_key: aws_secret_access_key)
|
|
65
|
+
Aws::S3::Client.new(region: desired_region.presence || aws_region)
|
|
65
66
|
end
|
|
66
67
|
|
|
67
68
|
# @abstract ECS Client
|
|
68
|
-
# @
|
|
69
|
-
|
|
69
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
70
|
+
# @return [Aws::ECS::Client, nil]
|
|
71
|
+
def aws_ecs_client(desired_region: nil)
|
|
70
72
|
return nil unless aws_configured?
|
|
71
73
|
|
|
72
|
-
|
|
73
|
-
access_key_id: aws_access_key_id,
|
|
74
|
-
secret_access_key: aws_secret_access_key)
|
|
74
|
+
Aws::ECS::Client.new(region: desired_region.presence || aws_region)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
# @abstract AutoScaling Client
|
|
78
|
-
# @
|
|
79
|
-
|
|
78
|
+
# @param desired_region [String, nil] region to connect to; defaults to the configured aws_region
|
|
79
|
+
# @return [Aws::AutoScaling::Client, nil]
|
|
80
|
+
def aws_auto_scale_client(desired_region: nil)
|
|
80
81
|
return nil unless aws_configured?
|
|
81
82
|
|
|
82
|
-
|
|
83
|
-
secret_access_key: aws_secret_access_key,
|
|
84
|
-
region: aws_region)
|
|
83
|
+
Aws::AutoScaling::Client.new(region: desired_region.presence || aws_region)
|
|
85
84
|
end
|
|
86
85
|
end
|
|
@@ -27,7 +27,7 @@ module CipherAble
|
|
|
27
27
|
# Decrypt the given text
|
|
28
28
|
#
|
|
29
29
|
def decrypt(text)
|
|
30
|
-
cipher.decrypt_and_verify(text)
|
|
30
|
+
text.blank? ? nil : cipher.decrypt_and_verify(text)
|
|
31
31
|
rescue StandardError => error
|
|
32
32
|
App47Logger.log_warn("Unable to decrypt text for #{inspect}", error)
|
|
33
33
|
nil
|
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: 3.2.3.
|
|
4
|
+
version: 3.2.3.40
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Schroeder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|