Skip to content

Commit c21af15

Browse files
committed
KNOX-3224: Green-palette style for Token Generation UI
1 parent 9f3ea33 commit c21af15

File tree

11 files changed

+116
-2028
lines changed

11 files changed

+116
-2028
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,6 @@ 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-
7467
<property>
7568
<name>gateway.scope.cookies.feature.enabled</name>
7669
<value>false</value>
@@ -207,5 +200,4 @@ limitations under the License.
207200
<value>LIVYSERVER</value>
208201
<description>Add service name to x-forward-context header for the list of services defined above.</description>
209202
</property>
210-
211203
</configuration>

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

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,54 @@
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>-->
6485
<provider>
6586
<role>identity-assertion</role>
6687
<name>Default</name>
6788
<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>
6897
<param>
6998
<name>hadoop.proxyuser.impersonation.enabled</name>
70-
<value>false</value>
99+
<value>true</value>
71100
</param>
72101
<param>
73-
<name>hadoop.proxyuser.changeme.users</name>
74-
<value>NONE</value>
102+
<name>hadoop.proxyuser.admin.users</name>
103+
<value>*</value>
75104
</param>
76105
<param>
77-
<name>hadoop.proxyuser.changeme.groups</name>
78-
<value>NONE</value>
106+
<name>hadoop.proxyuser.admin.groups</name>
107+
<value>*</value>
79108
</param>
80109
<param>
81-
<name>hadoop.proxyuser.changeme.hosts</name>
82-
<value>NONE</value>
110+
<name>hadoop.proxyuser.admin.hosts</name>
111+
<value>*</value>
83112
</param>
84113
</provider>
85114
</gateway>

