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

Add SLCore credentials provider implementation #5206

Conversation

georgii-borovinskikh-sonarsource
Copy link
Contributor

Fixes #5204

[PartCreationPolicy(CreationPolicy.Shared)]
internal class CredentialsListener : ICredentialsListener
{
private static readonly Uri SonarCloudUri = new Uri("https://sonarcloud.io");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't have a single source of truth type of place for this URL. Should we open a ticket for that? To refactor the code and move all redeclarations of this URL to a single place?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah it makes sense

const string password = "password123";

var testSubject = CreateTestSubject(out var credentialStoreMock);
credentialStoreMock.Setup(x => x.ReadCredentials(It.Is((TargetUri uri) => UriEquals(uri, SonarCloudUri)))).Returns(new Credential(username, password));
Copy link
Contributor

Choose a reason for hiding this comment

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

you can put SonarCloudUri as a method parameter without using It.Is for setup which would make it simpler. (no need to change)

Copy link

sonarqubecloud bot commented Feb 8, 2024

@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource merged commit 6a8a0b5 into feature/sloop-rule-meta-data Feb 9, 2024
7 checks passed
@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource deleted the gb/slcore-credentials-impl branch February 9, 2024 08:19
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