-
Notifications
You must be signed in to change notification settings - Fork 71
Integrate authentication middleware into ResilientClient #1108
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
Merged
sergio-correia
merged 3 commits into
keylime:master
from
sergio-correia:pop-auth-integration
Nov 20, 2025
Merged
Integrate authentication middleware into ResilientClient #1108
sergio-correia
merged 3 commits into
keylime:master
from
sergio-correia:pop-auth-integration
Nov 20, 2025
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
f66734d to
9dc6ee9
Compare
30 tasks
d3cce05 to
d1973c2
Compare
sarroutbi
approved these changes
Nov 11, 2025
Contributor
sarroutbi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Changes LGTM
Implement complete authentication system with challenge-response protocol, TPM2_Certify-based proof-of-possession, automatic token management, and configurable TLS security (secure by default). - AuthenticationClient with configurable API versioning (default: v3.0) - Authentication middleware for ResilientClient with auto token refresh - Async TPM operations trait with mock and real implementations - JSON:API compliant serialization and graceful unenrolled agent handling - Automatic retry with exponential backoff on authentication failures - Configurable TLS certificate validation (default: secure, opt-in insecure for testing) - Security warnings emitted once at agent startup when insecure TLS settings enabled Assisted-by: Claude 4 Sonnet Signed-off-by: Sergio Correia <[email protected]>
Enhance authentication middleware with precise endpoint detection and structured error types for better debugging and error handling. Middleware improvements: - Segment-based path matching instead of string contains - Match "sessions" only as last or second-to-last path segment - Prevents false positives on URLs like /users/sessions_count Error handling improvements: - AuthError enum with specific variants per failure mode - is_retryable() method for intelligent retry logic - Captures HTTP status codes and response bodies for debugging - Backwards compatible with anyhow::Result Assisted-by: Claude 4 Sonnet Signed-off-by: Sergio Correia <[email protected]>
Enhanced documentation and warnings for better developer understanding. Challenge encoding: - Improved warning when challenge is not valid base64 - Show base64 decode error and challenge preview for debugging - Clarify UTF-8 fallback is for testing/backwards compatibility Async TPM operations: - Document async/sync bridge pattern using spawn_blocking - Explain runtime requirements (tokio runtime, blocking thread pool) - Clarify why TPM operations need blocking threads (hardware I/O, sync API) - Document error handling for both task panics and TPM failures Assisted-by: Claude 4 Sonnet Signed-off-by: Sergio Correia <[email protected]>
d1973c2 to
a4dc10f
Compare
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.
Here we integrated authentication middleware into ResilientClient with automatic token
management and refresh, establishing an authentication system that transparently handles
TPM-based challenge-response authentication for HTTP clients.