-
Notifications
You must be signed in to change notification settings - Fork 194
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Expected behavior
In trino.auth.KerberosAuthentication
class constructor, argument mutual_authentication
is defined as bool
.
I expect trino.auth.KerberosAuthentication
to allow optional mutual authentication setting.
Same also applies to GSSAPIAuthentication
.
Type checker used: pyright 1.1.382
.
Actual behavior
Internally the value of mutual_authentication
argument is passed to requests_kerberos.HTTPKerberosAuth
, which expects it to be an instance of int
(REQUIRED = 1
, OPTIONAL = 2
, DISABLED = 3
).
This causes two issues:
- inability to use optional mutual authentication (if boolean value is passed)
- type checker errors (if numeric value is passed)
Steps To Reproduce
# pip install trino requests_kerberos
from trino.auth import KerberosAuthentication
from requests_kerberos import OPTIONAL
KerberosAuthentication(
principal="[email protected]",
mutual_authentication=OPTIONAL,
service_name="HTTP",
)
Log output
kerberos_test.py:7:27 - error: Argument of type "Literal[2]" cannot be assigned to parameter "mutual_authentication" of type "bool" in function "__init__"
"Literal[2]" is not assignable to "bool" (reportArgumentType)
Operating System
macOS 15.2
Trino Python client version
0.330.0
Trino Server version
N/A
Python version
3.12.7
Are you willing to submit PR?
- Yes I am willing to submit a PR!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working