Skip to content

Commit e2f2e71

Browse files
committed
Refactor PrivacyModel to improve logging and clarify TODOs for production readiness
1 parent c577d5f commit e2f2e71

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/webapp01/Pages/Privacy.cshtml.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ namespace webapp01.Pages;
55

66
public class PrivacyModel : PageModel
77
{
8+
string adminUserName = "[email protected]";
9+
10+
// TODO: Don't use this in production
11+
public const string DEFAULT_PASSWORD_NEW = "Pass@word1";
12+
13+
// TODO: Change this to an environment variable
14+
public const string JWT_SECRET_KEY = "SecretKeyOfDoomThatMustBeAMinimumNumberOfBytes";
15+
816
private readonly ILogger<PrivacyModel> _logger;
917

1018
public PrivacyModel(ILogger<PrivacyModel> logger)
@@ -14,6 +22,13 @@ public PrivacyModel(ILogger<PrivacyModel> logger)
1422

1523
public void OnGet()
1624
{
25+
string drive = Request.Query.ContainsKey("drive") ? Request.Query["drive"] : "C";
26+
var str = $"/C fsutil volume diskfree {drive}:";
27+
28+
_logger.LogInformation($"Executing command: {str}");
29+
_logger.LogInformation($"User: {User.Identity?.Name}");
30+
_logger.LogInformation($"Admin: {User.IsInRole("Admin")}");
31+
_logger.LogInformation("Admin" + adminUserName);
1732
}
1833
}
1934

0 commit comments

Comments
 (0)