Skip to content

Feat: enhance Linux credential management with secure storage and retrieval - #5429

Merged
gautamdsheth merged 2 commits into
devfrom
fix/linux-cred-mgmt
Aug 2, 2026
Merged

Feat: enhance Linux credential management with secure storage and retrieval#5429
gautamdsheth merged 2 commits into
devfrom
fix/linux-cred-mgmt

Conversation

@gautamdsheth

Copy link
Copy Markdown
Collaborator

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes NA

What is in this Pull Request ?

Fix linux cred management issue

Copilot AI review requested due to automatic review settings August 2, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 else branch is skipped and the method returns null. Move the OS fallback outside the HasSecretManagement() 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;

Comment thread src/Commands/Utilities/CredentialManager.cs Outdated
Comment thread src/Commands/Utilities/CredentialManager.cs Outdated
…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>
@gautamdsheth
gautamdsheth merged commit fc9a5fa into dev Aug 2, 2026
5 checks passed
@gautamdsheth
gautamdsheth deleted the fix/linux-cred-mgmt branch August 4, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants