From b7d9f2e29a03c9c19c7411ba26ce8316e4634d5a Mon Sep 17 00:00:00 2001 From: Branden Jordan Date: Tue, 4 Aug 2020 17:07:01 -0700 Subject: [PATCH] Updated type hinting for the cert_file parameter on the CertificateCredentials object to include the option of a tuple of the cert and key --- apns2/credentials.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apns2/credentials.py b/apns2/credentials.py index b1eca8b..ed1da1a 100644 --- a/apns2/credentials.py +++ b/apns2/credentials.py @@ -1,5 +1,5 @@ import time -from typing import Optional, Tuple, TYPE_CHECKING +from typing import Optional, Tuple, TYPE_CHECKING, Union import jwt @@ -32,7 +32,7 @@ def get_authorization_header(self, topic: Optional[str]) -> Optional[str]: # Credentials subclass for certificate authentication class CertificateCredentials(Credentials): - def __init__(self, cert_file: Optional[str] = None, password: Optional[str] = None, + def __init__(self, cert_file: Union[Optional[str], Optional[Tuple[str, str]]] = None, password: Optional[str] = None, cert_chain: Optional[str] = None) -> None: ssl_context = init_context(cert=cert_file, cert_password=password) if cert_chain: