mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:07:31 +00:00
fix: add expiration date information to service users keys (#7497)
* feat: add ExpirationDate to MachineKey JSON detail * fix: include time in expiration date column for machine keys table * fix: show expiration date in ShowKeyDialog if available * fix: add machine key expiration date note --------- Co-authored-by: Tim Möhlmann <tim+github@zitadel.com>
This commit is contained in:
@@ -61,7 +61,7 @@
|
||||
<ng-container matColumnDef="expirationDate">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'USER.MACHINE.EXPIRATIONDATE' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let key">
|
||||
{{ key.expirationDate | timestampToDate | localizedDate: 'fromNow' }}
|
||||
{{ key.expirationDate | timestampToDate | localizedDate: 'EEE dd. MMM YYYY, HH:mm' }}
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
|
@@ -17,6 +17,13 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="row" *ngIf="expirationDate">
|
||||
<p class="left cnsl-secondary-text">{{ 'USER.MACHINE.EXPIRATIONDATE' | translate }}</p>
|
||||
<p class="right">
|
||||
{{ expirationDate | localizedDate: 'EEE dd. MMM YYYY, HH:mm' }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button class="download-button" mat-stroked-button color="primary" (click)="saveFile()">Download</button>
|
||||
</ng-container>
|
||||
</div>
|
||||
|
@@ -11,6 +11,7 @@ import { InfoSectionType } from '../info-section/info-section.component';
|
||||
})
|
||||
export class ShowKeyDialogComponent {
|
||||
public keyResponse!: AddMachineKeyResponse.AsObject | AddAppKeyResponse.AsObject;
|
||||
public expirationDate: string = '';
|
||||
public InfoSectionType: any = InfoSectionType;
|
||||
|
||||
constructor(
|
||||
@@ -18,6 +19,10 @@ export class ShowKeyDialogComponent {
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
) {
|
||||
this.keyResponse = data.key;
|
||||
if (this.keyResponse.keyDetails) {
|
||||
const keyDetails: { expirationDate: string } = JSON.parse(atob(this.keyResponse.keyDetails.toString()));
|
||||
this.expirationDate = keyDetails.expirationDate;
|
||||
}
|
||||
}
|
||||
|
||||
public saveFile(): void {
|
||||
|
Reference in New Issue
Block a user