Skip to content
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

Injecting credential vault into Developer ID Provider #202

Merged
merged 3 commits into from
Mar 27, 2025

Conversation

guimafelipe
Copy link
Collaborator

No description provided.

@Copilot Copilot bot review requested due to automatic review settings March 26, 2025 17:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR injects a CredentialVault into the DeveloperIdProvider to decouple the credential management implementation from the provider and improve dependency injection practices. Key changes include:

  • Instantiating CredentialVault in Program.cs and passing it to DeveloperIdProvider.
  • Updating ICredentialVault interface visibility from internal to public.
  • Refactoring DeveloperIdProvider to remove lazy initialization and use the injected ICredentialVault directly.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
GitHubExtension/Program.cs Instantiates CredentialVault and injects it into DeveloperIdProvider.
GitHubExtension/DeveloperId/ICredentialVault.cs Changes interface visibility to public.
GitHubExtension/DeveloperId/DeveloperIdProvider.cs Refactors to replace Lazy with direct dependency injection, updating all corresponding method calls.
Comments suppressed due to low confidence (2)

GitHubExtension/DeveloperId/DeveloperIdProvider.cs:59

  • Ensure that tests cover scenarios where retrieving credentials from the injected ICredentialVault might yield empty or unexpected data, validating the restore functionality.
RestoreDeveloperIds(_credentialVault.GetAllCredentials());

GitHubExtension/DeveloperId/DeveloperIdProvider.cs:267

  • Update tests to confirm that saving and subsequent removal of credentials via the injected ICredentialVault behave as expected, ensuring overall integration consistency.
_credentialVault.SaveCredentials(

@guimafelipe guimafelipe requested a review from lauren-ciha March 26, 2025 17:33
@lauren-ciha lauren-ciha merged commit e2039c8 into main Mar 27, 2025
3 checks passed
@lauren-ciha lauren-ciha deleted the user/felipeda/refactor2 branch March 27, 2025 21:49
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