Skip to content

Commit

Permalink
Merge 014120b into cbeb2f1
Browse files Browse the repository at this point in the history
  • Loading branch information
samsmithnz committed Aug 9, 2023
2 parents cbeb2f1 + 014120b commit 4ce68cc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/RepoGovernance.Core/Models/AzureAppRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ public string ExpirationDateString
{
if (ExpirationDate != null)
{
return "Expiring on " + ExpirationDate?.ToString("R");
if (ExpirationDate < DateTime.Now)
{
return "Expired on " + ExpirationDate?.ToString("R");
}
else
{
return "Expiring on " + ExpirationDate?.ToString("R");
}

}
else
{
Expand Down
12 changes: 10 additions & 2 deletions src/RepoGovernance.Web/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,16 @@
@for (int i = 0; i < item.AzureDeployment.AppRegistrations.Count; i++)
{
<li>
Service principal #@(i + 1)
<i class="bi bi-info-circle" title='@item.AzureDeployment.AppRegistrations[i].Name, @item.AzureDeployment.AppRegistrations[i].ExpirationDateString'></i>
@if (item.AzureDeployment.AppRegistrations[i].ExpirationDate < DateTime.Now)
{
<span style="color:red">Service principal #@(i + 1)</span>
<i class="bi bi-info-circle" title='@item.AzureDeployment.AppRegistrations[i].Name, @item.AzureDeployment.AppRegistrations[i].ExpirationDateString'></i>
}
else
{
<span>Service principal #@(i + 1)</span>
<i class="bi bi-info-circle" title='@item.AzureDeployment.AppRegistrations[i].Name, @item.AzureDeployment.AppRegistrations[i].ExpirationDateString'></i>
}
</li>
}
@* <li>[Secret 1] status: Current (6 months)</li>
Expand Down

0 comments on commit 4ce68cc

Please sign in to comment.