Skip to content

Commit

Permalink
CDPD-62869, CDPD-62870, KNOX-2975, KNOX-2976: Expired tokens must not…
Browse files Browse the repository at this point in the history
… be enabled/disabled in batches (apache#812)

Additionally, useful tips are shown on why batch operation actions are hidden (e.g. KnoxSSO Cookies must not be revoked).

Change-Id: I1c5a3d3f3390c43755978f6faf9457541ab538a6
  • Loading branch information
smolnar82 authored and Sandor Molnar committed Nov 1, 2023
1 parent d836c31 commit ebd1676
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,16 @@
<button *ngIf="showEnableSelectedTokensButton" type="button" (click)="enableSelectedTokens();">&nbsp;Enable Selected Tokens&nbsp;&nbsp;</button>
<button *ngIf="showRevokeSelectedTokensButton" type="button" (click)="revokeSelectedTokens();">&nbsp;Revoke Selected Tokens&nbsp;</button>
</div>

<div *ngIf="!selection.isEmpty() && !showDisableSelectedTokensButton" style="margin-top: 25px;">
<img src="assets/yellow_tip.png" style="height:30px; width:auto" /> Expired tokens cannot be disabled in batches (nor individually).
</div>
<div *ngIf="!selection.isEmpty() && !showEnableSelectedTokensButton" style="margin-top: 25px;">
<img src="assets/yellow_tip.png" style="height:30px; width:auto" /> Expired tokens cannot be enabed in batches (nor individually).
</div>
<div *ngIf="!selection.isEmpty() && !showRevokeSelectedTokensButton" style="margin-top: 25px;">
<img src="assets/yellow_tip.png" style="height:30px; width:auto" /> KnoxSSO Cookies cannot be revoked in batches (nor individually).
</div>

</div>

Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ export class TokenManagementComponent implements OnInit {
this.showEnableSelectedTokensButton = false;
this.showRevokeSelectedTokensButton = false;
} else {
this.showDisableSelectedTokensButton = true;
this.showEnableSelectedTokensButton = true;
this.showDisableSelectedTokensButton = this.selectionHasZeroExpiredToken(); // expired tokens must not be disabled
this.showEnableSelectedTokensButton = this.selectionHasZeroExpiredToken(); // expired tokens must not be enabled
this.showRevokeSelectedTokensButton = this.selectionHasZeroKnoxSsoCookie(); // KnoxSSO cookies must not be revoked
}
}
Expand All @@ -270,6 +270,10 @@ export class TokenManagementComponent implements OnInit {
return this.selection.selected.every(token => !token.metadata.knoxSsoCookie);
}

private selectionHasZeroExpiredToken(): boolean {
return this.selection.selected.every(token => !this.isTokenExpired(token.expirationLong));
}

getFontWeight(token: KnoxToken): string {
return this.isCurrentKnoxSsoCookietoken(token) ? 'bold' : 'normal';
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ebd1676

Please sign in to comment.