Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3e6e7b6

Browse filesBrowse files
author
goreboothero
committed
[Messenger] Fix parsing of DSN
1 parent 4114326 commit 3e6e7b6
Copy full SHA for 3e6e7b6

File tree

Expand file treeCollapse file tree

2 files changed

+14
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+14
-0
lines changed

‎src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/ConnectionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/ConnectionTest.php
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ public function testFromDsnWithQueryOptions()
151151
);
152152
}
153153

154+
public function testFromDsnWithSecretKeyQueryOptions()
155+
{
156+
$httpClient = $this->createMock(HttpClientInterface::class);
157+
158+
$this->assertEquals(
159+
new Connection(['account' => '213', 'queue_name' => 'queue', 'buffer_size' => 1, 'wait_time' => 5, 'auto_setup' => false], new SqsClient(['region' => 'eu-west-1', 'accessKeyId' => null, 'accessKeySecret' => 'A+a+B+b'], null, $httpClient)),
160+
Connection::fromDsn('sqs://default/213/queue?secret_key=A+a+B+b&buffer_size=1&wait_time=5&auto_setup=0', [], $httpClient)
161+
);
162+
}
163+
154164
public function testFromDsnWithQueueNameOption()
155165
{
156166
$httpClient = $this->createMock(HttpClientInterface::class);

‎src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/Bridge/AmazonSqs/Transport/Connection.php
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ public static function fromDsn(string $dsn, array $options = [], HttpClientInter
108108
parse_str($parsedUrl['query'], $query);
109109
}
110110

111+
if (\array_key_exists('secret_key', $query)) {
112+
$query['secret_key'] = str_replace(' ', '+', $query['secret_key']);
113+
}
114+
111115
// check for extra keys in options
112116
$optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS));
113117
if (0 < \count($optionsExtraKeys)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.