aws-actionmailbox-ses 0.1.1 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 500a94c42e04fdbcd047f3ff0a949dba15110019cfc9dafbf824bfc917e1407f
4
- data.tar.gz: 3c26b90900c66fffb702399f13fd0aef63e0e2316d00f95d1089c71ccba1c6c2
3
+ metadata.gz: 7c81a3cc0b639c90ccd81bcf1540c60685adfa3c083280e70637bdc00721b851
4
+ data.tar.gz: 830df5c1ba13c70751f7162c9257583471102a05578b71ebda5691e13f88a07c
5
5
  SHA512:
6
- metadata.gz: 989d114e01bbe063d62d18c73e14aefc3790407c2f67568ad812fb68b4e0517cea1cd592c50d6a84a2b5bf613ad038dc3bbe82c10ad3c0c357ce62c74e225468
7
- data.tar.gz: 6a62a9998e3f806cfea4162e88bf9d6cc6adb89ac2fecfdb74cf8eab40328b19e9db56e411fcde1b9a15c99baa63c7c379cd5e3983b5e959b68b8cc707e19e33
6
+ metadata.gz: b97ef893bfcfcfa0653751789b1e377c3f6e4ed9d8f812675e6211ec098e0076d24ad9c9e1bec11ac9ae40d005232e4322f81d4c532ca43546a63388c4d8182a
7
+ data.tar.gz: bac6961f43f0cf4e686996e4933d5f72008cd4fbd8af7d77b1ca4ce3e798b6a668cd41bec6a9270a27bc9b994c819132695b1fcfb3398285e11dd36a35239448
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.2.0 (2026-04-28)
2
+ ------------------
3
+
4
+ * Feature - Support client-side-encrypted inbound objects via configurable `s3_client`, with optional `decrypt_fallback_to_plain` for mixed buckets (#5)
5
+
1
6
  0.1.1 (2026-03-31)
2
7
  ------------------
3
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.0
@@ -9,6 +9,8 @@ module Aws
9
9
  class Engine < ::Rails::Engine
10
10
  config.action_mailbox.ses = ActiveSupport::OrderedOptions.new
11
11
  config.action_mailbox.ses.s3_client_options ||= {}
12
+ config.action_mailbox.ses.s3_client ||= nil
13
+ config.action_mailbox.ses.decrypt_fallback_to_plain ||= false
12
14
 
13
15
  initializer 'aws-sdk-rails.mount_engine' do |app|
14
16
  app.routes.append do
@@ -9,7 +9,11 @@ module Aws
9
9
  class S3Client
10
10
  class << self
11
11
  def client
12
- @client ||= build_client
12
+ @client ||= ::Rails.configuration.action_mailbox.ses.s3_client || build_client
13
+ end
14
+
15
+ def client_plain
16
+ @client_plain ||= build_client
13
17
  end
14
18
 
15
19
  private
@@ -49,13 +49,20 @@ module Aws
49
49
  end
50
50
 
51
51
  def s3_content
52
- S3Client
53
- .client
52
+ fetch_client
54
53
  .get_object(key: key, bucket: bucket)
55
54
  .body
56
55
  .string
57
56
  end
58
57
 
58
+ def fetch_client
59
+ cfg = ::Rails.configuration.action_mailbox.ses
60
+ return S3Client.client unless cfg.decrypt_fallback_to_plain && cfg.s3_client
61
+
62
+ meta = S3Client.client_plain.head_object(key: key, bucket: bucket).metadata || {}
63
+ meta.key?('x-amz-key-v2') || meta.key?('x-amz-key') ? S3Client.client : S3Client.client_plain
64
+ end
65
+
59
66
  def message
60
67
  @message ||= JSON.parse(notification[:Message], symbolize_names: true)
61
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-actionmailbox-ses
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Amazon Web Services