Skip to content

Commit

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

Additionally, useful tips are shown on why batch operation actions are hidden (e.g. KnoxSSO Cookies must not be revoked).
  • Loading branch information
smolnar82 authored Oct 30, 2023
1 parent bc4d548 commit 7a5189a
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 @@ -262,8 +262,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 @@ -272,6 +272,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 7a5189a

Please sign in to comment.