Skip to content

Commit

Permalink
minor #53399 [Mailer][Notifier] add more #[\SensitiveParameter] att…
Browse files Browse the repository at this point in the history
…ributes (xabbuh)

This PR was merged into the 7.1 branch.

Discussion
----------

[Mailer][Notifier] add more `#[\SensitiveParameter]` attributes

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

Commits
-------

acd7353 add more SensitiveParameter attributes
  • Loading branch information
xabbuh committed Jan 5, 2024
2 parents 7c53816 + acd7353 commit b92bdc0
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 13 deletions.
Expand Up @@ -17,7 +17,7 @@

final class InfobipSmtpTransport extends EsmtpTransport
{
public function __construct(string $key, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
public function __construct(#[\SensitiveParameter] string $key, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
parent::__construct('smtp-api.infobip.com', 587, false, $dispatcher, $logger);

Expand Down
Expand Up @@ -25,7 +25,7 @@
*/
final class MailPaceSmtpTransport extends EsmtpTransport
{
public function __construct(string $id, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
public function __construct(#[\SensitiveParameter] string $id, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
parent::__construct('smtp.mailpace.com', 587, false, $dispatcher, $logger);

Expand Down
Expand Up @@ -29,7 +29,7 @@ class PostmarkSmtpTransport extends EsmtpTransport
{
private ?string $messageStream = null;

public function __construct(string $id, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
public function __construct(#[\SensitiveParameter] string $id, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
parent::__construct('smtp.postmarkapp.com', 587, false, $dispatcher, $logger);

Expand Down
Expand Up @@ -17,7 +17,7 @@

final class ScalewaySmtpTransport extends EsmtpTransport
{
public function __construct(string $projetId, string $token, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
public function __construct(string $projetId, #[\SensitiveParameter] string $token, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
parent::__construct('smtp.tem.scw.cloud', 465, true, $dispatcher, $logger);

Expand Down
Expand Up @@ -20,7 +20,7 @@
*/
class SendgridSmtpTransport extends EsmtpTransport
{
public function __construct(string $key, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
public function __construct(#[\SensitiveParameter] string $key, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
{
parent::__construct('smtp.sendgrid.net', 465, true, $dispatcher, $logger);

Expand Down
Expand Up @@ -96,7 +96,7 @@ class Connection
private \AMQPExchange $amqpDelayExchange;
private int $lastActivityTime = 0;

public function __construct(array $connectionOptions, array $exchangeOptions, array $queuesOptions, AmqpFactory $amqpFactory = null)
public function __construct(#[\SensitiveParameter] array $connectionOptions, array $exchangeOptions, array $queuesOptions, AmqpFactory $amqpFactory = null)
{
if (!\extension_loaded('amqp')) {
throw new LogicException(sprintf('You cannot use the "%s" as the "amqp" extension is not installed.', __CLASS__));
Expand Down
Expand Up @@ -41,7 +41,7 @@ final class GoogleChatTransport extends AbstractTransport
*/
public function __construct(
private string $space,
private string $accessKey,
#[\SensitiveParameter] private string $accessKey,
#[\SensitiveParameter] private string $accessToken,
private ?string $threadKey = null,
HttpClientInterface $client = null,
Expand Down
Expand Up @@ -30,13 +30,12 @@ final class MessageMediaTransport extends AbstractTransport
protected const HOST = 'api.messagemedia.com';

public function __construct(
private string $apiKey,
#[\SensitiveParameter] private string $apiKey,
#[\SensitiveParameter] private string $apiSecret,
private ?string $from = null,
HttpClientInterface $client = null,
EventDispatcherInterface $dispatcher = null,
)
{
) {
parent::__construct($client, $dispatcher);
}

Expand Down
5 changes: 2 additions & 3 deletions src/Symfony/Component/Notifier/Bridge/Ntfy/NtfyTransport.php
Expand Up @@ -36,8 +36,7 @@ public function __construct(
private bool $secureHttp = true,
HttpClientInterface $client = null,
EventDispatcherInterface $dispatcher = null,
)
{
) {
parent::__construct($client, $dispatcher);
}

Expand All @@ -46,7 +45,7 @@ public function getTopic(): string
return $this->topic;
}

public function setPassword(?string $password): self
public function setPassword(#[\SensitiveParameter] ?string $password): self
{
$this->password = $password;

Expand Down

0 comments on commit b92bdc0

Please sign in to comment.