Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mypy error with creds type #313

Closed
slmg opened this issue Mar 16, 2023 · 2 comments
Closed

Mypy error with creds type #313

slmg opened this issue Mar 16, 2023 · 2 comments

Comments

@slmg
Copy link

slmg commented Mar 16, 2023

What went wrong?

Argument "creds" to "SecurityContext" has incompatible type "Creds"; expected "Optional[Credentials]"  [arg-type]

How do we reproduce?

import gssapi

server_creds = gssapi.Credentials.acquire().creds
server_context = gssapi.SecurityContext(creds=server_creds)

Component versions (python-gssapi, Kerberos, OS / distro, etc.)

Python 3.10.10 on Bullseye, gssapi 1.8.2 (pip-installed), mypy 1.1.1

@jborean93
Copy link
Contributor

jborean93 commented Mar 21, 2023

Thanks for the bug report, I believe #314 fixes this problem for you.

I actually think this type annotation is there on purpose. The SecurityContext calls creds.usage which is a special property on gssapi.Credentials. Supporting the raw creds object here would require more work to support such a scenario.

@jborean93
Copy link
Contributor

Closing as per the above, the type is correct. It would be a new feature to accept the raw credential object and have it work here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants