Skip to content

Commit

Permalink
Torna porta opcional na operação webhook_validate
Browse files Browse the repository at this point in the history
  • Loading branch information
valterf committed Sep 15, 2021
1 parent b3fb22f commit 44d9dee
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cpqdtrd/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import urllib
import json
from datetime import datetime
from typing import List, Dict, Union
from typing import List, Dict, Optional
from contextlib import closing


Expand Down Expand Up @@ -138,15 +138,18 @@ def webhook_whoami(self):
def webhook_validate(
self,
host: str,
port: int,
timeout: Union[None, int] = None,
retries: Union[None, int] = None,
port: Optional[int] = None,
timeout: Optional[int] = None,
retries: Optional[int] = None,
token: str = "",
crt: str = "",
):
test_request = "{}/webhook/validate".format(self._url)
webhook_url = host
if port is not None:
webhook_url += ":{}".format(port)
payload = {
"url": "{}:{}".format(host, port)
"url": webhook_url
}
if timeout:
payload["timeout"] = int(timeout)
Expand Down

0 comments on commit 44d9dee

Please sign in to comment.