knox-token-generation-ui/angular.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@
5151
],
5252
"styles": [
5353
"node_modules/bootstrap/dist/css/bootstrap.min.css",
54-
"token-generation/assets/styles/app-font.css",
55-
"token-generation/assets/styles/knox.css",
56-
"token-generation/styles.css"
54+
"token-generation/styles.scss"
5755
],
5856
"scripts": [
5957
"node_modules/jquery/dist/jquery.min.js",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
.tokenResultDisplay {
3131
margin-left: 1.75%;
3232
margin-right: 1.75%;
33-
background-color: #e1e1e1;
33+
background-color: rgb(223, 228, 215);
3434
}

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

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
1414
-->
15-
<div style="margin-left: 1.75%; margin-right: 1.75%; margin-top: 4.5px">
15+
<div class="m-2">
1616
<form [formGroup]="tokenGenFrom">
1717
<fieldset>
1818
<div class="fields">
@@ -26,38 +26,43 @@ <h3>Token Generation</h3>
2626
token as an authorization bearer token. Copy the JWT token from the resulting text area and protect
2727
it
2828
securely from others as this token represents your identity and is active until expired.</label>
29-
<label class="icon-label"><mat-icon class="reduce-icon-size">mode_comment</mat-icon> Comment:</label>
30-
<input class="mb-2" formControlName="comment" (keydown.enter)="generateToken()" type="text" tabindex="1"
31-
autofocus size="255" maxlength="255">
32-
<label class="icon-label" *ngIf="comment.invalid" style="color: red;"><mat-icon
33-
class="reduce-icon-size">warning</mat-icon>Invalid comment!</label>
34-
3529
<label class="icon-label"><mat-icon class="reduce-icon-size">info</mat-icon> Configured maximum
3630
lifetime: {{tssStatus.maximumLifetimeText}} <mat-icon class="reduce-icon-size"
3731
*ngIf="'Unlimited lifetime' === tssStatus.maximumLifetimeText">priority_high</mat-icon></label>
3832
<div *ngIf="tssStatus.lifespanInputEnabled">
39-
<label class="icon-label"><mat-icon class="reduce-icon-size">access_time_filled</mat-icon> Lifetime
40-
(days, hours, mins):</label>
41-
<table>
42-
<tr>
43-
<td><input formControlName="lifespanDays" type="number" step="1" min="0" max="3650"
44-
value="0" size="3"></td> <!-- 10 years limit -->
45-
<td><input formControlName="lifespanHours" type="number" step="1" min="0" max="23" value="1"
46-
size="3"></td>
47-
<td><input formControlName="lifespanMins" type="number" step="1" min="0" max="59" value="0"
48-
size="3"></td>
49-
</tr>
50-
</table>
33+
<mat-form-field class="pe-1" style="width: 6%">
34+
<mat-label>Lifetime Days</mat-label>
35+
<input matInput type="number" formControlName="lifespanDays" type="number" step="1" min="0"
36+
max="3650" value="0">
37+
</mat-form-field>
38+
<mat-form-field class="pe-1" style="width: 6%">
39+
<mat-label>Hours</mat-label>
40+
<input matInput type="number" formControlName="lifespanHours" type="number" step="1" min="0"
41+
max="23" value="1">
42+
</mat-form-field>
43+
<mat-form-field style="width: 6%">
44+
<mat-label>Minutes</mat-label>
45+
<input matInput type="number" formControlName="lifespanMins" type="number" step="1" min="0"
46+
max="59" value="0">
47+
</mat-form-field>
48+
5149
<label class="icon-label"
5250
*ngIf="lifespanDays.invalid || lifespanHours.invalid || lifespanMins.invalid || tokenGenFrom.errors?.allZero"
5351
style="color: red;"><mat-icon class="reduce-icon-size">warning</mat-icon>Invalid
5452
lifetime!</label>
5553
</div>
54+
<mat-form-field style="width: 18%;">
55+
<mat-label class="icon-label"><mat-icon>mode_comment</mat-icon> Comment</mat-label>
56+
<input matInput placeholder="Comment" (keydown.enter)="generateToken()" formControlName="comment">
57+
</mat-form-field>
58+
<label class="icon-label" *ngIf="comment.invalid" style="color: red;"><mat-icon
59+
class="reduce-icon-size">warning</mat-icon>Invalid comment!</label>
5660

5761
<div *ngIf="tssStatus.impersonationEnabled">
58-
<label class="icon-label"><mat-icon class="reduce-icon-size">person</mat-icon> Generating token for
59-
(impersonation):</label>
60-
<input formControlName="impersonation" type="text" size="50" maxlength="255">
62+
<mat-form-field style="width: 18%;">
63+
<mat-label class="icon-label"><mat-icon>person</mat-icon> Generating token for (impersonation):</mat-label>
64+
<input matInput formControlName="impersonation">
65+
</mat-form-field>
6166
<label class="icon-label" *ngIf="impersonation.invalid" style="color: red;"><i
6267
class="icon-warning"></i>Invalid doAs!</label>
6368
</div>
@@ -68,17 +73,17 @@ <h3>Token Generation</h3>
6873
<mat-icon class="reduce-icon-size" style="color: #ae2817;">warning</mat-icon>
6974
</span>
7075

71-
<div style="align-content: center; width: 25%;">
72-
<button (click)="generateToken()"
76+
<div>
77+
<button mat-stroked-button (click)="generateToken()"
7378
[disabled]="!tssStatus.tokenManagementEnabled || !tssStatus.allowedTssForTokengen || !tokenGenFrom.valid"
74-
type="button" class="btn btn-primary btn-block" tabindex="2">
79+
color="success">
7580
Generate Token
7681
</button>
7782
</div>
7883
</fieldset>
7984
</form>
8085
</div>
81-
86+
<hr>
8287
<div style="margin-left: 1.75%; margin-right: 1.75%; margin-top: 10px">
8388
<span *ngIf="hasResult" style="color:black; margin-left: 1.75%; margin-right: 1.75%;">
8489
<label class="icon-label" (click)="copyTextToClipboard('accessToken')"><mat-icon
@@ -104,7 +109,7 @@ <h3>Token Generation</h3>
104109
</div>
105110

106111
<label class="icon-label" (click)="copyTextToClipboard('target_url')"><mat-icon
107-
class="reduce-icon-size">content_copy</mat-icon> Target Base URL:</label>
112+
class="reduce-icon-size">content_copy</mat-icon> Target Base URL:</label>
108113
<div class="tokenResultDisplay">
109114
<span id="target_url">{{tokenResultData.targetURL}}</span>
110115
</div>

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ import { TssStatusData } from '../model/tss.status.data';
2323
import { TokenGenService } from '../service/token-generation.service';
2424
import { CommonModule } from '@angular/common';
2525
import { MatIconModule } from '@angular/material/icon';
26+
import { MatButtonModule } from '@angular/material/button';
27+
import { MatInputModule } from '@angular/material/input';
28+
import { FormsModule } from '@angular/forms';
29+
import {MatFormFieldModule} from '@angular/material/form-field';
2630

2731
@Component({
2832
selector: 'app-token-generation',
2933
templateUrl: './token-generation.component.html',
3034
styleUrls: ['./token-generation.component.css'],
3135
providers: [TokenGenService],
3236
standalone: true,
33-
imports: [CommonModule, ReactiveFormsModule, MatIconModule]
37+
imports: [CommonModule, ReactiveFormsModule, MatIconModule, MatButtonModule, MatInputModule, FormsModule, MatFormFieldModule]
3438
})
3539
export class TokenGenerationComponent implements OnInit {
3640
tssStatusMessageLevel: 'info' | 'warning' | 'error';

knox-token-generation-ui/token-generation/assets/styles/app-font.css

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

0 commit comments

Comments
 (0)