refactor: extract _verify_peer_fingerprint to module level and add _c…#62
Merged
refactor: extract _verify_peer_fingerprint to module level and add _c…#62
Conversation
…reate_bio_wrapper
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/tinfoil/client.py">
<violation number="1" location="src/tinfoil/client.py:114">
P2: Custom agent: **Check System Design and Architectural Patterns**
`_create_bio_wrapper` has an inconsistent API compared to `_create_socket_wrapper`. It returns a function requiring `original_wrap_bio` as a parameter, forcing the caller to create a lambda adapter. Instead, accept `original_wrap_bio` as a parameter to `_create_bio_wrapper` itself and close over it, so the returned function can be directly assigned to `ctx.wrap_bio` — matching the pattern used by `_create_socket_wrapper`.
This simplifies the call site and makes both wrapper factories consistent, which is important for maintainability as the control plane grows.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
…reate_bio_wrapper
Summary by cubic
Extracted certificate public key fingerprint verification to a module-level helper and added a reusable BIO wrapper for async TLS pinning. This reduces duplication and keeps pinning consistent across sync and async clients.
Written for commit a4c31c9. Summary will update on new commits.