Skip to content

Commit e958e82

Browse files
committed
KNOX-3224: Update token management and generation UIs to Angular v21
1 parent c21af15 commit e958e82

File tree

14 files changed

+301
-368
lines changed

14 files changed

+301
-368
lines changed

gateway-release/home/conf/gateway-site.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ limitations under the License.
6464
<description>Boolean flag indicating whether to enable debug messages for krb5 authentication</description>
6565
</property>
6666

67+
<!-- @since 0.10 Websocket configs -->
68+
<property>
69+
<name>gateway.websocket.feature.enabled</name>
70+
<value>false</value>
71+
<description>Enable/Disable websocket feature.</description>
72+
</property>
73+
6774
<property>
6875
<name>gateway.scope.cookies.feature.enabled</name>
6976
<value>false</value>
@@ -200,4 +207,5 @@ limitations under the License.
200207
<value>LIVYSERVER</value>
201208
<description>Add service name to x-forward-context header for the list of services defined above.</description>
202209
</property>
210+
203211
</configuration>

gateway-release/home/conf/topologies/homepage.xml

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -61,54 +61,25 @@
6161
<value>false</value>
6262
</param>
6363
</provider>
64-
<!-- <provider>-->
65-
<!-- <role>identity-assertion</role>-->
66-
<!-- <name>Default</name>-->
67-
<!-- <enabled>true</enabled>-->
68-
<!-- <param>-->
69-
<!-- <name>hadoop.proxyuser.impersonation.enabled</name>-->
70-
<!-- <value>false</value>-->
71-
<!-- </param>-->
72-
<!-- <param>-->
73-
<!-- <name>hadoop.proxyuser.changeme.users</name>-->
74-
<!-- <value>NONE</value>-->
75-
<!-- </param>-->
76-
<!-- <param>-->
77-
<!-- <name>hadoop.proxyuser.changeme.groups</name>-->
78-
<!-- <value>NONE</value>-->
79-
<!-- </param>-->
80-
<!-- <param>-->
81-
<!-- <name>hadoop.proxyuser.changeme.hosts</name>-->
82-
<!-- <value>NONE</value>-->
83-
<!-- </param>-->
84-
<!-- </provider>-->
8564
<provider>
8665
<role>identity-assertion</role>
8766
<name>Default</name>
8867
<enabled>true</enabled>
89-
<param>
90-
<name>principal.mapping</name>
91-
<value>guest=hdfs;</value>
92-
</param>
93-
<param>
94-
<name>group.principal.mapping</name>
95-
<value>*=users;hdfs=admin</value>
96-
</param>
9768
<param>
9869
<name>hadoop.proxyuser.impersonation.enabled</name>
99-
<value>true</value>
70+
<value>false</value>
10071
</param>
10172
<param>
102-
<name>hadoop.proxyuser.admin.users</name>
103-
<value>*</value>
73+
<name>hadoop.proxyuser.changeme.users</name>
74+
<value>NONE</value>
10475
</param>
10576
<param>
106-
<name>hadoop.proxyuser.admin.groups</name>
107-
<value>*</value>
77+
<name>hadoop.proxyuser.changeme.groups</name>
78+
<value>NONE</value>
10879
</param>
10980
<param>
110-
<name>hadoop.proxyuser.admin.hosts</name>
111-
<value>*</value>
81+
<name>hadoop.proxyuser.changeme.hosts</name>
82+
<value>NONE</value>
11283
</param>
11384
</provider>
11485
</gateway>

