fix(webhooks): Refuse webhooks registration if auth header is used without auth data

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2024-06-10 16:33:44 +02:00 committed by Côme Chilliet
parent 621c068680
commit 74e5812c26

View file

@ -78,6 +78,9 @@ class WebhookListener extends Entity implements \JsonSerializable {
public function setAuthDataClear(?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');
}
$this->setAuthData(null);
return;
}