@page "/apikeys"
@inherits DashboardPageBase
@using ZB.MOM.WW.MxGateway.Server.Security.Authentication
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject IDashboardApiKeyManagementService ApiKeyManagementService
@LastGeneratedApiKey
| Key | Status | Display Name | Scopes | Constraints | Created | Last Used | Expires | @if (CanManageApiKeys) {Actions | }
|---|---|---|---|---|---|---|---|---|
@key.KeyId |
@DashboardDisplay.Text(key.DisplayName) | @DashboardDisplay.Text(string.Join(", ", key.Scopes.Order(StringComparer.Ordinal))) | @DashboardDisplay.Text(ConstraintText(key.Constraints)) | @DashboardDisplay.DateTime(key.CreatedUtc) | @DashboardDisplay.DateTime(key.LastUsedUtc) | @(key.ExpiresUtc is null ? "Never" : DashboardDisplay.DateTime(key.ExpiresUtc)) | @if (CanManageApiKeys) {
@if (key.RevokedUtc is null)
{
@* Rotate clears revoked_utc, which would silently reactivate a
deliberately revoked key. Only offer it for active keys so a
revoked key is not un-revoked as a side effect of rotation. *@
}
else
{
}
|
}