feat(webhooks): Add \SensitiveValue attribute to authData parameter in all classes

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2024-06-10 17:07:44 +02:00 committed by Côme Chilliet
parent c940ba015c
commit 6e38b48534
3 changed files with 8 additions and 1 deletions

View file

@ -98,6 +98,7 @@ class WebhooksController extends OCSController {
?array $eventFilter,
?array $headers,
?string $authMethod,
#[\SensitiveParameter]
?array $authData,
): DataResponse {
$appId = null;
@ -157,6 +158,7 @@ class WebhooksController extends OCSController {
?array $eventFilter,
?array $headers,
?string $authMethod,
#[\SensitiveParameter]
?array $authData,
): DataResponse {
$appId = null;

View file

@ -76,7 +76,10 @@ class WebhookListener extends Entity implements \JsonSerializable {
return json_decode($this->crypto->decrypt($this->getAuthData()), associative:true, flags:JSON_THROW_ON_ERROR);
}
public function setAuthDataClear(?array $data): void {
public function setAuthDataClear(
#[\SensitiveParameter]
?array $data
): void {
if ($data === null) {
if ($this->getAuthMethodEnum() === AuthMethod::Header) {
throw new \UnexpectedValueException('Header auth method needs an associative array of headers as auth data');

View file

@ -79,6 +79,7 @@ class WebhookListenerMapper extends QBMapper {
?array $eventFilter,
?array $headers,
AuthMethod $authMethod,
#[\SensitiveParameter]
?array $authData,
): WebhookListener {
/* Remove any superfluous antislash */
@ -116,6 +117,7 @@ class WebhookListenerMapper extends QBMapper {
?array $eventFilter,
?array $headers,
AuthMethod $authMethod,
#[\SensitiveParameter]
?array $authData,
): WebhookListener {
/* Remove any superfluous antislash */