knox-token-generation-ui/package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,33 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular/common": "^20.3.15",
15-
"@angular/compiler": "^20.3.15",
16-
"@angular/core": "^20.3.15",
17-
"@angular/forms": "^20.3.15",
18-
"@angular/platform-browser": "^20.3.15",
19-
"@angular/platform-browser-dynamic": "^20.3.15",
20-
"@angular/material": "^20.2.5",
21-
"@angular/router": "^20.3.2",
14+
"@angular/common": "^21.0.5",
15+
"@angular/compiler": "^21.0.5",
16+
"@angular/core": "^21.0.5",
17+
"@angular/forms": "^21.0.5",
18+
"@angular/platform-browser": "^21.0.5",
19+
"@angular/platform-browser-dynamic": "^21.0.5",
20+
"@angular/material": "^21.0.3",
21+
"@angular/router": "^21.0.5",
2222
"jquery": "^3.7.1",
2323
"sweetalert2": "^11.26.3",
2424
"zone.js": "~0.15.1",
2525
"bootstrap": "^5.3.8"
2626
},
2727
"devDependencies": {
28-
"@angular-devkit/build-angular": "^20.3.13",
29-
"@angular-eslint/builder": "20.7.0",
30-
"@angular-eslint/eslint-plugin": "20.7.0",
31-
"@angular-eslint/eslint-plugin-template": "20.7.0",
32-
"@angular-eslint/schematics": "20.7.0",
33-
"@angular-eslint/template-parser": "20.7.0",
34-
"@angular/cli": "^20.3.13",
35-
"@angular/compiler-cli": "^20.3.15",
36-
"@angular/language-service": "^20.3.15",
28+
"@angular-devkit/build-angular": "^21.0.3",
29+
"@angular-eslint/builder": "21.1.0",
30+
"@angular-eslint/eslint-plugin": "21.1.0",
31+
"@angular-eslint/eslint-plugin-template": "21.1.0",
32+
"@angular-eslint/schematics": "21.1.0",
33+
"@angular-eslint/template-parser": "21.1.0",
34+
"@angular/cli": "^21.0.3",
35+
"@angular/compiler-cli": "^21.0.5",
36+
"@angular/language-service": "^21.0.5",
3737
"@types/node": "^24.5.2",
3838
"eslint": "^9.39.0",
3939
"ts-node": "~10.9.0",
40-
"typescript": "~5.8.3",
40+
"typescript": "~5.9.3",
4141
"typescript-eslint": "^8.46.2"
4242
}
4343
}

knox-token-generation-ui/token-generation/app/token-generation/token-generation.component.html

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,27 @@
1717
<fieldset>
1818
<div class="fields">
1919
<h3>Token Generation</h3>
20-
<label *ngIf="tssStatusMessageLevel === 'info'" style="color: green;">{{tssStatusMessage}}</label>
21-
<label *ngIf="tssStatusMessageLevel === 'warning'"
22-
style="color: chocolate;">{{tssStatusMessage}}</label>
23-
<label *ngIf="tssStatusMessageLevel === 'error'" style="color: red;">{{tssStatusMessage}}</label>
20+
@if (tssStatusMessageLevel === 'info') {
21+
<label style="color: green;">{{tssStatusMessage}}</label>
22+
}
23+
@if (tssStatusMessageLevel === 'warning') {
24+
<label style="color: chocolate;">{{tssStatusMessage}}</label>
25+
}
26+
@if (tssStatusMessageLevel === 'error') {
27+
<label style="color: red;">{{tssStatusMessage}}</label>
28+
}
2429
<label class="icon-label"><mat-icon class="reduce-icon-size">info</mat-icon> Token Generation enables
2530
integration and API invocations by using the
2631
token as an authorization bearer token. Copy the JWT token from the resulting text area and protect
2732
it
2833
securely from others as this token represents your identity and is active until expired.</label>
2934
<label class="icon-label"><mat-icon class="reduce-icon-size">info</mat-icon> Configured maximum
30-
lifetime: {{tssStatus.maximumLifetimeText}} <mat-icon class="reduce-icon-size"
31-
*ngIf="'Unlimited lifetime' === tssStatus.maximumLifetimeText">priority_high</mat-icon></label>
32-
<div *ngIf="tssStatus.lifespanInputEnabled">
35+
lifetime: {{tssStatus.maximumLifetimeText}} @if ('Unlimited lifetime' ===
36+
tssStatus.maximumLifetimeText) {
37+
<mat-icon class="reduce-icon-size">priority_high</mat-icon>
38+
}</label>
39+
@if (tssStatus.lifespanInputEnabled) {
40+
<div>
3341
<mat-form-field class="pe-1" style="width: 6%">
3442
<mat-label>Lifetime Days</mat-label>
3543
<input matInput type="number" formControlName="lifespanDays" type="number" step="1" min="0"
@@ -45,33 +53,42 @@ <h3>Token Generation</h3>
4553
<input matInput type="number" formControlName="lifespanMins" type="number" step="1" min="0"
4654
max="59" value="0">
4755
</mat-form-field>
48-
49-
<label class="icon-label"
50-
*ngIf="lifespanDays.invalid || lifespanHours.invalid || lifespanMins.invalid || tokenGenFrom.errors?.allZero"
51-
style="color: red;"><mat-icon class="reduce-icon-size">warning</mat-icon>Invalid
56+
@if (lifespanDays.invalid || lifespanHours.invalid || lifespanMins.invalid ||
57+
tokenGenFrom.errors?.allZero) {
58+
<label class="icon-label" style="color: red;"><mat-icon
59+
class="reduce-icon-size">warning</mat-icon>Invalid
5260
lifetime!</label>
61+
}
5362
</div>
63+
}
5464
<mat-form-field style="width: 18%;">
5565
<mat-label class="icon-label"><mat-icon>mode_comment</mat-icon> Comment</mat-label>
5666
<input matInput placeholder="Comment" (keydown.enter)="generateToken()" formControlName="comment">
5767
</mat-form-field>
58-
<label class="icon-label" *ngIf="comment.invalid" style="color: red;"><mat-icon
68+
@if (comment.invalid) {
69+
<label class="icon-label" style="color: red;"><mat-icon
5970
class="reduce-icon-size">warning</mat-icon>Invalid comment!</label>
71+
}
6072

