gitlab-mail_room 0.0.27 → 1.1.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 +4 -4
- data/.github/workflows/ci.yml +3 -2
- data/.gitlab-ci.yml +1 -1
- data/.rubocop_todo.yml +38 -32
- data/CHANGELOG.md +7 -0
- data/lib/mail_room/arbitration/redis.rb +8 -3
- data/lib/mail_room/configuration.rb +1 -1
- data/lib/mail_room/delivery/sidekiq.rb +6 -2
- data/lib/mail_room/version.rb +1 -1
- data/mail_room.gemspec +6 -4
- data/spec/lib/arbitration/redis_spec.rb +23 -0
- data/spec/lib/coordinator_spec.rb +1 -1
- data/spec/lib/delivery/postback_spec.rb +5 -1
- data/spec/lib/delivery/sidekiq_spec.rb +18 -0
- data/spec/lib/microsoft_graph/connection_spec.rb +3 -3
- metadata +25 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e8a5af986fff787ca0cd1ba45293f44a2f5130ddc8f1a2e762258d397d3eb7d
|
|
4
|
+
data.tar.gz: 6056b4c396bb63fd769ddd26c0860f65095045f84c334e7531f40b465c7f2326
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c100b13d4179d816a39c308c36f0bb47e4c43bba80d549ef0a7f37cc70fb73d03dc3ecd554a50b4f350beb527bcff7cbeee999d737dcb7527d872d1606e204aa
|
|
7
|
+
data.tar.gz: d483eb80b21ee39e54b3a08ca18c3dad015027684dbb2d87b2b2d8b0c71a6bd72931932408034a6014b013ee653698703d9571a07385a162cfee0054fcd1fe8b
|
data/.github/workflows/ci.yml
CHANGED
data/.gitlab-ci.yml
CHANGED
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2026-01-14 08:16:06 UTC using RuboCop version 1.82.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -8,20 +8,17 @@
|
|
|
8
8
|
|
|
9
9
|
# Offense count: 5
|
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
-
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation
|
|
12
|
-
# Include: **/*.gemspec
|
|
11
|
+
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
|
|
13
12
|
Gemspec/OrderedDependencies:
|
|
14
13
|
Exclude:
|
|
15
14
|
- 'mail_room.gemspec'
|
|
16
15
|
|
|
17
16
|
# Offense count: 1
|
|
18
|
-
# Configuration parameters: Severity, Include.
|
|
19
|
-
# Include: **/*.gemspec
|
|
20
17
|
Gemspec/RequiredRubyVersion:
|
|
21
18
|
Exclude:
|
|
22
19
|
- 'mail_room.gemspec'
|
|
23
20
|
|
|
24
|
-
# Offense count:
|
|
21
|
+
# Offense count: 1
|
|
25
22
|
# This cop supports safe autocorrection (--autocorrect).
|
|
26
23
|
Layout/BlockEndNewline:
|
|
27
24
|
Exclude:
|
|
@@ -50,14 +47,13 @@ Layout/EmptyLinesAroundAccessModifier:
|
|
|
50
47
|
- 'lib/mail_room/coordinator.rb'
|
|
51
48
|
- 'lib/mail_room/delivery/que.rb'
|
|
52
49
|
|
|
53
|
-
# Offense count:
|
|
50
|
+
# Offense count: 3
|
|
54
51
|
# This cop supports safe autocorrection (--autocorrect).
|
|
55
52
|
# Configuration parameters: EnforcedStyle.
|
|
56
53
|
# SupportedStyles: empty_lines, no_empty_lines
|
|
57
54
|
Layout/EmptyLinesAroundBlockBody:
|
|
58
55
|
Exclude:
|
|
59
56
|
- 'spec/lib/crash_handler_spec.rb'
|
|
60
|
-
- 'spec/lib/delivery/sidekiq_spec.rb'
|
|
61
57
|
- 'spec/lib/logger/structured_spec.rb'
|
|
62
58
|
|
|
63
59
|
# Offense count: 1
|
|
@@ -68,7 +64,7 @@ Layout/EmptyLinesAroundClassBody:
|
|
|
68
64
|
Exclude:
|
|
69
65
|
- 'lib/mail_room/logger/structured.rb'
|
|
70
66
|
|
|
71
|
-
# Offense count:
|
|
67
|
+
# Offense count: 7
|
|
72
68
|
# This cop supports safe autocorrection (--autocorrect).
|
|
73
69
|
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
74
70
|
# SupportedStyles: special_inside_parentheses, consistent, align_braces
|
|
@@ -89,18 +85,26 @@ Layout/HashAlignment:
|
|
|
89
85
|
|
|
90
86
|
# Offense count: 2
|
|
91
87
|
# This cop supports safe autocorrection (--autocorrect).
|
|
92
|
-
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
|
|
88
|
+
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment, AllowRBSInlineAnnotation, AllowSteepAnnotation.
|
|
93
89
|
Layout/LeadingCommentSpace:
|
|
94
90
|
Exclude:
|
|
95
91
|
- 'lib/mail_room/mailbox.rb'
|
|
96
92
|
- 'spec/lib/arbitration/redis_spec.rb'
|
|
97
93
|
|
|
98
|
-
# Offense count:
|
|
94
|
+
# Offense count: 1
|
|
99
95
|
# This cop supports safe autocorrection (--autocorrect).
|
|
100
96
|
Layout/MultilineBlockLayout:
|
|
101
97
|
Exclude:
|
|
102
98
|
- 'spec/lib/delivery/que_spec.rb'
|
|
103
99
|
|
|
100
|
+
# Offense count: 1
|
|
101
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
102
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
|
103
|
+
# SupportedStyles: aligned, indented, indented_relative_to_receiver
|
|
104
|
+
Layout/MultilineMethodCallIndentation:
|
|
105
|
+
Exclude:
|
|
106
|
+
- 'lib/mail_room/imap/connection.rb'
|
|
107
|
+
|
|
104
108
|
# Offense count: 3
|
|
105
109
|
# This cop supports safe autocorrection (--autocorrect).
|
|
106
110
|
# Configuration parameters: EnforcedStyle.
|
|
@@ -120,8 +124,9 @@ Layout/SpaceAroundKeyword:
|
|
|
120
124
|
|
|
121
125
|
# Offense count: 2
|
|
122
126
|
# This cop supports safe autocorrection (--autocorrect).
|
|
123
|
-
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator.
|
|
127
|
+
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
|
|
124
128
|
# SupportedStylesForExponentOperator: space, no_space
|
|
129
|
+
# SupportedStylesForRationalLiterals: space, no_space
|
|
125
130
|
Layout/SpaceAroundOperators:
|
|
126
131
|
Exclude:
|
|
127
132
|
- 'lib/mail_room/mailbox.rb'
|
|
@@ -138,7 +143,7 @@ Layout/SpaceBeforeBlockBraces:
|
|
|
138
143
|
- 'spec/lib/crash_handler_spec.rb'
|
|
139
144
|
- 'spec/lib/mailbox_spec.rb'
|
|
140
145
|
|
|
141
|
-
# Offense count:
|
|
146
|
+
# Offense count: 47
|
|
142
147
|
# This cop supports safe autocorrection (--autocorrect).
|
|
143
148
|
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
|
144
149
|
# SupportedStyles: space, no_space
|
|
@@ -204,17 +209,18 @@ Lint/RescueException:
|
|
|
204
209
|
|
|
205
210
|
# Offense count: 1
|
|
206
211
|
# This cop supports safe autocorrection (--autocorrect).
|
|
207
|
-
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
|
|
212
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
|
|
213
|
+
# NotImplementedExceptions: NotImplementedError
|
|
208
214
|
Lint/UnusedMethodArgument:
|
|
209
215
|
Exclude:
|
|
210
216
|
- 'lib/mail_room/logger/structured.rb'
|
|
211
217
|
|
|
212
|
-
# Offense count:
|
|
218
|
+
# Offense count: 7
|
|
213
219
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
|
214
220
|
Metrics/AbcSize:
|
|
215
|
-
Max:
|
|
221
|
+
Max: 34
|
|
216
222
|
|
|
217
|
-
# Offense count:
|
|
223
|
+
# Offense count: 34
|
|
218
224
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
219
225
|
# AllowedMethods: refine
|
|
220
226
|
Metrics/BlockLength:
|
|
@@ -225,12 +231,12 @@ Metrics/BlockLength:
|
|
|
225
231
|
Metrics/ClassLength:
|
|
226
232
|
Max: 169
|
|
227
233
|
|
|
228
|
-
# Offense count:
|
|
234
|
+
# Offense count: 3
|
|
229
235
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
230
236
|
Metrics/CyclomaticComplexity:
|
|
231
237
|
Max: 8
|
|
232
238
|
|
|
233
|
-
# Offense count:
|
|
239
|
+
# Offense count: 16
|
|
234
240
|
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
235
241
|
Metrics/MethodLength:
|
|
236
242
|
Max: 22
|
|
@@ -240,14 +246,13 @@ Metrics/MethodLength:
|
|
|
240
246
|
Metrics/ModuleLength:
|
|
241
247
|
Max: 172
|
|
242
248
|
|
|
243
|
-
# Offense count:
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
# Offense count: 2
|
|
250
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
|
251
|
+
Metrics/PerceivedComplexity:
|
|
252
|
+
Max: 9
|
|
247
253
|
|
|
248
254
|
# Offense count: 1
|
|
249
|
-
|
|
250
|
-
Security/YAMLLoad:
|
|
255
|
+
Naming/AccessorMethodName:
|
|
251
256
|
Exclude:
|
|
252
257
|
- 'lib/mail_room/configuration.rb'
|
|
253
258
|
|
|
@@ -259,7 +264,7 @@ Style/Alias:
|
|
|
259
264
|
Exclude:
|
|
260
265
|
- 'lib/mail_room/coordinator.rb'
|
|
261
266
|
|
|
262
|
-
# Offense count:
|
|
267
|
+
# Offense count: 12
|
|
263
268
|
# This cop supports safe autocorrection (--autocorrect).
|
|
264
269
|
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
|
265
270
|
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
|
@@ -284,6 +289,7 @@ Style/Documentation:
|
|
|
284
289
|
- 'lib/mail_room/arbitration/redis.rb'
|
|
285
290
|
- 'lib/mail_room/connection.rb'
|
|
286
291
|
- 'lib/mail_room/crash_handler.rb'
|
|
292
|
+
- 'lib/mail_room/health_check.rb'
|
|
287
293
|
- 'lib/mail_room/delivery.rb'
|
|
288
294
|
- 'lib/mail_room/imap.rb'
|
|
289
295
|
- 'lib/mail_room/imap/connection.rb'
|
|
@@ -344,7 +350,7 @@ Style/GuardClause:
|
|
|
344
350
|
# This cop supports safe autocorrection (--autocorrect).
|
|
345
351
|
# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
|
346
352
|
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
|
347
|
-
# SupportedShorthandSyntax: always, never, either, consistent
|
|
353
|
+
# SupportedShorthandSyntax: always, never, either, consistent, either_consistent
|
|
348
354
|
Style/HashSyntax:
|
|
349
355
|
Exclude:
|
|
350
356
|
- 'spec/lib/microsoft_graph/connection_spec.rb'
|
|
@@ -385,7 +391,7 @@ Style/PreferredHashMethods:
|
|
|
385
391
|
- 'lib/mail_room/mailbox.rb'
|
|
386
392
|
|
|
387
393
|
# Offense count: 1
|
|
388
|
-
# This cop supports
|
|
394
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
389
395
|
# Configuration parameters: EnforcedStyle, AllowedCompactTypes.
|
|
390
396
|
# SupportedStyles: compact, exploded
|
|
391
397
|
Style/RaiseArgs:
|
|
@@ -438,7 +444,7 @@ Style/StringConcatenation:
|
|
|
438
444
|
Exclude:
|
|
439
445
|
- 'lib/mail_room/logger/structured.rb'
|
|
440
446
|
|
|
441
|
-
# Offense count:
|
|
447
|
+
# Offense count: 147
|
|
442
448
|
# This cop supports safe autocorrection (--autocorrect).
|
|
443
449
|
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
|
444
450
|
# SupportedStyles: single_quotes, double_quotes
|
|
@@ -457,7 +463,7 @@ Style/SymbolArray:
|
|
|
457
463
|
# Offense count: 2
|
|
458
464
|
# This cop supports safe autocorrection (--autocorrect).
|
|
459
465
|
# Configuration parameters: EnforcedStyleForMultiline.
|
|
460
|
-
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
|
|
466
|
+
# SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
|
|
461
467
|
Style/TrailingCommaInHashLiteral:
|
|
462
468
|
Exclude:
|
|
463
469
|
- 'spec/lib/mailbox_spec.rb'
|
|
@@ -484,9 +490,9 @@ Style/WordArray:
|
|
|
484
490
|
EnforcedStyle: percent
|
|
485
491
|
MinSize: 3
|
|
486
492
|
|
|
487
|
-
# Offense count:
|
|
493
|
+
# Offense count: 10
|
|
488
494
|
# This cop supports safe autocorrection (--autocorrect).
|
|
489
|
-
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes,
|
|
495
|
+
# Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
490
496
|
# URISchemes: http, https
|
|
491
497
|
Layout/LineLength:
|
|
492
498
|
Max: 177
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## Unreleased ##
|
|
2
|
+
|
|
3
|
+
* Bump `net-imap` to `>= 0.5, < 0.7` (allows the 0.6.x line on Ruby 3.2+)
|
|
4
|
+
* Raise minimum Ruby to 3.1 (`required_ruby_version >= 3.1`), required by `net-imap` 0.5+
|
|
5
|
+
* Modernize runtime dependency bounds: `oauth2 >= 2.0.9, < 3`, `jwt >= 2.0, < 4`, `redis-namespace >= 1.8.2, < 2`
|
|
6
|
+
* Drop Ruby 3.0 from the CI matrix (GitLab CI and GitHub Actions now test 3.1–3.4 and 4.0)
|
|
7
|
+
|
|
1
8
|
## mail_room 0.11.1 ##
|
|
2
9
|
|
|
3
10
|
https://github.com/tpitale/mail_room/compare/v0.11.0...v0.11.1
|
|
@@ -3,9 +3,11 @@ require "redis"
|
|
|
3
3
|
module MailRoom
|
|
4
4
|
module Arbitration
|
|
5
5
|
class Redis
|
|
6
|
-
Options = Struct.new(:redis_url, :namespace, :sentinels, :sentinel_username, :sentinel_password) do
|
|
6
|
+
Options = Struct.new(:redis_url, :redis_ssl_params, :namespace, :redis_db, :sentinels, :sentinel_username, :sentinel_password) do
|
|
7
7
|
def initialize(mailbox)
|
|
8
8
|
redis_url = mailbox.arbitration_options[:redis_url] || "redis://localhost:6379"
|
|
9
|
+
redis_ssl_params = mailbox.arbitration_options[:redis_ssl_params]
|
|
10
|
+
redis_db = mailbox.arbitration_options[:redis_db] || 0
|
|
9
11
|
namespace = mailbox.arbitration_options[:namespace]
|
|
10
12
|
sentinels = mailbox.arbitration_options[:sentinels]
|
|
11
13
|
sentinel_username = mailbox.arbitration_options[:sentinel_username]
|
|
@@ -18,7 +20,7 @@ module MailRoom
|
|
|
18
20
|
MSG
|
|
19
21
|
end
|
|
20
22
|
|
|
21
|
-
super(redis_url, namespace, sentinels, sentinel_username, sentinel_password)
|
|
23
|
+
super(redis_url, redis_ssl_params, namespace, redis_db, sentinels, sentinel_username, sentinel_password)
|
|
22
24
|
end
|
|
23
25
|
end
|
|
24
26
|
|
|
@@ -48,7 +50,10 @@ module MailRoom
|
|
|
48
50
|
def client
|
|
49
51
|
@client ||= begin
|
|
50
52
|
sentinels = options.sentinels
|
|
51
|
-
redis_options = { url: options.redis_url }
|
|
53
|
+
redis_options = { url: options.redis_url, db: options.redis_db }
|
|
54
|
+
# Needed for redis-client 0.26.2 and older: https://github.com/redis-rb/redis-client/pull/277
|
|
55
|
+
redis_options[:ssl] = true if options.redis_url.start_with?("rediss://")
|
|
56
|
+
redis_options[:ssl_params] = options.redis_ssl_params if options.redis_ssl_params
|
|
52
57
|
redis_options[:sentinels] = sentinels if sentinels
|
|
53
58
|
redis_options[:sentinel_username] = options.sentinel_username if options.sentinel_username
|
|
54
59
|
redis_options[:sentinel_password] = options.sentinel_password if options.sentinel_password
|
|
@@ -15,7 +15,7 @@ module MailRoom
|
|
|
15
15
|
begin
|
|
16
16
|
erb = ERB.new(File.read(options[:config_path]))
|
|
17
17
|
erb.filename = options[:config_path]
|
|
18
|
-
config_file = YAML.load(erb.result)
|
|
18
|
+
config_file = YAML.load(erb.result, symbolize_names: true)
|
|
19
19
|
|
|
20
20
|
set_mailboxes(config_file[:mailboxes])
|
|
21
21
|
set_health_check(config_file[:health_check])
|
|
@@ -8,9 +8,10 @@ module MailRoom
|
|
|
8
8
|
# Sidekiq Delivery method
|
|
9
9
|
# @author Douwe Maan
|
|
10
10
|
class Sidekiq
|
|
11
|
-
Options = Struct.new(:redis_url, :namespace, :sentinels, :queue, :worker, :logger, :redis_db, :sentinel_username, :sentinel_password) do
|
|
11
|
+
Options = Struct.new(:redis_url, :redis_ssl_params, :namespace, :sentinels, :queue, :worker, :logger, :redis_db, :sentinel_username, :sentinel_password) do
|
|
12
12
|
def initialize(mailbox)
|
|
13
13
|
redis_url = mailbox.delivery_options[:redis_url] || "redis://localhost:6379"
|
|
14
|
+
redis_ssl_params = mailbox.delivery_options[:redis_ssl_params]
|
|
14
15
|
redis_db = mailbox.delivery_options[:redis_db] || 0
|
|
15
16
|
namespace = mailbox.delivery_options[:namespace]
|
|
16
17
|
sentinels = mailbox.delivery_options[:sentinels]
|
|
@@ -27,7 +28,7 @@ module MailRoom
|
|
|
27
28
|
MSG
|
|
28
29
|
end
|
|
29
30
|
|
|
30
|
-
super(redis_url, namespace, sentinels, queue, worker, logger, redis_db, sentinel_username, sentinel_password)
|
|
31
|
+
super(redis_url, redis_ssl_params, namespace, sentinels, queue, worker, logger, redis_db, sentinel_username, sentinel_password)
|
|
31
32
|
end
|
|
32
33
|
end
|
|
33
34
|
|
|
@@ -56,6 +57,9 @@ module MailRoom
|
|
|
56
57
|
@client ||= begin
|
|
57
58
|
sentinels = options.sentinels
|
|
58
59
|
redis_options = { url: options.redis_url, db: options.redis_db }
|
|
60
|
+
# Needed for redis-client 0.26.2 and older: https://github.com/redis-rb/redis-client/pull/277
|
|
61
|
+
redis_options[:ssl] = true if options.redis_url.start_with?("rediss://")
|
|
62
|
+
redis_options[:ssl_params] = options.redis_ssl_params if options.redis_ssl_params
|
|
59
63
|
redis_options[:sentinels] = sentinels if sentinels
|
|
60
64
|
redis_options[:sentinel_username] = options.sentinel_username if options.sentinel_username
|
|
61
65
|
redis_options[:sentinel_password] = options.sentinel_password if options.sentinel_password
|
data/lib/mail_room/version.rb
CHANGED
data/mail_room.gemspec
CHANGED
|
@@ -17,11 +17,13 @@ Gem::Specification.new do |gem|
|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
18
18
|
gem.require_paths = ["lib"]
|
|
19
19
|
|
|
20
|
-
gem.
|
|
21
|
-
|
|
22
|
-
gem.add_dependency "
|
|
20
|
+
gem.required_ruby_version = ">= 3.1"
|
|
21
|
+
|
|
22
|
+
gem.add_dependency "net-imap", [">= 0.5", "< 0.7"]
|
|
23
|
+
gem.add_dependency "oauth2", [">= 2.0.9", "< 3"]
|
|
24
|
+
gem.add_dependency "jwt", [">= 2.0", "< 4"]
|
|
23
25
|
gem.add_dependency "redis", [">= 5", "< 6"]
|
|
24
|
-
gem.add_dependency "redis-namespace",
|
|
26
|
+
gem.add_dependency "redis-namespace", [">= 1.8.2", "< 2"]
|
|
25
27
|
|
|
26
28
|
gem.add_development_dependency "rake"
|
|
27
29
|
gem.add_development_dependency "rspec", "~> 3.9"
|
|
@@ -169,5 +169,28 @@ describe MailRoom::Arbitration::Redis do
|
|
|
169
169
|
end
|
|
170
170
|
end
|
|
171
171
|
end
|
|
172
|
+
|
|
173
|
+
context 'when redis_ssl_params is specified' do
|
|
174
|
+
let(:redis_url) { ENV['REDIS_URL'] }
|
|
175
|
+
let(:redis_ssl_params) { { verify_mode: OpenSSL::SSL::VERIFY_NONE } }
|
|
176
|
+
let(:mailbox) {
|
|
177
|
+
build_mailbox(
|
|
178
|
+
arbitration_options: {
|
|
179
|
+
redis_url: redis_url,
|
|
180
|
+
redis_ssl_params: redis_ssl_params
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
after do
|
|
186
|
+
redis.del("delivered:123")
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
it 'client has same specified ssl_params' do
|
|
190
|
+
subject.deliver?(123)
|
|
191
|
+
|
|
192
|
+
expect(raw_client.config.ssl_params).to eq(redis_ssl_params)
|
|
193
|
+
end
|
|
194
|
+
end
|
|
172
195
|
end
|
|
173
196
|
end
|
|
@@ -17,7 +17,7 @@ describe MailRoom::Coordinator do
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'sets the health check' do
|
|
20
|
-
health_check = MailRoom::HealthCheck.new({ address: '127.0.0.1', port: 8080})
|
|
20
|
+
health_check = MailRoom::HealthCheck.new({ address: '127.0.0.1', port: 8080 })
|
|
21
21
|
coordinator = MailRoom::Coordinator.new([], health_check)
|
|
22
22
|
|
|
23
23
|
expect(coordinator.health_check).to eq(health_check)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
require 'mail_room/delivery/postback'
|
|
3
3
|
require 'tempfile'
|
|
4
|
+
require 'base64'
|
|
4
5
|
require 'webmock/rspec'
|
|
5
6
|
|
|
6
7
|
describe MailRoom::Delivery::Postback do
|
|
@@ -94,7 +95,10 @@ describe MailRoom::Delivery::Postback do
|
|
|
94
95
|
|
|
95
96
|
let(:jwt_secret) do
|
|
96
97
|
file = Tempfile.new('secret')
|
|
97
|
-
|
|
98
|
+
# The secret is read back and Base64-decoded by MailRoom::JWT, so it
|
|
99
|
+
# must be valid Base64 and flushed to disk before it is read.
|
|
100
|
+
file.write(Base64.strict_encode64("test secret"))
|
|
101
|
+
file.flush
|
|
98
102
|
file
|
|
99
103
|
end
|
|
100
104
|
|
|
@@ -120,5 +120,23 @@ describe MailRoom::Delivery::Sidekiq do
|
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
122
|
end
|
|
123
|
+
|
|
124
|
+
context 'when redis_ssl_params is specified' do
|
|
125
|
+
let(:redis_url) { ENV['REDIS_URL'] }
|
|
126
|
+
let(:redis_ssl_params) { { verify_mode: OpenSSL::SSL::VERIFY_NONE } }
|
|
127
|
+
let(:mailbox) {
|
|
128
|
+
build_mailbox(
|
|
129
|
+
delivery_method: :sidekiq,
|
|
130
|
+
delivery_options: {
|
|
131
|
+
redis_url: redis_url,
|
|
132
|
+
redis_ssl_params: redis_ssl_params
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
it 'client has same specified ssl_params' do
|
|
138
|
+
expect(raw_client.config.ssl_params).to eq(redis_ssl_params)
|
|
139
|
+
end
|
|
140
|
+
end
|
|
123
141
|
end
|
|
124
142
|
end
|
|
@@ -106,7 +106,7 @@ describe MailRoom::MicrosoftGraph::Connection do
|
|
|
106
106
|
|
|
107
107
|
shared_examples 'with a single message' do
|
|
108
108
|
let(:message_id) { SecureRandom.hex }
|
|
109
|
-
let(:unread_messages_body) { { value: ['id' => message_id] } }
|
|
109
|
+
let(:unread_messages_body) { { value: [{ 'id' => message_id }] } }
|
|
110
110
|
let(:message_url) { "#{message_base_url}/#{message_id}" }
|
|
111
111
|
let(:message_body) { 'hello world' }
|
|
112
112
|
|
|
@@ -168,13 +168,13 @@ describe MailRoom::MicrosoftGraph::Connection do
|
|
|
168
168
|
context 'with multiple pages of messages' do
|
|
169
169
|
let(:message_ids) { [SecureRandom.hex, SecureRandom.hex] }
|
|
170
170
|
let(:next_page_url) { "#{graph_endpoint}/v1.0/nextPage" }
|
|
171
|
-
let(:unread_messages_body) { { value: ['id' => message_ids.first], '@odata.nextLink' => next_page_url } }
|
|
171
|
+
let(:unread_messages_body) { { value: [{ 'id' => message_ids.first }], '@odata.nextLink' => next_page_url } }
|
|
172
172
|
let(:message_body) { 'hello world' }
|
|
173
173
|
|
|
174
174
|
it 'requests message ID' do
|
|
175
175
|
stub_request(:get, next_page_url).to_return(
|
|
176
176
|
status: 200,
|
|
177
|
-
body: { value: ['id' => message_ids[1]] }.to_json
|
|
177
|
+
body: { value: [{ 'id' => message_ids[1] }] }.to_json
|
|
178
178
|
)
|
|
179
179
|
|
|
180
180
|
stubs = []
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-mail_room
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tony Pitale
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2026-06-18 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: net-imap
|
|
@@ -15,21 +15,27 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.
|
|
18
|
+
version: '0.5'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '0.7'
|
|
19
22
|
type: :runtime
|
|
20
23
|
prerelease: false
|
|
21
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
25
|
requirements:
|
|
23
26
|
- - ">="
|
|
24
27
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 0.
|
|
28
|
+
version: '0.5'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '0.7'
|
|
26
32
|
- !ruby/object:Gem::Dependency
|
|
27
33
|
name: oauth2
|
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
|
29
35
|
requirements:
|
|
30
36
|
- - ">="
|
|
31
37
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
38
|
+
version: 2.0.9
|
|
33
39
|
- - "<"
|
|
34
40
|
- !ruby/object:Gem::Version
|
|
35
41
|
version: '3'
|
|
@@ -39,7 +45,7 @@ dependencies:
|
|
|
39
45
|
requirements:
|
|
40
46
|
- - ">="
|
|
41
47
|
- !ruby/object:Gem::Version
|
|
42
|
-
version:
|
|
48
|
+
version: 2.0.9
|
|
43
49
|
- - "<"
|
|
44
50
|
- !ruby/object:Gem::Version
|
|
45
51
|
version: '3'
|
|
@@ -50,6 +56,9 @@ dependencies:
|
|
|
50
56
|
- - ">="
|
|
51
57
|
- !ruby/object:Gem::Version
|
|
52
58
|
version: '2.0'
|
|
59
|
+
- - "<"
|
|
60
|
+
- !ruby/object:Gem::Version
|
|
61
|
+
version: '4'
|
|
53
62
|
type: :runtime
|
|
54
63
|
prerelease: false
|
|
55
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -57,6 +66,9 @@ dependencies:
|
|
|
57
66
|
- - ">="
|
|
58
67
|
- !ruby/object:Gem::Version
|
|
59
68
|
version: '2.0'
|
|
69
|
+
- - "<"
|
|
70
|
+
- !ruby/object:Gem::Version
|
|
71
|
+
version: '4'
|
|
60
72
|
- !ruby/object:Gem::Dependency
|
|
61
73
|
name: redis
|
|
62
74
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -84,6 +96,9 @@ dependencies:
|
|
|
84
96
|
- - ">="
|
|
85
97
|
- !ruby/object:Gem::Version
|
|
86
98
|
version: 1.8.2
|
|
99
|
+
- - "<"
|
|
100
|
+
- !ruby/object:Gem::Version
|
|
101
|
+
version: '2'
|
|
87
102
|
type: :runtime
|
|
88
103
|
prerelease: false
|
|
89
104
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -91,6 +106,9 @@ dependencies:
|
|
|
91
106
|
- - ">="
|
|
92
107
|
- !ruby/object:Gem::Version
|
|
93
108
|
version: 1.8.2
|
|
109
|
+
- - "<"
|
|
110
|
+
- !ruby/object:Gem::Version
|
|
111
|
+
version: '2'
|
|
94
112
|
- !ruby/object:Gem::Dependency
|
|
95
113
|
name: rake
|
|
96
114
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -347,7 +365,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
347
365
|
requirements:
|
|
348
366
|
- - ">="
|
|
349
367
|
- !ruby/object:Gem::Version
|
|
350
|
-
version: '
|
|
368
|
+
version: '3.1'
|
|
351
369
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
352
370
|
requirements:
|
|
353
371
|
- - ">="
|