Feat: enhance Linux credential management with secure storage and retrieval - #5429
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds native Linux Secret Service support for stored credentials.
Changes:
- Adds Linux credential write/read/remove operations.
- Separates credential and managed-app-ID keyring schemas.
- Reorganizes documentation navigation and adds a changelog entry.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Commands/Utilities/CredentialManager.cs |
Implements Linux credential persistence. |
pages/articles/toc.yml |
Reorganizes article navigation. |
CHANGELOG.md |
Documents the Linux fix. |
Suppressed comments (2)
src/Commands/Utilities/CredentialManager.cs:134
- This Linux read path is also reachable only when the SecretManagement module is absent. If the module is installed without a default vault, lines 98-106 do not return a credential, but this
elsebranch is skipped and the method returns null. Move the OS fallback outside theHasSecretManagement()else so an empty default vault falls through to the keyring.
if (OperatingSystem.IsLinux())
{
var cred = ReadLinuxCredentialEntry(name);
if (cred == null)
{
cred = ReadLinuxCredentialEntry($"PnPPS:{name}");
}
return cred;
src/Commands/Utilities/CredentialManager.cs:216
- As with add/get, this keyring removal is skipped whenever SecretManagement is installed, even if
GetDefaultVault()returns empty. A native Linux credential then cannot be removed after installing the module or in the stated installed-but-unconfigured scenario. Fall through to this OS-specific removal whenever no default vault is available.
if (OperatingSystem.IsLinux())
{
success = DeleteLinuxCredentialEntry(name);
if (!success)
{
success = DeleteLinuxCredentialEntry($"PnPPS:{name}");
}
return success;
…ered Resolve the default vault once in AddCredential, GetCredential and RemoveCredential and fall through to the OS specific credential store when it is empty, matching what AddAppId, GetAppId and RemoveAppid already do. Previously these branched on whether the SecretManagement module was installed, so a machine with the module installed but no default vault registered stored nothing while reporting success, and retrieved and removed nothing. Document the Linux Secret Service storage and its prerequisites in the stored credential cmdlet documentation and the credential management article. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Type
Related Issues?
Fixes NA
What is in this Pull Request ?
Fix linux cred management issue