61-
<div *ngIf="tssStatus.impersonationEnabled">
73+
@if (tssStatus.impersonationEnabled) {
74+
<div>
6275
<mat-form-field style="width: 18%;">
63-
<mat-label class="icon-label"><mat-icon>person</mat-icon> Generating token for (impersonation):</mat-label>
76+
<mat-label class="icon-label"><mat-icon>person</mat-icon> Generating token for
77+
(impersonation):</mat-label>
6478
<input matInput formControlName="impersonation">
6579
</mat-form-field>
66-
<label class="icon-label" *ngIf="impersonation.invalid" style="color: red;"><i
67-
class="icon-warning"></i>Invalid doAs!</label>
80+
@if (impersonation.invalid) {
81+
<label class="icon-label" style="color: red;"><i class="icon-warning"></i>Invalid doAs!</label>
82+
}
6883
</div>
84+
}
6985
</div>
7086

71-
<span *ngIf="requestErrorMessage" class="help-inline" style="color: red;"><span
72-
class="errorMsg">{{requestErrorMessage}}</span>
87+
@if (requestErrorMessage) {
88+
<span class="help-inline" style="color: red;"><span class="errorMsg">{{requestErrorMessage}}</span>
7389
<mat-icon class="reduce-icon-size" style="color: #ae2817;">warning</mat-icon>
7490
</span>
91+
}
7592

7693
<div>
7794
<button mat-stroked-button (click)="generateToken()"
@@ -85,38 +102,37 @@ <h3>Token Generation</h3>
85102
</div>
86103
<hr>
87104
<div style="margin-left: 1.75%; margin-right: 1.75%; margin-top: 10px">
88-
<span *ngIf="hasResult" style="color:black; margin-left: 1.75%; margin-right: 1.75%;">
105+
@if (hasResult) {
106+
<span style="color:black; margin-left: 1.75%; margin-right: 1.75%;">
89107
<label class="icon-label" (click)="copyTextToClipboard('accessToken')"><mat-icon
90108
class="reduce-icon-size">content_copy</mat-icon> JWT Token:</label>
91109
<div class="tokenResultDisplay">
92110
<span id="accessToken" style="word-wrap: break-word">{{tokenResultData.accessToken}}</span>
93111
</div>
94-
95112
<label class="icon-label" (click)="copyTextToClipboard('accessPasscode')"><mat-icon
96113
class="reduce-icon-size">content_copy</mat-icon> Passcode Token:</label>
97-
<div *ngIf="tokenResultData.accessPasscode" class="tokenResultDisplay">
114+
@if (tokenResultData.accessPasscode) {
115+
<div class="tokenResultDisplay">
98116
<span id="accessPasscode">{{tokenResultData.accessPasscode}}</span>
99117
</div>
100-
118+
}
101119
<label class="icon-label"><mat-icon class="reduce-icon-size">info</mat-icon> Expiration:</label>
102120
<div class="tokenResultDisplay">
103121
<span>{{tokenResultData.expiry}}</span>
104122
</div>
105-
106123
<label class="icon-label"><mat-icon class="reduce-icon-size">info</mat-icon> User:</label>
107124
<div class="tokenResultDisplay">
108125
<span>{{tokenResultData.user}}</span>
109126
</div>
110-
111127
<label class="icon-label" (click)="copyTextToClipboard('target_url')"><mat-icon
112128
class="reduce-icon-size">content_copy</mat-icon> Target Base URL:</label>
113129
<div class="tokenResultDisplay">
114130
<span id="target_url">{{tokenResultData.targetURL}}</span>
115131
</div>
116-
117132
<label class="icon-label"><mat-icon class="reduce-icon-size">link</mat-icon> Homepage:</label>
118133
<div class="tokenResultDisplay">
119134
<a [href]="tokenResultData.homepageURL">Homepage URL</a>
120135
</div>
121136
</span>
137+
}
122138
</div>

knox-token-generation-ui/token-generation/app/token-generation/token-generation.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import Swal from 'sweetalert2/dist/sweetalert2.esm.all.js';
2121
import { TokenResultData } from '../model/token.result.data';
2222
import { TssStatusData } from '../model/tss.status.data';
2323
import { TokenGenService } from '../service/token-generation.service';
24-
import { CommonModule } from '@angular/common';
24+
2525
import { MatIconModule } from '@angular/material/icon';
2626
import { MatButtonModule } from '@angular/material/button';
2727
import { MatInputModule } from '@angular/material/input';
@@ -34,7 +34,7 @@ import {MatFormFieldModule} from '@angular/material/form-field';
3434
styleUrls: ['./token-generation.component.css'],
3535
providers: [TokenGenService],
3636
standalone: true,
37-
imports: [CommonModule, ReactiveFormsModule, MatIconModule, MatButtonModule, MatInputModule, FormsModule, MatFormFieldModule]
37+
imports: [ReactiveFormsModule, MatIconModule, MatButtonModule, MatInputModule, FormsModule, MatFormFieldModule]
3838
})
3939
export class TokenGenerationComponent implements OnInit {
4040
tssStatusMessageLevel: 'info' | 'warning' | 'error';

knox-token-generation-ui/token-generation/assets/sticky-footer.css

Lines changed: 0 additions & 42 deletions
This file was deleted.

knox-token-generation-ui/token-generation/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {environment} from './environments/environment';
2020
import { SessionInformationComponent } from './app/sessionInformation/session.information.component.js';
2121
import { TokenGenerationComponent } from './app/token-generation/token-generation.component.js';
2222
import { bootstrapApplication } from '@angular/platform-browser';
23-
import { enableProdMode, importProvidersFrom } from '@angular/core';
23+
import { enableProdMode, importProvidersFrom, provideZoneChangeDetection } from '@angular/core';
2424
import { provideRouter } from '@angular/router';
2525
import { APP_BASE_HREF } from '@angular/common';
2626
import { provideHttpClient } from '@angular/common/http';
@@ -37,7 +37,7 @@ const bootstrapComponents = [
3737
bootstrapComponents.forEach(component => {
3838
bootstrapApplication(component, {
3939
providers: [
40-
importProvidersFrom(),
40+
provideZoneChangeDetection(),importProvidersFrom(),
4141
provideHttpClient(),
4242
provideRouter([]),
4343
{

knox-token-generation-ui/token-generation/tsconfig.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"declaration": false,
55
"emitDecoratorMetadata": true,
66
"experimentalDecorators": true,
7-
"lib": [
8-
"es2017",
9-
"dom"
10-
],
117
"module": "ES2022",
128
"moduleResolution": "bundler",
139
"outDir": "../dist/out-tsc",

0 commit comments

Comments
 (0)