feat: add UDS credential helper mode#412
Open
wangxiaoxuan273 wants to merge 2 commits into
Open
Conversation
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds an opt-in Unix-domain socket (UDS) transport for the existing HTTP-based credential helper flow, enabling local credential retrieval without exposing a TCP listener.
Changes:
- Add
udscredential mode implementation using libcurl’sCURLOPT_UNIX_SOCKET_PATH. - Extend
ImageService::reload_auth()to routecredentialConfig.mode == "uds"to the new loader. - Add a UDS-mode test case and document the new configuration mode in README.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/image_service.cpp |
Implements load_cred_from_uds() and wires uds into the auth reload path. |
src/test/simple_credsrv_test.cpp |
Adds a gtest validating UDS credential server behavior (timeout + missing socket). |
README.md |
Documents credentialConfig.mode: "uds" and provides a configuration example. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
LGTM |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Comment on lines
+212
to
+213
| int load_cred_from_uds(const std::string socket_path, const std::string &remote_path, | ||
| std::string &username, std::string &password, int timeout) { |
| if (response.success() == false) { | ||
| LOG_ERRNO_RETURN(0, -1, "http request failed."); | ||
| } | ||
| ImageConfigNS::AuthConfig cfg; |
| if (ret != 200) { | ||
| LOG_ERRNO_RETURN(0, -1, "connect to auth component failed. http response code: `", ret); | ||
| } | ||
| LOG_DEBUG(writer.string); |
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.
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #410
Please check the following list: