File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2013,7 +2013,17 @@ def _static_connection_kwargs(self) -> t.Dict[str, t.Any]:
20132013 OAuth2Authentication ,
20142014 )
20152015
2016+ auth : t .Optional [
2017+ t .Union [
2018+ BasicAuthentication ,
2019+ KerberosAuthentication ,
2020+ OAuth2Authentication ,
2021+ JWTAuthentication ,
2022+ CertificateAuthentication ,
2023+ ]
2024+ ] = None
20162025 if self .method .is_basic or self .method .is_ldap :
2026+ assert self .password is not None # for mypy since validator already checks this
20172027 auth = BasicAuthentication (self .user , self .password )
20182028 elif self .method .is_kerberos :
20192029 if self .keytab :
@@ -2032,11 +2042,12 @@ def _static_connection_kwargs(self) -> t.Dict[str, t.Any]:
20322042 elif self .method .is_oauth :
20332043 auth = OAuth2Authentication ()
20342044 elif self .method .is_jwt :
2045+ assert self .jwt_token is not None
20352046 auth = JWTAuthentication (self .jwt_token )
20362047 elif self .method .is_certificate :
2048+ assert self .client_certificate is not None
2049+ assert self .client_private_key is not None
20372050 auth = CertificateAuthentication (self .client_certificate , self .client_private_key )
2038- else :
2039- auth = None
20402051
20412052 return {
20422053 "auth" : auth ,
You can’t perform that action at this time.
0 commit comments