Enable follow_untyped_imports for ndnkdf and fido_mds#932
Merged
johanlundberg merged 5 commits intomainfrom Apr 14, 2026
Merged
Enable follow_untyped_imports for ndnkdf and fido_mds#932johanlundberg merged 5 commits intomainfrom
johanlundberg merged 5 commits intomainfrom
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Enable follow_untyped_imports for ndnkdf and fido_mds
Summary
follow_untyped_imports = Trueinmypy.iniforndnkdfandfido_mds,letting mypy check call sites against inferred types from both libraries
webauthn.pycast()invccs/server/password.py(ndnkdf typing resolved the return type)Changes
mypy.iniAdded
follow_untyped_imports = Trueforndnkdfandfido_mds. This makes mypyfollow the libraries' unannotated source and check call sites against inferred types,
surfacing real type mismatches instead of silently accepting
Any.Both entries will be removed once the upstream libraries ship their own type annotations
(python-fido-mds upstream PR pending).
webauthn.py— real bugs fixedfollow_untyped_importsrevealed two latent crash paths inget_authenticator_information:authenticator_idcould beNone—att.aaguid or att.certificate_key_identifierproduces
UUID | str | Noneif both areNone. fido_mds APIs (get_entry,exists,AuthenticatorInformation) all requireUUID | str. Added an early guard:metadata_entrycould beNone—fido_mds.get_entry()returnsMetadataEntry | None. Code accessed attributes directly without checking. Added aguard after the call. Also removed a duplicate
att.aaguid or att.certificate_key_identifierexpression in the final return, replacing it with the already-guarded
authenticator_id.test_webauthn.py— monkey-patch to module level_apple_special_verify_attestationwas defined as a method onSecurityWebauthnTestswith
self: FidoMetadataStoreexplicitly typed for monkey-patching. With fido_mds nowtyped, mypy flagged the erased-type mismatch (
[misc]). Moved to module level — atmodule scope
selfis a plain parameter with no class hierarchy check — and updatedthe
mocker.patchcall site. Also consolidated the mid-file fido_mds imports to thetop of the file.
vccs/server/password.pyRemoved
cast(str, H2.hex())— withfollow_untyped_importsfor ndnkdf, mypy nowcorrectly infers that
H2.hex()returnsstr.