-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fixing CodeQL angry faces #95
Conversation
test/Microsoft.DotNet.Web.Authentication.Tests/Controllers/AnonymousAttributeController.cs
Show resolved
Hide resolved
public class AnonymousAttributeController : ControllerBase | ||
{ | ||
[AllowAnonymous] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should just be deleted, since it's identical to the next test. Ideally, you'd have wanted another test that had the "inherit from the controller" behavior tested (you'd just need to not have any Authorize attributes in that controller to keep CodeQL quiet)
@@ -393,7 +393,7 @@ public string HashPassword(TestUser user, string password) | |||
|
|||
public static string CalculateHash(TestUser user, string password) | |||
{ | |||
return $":HASH:{user.Name}:{password}"; // lgtm [cs/hardcoded-credentials] Part of unit tests | |||
return $":HASH:{user.Name}:{password}"; // CodeQL [SM00423] Hardcoded as part of unit tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These aren't even hardcoded, this a string interpolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to put 25 characters in there for a reason :D
dotnet/dnceng#5220