mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 22:57:23 +00:00
fix: Merge master (#1373)
* feat(console): app infos, api apps, fix redirects on create, fix role update, redesign idps, policy, prettier history (#1310) * idp fixes * idp cleanup and rehaul, complexity policy preview * policy fixes, orthodox redirect * link component, add links to policies * redirect pipe, state labels * Cnsl map changes (#1315) * map changes to different format * fix changes layout, cursor * set asc values * fix user appearance in changes, index * changes * app create with api * api app create * auth method for api config * authmethods, app card for api, authmethod in dev create * move machine keys to own module * jwt method for oidc * fix app edit * save toast * fix changes, change det in app detail * regenerate secret * chore(deps-dev): bump @angular-devkit/build-angular in /console (#1324) Bumps [@angular-devkit/build-angular](https://github.com/angular/angular-cli) from 0.1102.0 to 0.1102.1. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix policy backlink Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> (cherry picked from commit 40a7e958d712f83585e25f18f4fff620de5e3269) * fix: i18n refs, unnecessary logs (#1343) (cherry picked from commit 2e04c977eba295cab6aa533379f6075d2e27ab42) * fix: tos link (#1345) (cherry picked from commit 5333ef10c169e3656e3ca8dfb8edf7f738fa0a26) * fix: reactivate/deactivate idp, remove idp provider (#1348) * fix: reactivate/deactivate idp, remove idp provider * fix build * fix(console): add jwt to selection, idp deactivate reactivate (#1347) * fix: log error on idp change * add jwt to method selection Co-authored-by: Max Peintner <max@caos.ch> (cherry picked from commit c8b9888427f4ea6b513d370f9fed555208594edf) * fix: reactivate/deactivate idp (#1351) (cherry picked from commit 54f395e2e05d4adb29321e9597d049800c033b61) Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
parent
3c07a186fc
commit
9f417f3957
970
console/package-lock.json
generated
970
console/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -45,7 +45,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular/cli": "~11.2.0",
|
"@angular/cli": "~11.2.0",
|
||||||
"@angular-devkit/build-angular": "~0.1102.0",
|
"@angular-devkit/build-angular": "~0.1102.1",
|
||||||
"@angular/compiler-cli": "~11.0.0",
|
"@angular/compiler-cli": "~11.0.0",
|
||||||
"@types/jasmine": "~3.6.3",
|
"@types/jasmine": "~3.6.3",
|
||||||
"@angular/language-service": "~11.2.0",
|
"@angular/language-service": "~11.2.0",
|
||||||
|
@ -143,6 +143,37 @@ export class AppComponent implements OnDestroy {
|
|||||||
'mdi_pin',
|
'mdi_pin',
|
||||||
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/pin.svg'),
|
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/pin.svg'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
this.matIconRegistry.addSvgIcon(
|
||||||
|
'mdi_format-letter-case-lower',
|
||||||
|
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/format-letter-case-lower.svg'),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.matIconRegistry.addSvgIcon(
|
||||||
|
'mdi_format-letter-case-upper',
|
||||||
|
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/format-letter-case-upper.svg'),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.matIconRegistry.addSvgIcon(
|
||||||
|
'mdi_counter',
|
||||||
|
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/counter.svg'),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.matIconRegistry.addSvgIcon(
|
||||||
|
'mdi_symbol',
|
||||||
|
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/symbol.svg'),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.matIconRegistry.addSvgIcon(
|
||||||
|
'mdi_numeric',
|
||||||
|
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/numeric.svg'),
|
||||||
|
);
|
||||||
|
|
||||||
|
this.matIconRegistry.addSvgIcon(
|
||||||
|
'mdi_api',
|
||||||
|
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/mdi/api.svg'),
|
||||||
|
);
|
||||||
|
|
||||||
this.getProjectCount();
|
this.getProjectCount();
|
||||||
|
|
||||||
this.orgSub = this.authService.activeOrgChanged.subscribe(org => {
|
this.orgSub = this.authService.activeOrgChanged.subscribe(org => {
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
import { Component, Inject } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { FormControl } from '@angular/forms';
|
import { FormControl } from '@angular/forms';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { MachineKeyType } from 'src/app/proto/generated/management_pb';
|
import { AuthNKeyType, MachineKeyType } from 'src/app/proto/generated/management_pb';
|
||||||
|
|
||||||
|
export enum AddKeyDialogType {
|
||||||
|
MACHINE = "MACHINE",
|
||||||
|
AUTHNKEY = "AUTHNKEY",
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-add-key-dialog',
|
selector: 'app-add-key-dialog',
|
||||||
@ -10,16 +15,21 @@ import { MachineKeyType } from 'src/app/proto/generated/management_pb';
|
|||||||
})
|
})
|
||||||
export class AddKeyDialogComponent {
|
export class AddKeyDialogComponent {
|
||||||
public startDate: Date = new Date();
|
public startDate: Date = new Date();
|
||||||
types: MachineKeyType[] = [
|
types: MachineKeyType[] | AuthNKeyType[] = [];
|
||||||
MachineKeyType.MACHINEKEY_JSON,
|
public type!: MachineKeyType | AuthNKeyType;
|
||||||
];
|
|
||||||
public type: MachineKeyType = MachineKeyType.MACHINEKEY_JSON;
|
|
||||||
public dateControl: FormControl = new FormControl('', []);
|
public dateControl: FormControl = new FormControl('', []);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public dialogRef: MatDialogRef<AddKeyDialogComponent>,
|
public dialogRef: MatDialogRef<AddKeyDialogComponent>,
|
||||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||||
) {
|
) {
|
||||||
|
if (data.type = AddKeyDialogType.MACHINE) {
|
||||||
|
this.types = [MachineKeyType.MACHINEKEY_JSON];
|
||||||
|
this.type = MachineKeyType.MACHINEKEY_JSON;
|
||||||
|
} else if (data.type = AddKeyDialogType.AUTHNKEY) {
|
||||||
|
this.types = [AuthNKeyType.AUTHNKEY_JSON];
|
||||||
|
this.type = AuthNKeyType.AUTHNKEY_JSON;
|
||||||
|
}
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
this.startDate.setDate(today.getDate() + 1);
|
this.startDate.setDate(today.getDate() + 1);
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<div class="cnsl-app-card" [ngClass]="{'web': type == OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB,
|
<div class="cnsl-app-card" [ngClass]="{'web': type == OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB,
|
||||||
'useragent': type == OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT,
|
'useragent': type == OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT,
|
||||||
'native': type == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE}">
|
'native': type == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE, 'api': isApiApp}">
|
||||||
<ng-content></ng-content>
|
<ng-content></ng-content>
|
||||||
</div>
|
</div>
|
@ -45,5 +45,11 @@
|
|||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.api {
|
||||||
|
background-color: #333;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,6 @@ import { OIDCApplicationType } from 'src/app/proto/generated/management_pb';
|
|||||||
export class AppCardComponent {
|
export class AppCardComponent {
|
||||||
@Input() public outline: boolean = false;
|
@Input() public outline: boolean = false;
|
||||||
@Input() public type!: OIDCApplicationType;
|
@Input() public type!: OIDCApplicationType;
|
||||||
|
@Input() public isApiApp: boolean = false;
|
||||||
public OIDCApplicationType: any = OIDCApplicationType;
|
public OIDCApplicationType: any = OIDCApplicationType;
|
||||||
}
|
}
|
||||||
|
@ -17,17 +17,21 @@
|
|||||||
<p class="type-desc">{{method.descI18nKey | translate}}</p>
|
<p class="type-desc">{{method.descI18nKey | translate}}</p>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<div class="app-specs">
|
<div class="app-specs">
|
||||||
<div class="row" *ngIf="method && method.responseType != undefined">
|
<div class="row" *ngIf="isOIDC && method && method.responseType != undefined">
|
||||||
<span>{{'APP.OIDC.RESPONSE' | translate}}</span>
|
<span>{{'APP.OIDC.RESPONSETYPE' | translate}}</span>
|
||||||
<span>{{('APP.OIDC.RESPONSE'+method.responseType.toString()) | translate}}</span>
|
<span>{{('APP.OIDC.RESPONSE.'+method.responseType.toString()) | translate}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" *ngIf="method.grantType != undefined">
|
<div class="row" *ngIf="isOIDC && method.grantType != undefined">
|
||||||
<span>{{'APP.GRANT' | translate}}</span>
|
<span>{{'APP.GRANT' | translate}}</span>
|
||||||
<span>{{('APP.OIDC.GRANT'+method.grantType.toString()) | translate}}</span>
|
<span>{{('APP.OIDC.GRANT.'+method.grantType.toString()) | translate}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" *ngIf="method.authMethod != undefined">
|
<div class="row" *ngIf="isOIDC && method.authMethod != undefined">
|
||||||
<span>{{'APP.OIDC.AUTHMETHOD' | translate}}</span>
|
<span>{{'APP.AUTHMETHOD' | translate}}</span>
|
||||||
<span>{{('APP.OIDC.AUTHMETHOD'+method.authMethod.toString()) | translate}}</span>
|
<span>{{('APP.OIDC.AUTHMETHOD.'+method.authMethod.toString()) | translate}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="row" *ngIf="!isOIDC && method.apiAuthMethod != undefined">
|
||||||
|
<span>{{'APP.AUTHMETHOD' | translate}}</span>
|
||||||
|
<span>{{('APP.API.AUTHMETHOD.'+method.apiAuthMethod.toString()) | translate}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</label>
|
</label>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import { OIDCAuthMethodType, OIDCGrantType, OIDCResponseType } from 'src/app/proto/generated/management_pb';
|
import { APIAuthMethodType, OIDCAuthMethodType, OIDCGrantType, OIDCResponseType } from 'src/app/proto/generated/management_pb';
|
||||||
|
|
||||||
export interface RadioItemAuthType {
|
export interface RadioItemAuthType {
|
||||||
key: string;
|
key: string;
|
||||||
@ -11,6 +11,7 @@ export interface RadioItemAuthType {
|
|||||||
responseType?: OIDCResponseType;
|
responseType?: OIDCResponseType;
|
||||||
grantType?: OIDCGrantType;
|
grantType?: OIDCGrantType;
|
||||||
authMethod?: OIDCAuthMethodType;
|
authMethod?: OIDCAuthMethodType;
|
||||||
|
apiAuthMethod?: | APIAuthMethodType;
|
||||||
recommended?: boolean;
|
recommended?: boolean;
|
||||||
notRecommended?: boolean;
|
notRecommended?: boolean;
|
||||||
}
|
}
|
||||||
@ -24,6 +25,7 @@ export class AppAuthMethodRadioComponent {
|
|||||||
@Input() current: string = '';
|
@Input() current: string = '';
|
||||||
@Input() selected: string = '';
|
@Input() selected: string = '';
|
||||||
@Input() authMethods!: RadioItemAuthType[];
|
@Input() authMethods!: RadioItemAuthType[];
|
||||||
|
@Input() isOIDC: boolean = false;
|
||||||
@Output() selectedMethod: EventEmitter<string> = new EventEmitter();
|
@Output() selectedMethod: EventEmitter<string> = new EventEmitter();
|
||||||
|
|
||||||
public emitChange(): void {
|
public emitChange(): void {
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
<div class="radio-button-wrapper">
|
<div class="radio-button-wrapper">
|
||||||
<ng-container *ngFor="let type of types">
|
<ng-container *ngFor="let type of types">
|
||||||
<input type="radio" [disabled]="type.disabled" (change)="emitChange()" [value]="type.type"
|
<input type="radio" (change)="emitChange()" [value]="type" [(ngModel)]="selected" [id]="type.prefix" />
|
||||||
[(ngModel)]="selected" [id]="type.type" />
|
<label class="cnsl-type-radio-button" [for]="type.prefix">
|
||||||
<label class="cnsl-type-radio-button" [for]="type.type">
|
|
||||||
<div class="cnsl-type-radio-header" [ngStyle]="{'background': type.background}">
|
<div class="cnsl-type-radio-header" [ngStyle]="{'background': type.background}">
|
||||||
<span>{{type.prefix}}</span>
|
<span>{{type.prefix}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,15 +1,5 @@
|
|||||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { OIDCApplicationType } from 'src/app/proto/generated/management_pb';
|
import { RadioItemAppType, WEB_TYPE } from 'src/app/pages/projects/apps/authtypes';
|
||||||
|
|
||||||
export interface RadioItemAppType {
|
|
||||||
type: OIDCApplicationType;
|
|
||||||
titleI18nKey: string;
|
|
||||||
descI18nKey: string;
|
|
||||||
checked: boolean,
|
|
||||||
disabled: boolean,
|
|
||||||
prefix: string;
|
|
||||||
background: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-type-radio',
|
selector: 'app-type-radio',
|
||||||
@ -17,9 +7,9 @@ export interface RadioItemAppType {
|
|||||||
styleUrls: ['./app-type-radio.component.scss'],
|
styleUrls: ['./app-type-radio.component.scss'],
|
||||||
})
|
})
|
||||||
export class AppTypeRadioComponent {
|
export class AppTypeRadioComponent {
|
||||||
@Input() selected: OIDCApplicationType = OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB;
|
@Input() selected: RadioItemAppType = WEB_TYPE;
|
||||||
@Input() types!: RadioItemAppType[];
|
@Input() types!: RadioItemAppType[];
|
||||||
@Output() selectedType: EventEmitter<OIDCApplicationType> = new EventEmitter();
|
@Output() selectedType: EventEmitter<RadioItemAppType> = new EventEmitter();
|
||||||
|
|
||||||
public emitChange(): void {
|
public emitChange(): void {
|
||||||
this.selectedType.emit(this.selected);
|
this.selectedType.emit(this.selected);
|
||||||
|
@ -52,6 +52,6 @@
|
|||||||
|
|
||||||
@media only screen and (max-width: 500px) {
|
@media only screen and (max-width: 500px) {
|
||||||
margin: .5rem 0;
|
margin: .5rem 0;
|
||||||
padding: .5rem;
|
padding: 1rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,12 +6,45 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="scroll-container" appScrollable (scrollPosition)="scrollHandler($event)">
|
<div class="scroll-container" appScrollable (scrollPosition)="scrollHandler($event)">
|
||||||
<li class="item change-item-back" *ngFor="let event of data | async">
|
<li class="item change-item-back" *ngFor="let hist of data | async; index as histindex">
|
||||||
<span class="seq">
|
<span *ngIf="hist.values[0].dates[0]" class="date">{{
|
||||||
{{event.changeDate | timestampToDate | localizedDate: 'EEE dd. MMM, HH:mm'}}
|
hist.values[0]?.dates[0]| timestampToDate | localizedDate: 'dd. MMMM YYYY' }}</span>
|
||||||
</span>
|
<div class="item" *ngFor="let dayelement of hist.values; index as i">
|
||||||
<span class="editor">{{event.editor}}</span>
|
<div class="row">
|
||||||
<span class="desc">{{event?.eventType?.localizedMessage }}</span>
|
<app-avatar matTooltip="{{ dayelement.editorName }}" *ngIf="dayelement.editorName; else spacer"
|
||||||
|
class="avatar" [name]="dayelement.editorName" [size]="32">
|
||||||
|
</app-avatar>
|
||||||
|
<ng-template #spacer>
|
||||||
|
<div class="spacer"></div>
|
||||||
|
</ng-template>
|
||||||
|
<div class="actions">
|
||||||
|
<div class="action" *ngFor="let action of dayelement.eventTypes; index as j">
|
||||||
|
<button disabled mat-icon-button aria-label="Restore history"
|
||||||
|
matTooltip="{{ dayelement.dates[j] | timestampToDate | localizedDate: 'dd. MMMM YYYY, HH:mm' }}">
|
||||||
|
<mat-icon class="icon">schedule</mat-icon>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
<span class="msg">{{ action.localizedMessage }}</span>
|
||||||
|
<span class="block">{{
|
||||||
|
dayelement.dates[j] | timestampToDate | localizedDate: 'HH:mm'
|
||||||
|
}}</span>
|
||||||
|
</span>
|
||||||
|
<!-- <span *ngIf="histindex === 0 && i === 0 && j === 0">
|
||||||
|
<span>current file</span>
|
||||||
|
<span class="block">{{
|
||||||
|
dayelement.dates[j] | timestampToDate | localizedDate: 'HH:mm'
|
||||||
|
}}</span>
|
||||||
|
</span> -->
|
||||||
|
|
||||||
|
<!-- <button mat-icon-button disabled>
|
||||||
|
<mat-icon class="icon red" color="warn">error_outline
|
||||||
|
</mat-icon>
|
||||||
|
</button> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<div class="sp-wrapper">
|
<div class="sp-wrapper">
|
||||||
<mat-spinner *ngIf="loading | async" diameter="25"></mat-spinner>
|
<mat-spinner *ngIf="loading | async" diameter="25"></mat-spinner>
|
||||||
|
@ -21,54 +21,119 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@mixin changes-theme($theme) {
|
@mixin changes-theme($theme) {
|
||||||
.scroll-container {
|
.scroll-container {
|
||||||
max-height: 50vh;
|
max-height: 50vh;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
|
border-bottom: 1px solid #ffffff20;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
|
||||||
.item {
|
.date {
|
||||||
box-sizing: border-box;
|
font-weight: 500;
|
||||||
padding: .5rem;
|
font-size: 0.8rem;
|
||||||
margin: .25rem 0;
|
display: block;
|
||||||
border-radius: .5rem;
|
margin-bottom: .5rem;
|
||||||
display: flex;
|
}
|
||||||
flex-direction: column;
|
|
||||||
|
|
||||||
.editor {
|
.item {
|
||||||
color: var(--grey);
|
display: block;
|
||||||
font-size: 12px;
|
padding: 10px 0;
|
||||||
align-self: flex-end;
|
font-size: 0.8rem;
|
||||||
}
|
|
||||||
|
|
||||||
.seq {
|
.row {
|
||||||
color: var(--grey);
|
display: flex;
|
||||||
font-size: 12px;
|
flex-direction: row;
|
||||||
align-self: flex-end;
|
|
||||||
}
|
|
||||||
|
|
||||||
.desc {
|
.spacer {
|
||||||
overflow-x: auto;
|
width: 32px;
|
||||||
font-size: 14px;
|
}
|
||||||
}
|
|
||||||
/* stylelint-disable */
|
.actions {
|
||||||
$primary: map-get($theme, primary);
|
flex: 1;
|
||||||
$primary-dark: mat-color($primary, A800);
|
display: flex;
|
||||||
/* stylelint-enable */
|
flex-direction: column;
|
||||||
|
margin-top: -0.5rem;
|
||||||
|
|
||||||
&.change-item-back {
|
.action {
|
||||||
background-color: rgba($primary-dark, .93);
|
display: flex;
|
||||||
transition: background-color .3s cubic-bezier(.645, .045, .355, 1);
|
flex-direction: row;
|
||||||
}
|
align-items: center;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 32px;
|
||||||
|
display: inline-block;
|
||||||
|
height: 1.2rem;
|
||||||
|
line-height: 1.2rem;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
color: var(--grey);
|
||||||
|
}
|
||||||
|
|
||||||
|
span {
|
||||||
|
flex: 1;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.msg {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.block {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.restore {
|
||||||
|
visibility: hidden;
|
||||||
|
display: none;
|
||||||
|
opacity: 0;
|
||||||
|
margin-left: 1rem;
|
||||||
|
transform: opacity 0.2s ease-in-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
.restore {
|
||||||
|
visibility: visible;
|
||||||
|
display: inline-block;
|
||||||
|
opacity: 1;
|
||||||
|
color: #81868a;
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* stylelint-disable */
|
||||||
|
$primary: map-get($theme, primary);
|
||||||
|
$primary-dark: mat-color($primary, A800);
|
||||||
|
/* stylelint-enable */
|
||||||
|
|
||||||
|
&.change-item-back {
|
||||||
|
background-color: rgba($primary-dark, .93);
|
||||||
|
transition: background-color .3s cubic-bezier(.645, .045, .355, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.sp-wrapper {
|
||||||
|
padding: .5rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.end-container {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--grey);
|
||||||
|
font-size: 14px;
|
||||||
|
margin: 1rem 0;
|
||||||
|
color: var(--grey);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
.sp-wrapper {
|
|
||||||
padding: .5rem;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.end-container {
|
|
||||||
font-size: 12px;
|
|
||||||
color: var(--grey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,6 +4,8 @@ import { catchError, debounceTime, scan, take, takeUntil, tap } from 'rxjs/opera
|
|||||||
import { Change, Changes } from 'src/app/proto/generated/management_pb';
|
import { Change, Changes } from 'src/app/proto/generated/management_pb';
|
||||||
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
|
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
|
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
||||||
|
import { KeyValue } from '@angular/common';
|
||||||
|
|
||||||
export enum ChangeType {
|
export enum ChangeType {
|
||||||
MYUSER = 'myuser',
|
MYUSER = 'myuser',
|
||||||
@ -13,6 +15,18 @@ export enum ChangeType {
|
|||||||
APP = 'app',
|
APP = 'app',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MappedChange {
|
||||||
|
key: string,
|
||||||
|
values: Array<{
|
||||||
|
data: any[];
|
||||||
|
dates: Timestamp.AsObject[];
|
||||||
|
editorId: string;
|
||||||
|
editorName: string;
|
||||||
|
eventTypes: Array<{ key: string; localizedMessage: string; }>;
|
||||||
|
sequences: number[];
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-changes',
|
selector: 'app-changes',
|
||||||
templateUrl: './changes.component.html',
|
templateUrl: './changes.component.html',
|
||||||
@ -31,7 +45,7 @@ export class ChangesComponent implements OnInit, OnDestroy {
|
|||||||
private _data: BehaviorSubject<any> = new BehaviorSubject([]);
|
private _data: BehaviorSubject<any> = new BehaviorSubject([]);
|
||||||
|
|
||||||
loading: Observable<boolean> = this._loading.asObservable();
|
loading: Observable<boolean> = this._loading.asObservable();
|
||||||
public data!: Observable<Change.AsObject[]>;
|
public data!: Observable<MappedChange[]>;
|
||||||
public changes!: Changes.AsObject;
|
public changes!: Changes.AsObject;
|
||||||
private destroyed$: Subject<void> = new Subject();
|
private destroyed$: Subject<void> = new Subject();
|
||||||
constructor(private mgmtUserService: ManagementService, private authUserService: GrpcAuthService) {
|
constructor(private mgmtUserService: ManagementService, private authUserService: GrpcAuthService) {
|
||||||
@ -52,6 +66,7 @@ export class ChangesComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public scrollHandler(e: any): void {
|
public scrollHandler(e: any): void {
|
||||||
|
console.log('bottom');
|
||||||
if (e === 'bottom') {
|
if (e === 'bottom') {
|
||||||
this.more();
|
this.more();
|
||||||
}
|
}
|
||||||
@ -83,6 +98,7 @@ export class ChangesComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
private more(): void {
|
private more(): void {
|
||||||
const cursor = this.getCursor();
|
const cursor = this.getCursor();
|
||||||
|
console.log('cursor' + cursor);
|
||||||
|
|
||||||
let more: Promise<Changes>;
|
let more: Promise<Changes>;
|
||||||
|
|
||||||
@ -105,9 +121,11 @@ export class ChangesComponent implements OnInit, OnDestroy {
|
|||||||
// Determines the snapshot to paginate query
|
// Determines the snapshot to paginate query
|
||||||
private getCursor(): number {
|
private getCursor(): number {
|
||||||
const current = this._data.value;
|
const current = this._data.value;
|
||||||
|
|
||||||
if (current.length) {
|
if (current.length) {
|
||||||
return !this.sortDirectionAsc ? current[0].sequence :
|
const lastElementValues = current[current.length - 1].values;
|
||||||
current[current.length - 1].sequence;
|
const seq = lastElementValues[lastElementValues.length - 1].sequences;
|
||||||
|
return seq[seq.length - 1];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -125,8 +143,10 @@ export class ChangesComponent implements OnInit, OnDestroy {
|
|||||||
take(1),
|
take(1),
|
||||||
tap((res: Changes) => {
|
tap((res: Changes) => {
|
||||||
const values = res.toObject().changesList;
|
const values = res.toObject().changesList;
|
||||||
|
const mapped = this.mapChanges(values);
|
||||||
// update source with new values, done loading
|
// update source with new values, done loading
|
||||||
this._data.next(values);
|
// this._data.next(values);
|
||||||
|
this._data.next(mapped);
|
||||||
|
|
||||||
this._loading.next(false);
|
this._loading.next(false);
|
||||||
|
|
||||||
@ -143,4 +163,85 @@ export class ChangesComponent implements OnInit, OnDestroy {
|
|||||||
).subscribe();
|
).subscribe();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mapChanges(changes: Change.AsObject[]) {
|
||||||
|
const splitted: { [editorId: string]: any[]; } = {};
|
||||||
|
changes.forEach((change) => {
|
||||||
|
if (change.changeDate) {
|
||||||
|
const index = `${this.getDateString(change.changeDate)}`;//`${this.getDateString(change.changeDate)}:${change.editorId}`;
|
||||||
|
|
||||||
|
if (index) {
|
||||||
|
if (splitted[index]) {
|
||||||
|
const userData: any = {
|
||||||
|
editor: change.editor,
|
||||||
|
editorId: change.editorId,
|
||||||
|
editorName: change.editor,
|
||||||
|
|
||||||
|
dates: [change.changeDate],
|
||||||
|
data: [change.data],
|
||||||
|
eventTypes: [change.eventType],
|
||||||
|
sequences: [change.sequence],
|
||||||
|
};
|
||||||
|
const lastIndex = splitted[index].length - 1;
|
||||||
|
if (lastIndex > -1 && splitted[index][lastIndex].editor === change.editor) {
|
||||||
|
splitted[index][lastIndex].dates.push(change.changeDate);
|
||||||
|
splitted[index][lastIndex].data.push(change.data);
|
||||||
|
splitted[index][lastIndex].eventTypes.push(change.eventType);
|
||||||
|
splitted[index][lastIndex].sequences.push(change.sequence);
|
||||||
|
} else {
|
||||||
|
splitted[index].push(userData);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
splitted[index] = [
|
||||||
|
{
|
||||||
|
editor: change.editor,
|
||||||
|
editorId: change.editorId,
|
||||||
|
editorName: change.editor,
|
||||||
|
|
||||||
|
dates: [change.changeDate],
|
||||||
|
data: [change.data],
|
||||||
|
eventTypes: [change.eventType],
|
||||||
|
sequences: [change.sequence],
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
const arr = Object.keys(splitted).map(key => {
|
||||||
|
return { key: key, values: splitted[key] };
|
||||||
|
});
|
||||||
|
|
||||||
|
arr.sort((a, b) => {
|
||||||
|
return parseFloat(b.key) - parseFloat(a.key);
|
||||||
|
});
|
||||||
|
|
||||||
|
// console.log(arr);
|
||||||
|
return arr;
|
||||||
|
}
|
||||||
|
|
||||||
|
getDateString(ts: Timestamp.AsObject) {
|
||||||
|
const date = new Date(ts.seconds * 1000 + ts.nanos / 1000 / 1000);
|
||||||
|
return date.getUTCFullYear() + this.pad(date.getUTCMonth() + 1) + this.pad(date.getUTCDate());
|
||||||
|
}
|
||||||
|
|
||||||
|
getTimestampIndex(date: any): number {
|
||||||
|
const ts: Date = new Date(date.seconds * 1000 + date.nanos / 1000 / 1000);
|
||||||
|
console.log(ts);
|
||||||
|
return ts.getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
pad(n: number): string {
|
||||||
|
return n < 10 ? '0' + n : n.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Order by ascending property value
|
||||||
|
valueAscOrder = (a: KeyValue<number, string>, b: KeyValue<number, string>): number => {
|
||||||
|
return a.value.localeCompare(b.value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Order by descending property key
|
||||||
|
keyDescOrder = (a: KeyValue<number, string>, b: KeyValue<number, string>): number => {
|
||||||
|
return a.key > b.key ? -1 : (b.key > a.key ? 1 : 0);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@ import { ScrollableModule } from 'src/app/directives/scrollable/scrollable.modul
|
|||||||
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
||||||
import { LocalizedDatePipeModule } from 'src/app/pipes/localized-date-pipe/localized-date-pipe.module';
|
import { LocalizedDatePipeModule } from 'src/app/pipes/localized-date-pipe/localized-date-pipe.module';
|
||||||
import { TimestampToDatePipeModule } from 'src/app/pipes/timestamp-to-date-pipe/timestamp-to-date-pipe.module';
|
import { TimestampToDatePipeModule } from 'src/app/pipes/timestamp-to-date-pipe/timestamp-to-date-pipe.module';
|
||||||
|
import { AvatarModule } from '../avatar/avatar.module';
|
||||||
|
|
||||||
import { ChangesComponent } from './changes.component';
|
import { ChangesComponent } from './changes.component';
|
||||||
|
|
||||||
@ -30,6 +31,7 @@ import { ChangesComponent } from './changes.component';
|
|||||||
LocalizedDatePipeModule,
|
LocalizedDatePipeModule,
|
||||||
TimestampToDatePipeModule,
|
TimestampToDatePipeModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
|
AvatarModule
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
ChangesComponent,
|
ChangesComponent,
|
||||||
|
@ -0,0 +1,66 @@
|
|||||||
|
<app-refresh-table [loading]="loading$ | async" (refreshed)="refreshPage()" [dataSize]="dataSource.data.length"
|
||||||
|
[timestamp]="keyResult?.viewTimestamp" [selection]="selection">
|
||||||
|
<div actions>
|
||||||
|
<button color="warn"
|
||||||
|
[disabled]="([('project.app.write:' + projectId), 'project.app.write'] | hasRole | async) == false"
|
||||||
|
(click)="deleteSelectedKeys()" matTooltip="{{'ACTIONS.DELETE' | translate}}" class="icon-button"
|
||||||
|
mat-icon-button *ngIf="selection.hasValue()">
|
||||||
|
<i class="las la-trash"></i>
|
||||||
|
</button>
|
||||||
|
<a [disabled]="([('project.app.write:' + projectId), 'project.app.write'] | hasRole | async) == false"
|
||||||
|
color="primary" mat-raised-button (click)="openAddKey()">
|
||||||
|
<mat-icon class="icon">add</mat-icon>{{ 'ACTIONS.NEW' | translate }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="table-wrapper">
|
||||||
|
<table class="table" mat-table [dataSource]="dataSource">
|
||||||
|
<ng-container matColumnDef="select">
|
||||||
|
<th mat-header-cell *matHeaderCellDef>
|
||||||
|
<mat-checkbox color="primary" (change)="$event ? masterToggle() : null"
|
||||||
|
[checked]="selection.hasValue() && isAllSelected()"
|
||||||
|
[indeterminate]="selection.hasValue() && !isAllSelected()">
|
||||||
|
</mat-checkbox>
|
||||||
|
</th>
|
||||||
|
<td mat-cell *matCellDef="let key">
|
||||||
|
<mat-checkbox color="primary" (click)="$event.stopPropagation()"
|
||||||
|
(change)="$event ? selection.toggle(key) : null" [checked]="selection.isSelected(key)">
|
||||||
|
</mat-checkbox>
|
||||||
|
</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="id">
|
||||||
|
<th mat-header-cell *matHeaderCellDef> {{ 'USER.MACHINE.ID' | translate }} </th>
|
||||||
|
<td mat-cell *matCellDef="let key"> {{key?.id}} </td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="type">
|
||||||
|
<th mat-header-cell *matHeaderCellDef> {{ 'USER.MACHINE.TYPE' | translate }} </th>
|
||||||
|
<td mat-cell *matCellDef="let key"> {{'USER.MACHINE.KEYTYPES.'+key?.type | translate}} </td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="creationDate">
|
||||||
|
<th mat-header-cell *matHeaderCellDef> {{ 'USER.MACHINE.CREATIONDATE' | translate }} </th>
|
||||||
|
<td mat-cell *matCellDef="let key">
|
||||||
|
{{key.creationDate | timestampToDate | localizedDate: 'EEE dd. MMM, HH:mm'}}
|
||||||
|
</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container matColumnDef="expirationDate">
|
||||||
|
<th mat-header-cell *matHeaderCellDef> {{ 'USER.MACHINE.EXPIRATIONDATE' | translate }} </th>
|
||||||
|
<td mat-cell *matCellDef="let key">
|
||||||
|
{{key.expirationDate | timestampToDate | localizedDate: 'EEE dd. MMM, HH:mm'}}
|
||||||
|
</td>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
|
||||||
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
|
<tr class="highlight" mat-row *matRowDef="let key; columns: displayedColumns;"
|
||||||
|
(click)="selection.toggle(key);">
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
<mat-paginator #paginator class="paginator" [length]="keyResult?.totalResult || 0" [pageSize]="10"
|
||||||
|
[pageSizeOptions]="[5, 10, 20]" (page)="changePage($event)"></mat-paginator>
|
||||||
|
</div>
|
||||||
|
</app-refresh-table>
|
@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { ClientKeysComponent } from './client-keys.component';
|
||||||
|
|
||||||
|
describe('ClientKeysComponent', () => {
|
||||||
|
let component: ClientKeysComponent;
|
||||||
|
let fixture: ComponentFixture<ClientKeysComponent>;
|
||||||
|
|
||||||
|
beforeEach(waitForAsync(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ClientKeysComponent],
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(ClientKeysComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
141
console/src/app/modules/client-keys/client-keys.component.ts
Normal file
141
console/src/app/modules/client-keys/client-keys.component.ts
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
import { SelectionModel } from '@angular/cdk/collections';
|
||||||
|
import { Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
|
||||||
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
||||||
|
import { MatTableDataSource } from '@angular/material/table';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
||||||
|
import { Moment } from 'moment';
|
||||||
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
|
import { AuthNKeyType, ClientKeySearchResponse, ClientKeyView, MachineKeySearchResponse, MachineKeyType, MachineKeyView } from 'src/app/proto/generated/management_pb';
|
||||||
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
|
import { AddKeyDialogComponent, AddKeyDialogType } from 'src/app/modules/add-key-dialog/add-key-dialog.component';
|
||||||
|
import { ShowKeyDialogComponent } from 'src/app/modules/show-key-dialog/show-key-dialog.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-client-keys',
|
||||||
|
templateUrl: './client-keys.component.html',
|
||||||
|
styleUrls: ['./client-keys.component.scss'],
|
||||||
|
})
|
||||||
|
export class ClientKeysComponent implements OnInit {
|
||||||
|
@Input() projectId!: string;
|
||||||
|
@Input() appId!: string;
|
||||||
|
|
||||||
|
@ViewChild(MatPaginator) public paginator!: MatPaginator;
|
||||||
|
public dataSource: MatTableDataSource<ClientKeyView.AsObject> = new MatTableDataSource<ClientKeyView.AsObject>();
|
||||||
|
public selection: SelectionModel<ClientKeyView.AsObject> = new SelectionModel<ClientKeyView.AsObject>(true, []);
|
||||||
|
public keyResult!: MachineKeySearchResponse.AsObject | ClientKeySearchResponse.AsObject;
|
||||||
|
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
|
public loading$: Observable<boolean> = this.loadingSubject.asObservable();
|
||||||
|
@Input() public displayedColumns: string[] = ['select', 'id', 'type', 'creationDate', 'expirationDate'];
|
||||||
|
|
||||||
|
@Output() public changedSelection: EventEmitter<Array<ClientKeyView.AsObject>> = new EventEmitter();
|
||||||
|
|
||||||
|
constructor(public translate: TranslateService, private mgmtService: ManagementService, private dialog: MatDialog,
|
||||||
|
private toast: ToastService) {
|
||||||
|
this.selection.changed.subscribe(() => {
|
||||||
|
this.changedSelection.emit(this.selection.selected);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public ngOnInit(): void {
|
||||||
|
this.getData(10, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public isAllSelected(): boolean {
|
||||||
|
const numSelected = this.selection.selected.length;
|
||||||
|
const numRows = this.dataSource.data.length;
|
||||||
|
return numSelected === numRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
public masterToggle(): void {
|
||||||
|
this.isAllSelected() ?
|
||||||
|
this.selection.clear() :
|
||||||
|
this.dataSource.data.forEach(row => this.selection.select(row));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public changePage(event: PageEvent): void {
|
||||||
|
this.getData(event.pageSize, event.pageIndex * event.pageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public deleteSelectedKeys(): void {
|
||||||
|
const mappedDeletions = this.selection.selected.map(value => {
|
||||||
|
return this.mgmtService.DeleteClientKey(value.id, this.projectId, this.appId);
|
||||||
|
});
|
||||||
|
Promise.all(mappedDeletions).then(() => {
|
||||||
|
this.selection.clear();
|
||||||
|
this.toast.showInfo('USER.TOAST.SELECTEDKEYSDELETED', true);
|
||||||
|
this.getData(10, 0);
|
||||||
|
}).catch(error => {
|
||||||
|
this.toast.showError(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public openAddKey(): void {
|
||||||
|
const dialogRef = this.dialog.open(AddKeyDialogComponent, {
|
||||||
|
data: {},
|
||||||
|
width: '400px',
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogRef.afterClosed().subscribe(resp => {
|
||||||
|
if (resp) {
|
||||||
|
const type: AuthNKeyType = resp.type;
|
||||||
|
|
||||||
|
let date: Timestamp | undefined;
|
||||||
|
|
||||||
|
if (resp.date as Moment) {
|
||||||
|
const ts = new Timestamp();
|
||||||
|
console.log(resp.date.toDate());
|
||||||
|
const milliseconds = resp.date.toDate().getTime();
|
||||||
|
const seconds = Math.abs(milliseconds / 1000);
|
||||||
|
const nanos = (milliseconds - seconds * 1000) * 1000 * 1000;
|
||||||
|
ts.setSeconds(seconds);
|
||||||
|
ts.setNanos(nanos);
|
||||||
|
date = ts;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type) {
|
||||||
|
return this.mgmtService.addClientKey(this.projectId, this.appId, type, date).then((response) => {
|
||||||
|
if (response) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.refreshPage();
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
this.dialog.open(ShowKeyDialogComponent, {
|
||||||
|
data: {
|
||||||
|
key: response.toObject(),
|
||||||
|
type: AddKeyDialogType.AUTHNKEY
|
||||||
|
},
|
||||||
|
width: '400px',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}).catch((error: any) => {
|
||||||
|
this.toast.showError(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async getData(limit: number, offset: number): Promise<void> {
|
||||||
|
this.loadingSubject.next(true);
|
||||||
|
if (this.projectId && this.appId) {
|
||||||
|
this.mgmtService.SearchClientKeys(this.projectId, this.appId, limit, offset).then(resp => {
|
||||||
|
this.keyResult = resp.toObject();
|
||||||
|
this.dataSource.data = this.keyResult.resultList;
|
||||||
|
this.loadingSubject.next(false);
|
||||||
|
}).catch((error: any) => {
|
||||||
|
this.toast.showError(error);
|
||||||
|
this.loadingSubject.next(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public refreshPage(): void {
|
||||||
|
this.getData(this.paginator.pageSize, this.paginator.pageIndex * this.paginator.pageSize);
|
||||||
|
}
|
||||||
|
}
|
58
console/src/app/modules/client-keys/client-keys.module.ts
Normal file
58
console/src/app/modules/client-keys/client-keys.module.ts
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||||
|
import { MatDialogModule } from '@angular/material/dialog';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||||
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
|
import { MatTableModule } from '@angular/material/table';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
|
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
||||||
|
import { CardModule } from '../card/card.module';
|
||||||
|
import { InputModule } from '../input/input.module';
|
||||||
|
import { RefreshTableModule } from '../refresh-table/refresh-table.module';
|
||||||
|
|
||||||
|
import { ClientKeysComponent } from './client-keys.component';
|
||||||
|
import { ShowKeyDialogModule } from '../show-key-dialog/show-key-dialog.module';
|
||||||
|
import { AddKeyDialogModule } from 'src/app/modules/add-key-dialog/add-key-dialog.module';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { LocalizedDatePipeModule } from 'src/app/pipes/localized-date-pipe/localized-date-pipe.module';
|
||||||
|
import { TimestampToDatePipeModule } from 'src/app/pipes/timestamp-to-date-pipe/timestamp-to-date-pipe.module';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
ClientKeysComponent,
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
RouterModule,
|
||||||
|
FormsModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatDialogModule,
|
||||||
|
HasRoleModule,
|
||||||
|
CardModule,
|
||||||
|
MatTableModule,
|
||||||
|
MatPaginatorModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatProgressSpinnerModule,
|
||||||
|
MatCheckboxModule,
|
||||||
|
MatTooltipModule,
|
||||||
|
HasRolePipeModule,
|
||||||
|
TimestampToDatePipeModule,
|
||||||
|
LocalizedDatePipeModule,
|
||||||
|
TranslateModule,
|
||||||
|
RefreshTableModule,
|
||||||
|
InputModule,
|
||||||
|
ShowKeyDialogModule,
|
||||||
|
AddKeyDialogModule,
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
ClientKeysComponent,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class ClientKeysModule { }
|
@ -29,21 +29,19 @@
|
|||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</th>
|
</th>
|
||||||
<td mat-cell *matCellDef="let idp">
|
<td mat-cell *matCellDef="let idp">
|
||||||
<mat-checkbox color="primary" (click)="$event.stopPropagation()"
|
<mat-checkbox color="primary" (click)="$event.stopPropagation()" class="chbox"
|
||||||
[disabled]="serviceType==PolicyComponentServiceType.MGMT && idp?.providerType == IdpProviderType.IDPPROVIDERTYPE_SYSTEM"
|
[disabled]="serviceType==PolicyComponentServiceType.MGMT && idp?.providerType == IdpProviderType.IDPPROVIDERTYPE_SYSTEM"
|
||||||
(change)="$event ? selection.toggle(idp) : null" [checked]="selection.isSelected(idp)">
|
(change)="$event ? selection.toggle(idp) : null" [checked]="selection.isSelected(idp)">
|
||||||
<ng-template #genAvatar>
|
<img src="../../../assets/images/google.png"
|
||||||
<div class="avatar">
|
*ngIf="idp.stylingType == IdpStylingType.IDPSTYLINGTYPE_GOOGLE" alt="google" />
|
||||||
<span>{{idp.name.charAt(0)}}</span>
|
|
||||||
</div>
|
|
||||||
</ng-template>
|
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
</td>
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="name">
|
<ng-container matColumnDef="name">
|
||||||
<th mat-header-cell *matHeaderCellDef> {{ 'IDP.NAME' | translate }} </th>
|
<th mat-header-cell *matHeaderCellDef> {{ 'IDP.NAME' | translate }} </th>
|
||||||
<td [routerLink]="routerLinkForRow(idp)" mat-cell *matCellDef="let idp"> {{idp?.name}} </td>
|
<td [routerLink]="routerLinkForRow(idp)" mat-cell *matCellDef="let idp"><strong>{{idp?.name}}</strong>
|
||||||
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="config">
|
<ng-container matColumnDef="config">
|
||||||
@ -59,19 +57,24 @@
|
|||||||
<ng-container matColumnDef="state">
|
<ng-container matColumnDef="state">
|
||||||
<th mat-header-cell *matHeaderCellDef> {{ 'IDP.STATE' | translate }} </th>
|
<th mat-header-cell *matHeaderCellDef> {{ 'IDP.STATE' | translate }} </th>
|
||||||
<td [routerLink]="routerLinkForRow(idp)" mat-cell *matCellDef="let idp">
|
<td [routerLink]="routerLinkForRow(idp)" mat-cell *matCellDef="let idp">
|
||||||
{{ 'IDP.STATES.'+idp.state | translate }} </td>
|
<span class="state"
|
||||||
|
[ngClass]="{'active': idp.state === IdpState.IDPCONFIGSTATE_ACTIVE, 'inactive': idp.state === IdpState.IDPCONFIGSTATE_INACTIVE}">{{
|
||||||
|
'IDP.STATES.'+idp.state | translate }}</span>
|
||||||
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="creationDate">
|
<ng-container matColumnDef="dates">
|
||||||
<th mat-header-cell *matHeaderCellDef> {{ 'IDP.CREATIONDATE' | translate }} </th>
|
<th mat-header-cell *matHeaderCellDef> {{ 'IDP.CREATIONDATE' | translate }} </th>
|
||||||
<td [routerLink]="routerLinkForRow(idp)" class="pointer" mat-cell *matCellDef="let idp">
|
<td [routerLink]="routerLinkForRow(idp)" class="pointer" mat-cell *matCellDef="let idp">
|
||||||
{{idp.creationDate | timestampToDate | localizedDate: 'dd. MMM, HH:mm' }} </td>
|
<div class="date-block">
|
||||||
</ng-container>
|
<span class="date-sub">{{ 'IDP.CREATIONDATE' | translate }}:</span>
|
||||||
|
<span>{{idp.creationDate | timestampToDate | localizedDate: 'dd. MMM, HH:mm' }}</span>
|
||||||
<ng-container matColumnDef="changeDate">
|
</div>
|
||||||
<th mat-header-cell *matHeaderCellDef> {{ 'IDP.CHANGEDATE' | translate }} </th>
|
<div class="date-block">
|
||||||
<td [routerLink]="routerLinkForRow(idp)" class="pointer" mat-cell *matCellDef="let idp">
|
<span class="date-sub">{{ 'IDP.CHANGEDATE' | translate }}</span>
|
||||||
{{idp.changeDate | timestampToDate | localizedDate: 'dd. MMM, HH:mm' }} </td>
|
<span>{{idp.changeDate | timestampToDate | localizedDate: 'dd. MMM, HH:mm' }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="type">
|
<ng-container matColumnDef="type">
|
||||||
|
@ -23,6 +23,15 @@
|
|||||||
|
|
||||||
td {
|
td {
|
||||||
outline: none;
|
outline: none;
|
||||||
|
|
||||||
|
img {
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
margin-left: 1rem;
|
||||||
|
border-radius: .5rem;
|
||||||
|
object-fit: contain;
|
||||||
|
margin-top: .5rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tr {
|
tr {
|
||||||
@ -88,3 +97,16 @@ tr {
|
|||||||
padding-bottom: .5rem;
|
padding-bottom: .5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.date-block {
|
||||||
|
margin: .5rem 0;
|
||||||
|
display: block;
|
||||||
|
min-width: 120px;
|
||||||
|
|
||||||
|
.date-sub {
|
||||||
|
font-size: 13px;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -5,8 +5,9 @@ import { MatPaginator, PageEvent } from '@angular/material/paginator';
|
|||||||
import { MatTableDataSource } from '@angular/material/table';
|
import { MatTableDataSource } from '@angular/material/table';
|
||||||
import { RouterLink } from '@angular/router';
|
import { RouterLink } from '@angular/router';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
import { Empty } from 'google-protobuf/google/protobuf/empty_pb';
|
||||||
import { BehaviorSubject, Observable } from 'rxjs';
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
import { IdpSearchResponse as AdminIdpSearchResponse, IdpView as AdminIdpView } from 'src/app/proto/generated/admin_pb';
|
import { IdpSearchResponse as AdminIdpSearchResponse, IdpState, IdpStylingType, IdpView as AdminIdpView } from 'src/app/proto/generated/admin_pb';
|
||||||
import { IdpProviderType, IdpView as MgmtIdpView } from 'src/app/proto/generated/management_pb';
|
import { IdpProviderType, IdpView as MgmtIdpView } from 'src/app/proto/generated/management_pb';
|
||||||
import { AdminService } from 'src/app/services/admin.service';
|
import { AdminService } from 'src/app/services/admin.service';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
@ -34,7 +35,9 @@ export class IdpTableComponent implements OnInit {
|
|||||||
public loading$: Observable<boolean> = this.loadingSubject.asObservable();
|
public loading$: Observable<boolean> = this.loadingSubject.asObservable();
|
||||||
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
||||||
public IdpProviderType: any = IdpProviderType;
|
public IdpProviderType: any = IdpProviderType;
|
||||||
@Input() public displayedColumns: string[] = ['select', 'name', 'config', 'creationDate', 'changeDate', 'state'];
|
public IdpState: any = IdpState;
|
||||||
|
public IdpStylingType: any = IdpStylingType;
|
||||||
|
@Input() public displayedColumns: string[] = ['select', 'name', 'config', 'dates', 'state'];
|
||||||
|
|
||||||
@Output() public changedSelection: EventEmitter<Array<AdminIdpView.AsObject | MgmtIdpView.AsObject>>
|
@Output() public changedSelection: EventEmitter<Array<AdminIdpView.AsObject | MgmtIdpView.AsObject>>
|
||||||
= new EventEmitter();
|
= new EventEmitter();
|
||||||
@ -48,7 +51,7 @@ export class IdpTableComponent implements OnInit {
|
|||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.getData(10, 0);
|
this.getData(10, 0);
|
||||||
if (this.serviceType === PolicyComponentServiceType.MGMT) {
|
if (this.serviceType === PolicyComponentServiceType.MGMT) {
|
||||||
this.displayedColumns = ['select', 'name', 'config', 'creationDate', 'changeDate', 'state', 'type'];
|
this.displayedColumns = ['select', 'name', 'config', 'dates', 'state', 'type'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.disabled) {
|
if (!this.disabled) {
|
||||||
@ -74,22 +77,28 @@ export class IdpTableComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public deactivateSelectedIdps(): void {
|
public deactivateSelectedIdps(): void {
|
||||||
this.selection.clear();
|
const map: Promise<Empty>[] = this.selection.selected.map(value => {
|
||||||
Promise.all(this.selection.selected.map(value => {
|
|
||||||
return this.service.DeactivateIdpConfig(value.id);
|
return this.service.DeactivateIdpConfig(value.id);
|
||||||
})).then(() => {
|
});
|
||||||
|
Promise.all(map).then(() => {
|
||||||
|
this.selection.clear();
|
||||||
this.toast.showInfo('IDP.TOAST.SELECTEDDEACTIVATED', true);
|
this.toast.showInfo('IDP.TOAST.SELECTEDDEACTIVATED', true);
|
||||||
this.refreshPage();
|
this.refreshPage();
|
||||||
|
}).catch(error => {
|
||||||
|
this.toast.showError(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public reactivateSelectedIdps(): void {
|
public reactivateSelectedIdps(): void {
|
||||||
this.selection.clear();
|
const map: Promise<Empty>[] = this.selection.selected.map(value => {
|
||||||
Promise.all(this.selection.selected.map(value => {
|
|
||||||
return this.service.ReactivateIdpConfig(value.id);
|
return this.service.ReactivateIdpConfig(value.id);
|
||||||
})).then(() => {
|
});
|
||||||
|
Promise.all(map).then(() => {
|
||||||
|
this.selection.clear();
|
||||||
this.toast.showInfo('IDP.TOAST.SELECTEDREACTIVATED', true);
|
this.toast.showInfo('IDP.TOAST.SELECTEDREACTIVATED', true);
|
||||||
this.refreshPage();
|
this.refreshPage();
|
||||||
|
}).catch(error => {
|
||||||
|
this.toast.showError(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,16 +54,24 @@
|
|||||||
<cnsl-label>{{ 'IDP.CLIENTSECRET' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'IDP.CLIENTSECRET' | translate }}</cnsl-label>
|
||||||
<input cnslInput formControlName="clientSecret" />
|
<input cnslInput formControlName="clientSecret" />
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
<div class="line">
|
||||||
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
|
<cnsl-label>{{ 'IDP.SCOPESLIST' | translate }}</cnsl-label>
|
||||||
|
|
||||||
|
<input cnslInput [matChipInputFor]="chipScopesList"
|
||||||
|
[matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="true"
|
||||||
|
(matChipInputTokenEnd)="addScope($event)">
|
||||||
|
</cnsl-form-field>
|
||||||
|
<button (click)="addScope($event)" mat-icon-button>
|
||||||
|
<mat-icon>add</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<cnsl-form-field appearance="outline" class="formfield fullwidth">
|
<cnsl-form-field appearance="outline" class="formfield fullwidth">
|
||||||
<cnsl-label>{{ 'IDP.SCOPESLIST' | translate }}</cnsl-label>
|
<mat-chip-list class="chip-list" #chipScopesList aria-label="scope selection">
|
||||||
<mat-chip-list #chipScopesList aria-label="scope selection">
|
|
||||||
<mat-chip class="chip" *ngFor="let scope of scopesList?.value" selectable="false"
|
<mat-chip class="chip" *ngFor="let scope of scopesList?.value" selectable="false"
|
||||||
removable (removed)="removeScope(scope)">
|
removable (removed)="removeScope(scope)">
|
||||||
{{scope}} <mat-icon matChipRemove>cancel</mat-icon>
|
{{scope}} <mat-icon matChipRemove>cancel</mat-icon>
|
||||||
</mat-chip>
|
</mat-chip>
|
||||||
<input cnslInput [matChipInputFor]="chipScopesList"
|
|
||||||
[matChipInputSeparatorKeyCodes]="separatorKeysCodes" [matChipInputAddOnBlur]="true"
|
|
||||||
(matChipInputTokenEnd)="addScope($event)">
|
|
||||||
</mat-chip-list>
|
</mat-chip-list>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
|
@ -23,6 +23,12 @@
|
|||||||
.formfield {
|
.formfield {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
margin: 0 .5rem;
|
margin: 0 .5rem;
|
||||||
|
min-width: 150px;
|
||||||
|
|
||||||
|
.chip {
|
||||||
|
border-radius: .5rem;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
&.fullwidth {
|
&.fullwidth {
|
||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
@ -32,6 +38,24 @@
|
|||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-end;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.formfield {
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
input {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-wrapper {
|
.btn-wrapper {
|
||||||
@ -41,7 +65,6 @@
|
|||||||
.continue-button {
|
.continue-button {
|
||||||
margin-bottom: 4rem;
|
margin-bottom: 4rem;
|
||||||
display: block;
|
display: block;
|
||||||
padding: .5rem 4rem;
|
|
||||||
|
|
||||||
@media only screen and (max-width: 450px) {
|
@media only screen and (max-width: 450px) {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
|
27
console/src/app/modules/links/links.component.html
Normal file
27
console/src/app/modules/links/links.component.html
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<div class="next-steps">
|
||||||
|
<h5>{{'NEXTSTEPS.TITLE' | translate}}</h5>
|
||||||
|
<div class="row">
|
||||||
|
<ng-container *ngFor="let link of links">
|
||||||
|
<ng-template *ngIf="link.withRole" appHasRole [appHasRole]="link.withRole">
|
||||||
|
<div class="step">
|
||||||
|
<h6>{{ link.i18nTitle | translate }}</h6>
|
||||||
|
<p>{{link.i18nDesc | translate}}</p>
|
||||||
|
<span class="fill-space"></span>
|
||||||
|
<a *ngIf="link.routerLink" [routerLink]="link.routerLink" color="primary" mat-mini-fab><i
|
||||||
|
class="las la-angle-right"></i></a>
|
||||||
|
<a *ngIf="link.href" [href]="link.href" target="_blank" color="primary" mat-mini-fab><i
|
||||||
|
class="las la-angle-right"></i></a>
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
|
<div class="step" *ngIf="!link.withRole">
|
||||||
|
<h6>{{ link.i18nTitle | translate }}</h6>
|
||||||
|
<p>{{link.i18nDesc | translate}}</p>
|
||||||
|
<span class="fill-space"></span>
|
||||||
|
<a *ngIf="link.routerLink" [routerLink]="link.routerLink" color="primary" mat-mini-fab><i
|
||||||
|
class="las la-angle-right"></i></a>
|
||||||
|
<a *ngIf="link.href" [href]="link.href" target="_blank" color="primary" mat-mini-fab><i
|
||||||
|
class="las la-angle-right"></i></a>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
</div>
|
59
console/src/app/modules/links/links.component.scss
Normal file
59
console/src/app/modules/links/links.component.scss
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
.next-steps {
|
||||||
|
margin-top: 1rem;
|
||||||
|
h5 {
|
||||||
|
text-transform: uppercase;
|
||||||
|
font-size: 14px;
|
||||||
|
color: var(--grey);
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
overflow-x: auto;
|
||||||
|
padding-bottom: .5rem;
|
||||||
|
|
||||||
|
.step {
|
||||||
|
min-width: 220px;
|
||||||
|
max-width: 280px;
|
||||||
|
padding: 1rem;
|
||||||
|
margin: 0 .5rem;
|
||||||
|
border: 1px solid var(--grey);
|
||||||
|
border-radius: .5rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
|
h6 {
|
||||||
|
font-size: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
margin: 0 0 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: center;
|
||||||
|
color: var(--grey);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fill-space {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
display: block;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
25
console/src/app/modules/links/links.component.spec.ts
Normal file
25
console/src/app/modules/links/links.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { LinksComponent } from './links.component';
|
||||||
|
|
||||||
|
describe('LinksComponent', () => {
|
||||||
|
let component: LinksComponent;
|
||||||
|
let fixture: ComponentFixture<LinksComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
declarations: [ LinksComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
});
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(LinksComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
24
console/src/app/modules/links/links.component.ts
Normal file
24
console/src/app/modules/links/links.component.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
|
|
||||||
|
|
||||||
|
export interface CnslLinks {
|
||||||
|
i18nTitle: string;
|
||||||
|
i18nDesc: string;
|
||||||
|
routerLink?: any;
|
||||||
|
href?: string;
|
||||||
|
withRole?: Array<string | RegExp>;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'cnsl-links',
|
||||||
|
templateUrl: './links.component.html',
|
||||||
|
styleUrls: ['./links.component.scss']
|
||||||
|
})
|
||||||
|
export class LinksComponent implements OnInit {
|
||||||
|
@Input() links: Array<CnslLinks> = [];
|
||||||
|
constructor() { }
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
24
console/src/app/modules/links/links.module.ts
Normal file
24
console/src/app/modules/links/links.module.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { LinksComponent } from './links.component';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { MatButton, MatButtonModule } from '@angular/material/button';
|
||||||
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [LinksComponent],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
TranslateModule,
|
||||||
|
RouterModule,
|
||||||
|
MatButtonModule,
|
||||||
|
HasRoleModule,
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
LinksComponent,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
export class LinksModule { }
|
@ -1,6 +1,6 @@
|
|||||||
<app-refresh-table [loading]="loading$ | async" (refreshed)="refreshPage()" [dataSize]="dataSource.data.length"
|
<app-refresh-table [loading]="loading$ | async" (refreshed)="refreshPage()" [dataSize]="dataSource.data.length"
|
||||||
[timestamp]="keyResult?.viewTimestamp" [selection]="selection">
|
[timestamp]="keyResult?.viewTimestamp" [selection]="selection">
|
||||||
<ng-template appHasRole [appHasRole]="['user.write']" actions>
|
<div actions>
|
||||||
<button color="warn" [disabled]="([('user.write:' + userId), 'user.write'] | hasRole | async) == false"
|
<button color="warn" [disabled]="([('user.write:' + userId), 'user.write'] | hasRole | async) == false"
|
||||||
(click)="deleteSelectedKeys()" matTooltip="{{'ACTIONS.DELETE' | translate}}" class="icon-button"
|
(click)="deleteSelectedKeys()" matTooltip="{{'ACTIONS.DELETE' | translate}}" class="icon-button"
|
||||||
mat-icon-button *ngIf="selection.hasValue()">
|
mat-icon-button *ngIf="selection.hasValue()">
|
||||||
@ -10,7 +10,7 @@
|
|||||||
mat-raised-button (click)="openAddKey()">
|
mat-raised-button (click)="openAddKey()">
|
||||||
<mat-icon class="icon">add</mat-icon>{{ 'ACTIONS.NEW' | translate }}
|
<mat-icon class="icon">add</mat-icon>{{ 'ACTIONS.NEW' | translate }}
|
||||||
</a>
|
</a>
|
||||||
</ng-template>
|
</div>
|
||||||
|
|
||||||
<div class="table-wrapper">
|
<div class="table-wrapper">
|
||||||
<table class="table" mat-table [dataSource]="dataSource">
|
<table class="table" mat-table [dataSource]="dataSource">
|
||||||
@ -54,8 +54,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
<tr class="highlight" mat-row *matRowDef="let row; columns: displayedColumns;"
|
<tr class="highlight" mat-row *matRowDef="let row; columns: displayedColumns;">
|
||||||
[routerLink]="row.id ? ['/users', row.id ]: null">
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</table>
|
</table>
|
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
.table-wrapper {
|
||||||
|
overflow: auto;
|
||||||
|
|
||||||
|
.table,
|
||||||
|
.paginator {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
td,
|
||||||
|
th {
|
||||||
|
padding: 0 1rem;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:last-child {
|
||||||
|
padding-right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tr {
|
||||||
|
outline: none;
|
||||||
|
}
|
@ -7,12 +7,12 @@ import { TranslateService } from '@ngx-translate/core';
|
|||||||
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
||||||
import { Moment } from 'moment';
|
import { Moment } from 'moment';
|
||||||
import { BehaviorSubject, Observable } from 'rxjs';
|
import { BehaviorSubject, Observable } from 'rxjs';
|
||||||
import { MachineKeySearchResponse, MachineKeyType, MachineKeyView } from 'src/app/proto/generated/management_pb';
|
import { ClientKeySearchResponse, MachineKeySearchResponse, MachineKeyType, MachineKeyView } from 'src/app/proto/generated/management_pb';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
import { AddKeyDialogComponent } from './add-key-dialog/add-key-dialog.component';
|
import { AddKeyDialogComponent, AddKeyDialogType } from 'src/app/modules/add-key-dialog/add-key-dialog.component';
|
||||||
import { ShowKeyDialogComponent } from './show-key-dialog/show-key-dialog.component';
|
import { ShowKeyDialogComponent } from 'src/app/modules/show-key-dialog/show-key-dialog.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-machine-keys',
|
selector: 'app-machine-keys',
|
||||||
@ -21,17 +21,18 @@ import { ShowKeyDialogComponent } from './show-key-dialog/show-key-dialog.compon
|
|||||||
})
|
})
|
||||||
export class MachineKeysComponent implements OnInit {
|
export class MachineKeysComponent implements OnInit {
|
||||||
@Input() userId!: string;
|
@Input() userId!: string;
|
||||||
|
|
||||||
@ViewChild(MatPaginator) public paginator!: MatPaginator;
|
@ViewChild(MatPaginator) public paginator!: MatPaginator;
|
||||||
public dataSource: MatTableDataSource<MachineKeyView.AsObject> = new MatTableDataSource<MachineKeyView.AsObject>();
|
public dataSource: MatTableDataSource<MachineKeyView.AsObject> = new MatTableDataSource<MachineKeyView.AsObject>();
|
||||||
public selection: SelectionModel<MachineKeyView.AsObject> = new SelectionModel<MachineKeyView.AsObject>(true, []);
|
public selection: SelectionModel<MachineKeyView.AsObject> = new SelectionModel<MachineKeyView.AsObject>(true, []);
|
||||||
public keyResult!: MachineKeySearchResponse.AsObject;
|
public keyResult!: MachineKeySearchResponse.AsObject | ClientKeySearchResponse.AsObject;
|
||||||
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
private loadingSubject: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);
|
||||||
public loading$: Observable<boolean> = this.loadingSubject.asObservable();
|
public loading$: Observable<boolean> = this.loadingSubject.asObservable();
|
||||||
@Input() public displayedColumns: string[] = ['select', 'id', 'type', 'creationDate', 'expirationDate'];
|
@Input() public displayedColumns: string[] = ['select', 'id', 'type', 'creationDate', 'expirationDate'];
|
||||||
|
|
||||||
@Output() public changedSelection: EventEmitter<Array<MachineKeyView.AsObject>> = new EventEmitter();
|
@Output() public changedSelection: EventEmitter<Array<MachineKeyView.AsObject>> = new EventEmitter();
|
||||||
|
|
||||||
constructor(public translate: TranslateService, private userService: ManagementService, private dialog: MatDialog,
|
constructor(public translate: TranslateService, private mgmtService: ManagementService, private dialog: MatDialog,
|
||||||
private toast: ToastService) {
|
private toast: ToastService) {
|
||||||
this.selection.changed.subscribe(() => {
|
this.selection.changed.subscribe(() => {
|
||||||
this.changedSelection.emit(this.selection.selected);
|
this.changedSelection.emit(this.selection.selected);
|
||||||
@ -62,7 +63,7 @@ export class MachineKeysComponent implements OnInit {
|
|||||||
|
|
||||||
public deleteSelectedKeys(): void {
|
public deleteSelectedKeys(): void {
|
||||||
const mappedDeletions = this.selection.selected.map(value => {
|
const mappedDeletions = this.selection.selected.map(value => {
|
||||||
return this.userService.DeleteMachineKey(value.id, this.userId);
|
return this.mgmtService.DeleteMachineKey(value.id, this.userId);
|
||||||
});
|
});
|
||||||
Promise.all(mappedDeletions).then(() => {
|
Promise.all(mappedDeletions).then(() => {
|
||||||
this.selection.clear();
|
this.selection.clear();
|
||||||
@ -97,7 +98,7 @@ export class MachineKeysComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type) {
|
if (type) {
|
||||||
return this.userService.AddMachineKey(this.userId, type, date).then((response) => {
|
return this.mgmtService.AddMachineKey(this.userId, type, date).then((response) => {
|
||||||
if (response) {
|
if (response) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.refreshPage();
|
this.refreshPage();
|
||||||
@ -106,6 +107,7 @@ export class MachineKeysComponent implements OnInit {
|
|||||||
this.dialog.open(ShowKeyDialogComponent, {
|
this.dialog.open(ShowKeyDialogComponent, {
|
||||||
data: {
|
data: {
|
||||||
key: response.toObject(),
|
key: response.toObject(),
|
||||||
|
type: AddKeyDialogType.MACHINE
|
||||||
},
|
},
|
||||||
width: '400px',
|
width: '400px',
|
||||||
});
|
});
|
||||||
@ -121,14 +123,16 @@ export class MachineKeysComponent implements OnInit {
|
|||||||
private async getData(limit: number, offset: number): Promise<void> {
|
private async getData(limit: number, offset: number): Promise<void> {
|
||||||
this.loadingSubject.next(true);
|
this.loadingSubject.next(true);
|
||||||
|
|
||||||
this.userService.SearchMachineKeys(this.userId, limit, offset).then(resp => {
|
if (this.userId) {
|
||||||
this.keyResult = resp.toObject();
|
this.mgmtService.SearchMachineKeys(this.userId, limit, offset).then(resp => {
|
||||||
this.dataSource.data = this.keyResult.resultList;
|
this.keyResult = resp.toObject();
|
||||||
this.loadingSubject.next(false);
|
this.dataSource.data = this.keyResult.resultList;
|
||||||
}).catch((error: any) => {
|
this.loadingSubject.next(false);
|
||||||
this.toast.showError(error);
|
}).catch((error: any) => {
|
||||||
this.loadingSubject.next(false);
|
this.toast.showError(error);
|
||||||
});
|
this.loadingSubject.next(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public refreshPage(): void {
|
public refreshPage(): void {
|
58
console/src/app/modules/machine-keys/machine-keys.module.ts
Normal file
58
console/src/app/modules/machine-keys/machine-keys.module.ts
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||||
|
import { MatDialogModule } from '@angular/material/dialog';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatPaginatorModule } from '@angular/material/paginator';
|
||||||
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
|
import { MatTableModule } from '@angular/material/table';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
|
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
||||||
|
import { CardModule } from '../card/card.module';
|
||||||
|
import { InputModule } from '../input/input.module';
|
||||||
|
import { RefreshTableModule } from '../refresh-table/refresh-table.module';
|
||||||
|
|
||||||
|
import { MachineKeysComponent } from './machine-keys.component';
|
||||||
|
import { ShowKeyDialogModule } from '../show-key-dialog/show-key-dialog.module';
|
||||||
|
import { AddKeyDialogModule } from 'src/app/modules/add-key-dialog/add-key-dialog.module';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
import { LocalizedDatePipeModule } from 'src/app/pipes/localized-date-pipe/localized-date-pipe.module';
|
||||||
|
import { TimestampToDatePipeModule } from 'src/app/pipes/timestamp-to-date-pipe/timestamp-to-date-pipe.module';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
MachineKeysComponent,
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
RouterModule,
|
||||||
|
FormsModule,
|
||||||
|
MatButtonModule,
|
||||||
|
MatDialogModule,
|
||||||
|
HasRoleModule,
|
||||||
|
CardModule,
|
||||||
|
MatTableModule,
|
||||||
|
MatPaginatorModule,
|
||||||
|
MatIconModule,
|
||||||
|
MatProgressSpinnerModule,
|
||||||
|
MatCheckboxModule,
|
||||||
|
MatTooltipModule,
|
||||||
|
HasRolePipeModule,
|
||||||
|
TimestampToDatePipeModule,
|
||||||
|
LocalizedDatePipeModule,
|
||||||
|
TranslateModule,
|
||||||
|
RefreshTableModule,
|
||||||
|
InputModule,
|
||||||
|
ShowKeyDialogModule,
|
||||||
|
AddKeyDialogModule,
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
MachineKeysComponent,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class MachineKeysModule { }
|
@ -19,9 +19,11 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
flex: 1 0 300px;
|
flex: 1 0 300px;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
|
max-width: 300px;
|
||||||
|
|
||||||
@media only screen and (min-width: 1500px) {
|
@media only screen and (min-width: 1500px) {
|
||||||
flex-basis: 400px;
|
flex-basis: 400px;
|
||||||
|
max-width: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta-content {
|
.meta-content {
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
@import '~@angular/material/theming';
|
@import '~@angular/material/theming';
|
||||||
|
|
||||||
@mixin meta-theme($theme) {
|
@mixin meta-theme($theme) {
|
||||||
|
$is-dark-theme: map-get($theme, is-dark);
|
||||||
|
|
||||||
.meta-details {
|
.meta-details {
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
border-bottom: 1px solid #81868a40;
|
border-bottom: 1px solid #81868a40;
|
||||||
@ -25,24 +27,6 @@
|
|||||||
.second {
|
.second {
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.state {
|
|
||||||
border-radius: 50vw;
|
|
||||||
padding: 2px .5rem;
|
|
||||||
letter-spacing: .05em;
|
|
||||||
font-size: 13px;
|
|
||||||
background-color: #8795a120;
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
background-color: #85d996;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.inactive {
|
|
||||||
background-color: #ff8981;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,9 +7,10 @@
|
|||||||
<mat-icon matTooltip="{{'ACTIONS.REMOVE' | translate}}">
|
<mat-icon matTooltip="{{'ACTIONS.REMOVE' | translate}}">
|
||||||
remove_circle</mat-icon>
|
remove_circle</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
{{(componentType == LoginMethodComponentType.SecondFactor ? 'MFA.SECONDFACTORTYPES.': LoginMethodComponentType.MultiFactor ? 'MFA.MULTIFACTORTYPES.': '')+mfa | translate}}
|
{{(componentType == LoginMethodComponentType.SecondFactor ? 'MFA.SECONDFACTORTYPES.':
|
||||||
|
LoginMethodComponentType.MultiFactor ? 'MFA.MULTIFACTORTYPES.': '')+mfa | translate}}
|
||||||
</div>
|
</div>
|
||||||
<div class="mfa" (click)="addMfa()">
|
<div class="new-mfa" (click)="addMfa()" matRipple>
|
||||||
<mat-icon>add</mat-icon>
|
<mat-icon>add</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
@ -9,6 +9,12 @@
|
|||||||
margin: 0 -.5rem;
|
margin: 0 -.5rem;
|
||||||
|
|
||||||
.mfa {
|
.mfa {
|
||||||
|
background-color: #6a506e;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mfa,
|
||||||
|
.new-mfa {
|
||||||
border: 1px solid var(--grey);
|
border: 1px solid var(--grey);
|
||||||
border-radius: .5rem;
|
border-radius: .5rem;
|
||||||
display: grid;
|
display: grid;
|
||||||
@ -23,10 +29,13 @@
|
|||||||
|
|
||||||
.rm {
|
.rm {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
display: none;
|
||||||
left: 0;
|
top: -2px;
|
||||||
|
left: -2px;
|
||||||
transform: translateX(-50%) translateY(-50%);
|
transform: translateX(-50%) translateY(-50%);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
color: #f44336;
|
||||||
|
transition: all .2s ease;
|
||||||
|
|
||||||
&[disabled] {
|
&[disabled] {
|
||||||
display: none;
|
display: none;
|
||||||
@ -35,7 +44,9 @@
|
|||||||
|
|
||||||
&:not(.disabled) {
|
&:not(.disabled) {
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #ffffff10;
|
.rm {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import { MfaTableComponent } from './mfa-table.component';
|
|||||||
import { DialogAddTypeComponent } from './dialog-add-type/dialog-add-type.component';
|
import { DialogAddTypeComponent } from './dialog-add-type/dialog-add-type.component';
|
||||||
import { InputModule } from '../input/input.module';
|
import { InputModule } from '../input/input.module';
|
||||||
import { MatSelectModule } from '@angular/material/select';
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
|
import { MatRippleModule } from '@angular/material/core';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [MfaTableComponent, DialogAddTypeComponent],
|
declarations: [MfaTableComponent, DialogAddTypeComponent],
|
||||||
@ -36,6 +37,7 @@ import { MatSelectModule } from '@angular/material/select';
|
|||||||
TimestampToDatePipeModule,
|
TimestampToDatePipeModule,
|
||||||
HasRoleModule,
|
HasRoleModule,
|
||||||
MatProgressSpinnerModule,
|
MatProgressSpinnerModule,
|
||||||
|
MatRippleModule,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
MfaTableComponent,
|
MfaTableComponent,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<app-detail-layout [backRouterLink]="['/iam']" [title]="'POLICY.LABEL.TITLE' | translate"
|
<app-detail-layout [backRouterLink]="['/iam/policies']" [title]="'POLICY.LABEL.TITLE' | translate"
|
||||||
[description]="'POLICY.LABEL.DESCRIPTION' | translate">
|
[description]="'POLICY.LABEL.DESCRIPTION' | translate">
|
||||||
|
|
||||||
<div class="content" *ngIf="labelData">
|
<div class="content" *ngIf="labelData">
|
||||||
@ -14,7 +14,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<button (click)="savePolicy()" color="primary" type="submit"
|
<button (click)="savePolicy()" color="primary" type="submit" mat-raised-button>{{ 'ACTIONS.SAVE' | translate
|
||||||
mat-raised-button>{{ 'ACTIONS.SAVE' | translate }}</button>
|
}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<cnsl-links *ngIf="nextLinks" [links]="nextLinks"></cnsl-links>
|
||||||
</app-detail-layout>
|
</app-detail-layout>
|
@ -4,6 +4,8 @@ import { Subscription } from 'rxjs';
|
|||||||
import { DefaultLabelPolicyUpdate, DefaultLabelPolicyView } from 'src/app/proto/generated/admin_pb';
|
import { DefaultLabelPolicyUpdate, DefaultLabelPolicyView } from 'src/app/proto/generated/admin_pb';
|
||||||
import { AdminService } from 'src/app/services/admin.service';
|
import { AdminService } from 'src/app/services/admin.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { CnslLinks } from '../../links/links.component';
|
||||||
|
import { IAM_COMPLEXITY_LINK, IAM_LABEL_LINK, IAM_LOGIN_POLICY_LINK, IAM_POLICY_LINK } from '../../policy-grid/policy-links';
|
||||||
|
|
||||||
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
||||||
|
|
||||||
@ -19,6 +21,11 @@ export class LabelPolicyComponent implements OnDestroy {
|
|||||||
private sub: Subscription = new Subscription();
|
private sub: Subscription = new Subscription();
|
||||||
|
|
||||||
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
||||||
|
public nextLinks: CnslLinks[] = [
|
||||||
|
IAM_COMPLEXITY_LINK,
|
||||||
|
IAM_POLICY_LINK,
|
||||||
|
IAM_LOGIN_POLICY_LINK,
|
||||||
|
];
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private toast: ToastService,
|
private toast: ToastService,
|
||||||
|
@ -9,6 +9,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
||||||
import { InputModule } from 'src/app/modules/input/input.module';
|
import { InputModule } from 'src/app/modules/input/input.module';
|
||||||
|
import { LinksModule } from '../../links/links.module';
|
||||||
|
|
||||||
import { LabelPolicyRoutingModule } from './label-policy-routing.module';
|
import { LabelPolicyRoutingModule } from './label-policy-routing.module';
|
||||||
import { LabelPolicyComponent } from './label-policy.component';
|
import { LabelPolicyComponent } from './label-policy.component';
|
||||||
@ -27,6 +28,7 @@ import { LabelPolicyComponent } from './label-policy.component';
|
|||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
DetailLayoutModule,
|
DetailLayoutModule,
|
||||||
|
LinksModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class LabelPolicyModule { }
|
export class LabelPolicyModule { }
|
||||||
|
@ -28,28 +28,36 @@
|
|||||||
[(ngModel)]="loginData.allowUsernamePassword">
|
[(ngModel)]="loginData.allowUsernamePassword">
|
||||||
{{'POLICY.DATA.ALLOWUSERNAMEPASSWORD' | translate}}
|
{{'POLICY.DATA.ALLOWUSERNAMEPASSWORD' | translate}}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
<p>{{'POLICY.DATA.ALLOWUSERNAMEPASSWORD_DESC' | translate}}</p>
|
<cnsl-info-section class="info">
|
||||||
|
{{'POLICY.DATA.ALLOWUSERNAMEPASSWORD_DESC' | translate}}
|
||||||
|
</cnsl-info-section>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<mat-slide-toggle class="toggle" color="primary" [disabled]="disabled" ngDefaultControl
|
<mat-slide-toggle class="toggle" color="primary" [disabled]="disabled" ngDefaultControl
|
||||||
[(ngModel)]="loginData.allowRegister">
|
[(ngModel)]="loginData.allowRegister">
|
||||||
{{'POLICY.DATA.ALLOWREGISTER' | translate}}
|
{{'POLICY.DATA.ALLOWREGISTER' | translate}}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
<p> {{'POLICY.DATA.ALLOWREGISTER_DESC' | translate}} </p>
|
<cnsl-info-section class="info">
|
||||||
|
{{'POLICY.DATA.ALLOWREGISTER_DESC' | translate}}
|
||||||
|
</cnsl-info-section>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<mat-slide-toggle class="toggle" color="primary" [disabled]="disabled" ngDefaultControl
|
<mat-slide-toggle class="toggle" color="primary" [disabled]="disabled" ngDefaultControl
|
||||||
[(ngModel)]="loginData.allowExternalIdp">
|
[(ngModel)]="loginData.allowExternalIdp">
|
||||||
{{'POLICY.DATA.ALLOWEXTERNALIDP' | translate}}
|
{{'POLICY.DATA.ALLOWEXTERNALIDP' | translate}}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
<p> {{'POLICY.DATA.ALLOWEXTERNALIDP_DESC' | translate}} </p>
|
<cnsl-info-section class="info">
|
||||||
|
{{'POLICY.DATA.ALLOWEXTERNALIDP_DESC' | translate}}
|
||||||
|
</cnsl-info-section>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<mat-slide-toggle class="toggle" color="primary" [disabled]="disabled" ngDefaultControl
|
<mat-slide-toggle class="toggle" color="primary" [disabled]="disabled" ngDefaultControl
|
||||||
[(ngModel)]="loginData.forceMfa">
|
[(ngModel)]="loginData.forceMfa">
|
||||||
{{'POLICY.DATA.FORCEMFA' | translate}}
|
{{'POLICY.DATA.FORCEMFA' | translate}}
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
<p> {{'POLICY.DATA.FORCEMFA_DESC' | translate}} </p>
|
<cnsl-info-section class="info">
|
||||||
|
{{'POLICY.DATA.FORCEMFA_DESC' | translate}}
|
||||||
|
</cnsl-info-section>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<cnsl-form-field class="form-field" label="Access Code" required="true">
|
<cnsl-form-field class="form-field" label="Access Code" required="true">
|
||||||
@ -92,20 +100,37 @@
|
|||||||
<mat-icon matTooltip="{{'ACTIONS.REMOVE' | translate}}">
|
<mat-icon matTooltip="{{'ACTIONS.REMOVE' | translate}}">
|
||||||
remove_circle</mat-icon>
|
remove_circle</mat-icon>
|
||||||
</button>
|
</button>
|
||||||
<span class="name">{{idp.name}}</span>
|
<div class="line">
|
||||||
<span class="meta">{{ 'IDP.TYPE' | translate }}: {{ 'IDP.TYPES.'+idp.type | translate }}</span>
|
<img src="../../../assets/images/google.png"
|
||||||
<span class="meta">{{ 'IDP.ID' | translate }}: {{idp.idpConfigId}}</span>
|
*ngIf="idp.stylingType == IdpStylingType.IDPSTYLINGTYPE_GOOGLE" alt="google" />
|
||||||
|
<div>
|
||||||
|
<span class="name">{{idp.name}}</span>
|
||||||
|
<span class="meta-info">{{ 'IDP.TYPE' | translate }}: {{ 'IDP.TYPES.'+idp.type | translate }}</span>
|
||||||
|
<span class="meta-info">{{ 'IDP.ID' | translate }}: {{idp.idpConfigId}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!disabled" class="new-idp" (click)="openDialog()">
|
<div *ngIf="!disabled" class="new-idp" (click)="openDialog()" matRipple>
|
||||||
<mat-icon>add</mat-icon>
|
<mat-icon>add</mat-icon>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template appHasRole [appHasRole]="['org.idp.read']">
|
<ng-template appHasRole [appHasRole]="['org.idp.read']">
|
||||||
<h2>{{ 'IDP.LIST.TITLE' | translate }}</h2>
|
<app-card title="{{ 'IDP.LIST.TITLE' | translate }}" description="{{ 'IDP.LIST.DESCRIPTION' | translate }}"
|
||||||
<p>{{ 'IDP.LIST.DESCRIPTION' | translate }}</p>
|
[expanded]="false">
|
||||||
<app-idp-table [service]="service" [serviceType]="serviceType"
|
<div card-actions>
|
||||||
[disabled]="([serviceType == PolicyComponentServiceType.ADMIN ? 'iam.idp.write' : serviceType == PolicyComponentServiceType.MGMT ? 'org.idp.write' : ''] | hasRole | async) == false">
|
<i class="lab la-google"></i>
|
||||||
</app-idp-table>
|
<i class="lab la-facebook"></i>
|
||||||
|
<i class="lab la-apple"></i>
|
||||||
|
<i class="lab la-github"></i>
|
||||||
|
<i class="lab la-gitlab"></i>
|
||||||
|
</div>
|
||||||
|
<app-idp-table [service]="service" [serviceType]="serviceType"
|
||||||
|
[disabled]="([serviceType == PolicyComponentServiceType.ADMIN ? 'iam.idp.write' : serviceType == PolicyComponentServiceType.MGMT ? 'org.idp.write' : ''] | hasRole | async) == false">
|
||||||
|
</app-idp-table>
|
||||||
|
</app-card>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
|
<cnsl-links *ngIf="nextLinks" [links]="nextLinks"></cnsl-links>
|
||||||
|
|
||||||
</app-detail-layout>
|
</app-detail-layout>
|
@ -15,18 +15,17 @@
|
|||||||
margin: .3rem 0;
|
margin: .3rem 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
.info {
|
||||||
margin-top: .5rem;
|
margin-bottom: 1rem;
|
||||||
font-size: 14px;
|
display: block;
|
||||||
color: var(--grey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.save-button {
|
.save-button {
|
||||||
margin-top: 3rem;
|
margin-bottom: 3rem;
|
||||||
|
float: right;
|
||||||
display: block;
|
display: block;
|
||||||
padding: .5rem 4rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.idp-table-card {
|
.idp-table-card {
|
||||||
@ -46,6 +45,33 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
margin: 0 -.5rem;
|
margin: 0 -.5rem;
|
||||||
|
|
||||||
|
.idp {
|
||||||
|
background-color: #506e6e;
|
||||||
|
color: white;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
height: 30px;
|
||||||
|
width: 30px;
|
||||||
|
margin-right: 1rem;
|
||||||
|
border-radius: .5rem;
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
|
||||||
|
div {
|
||||||
|
flex: 1;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
* {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.idp,
|
.idp,
|
||||||
.new-idp {
|
.new-idp {
|
||||||
display: grid;
|
display: grid;
|
||||||
@ -68,15 +94,18 @@
|
|||||||
padding: 2px;
|
padding: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.meta {
|
.meta-info {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: var(--grey);
|
color: #fafafa;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rm {
|
.rm {
|
||||||
|
color: #f44336;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
display: none;
|
||||||
left: 0;
|
top: -2px;
|
||||||
|
transition: all .2s ease;
|
||||||
|
left: -2px;
|
||||||
transform: translateX(-50%) translateY(-50%);
|
transform: translateX(-50%) translateY(-50%);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
@ -86,11 +115,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:not(.disabled) {
|
&:not(.disabled) {
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: #ffffff10;
|
.rm {
|
||||||
}
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -102,6 +133,6 @@
|
|||||||
.divider {
|
.divider {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background-color: var(--grey);
|
background-color: rgba(var(--grey), .5);
|
||||||
margin: 1rem 0;
|
margin: 1rem 0;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import {
|
|||||||
DefaultLoginPolicyRequest,
|
DefaultLoginPolicyRequest,
|
||||||
DefaultLoginPolicyView,
|
DefaultLoginPolicyView,
|
||||||
IdpProviderView as AdminIdpProviderView,
|
IdpProviderView as AdminIdpProviderView,
|
||||||
|
IdpStylingType,
|
||||||
IdpView as AdminIdpView,
|
IdpView as AdminIdpView,
|
||||||
PasswordlessType as AdminPasswordlessType,
|
PasswordlessType as AdminPasswordlessType,
|
||||||
} from 'src/app/proto/generated/admin_pb';
|
} from 'src/app/proto/generated/admin_pb';
|
||||||
@ -24,6 +25,8 @@ import {
|
|||||||
import { AdminService } from 'src/app/services/admin.service';
|
import { AdminService } from 'src/app/services/admin.service';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { CnslLinks } from '../../links/links.component';
|
||||||
|
import { IAM_COMPLEXITY_LINK, IAM_LABEL_LINK, IAM_LOGIN_POLICY_LINK, IAM_POLICY_LINK, ORG_COMPLEXITY_LINK, ORG_IAM_POLICY_LINK } from '../../policy-grid/policy-links';
|
||||||
|
|
||||||
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
||||||
import { AddIdpDialogComponent } from './add-idp-dialog/add-idp-dialog.component';
|
import { AddIdpDialogComponent } from './add-idp-dialog/add-idp-dialog.component';
|
||||||
@ -46,6 +49,9 @@ export class LoginPolicyComponent implements OnDestroy {
|
|||||||
|
|
||||||
public loading: boolean = false;
|
public loading: boolean = false;
|
||||||
public disabled: boolean = true;
|
public disabled: boolean = true;
|
||||||
|
|
||||||
|
public IdpStylingType: any = IdpStylingType;
|
||||||
|
public nextLinks: CnslLinks[] = [];
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private toast: ToastService,
|
private toast: ToastService,
|
||||||
@ -59,11 +65,20 @@ export class LoginPolicyComponent implements OnDestroy {
|
|||||||
this.service = this.injector.get(ManagementService as Type<ManagementService>);
|
this.service = this.injector.get(ManagementService as Type<ManagementService>);
|
||||||
this.passwordlessTypes = [MgmtPasswordlessType.PASSWORDLESSTYPE_ALLOWED,
|
this.passwordlessTypes = [MgmtPasswordlessType.PASSWORDLESSTYPE_ALLOWED,
|
||||||
MgmtPasswordlessType.PASSWORDLESSTYPE_NOT_ALLOWED];
|
MgmtPasswordlessType.PASSWORDLESSTYPE_NOT_ALLOWED];
|
||||||
|
this.nextLinks = [
|
||||||
|
ORG_COMPLEXITY_LINK,
|
||||||
|
ORG_IAM_POLICY_LINK,
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
case PolicyComponentServiceType.ADMIN:
|
case PolicyComponentServiceType.ADMIN:
|
||||||
this.service = this.injector.get(AdminService as Type<AdminService>);
|
this.service = this.injector.get(AdminService as Type<AdminService>);
|
||||||
this.passwordlessTypes = [AdminPasswordlessType.PASSWORDLESSTYPE_ALLOWED,
|
this.passwordlessTypes = [AdminPasswordlessType.PASSWORDLESSTYPE_ALLOWED,
|
||||||
AdminPasswordlessType.PASSWORDLESSTYPE_NOT_ALLOWED];
|
AdminPasswordlessType.PASSWORDLESSTYPE_NOT_ALLOWED];
|
||||||
|
this.nextLinks = [
|
||||||
|
IAM_COMPLEXITY_LINK,
|
||||||
|
IAM_POLICY_LINK,
|
||||||
|
IAM_LABEL_LINK,
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -207,7 +222,7 @@ export class LoginPolicyComponent implements OnDestroy {
|
|||||||
switch (this.serviceType) {
|
switch (this.serviceType) {
|
||||||
case PolicyComponentServiceType.MGMT:
|
case PolicyComponentServiceType.MGMT:
|
||||||
(this.service as ManagementService).RemoveIdpProviderFromLoginPolicy(idp.idpConfigId).then(() => {
|
(this.service as ManagementService).RemoveIdpProviderFromLoginPolicy(idp.idpConfigId).then(() => {
|
||||||
const index = this.idps.findIndex(temp => temp === idp);
|
const index = (this.idps as MgmtIdpProviderView.AsObject[]).findIndex(temp => temp === idp);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
this.idps.splice(index, 1);
|
this.idps.splice(index, 1);
|
||||||
}
|
}
|
||||||
@ -215,7 +230,7 @@ export class LoginPolicyComponent implements OnDestroy {
|
|||||||
break;
|
break;
|
||||||
case PolicyComponentServiceType.ADMIN:
|
case PolicyComponentServiceType.ADMIN:
|
||||||
(this.service as AdminService).RemoveIdpProviderFromDefaultLoginPolicy(idp.idpConfigId).then(() => {
|
(this.service as AdminService).RemoveIdpProviderFromDefaultLoginPolicy(idp.idpConfigId).then(() => {
|
||||||
const index = this.idps.findIndex(temp => temp === idp);
|
const index = (this.idps as AdminIdpProviderView.AsObject[]).findIndex(temp => temp === idp);
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
this.idps.splice(index, 1);
|
this.idps.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { MatRippleModule } from '@angular/material/core';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
import { MatSelectModule } from '@angular/material/select';
|
import { MatSelectModule } from '@angular/material/select';
|
||||||
@ -15,6 +16,8 @@ import { IdpTableModule } from 'src/app/modules/idp-table/idp-table.module';
|
|||||||
import { InputModule } from 'src/app/modules/input/input.module';
|
import { InputModule } from 'src/app/modules/input/input.module';
|
||||||
import { MfaTableModule } from 'src/app/modules/mfa-table/mfa-table.module';
|
import { MfaTableModule } from 'src/app/modules/mfa-table/mfa-table.module';
|
||||||
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
import { HasRolePipeModule } from 'src/app/pipes/has-role-pipe/has-role-pipe.module';
|
||||||
|
import { InfoSectionModule } from '../../info-section/info-section.module';
|
||||||
|
import { LinksModule } from '../../links/links.module';
|
||||||
|
|
||||||
import { AddIdpDialogModule } from './add-idp-dialog/add-idp-dialog.module';
|
import { AddIdpDialogModule } from './add-idp-dialog/add-idp-dialog.module';
|
||||||
import { LoginPolicyRoutingModule } from './login-policy-routing.module';
|
import { LoginPolicyRoutingModule } from './login-policy-routing.module';
|
||||||
@ -25,6 +28,7 @@ import { LoginPolicyComponent } from './login-policy.component';
|
|||||||
imports: [
|
imports: [
|
||||||
LoginPolicyRoutingModule,
|
LoginPolicyRoutingModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
|
InfoSectionModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
CardModule,
|
CardModule,
|
||||||
InputModule,
|
InputModule,
|
||||||
@ -41,6 +45,8 @@ import { LoginPolicyComponent } from './login-policy.component';
|
|||||||
MfaTableModule,
|
MfaTableModule,
|
||||||
MatProgressSpinnerModule,
|
MatProgressSpinnerModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
|
MatRippleModule,
|
||||||
|
LinksModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class LoginPolicyModule { }
|
export class LoginPolicyModule { }
|
||||||
|
@ -20,7 +20,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<button (click)="savePolicy()" color="primary" type="submit"
|
<button (click)="savePolicy()" color="primary" type="submit" mat-raised-button>{{ 'ACTIONS.SAVE' | translate
|
||||||
mat-raised-button>{{ 'ACTIONS.SAVE' | translate }}</button>
|
}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<cnsl-links *ngIf="nextLinks" [links]="nextLinks"></cnsl-links>
|
||||||
</app-detail-layout>
|
</app-detail-layout>
|
@ -37,6 +37,5 @@
|
|||||||
button {
|
button {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
display: block;
|
display: block;
|
||||||
padding: .5rem 4rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ import { AdminService } from 'src/app/services/admin.service';
|
|||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
import { StorageService } from 'src/app/services/storage.service';
|
import { StorageService } from 'src/app/services/storage.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { CnslLinks } from '../../links/links.component';
|
||||||
|
import { IAM_COMPLEXITY_LINK, IAM_LABEL_LINK, IAM_LOGIN_POLICY_LINK, ORG_LOGIN_POLICY_LINK, ORG_COMPLEXITY_LINK } from '../../policy-grid/policy-links';
|
||||||
|
|
||||||
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
||||||
|
|
||||||
@ -28,7 +30,7 @@ export class OrgIamPolicyComponent implements OnDestroy {
|
|||||||
private org!: Org.AsObject;
|
private org!: Org.AsObject;
|
||||||
|
|
||||||
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
||||||
|
public nextLinks: Array<CnslLinks> = [];
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private toast: ToastService,
|
private toast: ToastService,
|
||||||
@ -44,6 +46,16 @@ export class OrgIamPolicyComponent implements OnDestroy {
|
|||||||
this.serviceType = data.serviceType;
|
this.serviceType = data.serviceType;
|
||||||
if (this.serviceType === PolicyComponentServiceType.MGMT) {
|
if (this.serviceType === PolicyComponentServiceType.MGMT) {
|
||||||
this.managementService = this.injector.get(ManagementService as Type<ManagementService>);
|
this.managementService = this.injector.get(ManagementService as Type<ManagementService>);
|
||||||
|
this.nextLinks = [
|
||||||
|
ORG_COMPLEXITY_LINK,
|
||||||
|
ORG_LOGIN_POLICY_LINK,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
this.nextLinks = [
|
||||||
|
IAM_COMPLEXITY_LINK,
|
||||||
|
IAM_LOGIN_POLICY_LINK,
|
||||||
|
IAM_LABEL_LINK,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
return this.route.params;
|
return this.route.params;
|
||||||
})).subscribe(_ => {
|
})).subscribe(_ => {
|
||||||
|
@ -9,6 +9,8 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
||||||
import { InputModule } from 'src/app/modules/input/input.module';
|
import { InputModule } from 'src/app/modules/input/input.module';
|
||||||
|
import { InfoSectionModule } from '../../info-section/info-section.module';
|
||||||
|
import { LinksModule } from '../../links/links.module';
|
||||||
|
|
||||||
import { OrgIamPolicyRoutingModule } from './org-iam-policy-routing.module';
|
import { OrgIamPolicyRoutingModule } from './org-iam-policy-routing.module';
|
||||||
import { OrgIamPolicyComponent } from './org-iam-policy.component';
|
import { OrgIamPolicyComponent } from './org-iam-policy.component';
|
||||||
@ -25,8 +27,10 @@ import { OrgIamPolicyComponent } from './org-iam-policy.component';
|
|||||||
MatIconModule,
|
MatIconModule,
|
||||||
HasRoleModule,
|
HasRoleModule,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
|
InfoSectionModule,
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
DetailLayoutModule,
|
DetailLayoutModule,
|
||||||
|
LinksModule
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class OrgIamPolicyModule { }
|
export class OrgIamPolicyModule { }
|
||||||
|
@ -34,6 +34,5 @@
|
|||||||
button {
|
button {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
display: block;
|
display: block;
|
||||||
padding: .5rem 4rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<div *ngIf="complexityData" class="content">
|
<div *ngIf="complexityData" class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<mat-icon class="icon" svgIcon="mdi_counter"></mat-icon>
|
||||||
<span class="left-desc">{{'POLICY.DATA.MINLENGTH' | translate}}</span>
|
<span class="left-desc">{{'POLICY.DATA.MINLENGTH' | translate}}</span>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<div class="length-wrapper">
|
<div class="length-wrapper">
|
||||||
@ -29,18 +30,21 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<mat-icon class="icon" svgIcon="mdi_numeric"></mat-icon>
|
||||||
<span class="left-desc">{{'POLICY.DATA.HASNUMBER' | translate}}</span>
|
<span class="left-desc">{{'POLICY.DATA.HASNUMBER' | translate}}</span>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<mat-slide-toggle color="primary" name="hasNumber" ngDefaultControl [(ngModel)]="complexityData.hasNumber">
|
<mat-slide-toggle color="primary" name="hasNumber" ngDefaultControl [(ngModel)]="complexityData.hasNumber">
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<mat-icon class="icon" svgIcon="mdi_symbol"></mat-icon>
|
||||||
<span class="left-desc">{{'POLICY.DATA.HASSYMBOL' | translate}}</span>
|
<span class="left-desc">{{'POLICY.DATA.HASSYMBOL' | translate}}</span>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<mat-slide-toggle color="primary" name="hasSymbol" ngDefaultControl [(ngModel)]="complexityData.hasSymbol">
|
<mat-slide-toggle color="primary" name="hasSymbol" ngDefaultControl [(ngModel)]="complexityData.hasSymbol">
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<mat-icon class="icon" svgIcon="mdi_format-letter-case-lower"></mat-icon>
|
||||||
<span class="left-desc">{{'POLICY.DATA.HASLOWERCASE' | translate}}</span>
|
<span class="left-desc">{{'POLICY.DATA.HASLOWERCASE' | translate}}</span>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<mat-slide-toggle color="primary" name="hasLowercase" ngDefaultControl
|
<mat-slide-toggle color="primary" name="hasLowercase" ngDefaultControl
|
||||||
@ -48,6 +52,7 @@
|
|||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<mat-icon class="icon" svgIcon="mdi_format-letter-case-upper"></mat-icon>
|
||||||
<span class="left-desc">{{'POLICY.DATA.HASUPPERCASE' | translate}}</span>
|
<span class="left-desc">{{'POLICY.DATA.HASUPPERCASE' | translate}}</span>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<mat-slide-toggle color="primary" name="hasUppercase" ngDefaultControl
|
<mat-slide-toggle color="primary" name="hasUppercase" ngDefaultControl
|
||||||
@ -57,7 +62,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<button (click)="savePolicy()" color="primary" type="submit"
|
<button (click)="savePolicy()" color="primary" type="submit" mat-raised-button>{{ 'ACTIONS.SAVE' | translate
|
||||||
mat-raised-button>{{ 'ACTIONS.SAVE' | translate }}</button>
|
}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<cnsl-links *ngIf="nextLinks" [links]="nextLinks"></cnsl-links>
|
||||||
</app-detail-layout>
|
</app-detail-layout>
|
@ -18,6 +18,10 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding: .3rem 0;
|
padding: .3rem 0;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
margin-right: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.left-desc {
|
.left-desc {
|
||||||
font-size: .9rem;
|
font-size: .9rem;
|
||||||
}
|
}
|
||||||
@ -42,6 +46,5 @@
|
|||||||
button {
|
button {
|
||||||
margin-top: 3rem;
|
margin-top: 3rem;
|
||||||
display: block;
|
display: block;
|
||||||
padding: .5rem 4rem;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@ import { PasswordComplexityPolicyView } from 'src/app/proto/generated/management
|
|||||||
import { AdminService } from 'src/app/services/admin.service';
|
import { AdminService } from 'src/app/services/admin.service';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
import { CnslLinks } from '../../links/links.component';
|
||||||
|
import { IAM_LABEL_LINK, IAM_LOGIN_POLICY_LINK, IAM_POLICY_LINK, ORG_IAM_POLICY_LINK, ORG_LOGIN_POLICY_LINK } from '../../policy-grid/policy-links';
|
||||||
|
|
||||||
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
import { PolicyComponentServiceType } from '../policy-component-types.enum';
|
||||||
|
|
||||||
@ -25,6 +27,7 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
|
|||||||
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
public PolicyComponentServiceType: any = PolicyComponentServiceType;
|
||||||
|
|
||||||
public loading: boolean = false;
|
public loading: boolean = false;
|
||||||
|
public nextLinks: CnslLinks[] = [];
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private toast: ToastService,
|
private toast: ToastService,
|
||||||
@ -36,9 +39,18 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
|
|||||||
switch (this.serviceType) {
|
switch (this.serviceType) {
|
||||||
case PolicyComponentServiceType.MGMT:
|
case PolicyComponentServiceType.MGMT:
|
||||||
this.service = this.injector.get(ManagementService as Type<ManagementService>);
|
this.service = this.injector.get(ManagementService as Type<ManagementService>);
|
||||||
|
this.nextLinks = [
|
||||||
|
ORG_IAM_POLICY_LINK,
|
||||||
|
ORG_LOGIN_POLICY_LINK,
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
case PolicyComponentServiceType.ADMIN:
|
case PolicyComponentServiceType.ADMIN:
|
||||||
this.service = this.injector.get(AdminService as Type<AdminService>);
|
this.service = this.injector.get(AdminService as Type<AdminService>);
|
||||||
|
this.nextLinks = [
|
||||||
|
IAM_POLICY_LINK,
|
||||||
|
IAM_LOGIN_POLICY_LINK,
|
||||||
|
IAM_LABEL_LINK,
|
||||||
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
||||||
import { InputModule } from 'src/app/modules/input/input.module';
|
import { InputModule } from 'src/app/modules/input/input.module';
|
||||||
|
import { LinksModule } from '../../links/links.module';
|
||||||
|
|
||||||
import { PasswordComplexityPolicyRoutingModule } from './password-complexity-policy-routing.module';
|
import { PasswordComplexityPolicyRoutingModule } from './password-complexity-policy-routing.module';
|
||||||
import { PasswordComplexityPolicyComponent } from './password-complexity-policy.component';
|
import { PasswordComplexityPolicyComponent } from './password-complexity-policy.component';
|
||||||
@ -29,6 +30,7 @@ import { PasswordComplexityPolicyComponent } from './password-complexity-policy.
|
|||||||
TranslateModule,
|
TranslateModule,
|
||||||
DetailLayoutModule,
|
DetailLayoutModule,
|
||||||
MatProgressSpinnerModule,
|
MatProgressSpinnerModule,
|
||||||
|
LinksModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class PasswordComplexityPolicyModule { }
|
export class PasswordComplexityPolicyModule { }
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<button (click)="savePolicy()" color="primary" type="submit"
|
<button (click)="savePolicy()" color="primary" type="submit" mat-raised-button>{{ 'ACTIONS.SAVE' | translate
|
||||||
mat-raised-button>{{ 'ACTIONS.SAVE' | translate }}</button>
|
}}</button>
|
||||||
</div>
|
</div>
|
||||||
</app-detail-layout>
|
</app-detail-layout>
|
@ -9,6 +9,7 @@ import { TranslateModule } from '@ngx-translate/core';
|
|||||||
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
import { DetailLayoutModule } from 'src/app/modules/detail-layout/detail-layout.module';
|
||||||
import { InputModule } from 'src/app/modules/input/input.module';
|
import { InputModule } from 'src/app/modules/input/input.module';
|
||||||
|
import { LinksModule } from '../../links/links.module';
|
||||||
|
|
||||||
import { PasswordLockoutPolicyRoutingModule } from './password-lockout-policy-routing.module';
|
import { PasswordLockoutPolicyRoutingModule } from './password-lockout-policy-routing.module';
|
||||||
import { PasswordLockoutPolicyComponent } from './password-lockout-policy.component';
|
import { PasswordLockoutPolicyComponent } from './password-lockout-policy.component';
|
||||||
|
@ -19,6 +19,20 @@
|
|||||||
<p class="desc">
|
<p class="desc">
|
||||||
{{'POLICY.PWD_COMPLEXITY.DESCRIPTION' | translate}}</p>
|
{{'POLICY.PWD_COMPLEXITY.DESCRIPTION' | translate}}</p>
|
||||||
|
|
||||||
|
<div class="icons">
|
||||||
|
<mat-icon matTooltip="{{'POLICY.DATA.HASUPPERCASE' | translate}}" *ngIf="complexityPolicy?.hasUppercase"
|
||||||
|
class="icon" svgIcon="mdi_format-letter-case-upper">
|
||||||
|
</mat-icon>
|
||||||
|
<mat-icon matTooltip="{{'POLICY.DATA.HASLOWERCASE' | translate}}" *ngIf="complexityPolicy?.hasLowercase"
|
||||||
|
class="icon" svgIcon="mdi_format-letter-case-lower">
|
||||||
|
</mat-icon>
|
||||||
|
<mat-icon matTooltip="{{'POLICY.DATA.HASNUMBER' | translate}}" *ngIf="complexityPolicy?.hasNumber"
|
||||||
|
class="icon" svgIcon="mdi_numeric"></mat-icon>
|
||||||
|
<mat-icon matTooltip="{{'POLICY.DATA.HASSYMBOL' | translate}}" *ngIf="complexityPolicy?.hasSymbol"
|
||||||
|
class="icon" svgIcon="mdi_symbol"></mat-icon>
|
||||||
|
<!-- <mat-icon *ngIf="complexityPolicy?." class="icon" svgIcon="mdi_counter"></mat-icon> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
<button
|
<button
|
||||||
@ -67,10 +81,8 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #showDescIAM>
|
<p class="desc">
|
||||||
<p class="desc">
|
{{'POLICY.LOGIN_POLICY.DESCRIPTION' | translate}}</p>
|
||||||
{{'POLICY.LOGIN_POLICY.DESCRIPTION' | translate}}</p>
|
|
||||||
</ng-template>
|
|
||||||
|
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<div class="btn-wrapper">
|
<div class="btn-wrapper">
|
||||||
|
@ -21,6 +21,7 @@ h2 {
|
|||||||
min-height: 250px;
|
min-height: 250px;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
@media only screen and (max-width: 450px) {
|
@media only screen and (max-width: 450px) {
|
||||||
flex-basis: 100%;
|
flex-basis: 100%;
|
||||||
@ -30,7 +31,7 @@ h2 {
|
|||||||
height: 60px;
|
height: 60px;
|
||||||
width: 60px;
|
width: 60px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: linear-gradient(40deg, rgb(129, 85, 185) 30%, #5469d4);
|
background: linear-gradient(40deg, rgb(129, 85, 185) 30%, #7b8ada);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@ -64,6 +65,13 @@ h2 {
|
|||||||
color: var(--grey);
|
color: var(--grey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.icons {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
.icon {
|
||||||
|
margin-right: .5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.fill-space {
|
.fill-space {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input, OnInit } from '@angular/core';
|
||||||
import { PolicyComponentType } from 'src/app/modules/policies/policy-component-types.enum';
|
import { PolicyComponentType } from 'src/app/modules/policies/policy-component-types.enum';
|
||||||
|
import { PasswordComplexityPolicyView as MgmtPasswordComplexityPolicyView } from 'src/app/proto/generated/management_pb';
|
||||||
|
import { DefaultPasswordComplexityPolicyView as AdminPasswordComplexityPolicyView } from 'src/app/proto/generated/admin_pb';
|
||||||
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
|
import { AdminService } from 'src/app/services/admin.service';
|
||||||
|
|
||||||
export enum PolicyGridType {
|
export enum PolicyGridType {
|
||||||
ORG,
|
ORG,
|
||||||
@ -11,9 +15,24 @@ export enum PolicyGridType {
|
|||||||
templateUrl: './policy-grid.component.html',
|
templateUrl: './policy-grid.component.html',
|
||||||
styleUrls: ['./policy-grid.component.scss'],
|
styleUrls: ['./policy-grid.component.scss'],
|
||||||
})
|
})
|
||||||
export class PolicyGridComponent {
|
export class PolicyGridComponent implements OnInit {
|
||||||
@Input() public type!: PolicyGridType;
|
@Input() public type!: PolicyGridType;
|
||||||
public PolicyComponentType: any = PolicyComponentType;
|
public PolicyComponentType: any = PolicyComponentType;
|
||||||
public PolicyGridType: any = PolicyGridType;
|
public PolicyGridType: any = PolicyGridType;
|
||||||
constructor() { }
|
|
||||||
|
public complexityPolicy!: MgmtPasswordComplexityPolicyView.AsObject | AdminPasswordComplexityPolicyView.AsObject | any;
|
||||||
|
|
||||||
|
constructor(private mgmtService: ManagementService, private adminService: AdminService) { }
|
||||||
|
|
||||||
|
public ngOnInit(): void {
|
||||||
|
if (this.type == PolicyGridType.ORG) {
|
||||||
|
this.mgmtService.GetDefaultPasswordComplexityPolicy().then((policy) => {
|
||||||
|
this.complexityPolicy = policy.toObject();
|
||||||
|
});
|
||||||
|
} else if (this.type == PolicyGridType.IAM) {
|
||||||
|
this.adminService.GetDefaultPasswordComplexityPolicy().then((policy) => {
|
||||||
|
this.complexityPolicy = policy.toObject();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import { CommonModule } from '@angular/common';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
import { RouterModule } from '@angular/router';
|
import { RouterModule } from '@angular/router';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
import { HasRoleModule } from 'src/app/directives/has-role/has-role.module';
|
||||||
@ -19,6 +20,7 @@ import { PolicyGridComponent } from './policy-grid.component';
|
|||||||
RouterModule,
|
RouterModule,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
|
MatTooltipModule,
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
PolicyGridComponent,
|
PolicyGridComponent,
|
||||||
|
51
console/src/app/modules/policy-grid/policy-links.ts
Normal file
51
console/src/app/modules/policy-grid/policy-links.ts
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
import { PolicyComponentType } from '../policies/policy-component-types.enum';
|
||||||
|
|
||||||
|
export const IAM_COMPLEXITY_LINK = {
|
||||||
|
i18nTitle: 'POLICY.PWD_COMPLEXITY.TITLE',
|
||||||
|
i18nDesc: 'POLICY.PWD_COMPLEXITY.DESCRIPTION',
|
||||||
|
routerLink: ['/iam', 'policy', PolicyComponentType.COMPLEXITY],
|
||||||
|
withRole: ['iam.policy.read'],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const IAM_POLICY_LINK = {
|
||||||
|
i18nTitle: 'POLICY.IAM_POLICY.TITLE',
|
||||||
|
i18nDesc: 'POLICY.IAM_POLICY.DESCRIPTION',
|
||||||
|
routerLink: ['/iam', 'policy', PolicyComponentType.IAM],
|
||||||
|
withRole: ['iam.policy.read'],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const IAM_LOGIN_POLICY_LINK = {
|
||||||
|
i18nTitle: 'POLICY.LOGIN_POLICY.TITLE',
|
||||||
|
i18nDesc: 'POLICY.LOGIN_POLICY.DESCRIPTION',
|
||||||
|
routerLink: ['/iam', 'policy', PolicyComponentType.LOGIN],
|
||||||
|
withRole: ['iam.policy.read'],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const IAM_LABEL_LINK = {
|
||||||
|
i18nTitle: 'POLICY.LABEL.TITLE',
|
||||||
|
i18nDesc: 'POLICY.LABEL.DESCRIPTION',
|
||||||
|
routerLink: ['/iam', 'policy', PolicyComponentType.LABEL],
|
||||||
|
withRole: ['iam.policy.read'],
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const ORG_COMPLEXITY_LINK = {
|
||||||
|
i18nTitle: 'POLICY.PWD_COMPLEXITY.TITLE',
|
||||||
|
i18nDesc: 'POLICY.PWD_COMPLEXITY.DESCRIPTION',
|
||||||
|
routerLink: ['/org', 'policy', PolicyComponentType.COMPLEXITY],
|
||||||
|
withRole: ['policy.read'],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ORG_IAM_POLICY_LINK = {
|
||||||
|
i18nTitle: 'POLICY.IAM_POLICY.TITLE',
|
||||||
|
i18nDesc: 'POLICY.IAM_POLICY.DESCRIPTION',
|
||||||
|
routerLink: ['/org', 'policy', PolicyComponentType.IAM],
|
||||||
|
withRole: ['iam.policy.read'],
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ORG_LOGIN_POLICY_LINK = {
|
||||||
|
i18nTitle: 'POLICY.LOGIN_POLICY.TITLE',
|
||||||
|
i18nDesc: 'POLICY.LOGIN_POLICY.DESCRIPTION',
|
||||||
|
routerLink: ['/org', 'policy', PolicyComponentType.LOGIN],
|
||||||
|
withRole: ['policy.read'],
|
||||||
|
};
|
@ -1,4 +1,4 @@
|
|||||||
import { Component, Inject, OnInit } from '@angular/core';
|
import { Component, Inject } from '@angular/core';
|
||||||
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
|
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||||
@ -9,7 +9,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
templateUrl: './project-role-detail.component.html',
|
templateUrl: './project-role-detail.component.html',
|
||||||
styleUrls: ['./project-role-detail.component.scss'],
|
styleUrls: ['./project-role-detail.component.scss'],
|
||||||
})
|
})
|
||||||
export class ProjectRoleDetailComponent implements OnInit {
|
export class ProjectRoleDetailComponent {
|
||||||
public projectId: string = '';
|
public projectId: string = '';
|
||||||
|
|
||||||
public formGroup!: FormGroup;
|
public formGroup!: FormGroup;
|
||||||
@ -27,12 +27,9 @@ export class ProjectRoleDetailComponent implements OnInit {
|
|||||||
this.formGroup.patchValue(data.role);
|
this.formGroup.patchValue(data.role);
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
|
||||||
}
|
|
||||||
|
|
||||||
submitForm(): void {
|
submitForm(): void {
|
||||||
if (this.formGroup.valid && this.key?.value && this.group?.value && this.displayName?.value) {
|
if (this.formGroup.valid && this.key?.value && this.group?.value && this.displayName?.value) {
|
||||||
this.mgmtService.ChangeProjectRole(this.projectId, this.key.value, this.key.value, this.group.value)
|
this.mgmtService.ChangeProjectRole(this.projectId, this.key.value, this.displayName.value, this.group.value)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.toast.showInfo('PROJECT.TOAST.ROLECHANGED', true);
|
this.toast.showInfo('PROJECT.TOAST.ROLECHANGED', true);
|
||||||
this.dialogRef.close(true);
|
this.dialogRef.close(true);
|
||||||
|
@ -40,13 +40,15 @@
|
|||||||
<span *ngIf="org?.id" class="second">{{ org.id }}</span>
|
<span *ngIf="org?.id" class="second">{{ org.id }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="meta-row">
|
<div class="meta-row">
|
||||||
<span class="first">{{'ORG.PAGES.PRIMARYDOMAIN' | translate}}</span>
|
<span class="first">{{'ORG.PAGES.PRIMARYDOMAIN' | translate}}</span>
|
||||||
<span class="second"><span style="display: block;">{{primaryDomain}}</span></span>
|
<span class="second"><span style="display: block;">{{primaryDomain}}</span></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="meta-row">
|
<div class="meta-row">
|
||||||
<span class="first">{{'ORG.PAGES.STATE' | translate}}</span>
|
<span class="first">{{'ORG.PAGES.STATE' | translate}}</span>
|
||||||
<span *ngIf="org && org.state !== undefined"
|
<span *ngIf="org && org.state !== undefined" class="state"
|
||||||
class="second">{{'ORG.STATE.'+org.state | translate}}</span>
|
[ngClass]="{'active': org.state === OrgState.ORGSTATE_ACTIVE, 'inactive': org.state === OrgState.ORGSTATE_INACTIVE}">{{'ORG.STATE.'+org.state
|
||||||
|
|
|
||||||
|
translate}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
{{'APP.OIDC.PROSWITCH' | translate}}
|
{{'APP.OIDC.PROSWITCH' | translate}}
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
|
|
||||||
<mat-horizontal-stepper class="stepper" *ngIf="!devmode" linear #stepper labelPosition="bottom">
|
<mat-horizontal-stepper class="stepper" *ngIf="!devmode" linear #stepper labelPosition="bottom"
|
||||||
|
(selectionChange)="changeStep($event)">
|
||||||
<mat-step [stepControl]="firstFormGroup" [editable]="true">
|
<mat-step [stepControl]="firstFormGroup" [editable]="true">
|
||||||
<form [formGroup]="firstFormGroup">
|
<form [formGroup]="firstFormGroup">
|
||||||
<ng-template matStepLabel>{{'APP.OIDC.NAMEANDTYPESECTION' | translate}}</ng-template>
|
<ng-template matStepLabel>{{'APP.OIDC.NAMEANDTYPESECTION' | translate}}</ng-template>
|
||||||
@ -29,8 +30,9 @@
|
|||||||
|
|
||||||
<p class="step-title">{{'APP.OIDC.TYPETITLE' | translate}}</p>
|
<p class="step-title">{{'APP.OIDC.TYPETITLE' | translate}}</p>
|
||||||
|
|
||||||
<app-type-radio [types]="oidcAppTypes" (selectedType)="changedAppType($event)"
|
<app-type-radio [types]="appTypes" (selectedType)="appType?.setValue($event)"
|
||||||
[selected]="applicationType?.value"></app-type-radio>
|
[selected]="appType?.value">
|
||||||
|
</app-type-radio>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button mat-raised-button [disabled]="firstFormGroup.invalid" color="primary"
|
<button mat-raised-button [disabled]="firstFormGroup.invalid" color="primary"
|
||||||
matStepperNext>{{'ACTIONS.CONTINUE' | translate}}</button>
|
matStepperNext>{{'ACTIONS.CONTINUE' | translate}}</button>
|
||||||
@ -42,10 +44,11 @@
|
|||||||
<mat-step *ngIf="oidcApp.applicationType !== OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE"
|
<mat-step *ngIf="oidcApp.applicationType !== OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE"
|
||||||
[stepControl]="secondFormGroup" [editable]="true">
|
[stepControl]="secondFormGroup" [editable]="true">
|
||||||
<form [formGroup]="secondFormGroup">
|
<form [formGroup]="secondFormGroup">
|
||||||
<ng-template matStepLabel>{{'APP.OIDC.AUTHMETHODSECTION' | translate}}</ng-template>
|
<ng-template matStepLabel>{{'APP.AUTHMETHODSECTION' | translate}}</ng-template>
|
||||||
|
|
||||||
<app-auth-method-radio [authMethods]="authMethods" [selected]="authMethod?.value"
|
<app-auth-method-radio [authMethods]="authMethods" [selected]="authMethod?.value"
|
||||||
(selectedMethod)="changedAppAuthMethod($event)">
|
[isOIDC]="appType?.value?.createType == AppCreateType.OIDC"
|
||||||
|
(selectedMethod)="authMethod?.setValue($event)">
|
||||||
</app-auth-method-radio>
|
</app-auth-method-radio>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
@ -57,7 +60,8 @@
|
|||||||
</form>
|
</form>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
|
|
||||||
<mat-step [editable]="true">
|
<!-- show redirect step only for OIDC apps -->
|
||||||
|
<mat-step *ngIf="appType?.value?.createType == AppCreateType.OIDC" [editable]="true">
|
||||||
<ng-template matStepLabel>{{'APP.OIDC.REDIRECTSECTION' | translate}}</ng-template>
|
<ng-template matStepLabel>{{'APP.OIDC.REDIRECTSECTION' | translate}}</ng-template>
|
||||||
|
|
||||||
<p class="step-title">{{'APP.OIDC.REDIRECTTITLE' | translate}}</p>
|
<p class="step-title">{{'APP.OIDC.REDIRECTTITLE' | translate}}</p>
|
||||||
@ -68,8 +72,9 @@
|
|||||||
{{'APP.OIDC.REDIRECTDESCRIPTIONWEB' | translate}}</p>
|
{{'APP.OIDC.REDIRECTDESCRIPTIONWEB' | translate}}</p>
|
||||||
|
|
||||||
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
||||||
|
[isNative]="oidcApp.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE"
|
||||||
(changedUris)="oidcApp.redirectUrisList = $event" [urisList]="oidcApp.redirectUrisList"
|
(changedUris)="oidcApp.redirectUrisList = $event" [urisList]="oidcApp.redirectUrisList"
|
||||||
title="{{ 'APP.OIDC.REDIRECT' | translate }}">
|
[getValues]="requestRedirectValuesSubject$" title="{{ 'APP.OIDC.REDIRECT' | translate }}">
|
||||||
</cnsl-redirect-uris>
|
</cnsl-redirect-uris>
|
||||||
|
|
||||||
<p class="step-title">{{'APP.OIDC.POSTREDIRECTTITLE' | translate}}</p>
|
<p class="step-title">{{'APP.OIDC.POSTREDIRECTTITLE' | translate}}</p>
|
||||||
@ -82,7 +87,9 @@
|
|||||||
|
|
||||||
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
||||||
(changedUris)="oidcApp.postLogoutRedirectUrisList = $event"
|
(changedUris)="oidcApp.postLogoutRedirectUrisList = $event"
|
||||||
[urisList]="oidcApp.postLogoutRedirectUrisList" title="{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}">
|
[urisList]="oidcApp.postLogoutRedirectUrisList" title="{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}"
|
||||||
|
[getValues]="requestRedirectValuesSubject$"
|
||||||
|
[isNative]="oidcApp.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE">
|
||||||
</cnsl-redirect-uris>
|
</cnsl-redirect-uris>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
@ -103,78 +110,94 @@
|
|||||||
{{oidcApp.name}}
|
{{oidcApp.name}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
|
||||||
<span class="left">
|
|
||||||
{{ 'APP.TYPE' | translate }}
|
|
||||||
</span>
|
|
||||||
<span class="right">
|
|
||||||
{{'APP.OIDC.APPTYPE'+oidcApp.applicationType | translate}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<span class="left">
|
|
||||||
{{ 'APP.GRANT' | translate }}
|
|
||||||
</span>
|
|
||||||
<span class="right" *ngIf="oidcApp.grantTypesList?.length > 0">
|
|
||||||
[<span *ngFor="let element of oidcApp.grantTypesList; index as i">
|
|
||||||
{{'APP.OIDC.GRANT'+element | translate}}
|
|
||||||
{{i < oidcApp.grantTypesList.length - 1 ? ', ' : '' }} </span>]
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<span class="left">
|
|
||||||
{{ 'APP.OIDC.RESPONSE' | translate }}
|
|
||||||
</span>
|
|
||||||
<span class="right" *ngIf="oidcApp.responseTypesList?.length > 0">
|
|
||||||
[<span *ngFor="let element of oidcApp.responseTypesList; index as i">
|
|
||||||
{{('APP.OIDC.RESPONSE'+element | translate)}}
|
|
||||||
{{i < oidcApp.responseTypesList.length - 1 ? ', ' : '' }} </span>]
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
<ng-container *ngIf="appType?.value?.createType == AppCreateType.OIDC">
|
||||||
<span class="left">
|
<div class="row">
|
||||||
{{ 'APP.OIDC.AUTHMETHOD' | translate }}
|
<span class="left">
|
||||||
</span>
|
{{ 'APP.TYPE' | translate }}
|
||||||
<span class="right">
|
|
||||||
<span>
|
|
||||||
{{'APP.OIDC.AUTHMETHOD'+oidcApp?.authMethodType | translate}}
|
|
||||||
</span>
|
</span>
|
||||||
</span>
|
<span class="right">
|
||||||
</div>
|
{{'APP.OIDC.APPTYPE.'+oidcApp.applicationType | translate}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<span class="left">
|
||||||
|
{{ 'APP.GRANT' | translate }}
|
||||||
|
</span>
|
||||||
|
<span class="right" *ngIf="oidcApp.grantTypesList?.length > 0">
|
||||||
|
[<span *ngFor="let element of oidcApp.grantTypesList; index as i">
|
||||||
|
{{'APP.OIDC.GRANT.'+element | translate}}
|
||||||
|
{{i < oidcApp.grantTypesList.length - 1 ? ', ' : '' }} </span>]
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<span class="left">
|
||||||
|
{{ 'APP.OIDC.RESPONSETYPE' | translate }}
|
||||||
|
</span>
|
||||||
|
<span class="right" *ngIf="oidcApp.responseTypesList?.length > 0">
|
||||||
|
[<span *ngFor="let element of oidcApp.responseTypesList; index as i">
|
||||||
|
{{('APP.OIDC.RESPONSE.'+element | translate)}}
|
||||||
|
{{i < oidcApp.responseTypesList.length - 1 ? ', ' : '' }} </span>]
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<span class="left">
|
<span class="left">
|
||||||
{{ 'APP.OIDC.REDIRECT' | translate }}
|
{{ 'APP.AUTHMETHOD' | translate }}
|
||||||
</span>
|
|
||||||
<span class="right" *ngIf="oidcApp.redirectUrisList?.length > 0">
|
|
||||||
[<span *ngFor="let redirect of oidcApp.redirectUrisList; index as i">
|
|
||||||
{{redirect}}
|
|
||||||
{{i < oidcApp.redirectUrisList.length - 1 ? ', ' : '' }} </span>]
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
<span class="right">
|
||||||
|
<span>
|
||||||
|
{{'APP.OIDC.AUTHMETHOD.'+oidcApp?.authMethodType | translate}}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<span class="left">
|
<span class="left">
|
||||||
{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}
|
{{ 'APP.OIDC.REDIRECT' | translate }}
|
||||||
</span>
|
|
||||||
<span class="right" *ngIf="oidcApp.postLogoutRedirectUrisList?.length > 0">
|
|
||||||
[<span *ngFor="let redirect of oidcApp.postLogoutRedirectUrisList; index as i">
|
|
||||||
{{redirect}}
|
|
||||||
{{i < oidcApp.postLogoutRedirectUrisList.length - 1 ? ', ' : '' }} </span>]
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
<span class="right" *ngIf="oidcApp.redirectUrisList?.length > 0">
|
||||||
|
[<span *ngFor="let redirect of oidcApp.redirectUrisList; index as i">
|
||||||
|
{{redirect}}
|
||||||
|
{{i < oidcApp.redirectUrisList.length - 1 ? ', ' : '' }} </span>]
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<span class="left">
|
||||||
|
{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}
|
||||||
|
</span>
|
||||||
|
<span class="right" *ngIf="oidcApp.postLogoutRedirectUrisList?.length > 0">
|
||||||
|
[<span *ngFor="let redirect of oidcApp.postLogoutRedirectUrisList; index as i">
|
||||||
|
{{redirect}}
|
||||||
|
{{i < oidcApp.postLogoutRedirectUrisList.length - 1 ? ', ' : '' }} </span>]
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
|
<ng-container *ngIf="appType?.value?.createType == AppCreateType.API">
|
||||||
|
<div class="row">
|
||||||
|
<span class="left">
|
||||||
|
{{ 'APP.AUTHMETHOD' | translate }}
|
||||||
|
</span>
|
||||||
|
<span class="right">
|
||||||
|
<span>
|
||||||
|
{{'APP.API.AUTHMETHOD.'+apiApp?.authMethodType | translate}}
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
<button mat-stroked-button color="primary" matStepperPrevious>{{'ACTIONS.BACK' | translate}}</button>
|
<button mat-stroked-button color="primary" matStepperPrevious>{{'ACTIONS.BACK' | translate}}</button>
|
||||||
<button mat-raised-button color="primary" (click)="saveOIDCApp()">{{'ACTIONS.CREATE' |
|
<button mat-raised-button color="primary" (click)="createApp()">{{'ACTIONS.CREATE' |
|
||||||
translate}}</button>
|
translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
</mat-horizontal-stepper>
|
</mat-horizontal-stepper>
|
||||||
|
|
||||||
<div *ngIf="devmode" class="dev">
|
<div *ngIf="devmode" class="dev">
|
||||||
<form [formGroup]="form" (ngSubmit)="saveOIDCApp()">
|
<form [formGroup]="form" (ngSubmit)="createApp()">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<cnsl-form-field appearance="outline" class="formfield">
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
<cnsl-label>{{ 'APP.NAME' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'APP.NAME' | translate }}</cnsl-label>
|
||||||
@ -182,51 +205,59 @@
|
|||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<cnsl-form-field appearance="outline" class="formfield">
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
<cnsl-label>{{ 'APP.OIDC.APPTYPE' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'APP.TYPE' | translate }}</cnsl-label>
|
||||||
<mat-select formControlName="applicationType">
|
<mat-select formControlName="appType">
|
||||||
<mat-option *ngFor="let type of oidcAppTypes" [value]="type.type">
|
<mat-option *ngFor="let appType of appTypes" [value]="appType">
|
||||||
{{ 'APP.OIDC.APPTYPE'+type.type | translate }}
|
{{ appType.titleI18nKey | translate }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<cnsl-form-field appearance="outline" class="formfield">
|
<ng-container *ngIf="formappType?.value?.createType == AppCreateType.OIDC">
|
||||||
<cnsl-label>{{ 'APP.OIDC.GRANT' | translate }}</cnsl-label>
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
<mat-select formControlName="grantTypesList" multiple>
|
<cnsl-label>{{ 'APP.OIDC.GRANTTYPE' | translate }}</cnsl-label>
|
||||||
<mat-option *ngFor="let grant of oidcGrantTypes" [value]="grant.type">
|
<mat-select formControlName="grantTypesList" multiple>
|
||||||
{{ ('APP.OIDC.GRANT' + grant.type) | translate }}
|
<mat-option *ngFor="let grant of oidcGrantTypes" [value]="grant.type">
|
||||||
</mat-option>
|
{{ ('APP.OIDC.GRANT.' + grant.type) | translate }}
|
||||||
</mat-select>
|
</mat-option>
|
||||||
</cnsl-form-field>
|
</mat-select>
|
||||||
|
</cnsl-form-field>
|
||||||
|
|
||||||
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
|
<cnsl-label>{{ 'APP.OIDC.RESPONSETYPE' | translate }}</cnsl-label>
|
||||||
|
<mat-select formControlName="responseTypesList" multiple>
|
||||||
|
<mat-option *ngFor="let type of oidcResponseTypes" [value]="type.type">
|
||||||
|
{{ 'APP.OIDC.RESPONSE.'+type.type | translate }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</cnsl-form-field>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<cnsl-form-field appearance="outline" class="formfield">
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
<cnsl-label>{{ 'APP.OIDC.RESPONSE' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'APP.AUTHMETHOD' | translate }}</cnsl-label>
|
||||||
<mat-select formControlName="responseTypesList" multiple>
|
|
||||||
<mat-option *ngFor="let type of oidcResponseTypes" [value]="type.type">
|
|
||||||
{{ 'APP.OIDC.RESPONSE'+type.type | translate }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</cnsl-form-field>
|
|
||||||
|
|
||||||
<cnsl-form-field appearance="outline" class="formfield">
|
|
||||||
<cnsl-label>{{ 'APP.OIDC.AUTHMETHOD' | translate }}</cnsl-label>
|
|
||||||
<mat-select formControlName="authMethodType">
|
<mat-select formControlName="authMethodType">
|
||||||
<mat-option *ngFor="let type of oidcAuthMethodType" [value]="type.type">
|
<mat-option *ngFor="let type of authMethodTypes" [value]="type.type">
|
||||||
{{ 'APP.OIDC.AUTHMETHOD'+type.type | translate }}
|
<span *ngIf="type.oidc">{{ 'APP.OIDC.AUTHMETHOD.'+type.type | translate }}</span>
|
||||||
|
<span *ngIf="type.api">{{ 'APP.API.AUTHMETHOD.'+type.type | translate }}</span>
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content" *ngIf="formappType?.value?.createType == AppCreateType.OIDC">
|
||||||
<div class="formfield full-width">
|
<div class="formfield full-width">
|
||||||
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
||||||
(changedUris)="oidcApp.redirectUrisList = $event" [urisList]="oidcApp.redirectUrisList"
|
(changedUris)="oidcApp.redirectUrisList = $event" [urisList]="oidcApp.redirectUrisList"
|
||||||
title="{{ 'APP.OIDC.REDIRECT' | translate }}">
|
title="{{ 'APP.OIDC.REDIRECT' | translate }}" [getValues]="requestRedirectValuesSubject$"
|
||||||
|
[isNative]="oidcApp.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE">
|
||||||
</cnsl-redirect-uris>
|
</cnsl-redirect-uris>
|
||||||
|
|
||||||
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
<cnsl-redirect-uris class="redirect-section" [canWrite]="true"
|
||||||
(changedUris)="oidcApp.postLogoutRedirectUrisList = $event"
|
(changedUris)="oidcApp.postLogoutRedirectUrisList = $event"
|
||||||
[urisList]="oidcApp.postLogoutRedirectUrisList"
|
[urisList]="oidcApp.postLogoutRedirectUrisList"
|
||||||
title="{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}">
|
title="{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}"
|
||||||
|
[getValues]="requestRedirectValuesSubject$"
|
||||||
|
[isNative]="oidcApp.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE">
|
||||||
</cnsl-redirect-uris>
|
</cnsl-redirect-uris>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,14 +4,17 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
|
|||||||
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subject, Subscription } from 'rxjs';
|
||||||
import { debounceTime } from 'rxjs/operators';
|
import { debounceTime, takeUntil } from 'rxjs/operators';
|
||||||
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
|
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
|
||||||
import {
|
import {
|
||||||
|
APIApplicationCreate,
|
||||||
|
APIAuthMethodType,
|
||||||
Application,
|
Application,
|
||||||
OIDCApplicationCreate,
|
OIDCApplicationCreate,
|
||||||
OIDCApplicationType,
|
OIDCApplicationType,
|
||||||
OIDCAuthMethodType,
|
OIDCAuthMethodType,
|
||||||
|
OIDCConfig,
|
||||||
OIDCGrantType,
|
OIDCGrantType,
|
||||||
OIDCResponseType,
|
OIDCResponseType,
|
||||||
} from 'src/app/proto/generated/management_pb';
|
} from 'src/app/proto/generated/management_pb';
|
||||||
@ -21,11 +24,15 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import {
|
import {
|
||||||
WEB_TYPE,
|
WEB_TYPE,
|
||||||
NATIVE_TYPE,
|
NATIVE_TYPE,
|
||||||
USER_AGENT_TYPE
|
USER_AGENT_TYPE,
|
||||||
|
API_TYPE,
|
||||||
|
RadioItemAppType,
|
||||||
|
AppCreateType
|
||||||
} from '../authtypes';
|
} from '../authtypes';
|
||||||
|
|
||||||
import { AppSecretDialogComponent } from '../app-secret-dialog/app-secret-dialog.component';
|
import { AppSecretDialogComponent } from '../app-secret-dialog/app-secret-dialog.component';
|
||||||
import { CODE_METHOD, getPartialConfigFromAuthMethod, IMPLICIT_METHOD, PKCE_METHOD, PK_JWT_METHOD, POST_METHOD } from '../authmethods';
|
import { CODE_METHOD, getPartialConfigFromAuthMethod, IMPLICIT_METHOD, BASIC_AUTH_METHOD, PKCE_METHOD, PK_JWT_METHOD, POST_METHOD } from '../authmethods';
|
||||||
|
import { StepperSelectionEvent } from '@angular/cdk/stepper';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -35,10 +42,13 @@ import { CODE_METHOD, getPartialConfigFromAuthMethod, IMPLICIT_METHOD, PKCE_METH
|
|||||||
})
|
})
|
||||||
export class AppCreateComponent implements OnInit, OnDestroy {
|
export class AppCreateComponent implements OnInit, OnDestroy {
|
||||||
private subscription?: Subscription;
|
private subscription?: Subscription;
|
||||||
|
private destroyed$: Subject<void> = new Subject();
|
||||||
public devmode: boolean = false;
|
public devmode: boolean = false;
|
||||||
public projectId: string = '';
|
public projectId: string = '';
|
||||||
public loading: boolean = false;
|
public loading: boolean = false;
|
||||||
|
|
||||||
public oidcApp: OIDCApplicationCreate.AsObject = new OIDCApplicationCreate().toObject();
|
public oidcApp: OIDCApplicationCreate.AsObject = new OIDCApplicationCreate().toObject();
|
||||||
|
public apiApp: APIApplicationCreate.AsObject = new APIApplicationCreate().toObject();
|
||||||
|
|
||||||
public oidcResponseTypes: { type: OIDCResponseType, checked: boolean; disabled: boolean; }[] = [
|
public oidcResponseTypes: { type: OIDCResponseType, checked: boolean; disabled: boolean; }[] = [
|
||||||
{ type: OIDCResponseType.OIDCRESPONSETYPE_CODE, checked: false, disabled: false },
|
{ type: OIDCResponseType.OIDCRESPONSETYPE_CODE, checked: false, disabled: false },
|
||||||
@ -46,22 +56,30 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
{ type: OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN, checked: false, disabled: false },
|
{ type: OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN, checked: false, disabled: false },
|
||||||
];
|
];
|
||||||
|
|
||||||
public oidcAppTypes: any = [
|
public oidcAppTypes: OIDCApplicationType[] = [
|
||||||
|
OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB,
|
||||||
|
OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE,
|
||||||
|
OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT,
|
||||||
|
];
|
||||||
|
public appTypes: any = [
|
||||||
WEB_TYPE,
|
WEB_TYPE,
|
||||||
NATIVE_TYPE,
|
NATIVE_TYPE,
|
||||||
USER_AGENT_TYPE,
|
USER_AGENT_TYPE,
|
||||||
|
API_TYPE,
|
||||||
];
|
];
|
||||||
|
|
||||||
public authMethods: RadioItemAuthType[] = [
|
public authMethods: RadioItemAuthType[] = [
|
||||||
PKCE_METHOD,
|
PKCE_METHOD,
|
||||||
CODE_METHOD,
|
CODE_METHOD,
|
||||||
|
PK_JWT_METHOD,
|
||||||
POST_METHOD,
|
POST_METHOD,
|
||||||
];
|
];
|
||||||
|
|
||||||
public oidcAuthMethodType: { type: OIDCAuthMethodType, checked: boolean, disabled: boolean; }[] = [
|
// set to oidc first
|
||||||
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC, checked: false, disabled: false },
|
public authMethodTypes: { type: OIDCAuthMethodType | APIAuthMethodType, checked: boolean, disabled: boolean; api?: boolean; oidc?: boolean; }[] = [
|
||||||
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE, checked: false, disabled: false },
|
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC, checked: false, disabled: false, oidc: true },
|
||||||
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST, checked: false, disabled: false },
|
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE, checked: false, disabled: false, oidc: true },
|
||||||
|
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST, checked: false, disabled: false, oidc: true },
|
||||||
];
|
];
|
||||||
|
|
||||||
// stepper
|
// stepper
|
||||||
@ -71,6 +89,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
// devmode
|
// devmode
|
||||||
public form!: FormGroup;
|
public form!: FormGroup;
|
||||||
|
|
||||||
|
public AppCreateType: any = AppCreateType;
|
||||||
public OIDCApplicationType: any = OIDCApplicationType;
|
public OIDCApplicationType: any = OIDCApplicationType;
|
||||||
public OIDCGrantType: any = OIDCGrantType;
|
public OIDCGrantType: any = OIDCGrantType;
|
||||||
public OIDCAuthMethodType: any = OIDCAuthMethodType;
|
public OIDCAuthMethodType: any = OIDCAuthMethodType;
|
||||||
@ -87,6 +106,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
];
|
];
|
||||||
|
|
||||||
public readonly separatorKeysCodes: number[] = [ENTER, COMMA, SPACE];
|
public readonly separatorKeysCodes: number[] = [ENTER, COMMA, SPACE];
|
||||||
|
public requestRedirectValuesSubject$: Subject<void> = new Subject();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@ -101,57 +121,68 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
name: ['', [Validators.required]],
|
name: ['', [Validators.required]],
|
||||||
responseTypesList: ['', [Validators.required]],
|
responseTypesList: ['', [Validators.required]],
|
||||||
grantTypesList: ['', [Validators.required]],
|
grantTypesList: ['', [Validators.required]],
|
||||||
applicationType: ['', [Validators.required]],
|
appType: ['', [Validators.required]],
|
||||||
authMethodType: ['', [Validators.required]],
|
authMethodType: ['', [Validators.required]],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.form.valueChanges.pipe(debounceTime(300)).subscribe((value) => {
|
this.initForm();
|
||||||
this.oidcApp.name = this.formname?.value;
|
|
||||||
this.oidcApp.applicationType = this.formapplicationType?.value;
|
|
||||||
this.oidcApp.responseTypesList = this.formresponseTypesList?.value;
|
|
||||||
this.oidcApp.grantTypesList = this.formgrantTypesList?.value;
|
|
||||||
this.oidcApp.authMethodType = this.formauthMethodType?.value;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.firstFormGroup = this.fb.group({
|
this.firstFormGroup = this.fb.group({
|
||||||
name: ['', [Validators.required]],
|
name: ['', [Validators.required]],
|
||||||
applicationType: [OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB, [Validators.required]],
|
appType: [WEB_TYPE, [Validators.required]],
|
||||||
});
|
});
|
||||||
|
|
||||||
this.firstFormGroup.valueChanges.subscribe(value => {
|
this.firstFormGroup.valueChanges.subscribe(value => {
|
||||||
if (this.firstFormGroup.valid) {
|
if (this.firstFormGroup.valid) {
|
||||||
this.oidcApp.name = this.name?.value;
|
this.oidcApp.name = this.name?.value;
|
||||||
this.oidcApp.applicationType = this.applicationType?.value;
|
this.apiApp.name = this.name?.value;
|
||||||
|
|
||||||
switch (this.applicationType?.value) {
|
if (this.isStepperOIDC) {
|
||||||
case OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE:
|
const oidcAppType = (this.appType?.value as RadioItemAppType).oidcApplicationType;
|
||||||
this.authMethods = [
|
if (oidcAppType !== undefined) {
|
||||||
PKCE_METHOD,
|
this.oidcApp.applicationType = oidcAppType;
|
||||||
];
|
}
|
||||||
|
|
||||||
// automatically set to PKCE and skip step
|
switch (this.oidcApp.applicationType) {
|
||||||
this.oidcApp.responseTypesList = [OIDCResponseType.OIDCRESPONSETYPE_CODE];
|
case OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE:
|
||||||
this.oidcApp.grantTypesList = [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE];
|
this.authMethods = [
|
||||||
this.oidcApp.authMethodType = OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
|
PKCE_METHOD,
|
||||||
|
];
|
||||||
|
|
||||||
break;
|
// automatically set to PKCE and skip step
|
||||||
case OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB:
|
this.oidcApp.responseTypesList = [OIDCResponseType.OIDCRESPONSETYPE_CODE];
|
||||||
this.authMethods = [
|
this.oidcApp.grantTypesList = [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE];
|
||||||
PKCE_METHOD,
|
this.oidcApp.authMethodType = OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
|
||||||
CODE_METHOD,
|
|
||||||
POST_METHOD,
|
|
||||||
];
|
|
||||||
|
|
||||||
this.authMethod?.setValue(PKCE_METHOD.key);
|
break;
|
||||||
break;
|
case OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB:
|
||||||
case OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT:
|
// PK_JWT_METHOD.recommended = false;
|
||||||
this.authMethods = [
|
this.authMethods = [
|
||||||
PKCE_METHOD,
|
PKCE_METHOD,
|
||||||
IMPLICIT_METHOD,
|
CODE_METHOD,
|
||||||
];
|
PK_JWT_METHOD,
|
||||||
|
POST_METHOD,
|
||||||
|
];
|
||||||
|
|
||||||
this.authMethod?.setValue(PKCE_METHOD.key);
|
this.authMethod?.setValue(PKCE_METHOD.key);
|
||||||
break;
|
break;
|
||||||
|
case OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT:
|
||||||
|
this.authMethods = [
|
||||||
|
PKCE_METHOD,
|
||||||
|
IMPLICIT_METHOD,
|
||||||
|
];
|
||||||
|
|
||||||
|
this.authMethod?.setValue(PKCE_METHOD.key);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else if (this.isStepperAPI) {
|
||||||
|
// PK_JWT_METHOD.recommended = true;
|
||||||
|
this.authMethods = [
|
||||||
|
PK_JWT_METHOD,
|
||||||
|
BASIC_AUTH_METHOD,
|
||||||
|
];
|
||||||
|
|
||||||
|
this.authMethod?.setValue(PK_JWT_METHOD.key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -162,10 +193,12 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
this.secondFormGroup.valueChanges.subscribe(form => {
|
this.secondFormGroup.valueChanges.subscribe(form => {
|
||||||
const partialConfig = getPartialConfigFromAuthMethod(form.authMethod);
|
const partialConfig = getPartialConfigFromAuthMethod(form.authMethod);
|
||||||
|
|
||||||
if (partialConfig) {
|
if (this.isStepperOIDC && partialConfig && partialConfig.oidc) {
|
||||||
this.oidcApp.responseTypesList = partialConfig.responseTypesList ?? [];
|
this.oidcApp.responseTypesList = partialConfig.oidc?.responseTypesList ?? [];
|
||||||
this.oidcApp.grantTypesList = partialConfig.grantTypesList ?? [];
|
this.oidcApp.grantTypesList = partialConfig.oidc?.grantTypesList ?? [];
|
||||||
this.oidcApp.authMethodType = partialConfig.authMethodType ?? OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
|
this.oidcApp.authMethodType = partialConfig.oidc?.authMethodType ?? OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
|
||||||
|
} else if (this.isStepperAPI && partialConfig && partialConfig.api) {
|
||||||
|
this.apiApp.authMethodType = partialConfig.api?.authMethodType ?? APIAuthMethodType.APIAUTHMETHODTYPE_BASIC;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -176,52 +209,135 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
public ngOnDestroy(): void {
|
public ngOnDestroy(): void {
|
||||||
this.subscription?.unsubscribe();
|
this.subscription?.unsubscribe();
|
||||||
|
this.destroyed$.next();
|
||||||
}
|
}
|
||||||
|
|
||||||
public changedAppType(type: OIDCApplicationType) {
|
public initForm(): void {
|
||||||
this.firstFormGroup.controls['applicationType'].setValue(type);
|
this.form.valueChanges.pipe(
|
||||||
|
takeUntil(this.destroyed$),
|
||||||
|
debounceTime(150)).subscribe(() => {
|
||||||
|
this.oidcApp.name = this.formname?.value;
|
||||||
|
this.apiApp.name = this.formname?.value;
|
||||||
|
|
||||||
|
this.oidcApp.responseTypesList = this.formresponseTypesList?.value;
|
||||||
|
this.oidcApp.grantTypesList = this.formgrantTypesList?.value;
|
||||||
|
|
||||||
|
this.oidcApp.authMethodType = this.formauthMethodType?.value;
|
||||||
|
this.apiApp.authMethodType = this.formauthMethodType?.value;
|
||||||
|
|
||||||
|
const oidcAppType = (this.formappType?.value as RadioItemAppType).oidcApplicationType;
|
||||||
|
if (oidcAppType !== undefined) {
|
||||||
|
this.oidcApp.applicationType = oidcAppType;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.formappType?.valueChanges.pipe(takeUntil(this.destroyed$)).subscribe(() => {
|
||||||
|
this.setDevFormValidators();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public changedAppAuthMethod(methodKey: string) {
|
public setDevFormValidators(): void {
|
||||||
console.log(methodKey);
|
if (this.isDevOIDC) {
|
||||||
this.secondFormGroup.controls['authMethod'].setValue(methodKey);
|
const grantTypesControl = new FormControl('', [Validators.required]);
|
||||||
|
const responseTypesControl = new FormControl('', [Validators.required]);
|
||||||
|
|
||||||
|
this.form.addControl('grantTypesList', grantTypesControl);
|
||||||
|
this.form.addControl('responseTypesList', responseTypesControl);
|
||||||
|
|
||||||
|
this.authMethodTypes = [
|
||||||
|
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC, checked: false, disabled: false, oidc: true },
|
||||||
|
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE, checked: false, disabled: false, oidc: true },
|
||||||
|
{ type: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST, checked: false, disabled: false, oidc: true },
|
||||||
|
];
|
||||||
|
this.authMethod?.setValue(OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC);
|
||||||
|
} else if (this.isDevAPI) {
|
||||||
|
this.form.removeControl('grantTypesList');
|
||||||
|
this.form.removeControl('responseTypesList');
|
||||||
|
|
||||||
|
this.authMethodTypes = [
|
||||||
|
{ type: APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT, checked: false, disabled: false, api: true },
|
||||||
|
{ type: APIAuthMethodType.APIAUTHMETHODTYPE_BASIC, checked: false, disabled: false, api: true },
|
||||||
|
];
|
||||||
|
this.authMethod?.setValue(APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT);
|
||||||
|
}
|
||||||
|
this.form.updateValueAndValidity();
|
||||||
|
}
|
||||||
|
|
||||||
|
public changeStep(event: StepperSelectionEvent) {
|
||||||
|
if (event.selectedIndex >= 2) {
|
||||||
|
this.requestRedirectValuesSubject$.next();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getData({ projectid }: Params): Promise<void> {
|
private async getData({ projectid }: Params): Promise<void> {
|
||||||
this.projectId = projectid;
|
this.projectId = projectid;
|
||||||
this.oidcApp.projectId = projectid;
|
this.oidcApp.projectId = projectid;
|
||||||
|
this.apiApp.projectId = projectid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public close(): void {
|
public close(): void {
|
||||||
this._location.back();
|
this._location.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveOIDCApp(): void {
|
public createApp(): void {
|
||||||
this.loading = true;
|
const appOIDCCheck = this.devmode ? this.isDevOIDC : this.isStepperOIDC;
|
||||||
this.mgmtService
|
const appAPICheck = this.devmode ? this.isDevAPI : this.isStepperAPI;
|
||||||
.CreateOIDCApp(this.oidcApp)
|
|
||||||
.then((data: Application) => {
|
if (appOIDCCheck) {
|
||||||
this.loading = false;
|
this.requestRedirectValuesSubject$.next();
|
||||||
const response = data.toObject();
|
|
||||||
if (response.oidcConfig?.authMethodType !== OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE) {
|
this.loading = true;
|
||||||
this.showSavedDialog(response);
|
this.mgmtService
|
||||||
} else {
|
.CreateOIDCApp(this.oidcApp)
|
||||||
this.router.navigate(['projects', this.projectId, 'apps', response.id]);
|
.then((data: Application) => {
|
||||||
}
|
this.loading = false;
|
||||||
})
|
const response = data.toObject();
|
||||||
.catch(error => {
|
if (response.oidcConfig?.authMethodType !== OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE) {
|
||||||
this.loading = false;
|
this.showSavedDialog(response);
|
||||||
this.toast.showError(error);
|
} else {
|
||||||
});
|
this.router.navigate(['projects', this.projectId, 'apps', response.id]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.loading = false;
|
||||||
|
this.toast.showError(error);
|
||||||
|
});
|
||||||
|
} else if (appAPICheck) {
|
||||||
|
this.loading = true;
|
||||||
|
this.mgmtService
|
||||||
|
.CreateAPIApplication(this.apiApp)
|
||||||
|
.then((data: Application) => {
|
||||||
|
this.loading = false;
|
||||||
|
const response = data.toObject();
|
||||||
|
if (response.apiConfig?.authMethodType == APIAuthMethodType.APIAUTHMETHODTYPE_BASIC) {
|
||||||
|
this.showSavedDialog(response);
|
||||||
|
} else {
|
||||||
|
this.router.navigate(['projects', this.projectId, 'apps', response.id]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.loading = false;
|
||||||
|
this.toast.showError(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public showSavedDialog(app: Application.AsObject): void {
|
public showSavedDialog(app: Application.AsObject): void {
|
||||||
if (app.oidcConfig !== undefined) {
|
if (app.oidcConfig?.clientSecret !== undefined) {
|
||||||
const dialogRef = this.dialog.open(AppSecretDialogComponent, {
|
const dialogRef = this.dialog.open(AppSecretDialogComponent, {
|
||||||
data: app.oidcConfig,
|
data: app.oidcConfig,
|
||||||
});
|
});
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(() => {
|
||||||
|
this.router.navigate(['projects', this.projectId, 'apps', app.id]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if (app.apiConfig?.clientSecret !== undefined) {
|
||||||
|
const dialogRef = this.dialog.open(AppSecretDialogComponent, {
|
||||||
|
data: app.apiConfig,
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogRef.afterClosed().subscribe(() => {
|
||||||
this.router.navigate(['projects', this.projectId, 'apps', app.id]);
|
this.router.navigate(['projects', this.projectId, 'apps', app.id]);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -232,8 +348,8 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
get name(): AbstractControl | null {
|
get name(): AbstractControl | null {
|
||||||
return this.firstFormGroup.get('name');
|
return this.firstFormGroup.get('name');
|
||||||
}
|
}
|
||||||
get applicationType(): AbstractControl | null {
|
get appType(): AbstractControl | null {
|
||||||
return this.firstFormGroup.get('applicationType');
|
return this.firstFormGroup.get('appType');
|
||||||
}
|
}
|
||||||
public grantTypeChecked(type: OIDCGrantType): boolean {
|
public grantTypeChecked(type: OIDCGrantType): boolean {
|
||||||
return this.oidcGrantTypes.filter(gt => gt.checked).map(gt => gt.type).findIndex(t => t === type) > -1;
|
return this.oidcGrantTypes.filter(gt => gt.checked).map(gt => gt.type).findIndex(t => t === type) > -1;
|
||||||
@ -256,11 +372,30 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
get formgrantTypesList(): AbstractControl | null {
|
get formgrantTypesList(): AbstractControl | null {
|
||||||
return this.form.get('grantTypesList');
|
return this.form.get('grantTypesList');
|
||||||
}
|
}
|
||||||
get formapplicationType(): AbstractControl | null {
|
get formappType(): AbstractControl | null {
|
||||||
return this.form.get('applicationType');
|
return this.form.get('appType');
|
||||||
}
|
}
|
||||||
|
// get formapplicationType(): AbstractControl | null {
|
||||||
|
// return this.form.get('applicationType');
|
||||||
|
// }
|
||||||
get formauthMethodType(): AbstractControl | null {
|
get formauthMethodType(): AbstractControl | null {
|
||||||
return this.form.get('authMethodType');
|
return this.form.get('authMethodType');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get isDevOIDC(): boolean {
|
||||||
|
return (this.formappType?.value as RadioItemAppType).createType == AppCreateType.OIDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
get isStepperOIDC(): boolean {
|
||||||
|
return (this.appType?.value as RadioItemAppType).createType == AppCreateType.OIDC;
|
||||||
|
}
|
||||||
|
|
||||||
|
get isDevAPI(): boolean {
|
||||||
|
return (this.formappType?.value as RadioItemAppType).createType == AppCreateType.API;
|
||||||
|
}
|
||||||
|
|
||||||
|
get isStepperAPI(): boolean {
|
||||||
|
return (this.appType?.value as RadioItemAppType).createType == AppCreateType.API;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6,7 +6,9 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="title-col">
|
<div class="title-col">
|
||||||
<h1>{{app?.name}}</h1>
|
<h1>{{app?.name}}</h1>
|
||||||
<span>{{'APP.OIDC.APPTYPE'+app?.oidcConfig?.applicationType | translate}}</span>
|
<span *ngIf="app?.oidcConfig">{{'APP.OIDC.APPTYPE.'+app?.oidcConfig?.applicationType |
|
||||||
|
translate}}</span>
|
||||||
|
<span *ngIf="app?.apiConfig">API</span>
|
||||||
</div>
|
</div>
|
||||||
<ng-container *ngIf="isZitadel === false">
|
<ng-container *ngIf="isZitadel === false">
|
||||||
<ng-template appHasRole [appHasRole]="['project.app.write:'+projectId, 'project.app.write']">
|
<ng-template appHasRole [appHasRole]="['project.app.write:'+projectId, 'project.app.write']">
|
||||||
@ -54,10 +56,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- <cnsl-info-section class="docs-line" *ngIf="docs?.discoveryEndpoint">
|
<div class="environment-wrapper">
|
||||||
<p><strong>Discovery Endpoint:</strong> {{docs.discoveryEndpoint}}</p>
|
<div class="environment" *ngIf="app?.oidcConfig?.clientId">
|
||||||
<p><strong>Issuer:</strong> {{docs.issuer}}</p>
|
<span class="key">{{'APP.OIDC.INFO.CLIENTID' | translate}}</span>
|
||||||
</cnsl-info-section> -->
|
<div class="environment-row">
|
||||||
|
<span>{{this.app.oidcConfig?.clientId}}</span>
|
||||||
|
<button color="primary" [disabled]="copiedKey == this.app.oidcConfig?.clientId"
|
||||||
|
[matTooltip]="(copiedKey != this.app.oidcConfig?.clientId ? 'USER.PAGES.COPY' : 'USER.PAGES.COPIED' ) | translate"
|
||||||
|
appCopyToClipboard [valueToCopy]="this.app.oidcConfig?.clientId"
|
||||||
|
(copiedValue)="copiedKey = 'clientId'" mat-icon-button>
|
||||||
|
<i *ngIf="copiedKey != 'clientId'" class="las la-clipboard"></i>
|
||||||
|
<i *ngIf="copiedKey == 'clientId'" class="las la-clipboard-check"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ng-container *ngFor="let environmentV of (environmentMap | keyvalue)">
|
||||||
|
<div *ngIf="environmentV.value" class="environment">
|
||||||
|
<span class="key">{{environmentV.key}}</span>
|
||||||
|
<div class="environment-row">
|
||||||
|
<span>{{environmentV.value}}</span>
|
||||||
|
<button color="primary" [disabled]="copiedKey == environmentV.value"
|
||||||
|
[matTooltip]="(copiedKey != environmentV.value ? 'USER.PAGES.COPY' : 'USER.PAGES.COPIED' ) | translate"
|
||||||
|
appCopyToClipboard [valueToCopy]="environmentV.value"
|
||||||
|
(copiedValue)="copiedKey = environmentV.key" mat-icon-button>
|
||||||
|
<i *ngIf="copiedKey != environmentV.key" class="las la-clipboard"></i>
|
||||||
|
<i *ngIf="copiedKey == environmentV.key" class="las la-clipboard-check"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="compliance"
|
<div class="compliance"
|
||||||
*ngIf="app?.oidcConfig?.complianceProblemsList && app.oidcConfig?.complianceProblemsList?.length">
|
*ngIf="app?.oidcConfig?.complianceProblemsList && app.oidcConfig?.complianceProblemsList?.length">
|
||||||
@ -70,7 +98,7 @@
|
|||||||
</cnsl-info-section>
|
</cnsl-info-section>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content" *ngIf="app?.oidcConfig">
|
||||||
<h3 class="full-width section-title">{{'APP.OIDC.REDIRECTSECTIONTITLE' | translate}}</h3>
|
<h3 class="full-width section-title">{{'APP.OIDC.REDIRECTSECTIONTITLE' | translate}}</h3>
|
||||||
|
|
||||||
<mat-slide-toggle color="primary" class="devmode" [formControl]="devMode" name="devMode"
|
<mat-slide-toggle color="primary" class="devmode" [formControl]="devMode" name="devMode"
|
||||||
@ -83,33 +111,47 @@
|
|||||||
<span>{{'APP.OIDC.REDIRECTDESCRIPTIONNATIVE' | translate}}</span>
|
<span>{{'APP.OIDC.REDIRECTDESCRIPTIONNATIVE' | translate}}</span>
|
||||||
</cnsl-info-section>
|
</cnsl-info-section>
|
||||||
|
|
||||||
<p class="step-description"
|
<cnsl-info-section class="step-description"
|
||||||
*ngIf="applicationType?.value == OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB || applicationType?.value == OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT">
|
*ngIf="applicationType?.value == OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB || applicationType?.value == OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT">
|
||||||
{{'APP.OIDC.REDIRECTDESCRIPTIONWEB' | translate}}</p>
|
{{'APP.OIDC.REDIRECTDESCRIPTIONWEB' | translate}}
|
||||||
|
</cnsl-info-section>
|
||||||
|
|
||||||
<div style="margin: .5rem" class="divider"></div>
|
<div style="margin: .5rem" class="divider"></div>
|
||||||
|
<cnsl-redirect-uris *ngIf="applicationType?.value !== undefined" class="redirect-section"
|
||||||
<cnsl-redirect-uris class="redirect-section" [canWrite]="canWrite" [devMode]="devMode?.value"
|
[canWrite]="canWrite" [devMode]="devMode?.value" [getValues]="requestRedirectValuesSubject$"
|
||||||
(changedUris)="redirectUrisList = $event" [urisList]="redirectUrisList"
|
(changedUris)="redirectUrisList = $event" [urisList]="redirectUrisList"
|
||||||
title="{{ 'APP.OIDC.REDIRECT' | translate }}">
|
title="{{ 'APP.OIDC.REDIRECT' | translate }}"
|
||||||
|
[isNative]="applicationType?.value == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE">
|
||||||
</cnsl-redirect-uris>
|
</cnsl-redirect-uris>
|
||||||
|
|
||||||
<cnsl-redirect-uris class="redirect-section" [canWrite]="canWrite" [devMode]="devMode?.value"
|
<cnsl-redirect-uris *ngIf="applicationType?.value !== undefined" class="redirect-section"
|
||||||
(changedUris)="postLogoutRedirectUrisList = $event" [urisList]="postLogoutRedirectUrisList"
|
[canWrite]="canWrite" [devMode]="devMode?.value" (changedUris)="postLogoutRedirectUrisList = $event"
|
||||||
title="{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}">
|
[urisList]="postLogoutRedirectUrisList" [getValues]="requestRedirectValuesSubject$"
|
||||||
|
title="{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}"
|
||||||
|
[isNative]="applicationType?.value == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE">
|
||||||
</cnsl-redirect-uris>
|
</cnsl-redirect-uris>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-auth-method-radio *ngIf="authMethods && initialAuthMethod && app?.oidcConfig" [authMethods]="authMethods"
|
<app-auth-method-radio *ngIf="authMethods && initialAuthMethod && (app?.oidcConfig || app?.apiConfig)"
|
||||||
[selected]="initialAuthMethod" [current]="currentAuthMethod"
|
[authMethods]="authMethods" [selected]="initialAuthMethod" [current]="currentAuthMethod"
|
||||||
(selectedMethod)="setPartialConfigFromAuthMethod($event)">
|
[isOIDC]="app?.oidcConfig !== undefined" (selectedMethod)="setPartialConfigFromAuthMethod($event)">
|
||||||
</app-auth-method-radio>
|
</app-auth-method-radio>
|
||||||
|
|
||||||
<form *ngIf="appForm" [formGroup]="appForm" (ngSubmit)="saveOIDCApp()">
|
<app-card *ngIf="currentAuthMethod == 'PK_JWT' && projectId && app?.id" [expanded]="false"
|
||||||
|
title="{{ 'USER.MACHINE.KEYSTITLE' | translate }}" description="{{ 'USER.MACHINE.KEYSDESC' | translate }}">
|
||||||
|
<app-client-keys [projectId]="projectId" [appId]="app.id"></app-client-keys>
|
||||||
|
</app-card>
|
||||||
|
|
||||||
|
<div *ngIf="currentAuthMethod == 'BASIC'">
|
||||||
|
<button [disabled]="!canWrite" mat-stroked-button
|
||||||
|
(click)="regenerateAPIClientSecret()">{{'APP.API.REGENERATESECRET' | translate}}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<form *ngIf="oidcForm && app?.oidcConfig" [formGroup]="oidcForm" (ngSubmit)="saveOIDCApp()">
|
||||||
<app-card title=" {{ 'APP.OIDC.TITLE' | translate }}" *ngIf="app && app.oidcConfig" [expanded]="false">
|
<app-card title=" {{ 'APP.OIDC.TITLE' | translate }}" *ngIf="app && app.oidcConfig" [expanded]="false">
|
||||||
<div card-actions
|
<div card-actions *ngIf="currentAuthMethod == 'CODE' || currentAuthMethod == 'POST'">
|
||||||
*ngIf="app?.oidcConfig?.authMethodType !== OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE">
|
<button type="button" [disabled]="!canWrite" mat-stroked-button
|
||||||
<button [disabled]="!canWrite" mat-stroked-button
|
|
||||||
(click)="regenerateOIDCClientSecret()">{{'APP.OIDC.REGENERATESECRET' | translate}}</button>
|
(click)="regenerateOIDCClientSecret()">{{'APP.OIDC.REGENERATESECRET' | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -120,37 +162,37 @@
|
|||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
<cnsl-label>{{ 'APP.OIDC.RESPONSE' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'APP.OIDC.RESPONSETYPE' | translate }}</cnsl-label>
|
||||||
<mat-select formControlName="responseTypesList" multiple>
|
<mat-select formControlName="responseTypesList" multiple>
|
||||||
<mat-option *ngFor="let type of oidcResponseTypes" [value]="type">
|
<mat-option *ngFor="let type of oidcResponseTypes" [value]="type">
|
||||||
{{ 'APP.OIDC.RESPONSE'+type | translate }}
|
{{ 'APP.OIDC.RESPONSE.'+type | translate }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<cnsl-form-field class="formfield" appearance="outline">
|
<cnsl-form-field class="formfield" appearance="outline">
|
||||||
<cnsl-label>{{ 'APP.OIDC.GRANT' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'APP.OIDC.GRANTTYPE' | translate }}</cnsl-label>
|
||||||
<mat-select formControlName="grantTypesList" multiple>
|
<mat-select formControlName="grantTypesList" multiple>
|
||||||
<mat-option *ngFor="let grant of oidcGrantTypes" [value]="grant">
|
<mat-option *ngFor="let grant of oidcGrantTypes" [value]="grant">
|
||||||
{{ 'APP.OIDC.GRANT'+grant | translate }}
|
{{ 'APP.OIDC.GRANT.'+grant | translate }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<cnsl-form-field appearance="outline" class="formfield">
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
<cnsl-label>{{ 'APP.OIDC.APPTYPE' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'APP.TYPE' | translate }}</cnsl-label>
|
||||||
<mat-select formControlName="applicationType">
|
<mat-select formControlName="applicationType">
|
||||||
<mat-option *ngFor="let type of oidcAppTypes" [value]="type">
|
<mat-option *ngFor="let type of oidcAppTypes" [value]="type">
|
||||||
{{ 'APP.OIDC.APPTYPE'+type | translate }}
|
{{ 'APP.OIDC.APPTYPE.'+type | translate }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
|
|
||||||
<cnsl-form-field appearance="outline" class="formfield">
|
<cnsl-form-field appearance="outline" class="formfield">
|
||||||
<cnsl-label>{{ 'APP.OIDC.AUTHMETHOD' | translate }}</cnsl-label>
|
<cnsl-label>{{ 'APP.AUTHMETHOD' | translate }}</cnsl-label>
|
||||||
<mat-select formControlName="authMethodType">
|
<mat-select formControlName="authMethodType">
|
||||||
<mat-option *ngFor="let type of oidcAuthMethodType" [value]="type">
|
<mat-option *ngFor="let type of oidcAuthMethodType" [value]="type">
|
||||||
{{ 'APP.OIDC.AUTHMETHOD'+type | translate }}
|
{{ 'APP.OIDC.AUTHMETHOD.'+type | translate }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</cnsl-form-field>
|
</cnsl-form-field>
|
||||||
@ -200,39 +242,14 @@
|
|||||||
</app-card>
|
</app-card>
|
||||||
|
|
||||||
<div class="btn-container">
|
<div class="btn-container">
|
||||||
<button class="submit-button" type="submit" color="primary" [disabled]="appForm.invalid || !canWrite"
|
<button class="submit-button" type="submit" color="primary" [disabled]="oidcForm.invalid || !canWrite"
|
||||||
mat-raised-button>
|
mat-raised-button>
|
||||||
{{ 'ACTIONS.SAVE' | translate }}
|
{{ 'ACTIONS.SAVE' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="next-steps">
|
<cnsl-links [links]="nextLinks"></cnsl-links>
|
||||||
<h5>{{'APP.PAGES.NEXTSTEPS.TITLE' | translate}}</h5>
|
|
||||||
<div class="row">
|
|
||||||
<div class="step">
|
|
||||||
<h6>{{ 'APP.PAGES.NEXTSTEPS.0.TITLE' | translate }}</h6>
|
|
||||||
<p>{{'APP.PAGES.NEXTSTEPS.0.DESC' | translate}}</p>
|
|
||||||
<span class="fill-space"></span>
|
|
||||||
<a [routerLink]="['/projects', this.projectId]" color="primary" mat-mini-fab><i
|
|
||||||
class="las la-angle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
<div class="step">
|
|
||||||
<h6>{{ 'APP.PAGES.NEXTSTEPS.1.TITLE' | translate }}</h6>
|
|
||||||
<p>{{'APP.PAGES.NEXTSTEPS.1.DESC' | translate}}</p>
|
|
||||||
<span class="fill-space"></span>
|
|
||||||
<a [routerLink]="['/users', 'create']" color="primary" mat-mini-fab><i
|
|
||||||
class="las la-angle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
<div class="step">
|
|
||||||
<h6>{{ 'APP.PAGES.NEXTSTEPS.2.TITLE' | translate }}</h6>
|
|
||||||
<p>{{'APP.PAGES.NEXTSTEPS.2.DESC' | translate}}</p>
|
|
||||||
<span class="fill-space"></span>
|
|
||||||
<a href="https://docs.zitadel.ch" color="primary" mat-mini-fab><i
|
|
||||||
class="las la-angle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,6 +44,46 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.environment-wrapper {
|
||||||
|
padding: 1rem 0;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
.environment {
|
||||||
|
min-width: 300px;
|
||||||
|
|
||||||
|
.key {
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--grey);
|
||||||
|
}
|
||||||
|
.environment-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
height: 30px;
|
||||||
|
|
||||||
|
button {
|
||||||
|
transition: opacity .15s ease-in-out;
|
||||||
|
visibility: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
&[disabled] {
|
||||||
|
visibility: visible;
|
||||||
|
color: white;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
button {
|
||||||
|
visibility: visible;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.compliance .problem {
|
.compliance .problem {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
@ -174,61 +214,3 @@
|
|||||||
height: 1px;
|
height: 1px;
|
||||||
background-color: rgba(#8795a1, .2);
|
background-color: rgba(#8795a1, .2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.next-steps {
|
|
||||||
h5 {
|
|
||||||
text-transform: uppercase;
|
|
||||||
font-size: 14px;
|
|
||||||
color: var(--grey);
|
|
||||||
}
|
|
||||||
|
|
||||||
.row {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
overflow-x: auto;
|
|
||||||
|
|
||||||
.step {
|
|
||||||
min-width: 220px;
|
|
||||||
max-width: 280px;
|
|
||||||
padding: 1rem;
|
|
||||||
margin: 0 .5rem;
|
|
||||||
border: 1px solid var(--grey);
|
|
||||||
border-radius: .5rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
box-sizing: border-box;
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
h6 {
|
|
||||||
font-size: 1rem;
|
|
||||||
text-align: center;
|
|
||||||
margin: 0 0 1rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
font-size: 14px;
|
|
||||||
text-align: center;
|
|
||||||
color: var(--grey);
|
|
||||||
}
|
|
||||||
|
|
||||||
.fill-space {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
display: block;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
margin-right: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,20 +1,27 @@
|
|||||||
import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
|
import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
|
||||||
import { Location } from '@angular/common';
|
import { Location } from '@angular/common';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||||
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { MatButtonToggleChange } from '@angular/material/button-toggle';
|
import { MatButtonToggleChange } from '@angular/material/button-toggle';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||||
|
import { ActivatedRoute, Params, Router, RouterLink } from '@angular/router';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
|
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
|
||||||
import { Subscription } from 'rxjs';
|
import { Subject, Subscription } from 'rxjs';
|
||||||
import { take } from 'rxjs/operators';
|
import { take } from 'rxjs/operators';
|
||||||
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
|
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
|
||||||
import { ChangeType } from 'src/app/modules/changes/changes.component';
|
import { ChangeType } from 'src/app/modules/changes/changes.component';
|
||||||
|
import { CnslLinks } from 'src/app/modules/links/links.component';
|
||||||
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
|
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
|
||||||
import {
|
import {
|
||||||
|
APIAuthMethodType,
|
||||||
|
APIConfig,
|
||||||
|
APIConfigUpdate,
|
||||||
Application,
|
Application,
|
||||||
AppState,
|
AppState,
|
||||||
|
ClientSecret,
|
||||||
OIDCApplicationType,
|
OIDCApplicationType,
|
||||||
OIDCAuthMethodType,
|
OIDCAuthMethodType,
|
||||||
OIDCConfig,
|
OIDCConfig,
|
||||||
@ -29,7 +36,7 @@ import { ManagementService } from 'src/app/services/mgmt.service';
|
|||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
|
|
||||||
import { AppSecretDialogComponent } from '../app-secret-dialog/app-secret-dialog.component';
|
import { AppSecretDialogComponent } from '../app-secret-dialog/app-secret-dialog.component';
|
||||||
import { CODE_METHOD, getAuthMethodFromPartialConfig, getPartialConfigFromAuthMethod, IMPLICIT_METHOD, PKCE_METHOD, PK_JWT_METHOD, POST_METHOD, CUSTOM_METHOD } from '../authmethods';
|
import { CODE_METHOD, getAuthMethodFromPartialConfig, getPartialConfigFromAuthMethod, IMPLICIT_METHOD, PKCE_METHOD, PK_JWT_METHOD, POST_METHOD, CUSTOM_METHOD, BASIC_AUTH_METHOD } from '../authmethods';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-app-detail',
|
selector: 'app-app-detail',
|
||||||
@ -46,11 +53,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
public addOnBlur: boolean = true;
|
public addOnBlur: boolean = true;
|
||||||
public readonly separatorKeysCodes: number[] = [ENTER, COMMA, SPACE];
|
public readonly separatorKeysCodes: number[] = [ENTER, COMMA, SPACE];
|
||||||
|
|
||||||
public authMethods: RadioItemAuthType[] = [
|
public authMethods: RadioItemAuthType[] = [];
|
||||||
PKCE_METHOD,
|
|
||||||
CODE_METHOD,
|
|
||||||
POST_METHOD,
|
|
||||||
];
|
|
||||||
private subscription?: Subscription;
|
private subscription?: Subscription;
|
||||||
public projectId: string = '';
|
public projectId: string = '';
|
||||||
public app!: Application.AsObject;
|
public app!: Application.AsObject;
|
||||||
@ -74,6 +77,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
||||||
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
||||||
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
||||||
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_PRIVATE_KEY_JWT,
|
||||||
];
|
];
|
||||||
|
|
||||||
public oidcTokenTypes: OIDCTokenType[] = [
|
public oidcTokenTypes: OIDCTokenType[] = [
|
||||||
@ -83,7 +87,8 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
public AppState: any = AppState;
|
public AppState: any = AppState;
|
||||||
public appNameForm!: FormGroup;
|
public appNameForm!: FormGroup;
|
||||||
public appForm!: FormGroup;
|
public oidcForm!: FormGroup;
|
||||||
|
public apiForm!: FormGroup;
|
||||||
|
|
||||||
public redirectUrisList: string[] = [];
|
public redirectUrisList: string[] = [];
|
||||||
public postLogoutRedirectUrisList: string[] = [];
|
public postLogoutRedirectUrisList: string[] = [];
|
||||||
@ -93,9 +98,16 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
public OIDCApplicationType: any = OIDCApplicationType;
|
public OIDCApplicationType: any = OIDCApplicationType;
|
||||||
public OIDCAuthMethodType: any = OIDCAuthMethodType;
|
public OIDCAuthMethodType: any = OIDCAuthMethodType;
|
||||||
|
public APIAuthMethodType: any = APIAuthMethodType;
|
||||||
public OIDCTokenType: any = OIDCTokenType;
|
public OIDCTokenType: any = OIDCTokenType;
|
||||||
|
|
||||||
public ChangeType: any = ChangeType;
|
public ChangeType: any = ChangeType;
|
||||||
|
|
||||||
|
public requestRedirectValuesSubject$: Subject<void> = new Subject();
|
||||||
|
public copiedKey: any = '';
|
||||||
|
public environmentMap: { [key: string]: string; } = {};
|
||||||
|
public nextLinks: Array<CnslLinks> = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public translate: TranslateService,
|
public translate: TranslateService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@ -106,12 +118,26 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
private mgmtService: ManagementService,
|
private mgmtService: ManagementService,
|
||||||
private authService: GrpcAuthService,
|
private authService: GrpcAuthService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
|
private http: HttpClient,
|
||||||
|
private snackbar: MatSnackBar,
|
||||||
) {
|
) {
|
||||||
|
this.http.get('./assets/environment.json')
|
||||||
|
.toPromise().then((env: any) => {
|
||||||
|
|
||||||
|
this.environmentMap = {
|
||||||
|
issuer: env.issuer,
|
||||||
|
adminServiceUrl: env.adminServiceUrl,
|
||||||
|
mgmtServiceUrl: env.mgmtServiceUrl,
|
||||||
|
authServiceUrl: env.adminServiceUrl,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
this.appNameForm = this.fb.group({
|
this.appNameForm = this.fb.group({
|
||||||
state: [{ value: '', disabled: true }, []],
|
state: [{ value: '', disabled: true }, []],
|
||||||
name: [{ value: '', disabled: true }, [Validators.required]],
|
name: [{ value: '', disabled: true }, [Validators.required]],
|
||||||
});
|
});
|
||||||
this.appForm = this.fb.group({
|
|
||||||
|
this.oidcForm = this.fb.group({
|
||||||
devMode: [{ value: false, disabled: true }, []],
|
devMode: [{ value: false, disabled: true }, []],
|
||||||
clientId: [{ value: '', disabled: true }],
|
clientId: [{ value: '', disabled: true }],
|
||||||
responseTypesList: [{ value: [], disabled: true }],
|
responseTypesList: [{ value: [], disabled: true }],
|
||||||
@ -124,6 +150,10 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
idTokenUserinfoAssertion: [{ value: false, disabled: true }],
|
idTokenUserinfoAssertion: [{ value: false, disabled: true }],
|
||||||
clockSkewSeconds: [{ value: 0, disabled: true }],
|
clockSkewSeconds: [{ value: 0, disabled: true }],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.apiForm = this.fb.group({
|
||||||
|
authMethodType: [{ value: '', disabled: true }],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public formatClockSkewLabel(seconds: number): string {
|
public formatClockSkewLabel(seconds: number): string {
|
||||||
@ -138,8 +168,30 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.subscription?.unsubscribe();
|
this.subscription?.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private initLinks(): void {
|
||||||
|
this.nextLinks = [
|
||||||
|
{
|
||||||
|
i18nTitle: 'APP.PAGES.NEXTSTEPS.0.TITLE',
|
||||||
|
i18nDesc: 'APP.PAGES.NEXTSTEPS.0.DESC',
|
||||||
|
routerLink: ['/projects', this.projectId],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
i18nTitle: 'APP.PAGES.NEXTSTEPS.1.TITLE',
|
||||||
|
i18nDesc: 'APP.PAGES.NEXTSTEPS.1.DESC',
|
||||||
|
routerLink: ['/users', 'create'],
|
||||||
|
}, {
|
||||||
|
i18nTitle: 'APP.PAGES.NEXTSTEPS.2.TITLE',
|
||||||
|
i18nDesc: 'APP.PAGES.NEXTSTEPS.2.DESC',
|
||||||
|
href: 'https://docs.zitadel.ch'
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
private async getData({ projectid, id }: Params): Promise<void> {
|
private async getData({ projectid, id }: Params): Promise<void> {
|
||||||
this.projectId = projectid;
|
this.projectId = projectid;
|
||||||
|
|
||||||
|
this.initLinks();
|
||||||
|
|
||||||
this.mgmtService.GetIam().then(iam => {
|
this.mgmtService.GetIam().then(iam => {
|
||||||
this.isZitadel = iam.toObject().iamProjectId === this.projectId;
|
this.isZitadel = iam.toObject().iamProjectId === this.projectId;
|
||||||
});
|
});
|
||||||
@ -149,9 +201,22 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.app = app.toObject();
|
this.app = app.toObject();
|
||||||
this.appNameForm.patchValue(this.app);
|
this.appNameForm.patchValue(this.app);
|
||||||
|
|
||||||
this.getAuthMethodOptions();
|
|
||||||
if (this.app.oidcConfig) {
|
if (this.app.oidcConfig) {
|
||||||
this.initialAuthMethod = this.authMethodFromPartialConfig(this.app.oidcConfig);
|
this.getAuthMethodOptions('OIDC');
|
||||||
|
|
||||||
|
this.initialAuthMethod = this.authMethodFromPartialConfig({ oidc: this.app.oidcConfig });
|
||||||
|
this.currentAuthMethod = this.initialAuthMethod;
|
||||||
|
if (this.initialAuthMethod === CUSTOM_METHOD.key) {
|
||||||
|
if (!this.authMethods.includes(CUSTOM_METHOD)) {
|
||||||
|
this.authMethods.push(CUSTOM_METHOD);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.authMethods = this.authMethods.filter(element => element != CUSTOM_METHOD);
|
||||||
|
}
|
||||||
|
} else if (this.app.apiConfig) {
|
||||||
|
this.getAuthMethodOptions('API');
|
||||||
|
|
||||||
|
this.initialAuthMethod = this.authMethodFromPartialConfig({ api: this.app.apiConfig });
|
||||||
this.currentAuthMethod = this.initialAuthMethod;
|
this.currentAuthMethod = this.initialAuthMethod;
|
||||||
if (this.initialAuthMethod === CUSTOM_METHOD.key) {
|
if (this.initialAuthMethod === CUSTOM_METHOD.key) {
|
||||||
if (!this.authMethods.includes(CUSTOM_METHOD)) {
|
if (!this.authMethods.includes(CUSTOM_METHOD)) {
|
||||||
@ -164,7 +229,8 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
if (allowed) {
|
if (allowed) {
|
||||||
this.appNameForm.enable();
|
this.appNameForm.enable();
|
||||||
this.appForm.enable();
|
this.oidcForm.enable();
|
||||||
|
this.apiForm.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.app.oidcConfig?.redirectUrisList) {
|
if (this.app.oidcConfig?.redirectUrisList) {
|
||||||
@ -175,14 +241,14 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
if (this.app.oidcConfig?.clockSkew) {
|
if (this.app.oidcConfig?.clockSkew) {
|
||||||
const inSecs = this.app.oidcConfig?.clockSkew.seconds + this.app.oidcConfig?.clockSkew.nanos / 100000;
|
const inSecs = this.app.oidcConfig?.clockSkew.seconds + this.app.oidcConfig?.clockSkew.nanos / 100000;
|
||||||
this.appForm.controls['clockSkewSeconds'].setValue(inSecs);
|
this.oidcForm.controls['clockSkewSeconds'].setValue(inSecs);
|
||||||
}
|
}
|
||||||
if (this.app.oidcConfig) {
|
if (this.app.oidcConfig) {
|
||||||
this.appForm.patchValue(this.app.oidcConfig);
|
this.oidcForm.patchValue(this.app.oidcConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.appForm.valueChanges.subscribe(oidcConfig => {
|
this.oidcForm.valueChanges.subscribe((oidcConfig) => {
|
||||||
this.initialAuthMethod = this.authMethodFromPartialConfig(oidcConfig);
|
this.initialAuthMethod = this.authMethodFromPartialConfig({ oidc: oidcConfig });
|
||||||
if (this.initialAuthMethod === CUSTOM_METHOD.key) {
|
if (this.initialAuthMethod === CUSTOM_METHOD.key) {
|
||||||
if (!this.authMethods.includes(CUSTOM_METHOD)) {
|
if (!this.authMethods.includes(CUSTOM_METHOD)) {
|
||||||
this.authMethods.push(CUSTOM_METHOD);
|
this.authMethods.push(CUSTOM_METHOD);
|
||||||
@ -190,6 +256,21 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
} else {
|
} else {
|
||||||
this.authMethods = this.authMethods.filter(element => element != CUSTOM_METHOD);
|
this.authMethods = this.authMethods.filter(element => element != CUSTOM_METHOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.showSaveSnack();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.apiForm.valueChanges.subscribe((apiConfig) => {
|
||||||
|
this.initialAuthMethod = this.authMethodFromPartialConfig({ api: apiConfig });
|
||||||
|
if (this.initialAuthMethod === CUSTOM_METHOD.key) {
|
||||||
|
if (!this.authMethods.includes(CUSTOM_METHOD)) {
|
||||||
|
this.authMethods.push(CUSTOM_METHOD);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.authMethods = this.authMethods.filter(element => element != CUSTOM_METHOD);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.showSaveSnack();
|
||||||
});
|
});
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@ -200,43 +281,68 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.docs = (await this.mgmtService.GetZitadelDocs()).toObject();
|
this.docs = (await this.mgmtService.GetZitadelDocs()).toObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAuthMethodOptions(): void {
|
private async showSaveSnack(): Promise<void> {
|
||||||
switch (this.app.oidcConfig?.applicationType) {
|
const message = await this.translate.get('APP.TOAST.CONFIGCHANGED').toPromise();
|
||||||
case OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE:
|
const action = await this.translate.get('ACTIONS.SAVENOW').toPromise();
|
||||||
this.authMethods = [
|
|
||||||
PKCE_METHOD,
|
const snackRef = this.snackbar.open(message, action, { duration: 5000, verticalPosition: 'top' });
|
||||||
CUSTOM_METHOD,
|
snackRef.onAction().subscribe(() => {
|
||||||
];
|
if (this.app.oidcConfig) {
|
||||||
break;
|
this.saveOIDCApp();
|
||||||
case OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB:
|
} else if (this.app.apiConfig) {
|
||||||
this.authMethods = [
|
this.saveAPIApp();
|
||||||
PKCE_METHOD,
|
}
|
||||||
CODE_METHOD,
|
});
|
||||||
POST_METHOD,
|
}
|
||||||
];
|
|
||||||
break;
|
private getAuthMethodOptions(type: string): void {
|
||||||
case OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT:
|
if (type == 'OIDC') {
|
||||||
this.authMethods = [
|
switch (this.app.oidcConfig?.applicationType) {
|
||||||
PKCE_METHOD,
|
case OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE:
|
||||||
IMPLICIT_METHOD,
|
this.authMethods = [
|
||||||
];
|
PKCE_METHOD,
|
||||||
break;
|
CUSTOM_METHOD,
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB:
|
||||||
|
this.authMethods = [
|
||||||
|
PKCE_METHOD,
|
||||||
|
CODE_METHOD,
|
||||||
|
PK_JWT_METHOD,
|
||||||
|
POST_METHOD,
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
case OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT:
|
||||||
|
this.authMethods = [
|
||||||
|
PKCE_METHOD,
|
||||||
|
IMPLICIT_METHOD,
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (type == 'API') {
|
||||||
|
this.authMethods = [
|
||||||
|
PK_JWT_METHOD,
|
||||||
|
BASIC_AUTH_METHOD,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public authMethodFromPartialConfig(config: OIDCConfig.AsObject): string {
|
public authMethodFromPartialConfig(config: { oidc?: OIDCConfig.AsObject, api?: APIConfig.AsObject; }): string {
|
||||||
const key = getAuthMethodFromPartialConfig(config);
|
const key = getAuthMethodFromPartialConfig(config);
|
||||||
return key;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
public setPartialConfigFromAuthMethod(authMethod: string): void {
|
public setPartialConfigFromAuthMethod(authMethod: string): void {
|
||||||
const partialConfig = getPartialConfigFromAuthMethod(authMethod);
|
const partialConfig = getPartialConfigFromAuthMethod(authMethod);
|
||||||
|
if (partialConfig && partialConfig.oidc && this.app.oidcConfig) {
|
||||||
if (partialConfig && this.app.oidcConfig) {
|
this.app.oidcConfig.responseTypesList = (partialConfig.oidc as Partial<OIDCConfig.AsObject>).responseTypesList ?? [];
|
||||||
this.app.oidcConfig.responseTypesList = partialConfig.responseTypesList ?? [];
|
this.app.oidcConfig.grantTypesList = (partialConfig.oidc as Partial<OIDCConfig.AsObject>).grantTypesList ?? [];
|
||||||
this.app.oidcConfig.grantTypesList = partialConfig.grantTypesList ?? [];
|
this.app.oidcConfig.authMethodType = (partialConfig.oidc as Partial<OIDCConfig.AsObject>).authMethodType ?? OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
|
||||||
this.app.oidcConfig.authMethodType = partialConfig.authMethodType ?? OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
|
this.oidcForm.patchValue(this.app.oidcConfig);
|
||||||
this.appForm.patchValue(this.app.oidcConfig);
|
} else if (partialConfig && partialConfig.api && this.app.apiConfig) {
|
||||||
|
this.app.apiConfig.authMethodType = (partialConfig.api as Partial<APIConfig.AsObject>).authMethodType ?? APIAuthMethodType.APIAUTHMETHODTYPE_BASIC;
|
||||||
|
this.apiAuthMethodType?.setValue(this.app.apiConfig.authMethodType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +392,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.mgmtService
|
this.mgmtService
|
||||||
.UpdateApplication(this.projectId, this.app.id, this.name?.value)
|
.UpdateApplication(this.projectId, this.app.id, this.name?.value)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.toast.showInfo('APP.TOAST.OIDCUPDATED', true);
|
this.toast.showInfo('APP.TOAST.UPDATED', true);
|
||||||
this.editState = false;
|
this.editState = false;
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
@ -297,11 +403,12 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
|
|
||||||
public saveOIDCApp(): void {
|
public saveOIDCApp(): void {
|
||||||
|
this.requestRedirectValuesSubject$.next();
|
||||||
if (this.appNameForm.valid) {
|
if (this.appNameForm.valid) {
|
||||||
this.app.name = this.name?.value;
|
this.app.name = this.name?.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.appForm.valid) {
|
if (this.oidcForm.valid) {
|
||||||
if (this.app.oidcConfig) {
|
if (this.app.oidcConfig) {
|
||||||
this.app.oidcConfig.responseTypesList = this.responseTypesList?.value;
|
this.app.oidcConfig.responseTypesList = this.responseTypesList?.value;
|
||||||
this.app.oidcConfig.grantTypesList = this.grantTypesList?.value;
|
this.app.oidcConfig.grantTypesList = this.grantTypesList?.value;
|
||||||
@ -340,7 +447,8 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
.UpdateOIDCAppConfig(req)
|
.UpdateOIDCAppConfig(req)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (this.app.oidcConfig) {
|
if (this.app.oidcConfig) {
|
||||||
this.currentAuthMethod = this.authMethodFromPartialConfig(this.app.oidcConfig);
|
const config = { oidc: this.app.oidcConfig };
|
||||||
|
this.currentAuthMethod = this.authMethodFromPartialConfig(config);
|
||||||
}
|
}
|
||||||
this.toast.showInfo('APP.TOAST.OIDCUPDATED', true);
|
this.toast.showInfo('APP.TOAST.OIDCUPDATED', true);
|
||||||
})
|
})
|
||||||
@ -351,12 +459,52 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public saveAPIApp(): void {
|
||||||
|
if (this.apiForm.valid && this.app.apiConfig) {
|
||||||
|
this.app.apiConfig.authMethodType = this.apiAuthMethodType?.value;
|
||||||
|
|
||||||
|
const req = new APIConfigUpdate();
|
||||||
|
req.setProjectId(this.projectId);
|
||||||
|
req.setApplicationId(this.app.id);
|
||||||
|
req.setAuthMethodType(this.app.apiConfig.authMethodType);
|
||||||
|
|
||||||
|
this.mgmtService
|
||||||
|
.UpdateAPIAppConfig(req)
|
||||||
|
.then(() => {
|
||||||
|
if (this.app.apiConfig) {
|
||||||
|
const config = { api: this.app.apiConfig };
|
||||||
|
this.currentAuthMethod = this.authMethodFromPartialConfig(config);
|
||||||
|
}
|
||||||
|
this.toast.showInfo('APP.TOAST.OIDCUPDATED', true);
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.toast.showError(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public regenerateOIDCClientSecret(): void {
|
public regenerateOIDCClientSecret(): void {
|
||||||
this.mgmtService.RegenerateOIDCClientSecret(this.app.id, this.projectId).then((data: OIDCConfig) => {
|
this.mgmtService.RegenerateOIDCClientSecret(this.app.id, this.projectId).then((data: ClientSecret) => {
|
||||||
this.toast.showInfo('APP.TOAST.OIDCCLIENTSECRETREGENERATED', true);
|
this.toast.showInfo('APP.TOAST.CLIENTSECRETREGENERATED', true);
|
||||||
this.dialog.open(AppSecretDialogComponent, {
|
this.dialog.open(AppSecretDialogComponent, {
|
||||||
data: {
|
data: {
|
||||||
clientId: data.toObject().clientId,
|
// clientId: data.toObject() as ClientSecret.AsObject.clientId,
|
||||||
|
clientSecret: data.toObject().clientSecret,
|
||||||
|
},
|
||||||
|
width: '400px',
|
||||||
|
});
|
||||||
|
|
||||||
|
}).catch(error => {
|
||||||
|
this.toast.showError(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public regenerateAPIClientSecret(): void {
|
||||||
|
this.mgmtService.RegenerateAPIClientSecret(this.app.id, this.projectId).then((data: ClientSecret) => {
|
||||||
|
this.toast.showInfo('APP.TOAST.CLIENTSECRETREGENERATED', true);
|
||||||
|
this.dialog.open(AppSecretDialogComponent, {
|
||||||
|
data: {
|
||||||
|
// clientId: data.toObject().clientId ?? '',
|
||||||
clientSecret: data.toObject().clientSecret,
|
clientSecret: data.toObject().clientSecret,
|
||||||
},
|
},
|
||||||
width: '400px',
|
width: '400px',
|
||||||
@ -376,46 +524,50 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get clientId(): AbstractControl | null {
|
public get clientId(): AbstractControl | null {
|
||||||
return this.appForm.get('clientId');
|
return this.oidcForm.get('clientId');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get responseTypesList(): AbstractControl | null {
|
public get responseTypesList(): AbstractControl | null {
|
||||||
return this.appForm.get('responseTypesList');
|
return this.oidcForm.get('responseTypesList');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get grantTypesList(): AbstractControl | null {
|
public get grantTypesList(): AbstractControl | null {
|
||||||
return this.appForm.get('grantTypesList');
|
return this.oidcForm.get('grantTypesList');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get applicationType(): AbstractControl | null {
|
public get applicationType(): AbstractControl | null {
|
||||||
return this.appForm.get('applicationType');
|
return this.oidcForm.get('applicationType');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get authMethodType(): AbstractControl | null {
|
public get authMethodType(): AbstractControl | null {
|
||||||
return this.appForm.get('authMethodType');
|
return this.oidcForm.get('authMethodType');
|
||||||
|
}
|
||||||
|
|
||||||
|
public get apiAuthMethodType(): AbstractControl | null {
|
||||||
|
return this.apiForm.get('authMethodType');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get devMode(): AbstractControl | null {
|
public get devMode(): AbstractControl | null {
|
||||||
return this.appForm.get('devMode');
|
return this.oidcForm.get('devMode');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get accessTokenType(): AbstractControl | null {
|
public get accessTokenType(): AbstractControl | null {
|
||||||
return this.appForm.get('accessTokenType');
|
return this.oidcForm.get('accessTokenType');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get idTokenRoleAssertion(): AbstractControl | null {
|
public get idTokenRoleAssertion(): AbstractControl | null {
|
||||||
return this.appForm.get('idTokenRoleAssertion');
|
return this.oidcForm.get('idTokenRoleAssertion');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get accessTokenRoleAssertion(): AbstractControl | null {
|
public get accessTokenRoleAssertion(): AbstractControl | null {
|
||||||
return this.appForm.get('accessTokenRoleAssertion');
|
return this.oidcForm.get('accessTokenRoleAssertion');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get idTokenUserinfoAssertion(): AbstractControl | null {
|
public get idTokenUserinfoAssertion(): AbstractControl | null {
|
||||||
return this.appForm.get('idTokenUserinfoAssertion');
|
return this.oidcForm.get('idTokenUserinfoAssertion');
|
||||||
}
|
}
|
||||||
|
|
||||||
public get clockSkewSeconds(): AbstractControl | null {
|
public get clockSkewSeconds(): AbstractControl | null {
|
||||||
return this.appForm.get('clockSkewSeconds');
|
return this.oidcForm.get('clockSkewSeconds');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,9 @@ import { AppSecretDialogComponent } from './app-secret-dialog/app-secret-dialog.
|
|||||||
import { AppsRoutingModule } from './apps-routing.module';
|
import { AppsRoutingModule } from './apps-routing.module';
|
||||||
import { A11yModule } from '@angular/cdk/a11y';
|
import { A11yModule } from '@angular/cdk/a11y';
|
||||||
import { RedirectUrisComponent } from './redirect-uris/redirect-uris.component';
|
import { RedirectUrisComponent } from './redirect-uris/redirect-uris.component';
|
||||||
|
import { LinksModule } from 'src/app/modules/links/links.module';
|
||||||
|
import { RedirectPipeModule } from 'src/app/pipes/redirect-pipe/redirect-pipe.module';
|
||||||
|
import { ClientKeysModule } from 'src/app/modules/client-keys/client-keys.module';
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
AppCreateComponent,
|
AppCreateComponent,
|
||||||
@ -43,6 +45,8 @@ import { RedirectUrisComponent } from './redirect-uris/redirect-uris.component';
|
|||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
A11yModule,
|
A11yModule,
|
||||||
|
RedirectPipeModule,
|
||||||
|
LinksModule,
|
||||||
AppRadioModule,
|
AppRadioModule,
|
||||||
AppsRoutingModule,
|
AppsRoutingModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
@ -51,6 +55,7 @@ import { RedirectUrisComponent } from './redirect-uris/redirect-uris.component';
|
|||||||
HasRoleModule,
|
HasRoleModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
MatChipsModule,
|
MatChipsModule,
|
||||||
|
ClientKeysModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatButtonToggleModule,
|
MatButtonToggleModule,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
|
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
|
||||||
import { OIDCAuthMethodType, OIDCConfig, OIDCGrantType, OIDCResponseType } from 'src/app/proto/generated/management_pb';
|
import { APIAuthMethodType, APIConfig, OIDCAuthMethodType, OIDCConfig, OIDCGrantType, OIDCResponseType } from 'src/app/proto/generated/management_pb';
|
||||||
|
|
||||||
export const CODE_METHOD: RadioItemAuthType = {
|
export const CODE_METHOD: RadioItemAuthType = {
|
||||||
key: 'CODE',
|
key: 'CODE',
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.CODE.TITLE',
|
titleI18nKey: 'APP.AUTHMETHODS.CODE.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.CODE.DESCRIPTION',
|
descI18nKey: 'APP.AUTHMETHODS.CODE.DESCRIPTION',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
prefix: 'CODE',
|
prefix: 'CODE',
|
||||||
background: 'rgb(89 115 128)',
|
background: 'rgb(89 115 128)',
|
||||||
@ -15,8 +15,8 @@ export const CODE_METHOD: RadioItemAuthType = {
|
|||||||
};
|
};
|
||||||
export const PKCE_METHOD: RadioItemAuthType = {
|
export const PKCE_METHOD: RadioItemAuthType = {
|
||||||
key: 'PKCE',
|
key: 'PKCE',
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.PKCE.TITLE',
|
titleI18nKey: 'APP.AUTHMETHODS.PKCE.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.PKCE.DESCRIPTION',
|
descI18nKey: 'APP.AUTHMETHODS.PKCE.DESCRIPTION',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
prefix: 'PKCE',
|
prefix: 'PKCE',
|
||||||
background: 'rgb(80 110 92)',
|
background: 'rgb(80 110 92)',
|
||||||
@ -27,11 +27,11 @@ export const PKCE_METHOD: RadioItemAuthType = {
|
|||||||
};
|
};
|
||||||
export const POST_METHOD: RadioItemAuthType = {
|
export const POST_METHOD: RadioItemAuthType = {
|
||||||
key: 'POST',
|
key: 'POST',
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.POST.TITLE',
|
titleI18nKey: 'APP.AUTHMETHODS.POST.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.POST.DESCRIPTION',
|
descI18nKey: 'APP.AUTHMETHODS.POST.DESCRIPTION',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
prefix: 'POST',
|
prefix: 'POST',
|
||||||
background: '#595d80',
|
background: 'rgb(144 75 75)',
|
||||||
responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
|
responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
|
||||||
grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
|
grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
|
||||||
authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
||||||
@ -39,19 +39,34 @@ export const POST_METHOD: RadioItemAuthType = {
|
|||||||
};
|
};
|
||||||
export const PK_JWT_METHOD: RadioItemAuthType = {
|
export const PK_JWT_METHOD: RadioItemAuthType = {
|
||||||
key: 'PK_JWT',
|
key: 'PK_JWT',
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.ALTERNATIVE.TITLE',
|
titleI18nKey: 'APP.AUTHMETHODS.PK_JWT.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.ALTERNATIVE.DESCRIPTION',
|
descI18nKey: 'APP.AUTHMETHODS.PK_JWT.DESCRIPTION',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
prefix: 'PK_JWT',
|
prefix: 'JWT',
|
||||||
background: '#6a506e',
|
background: 'rgb(89, 93, 128)',
|
||||||
|
responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
|
||||||
|
grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
|
||||||
|
authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_PRIVATE_KEY_JWT,
|
||||||
|
apiAuthMethod: APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT,
|
||||||
|
// recommended: true,
|
||||||
|
};
|
||||||
|
export const BASIC_AUTH_METHOD: RadioItemAuthType = {
|
||||||
|
key: 'BASIC',
|
||||||
|
titleI18nKey: 'APP.AUTHMETHODS.BASIC.TITLE',
|
||||||
|
descI18nKey: 'APP.AUTHMETHODS.BASIC.DESCRIPTION',
|
||||||
|
disabled: false,
|
||||||
|
prefix: 'BASIC',
|
||||||
|
background: 'rgb(144 75 75)',
|
||||||
responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
|
responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
|
||||||
grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
|
grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
|
||||||
authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
||||||
|
apiAuthMethod: APIAuthMethodType.APIAUTHMETHODTYPE_BASIC,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const IMPLICIT_METHOD: RadioItemAuthType = {
|
export const IMPLICIT_METHOD: RadioItemAuthType = {
|
||||||
key: 'IMPLICIT',
|
key: 'IMPLICIT',
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.IMPLICIT.TITLE',
|
titleI18nKey: 'APP.AUTHMETHODS.IMPLICIT.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.IMPLICIT.DESCRIPTION',
|
descI18nKey: 'APP.AUTHMETHODS.IMPLICIT.DESCRIPTION',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
prefix: 'IMP',
|
prefix: 'IMP',
|
||||||
background: 'rgb(144 75 75)',
|
background: 'rgb(144 75 75)',
|
||||||
@ -60,51 +75,84 @@ export const IMPLICIT_METHOD: RadioItemAuthType = {
|
|||||||
authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
||||||
notRecommended: true,
|
notRecommended: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const CUSTOM_METHOD: RadioItemAuthType = {
|
export const CUSTOM_METHOD: RadioItemAuthType = {
|
||||||
key: 'CUSTOM',
|
key: 'CUSTOM',
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.CUSTOM.TITLE',
|
titleI18nKey: 'APP.AUTHMETHODS.CUSTOM.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.AUTHMETHOD.CUSTOM.DESCRIPTION',
|
descI18nKey: 'APP.AUTHMETHODS.CUSTOM.DESCRIPTION',
|
||||||
disabled: false,
|
disabled: false,
|
||||||
prefix: 'CUSTOM',
|
prefix: 'CUSTOM',
|
||||||
background: '#333',
|
background: '#333',
|
||||||
};
|
};
|
||||||
|
|
||||||
export function getPartialConfigFromAuthMethod(authMethod: string): Partial<OIDCConfig.AsObject> | undefined {
|
export function getPartialConfigFromAuthMethod(authMethod: string): {
|
||||||
let config: Partial<OIDCConfig.AsObject>;
|
oidc?: Partial<OIDCConfig.AsObject>;
|
||||||
|
api?: Partial<APIConfig.AsObject>;
|
||||||
|
} | undefined {
|
||||||
|
let config: {
|
||||||
|
oidc?: Partial<OIDCConfig.AsObject>,
|
||||||
|
api?: Partial<APIConfig.AsObject>,
|
||||||
|
};
|
||||||
switch (authMethod) {
|
switch (authMethod) {
|
||||||
case CODE_METHOD.key:
|
case CODE_METHOD.key:
|
||||||
config = {
|
config = {
|
||||||
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
oidc: {
|
||||||
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
|
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
return config;
|
return config;
|
||||||
case PKCE_METHOD.key:
|
case PKCE_METHOD.key:
|
||||||
config = {
|
config = {
|
||||||
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
oidc: {
|
||||||
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
|
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return config;
|
return config;
|
||||||
case POST_METHOD.key:
|
case POST_METHOD.key:
|
||||||
config = {
|
config = {
|
||||||
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
oidc: {
|
||||||
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
|
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return config;
|
||||||
|
case PK_JWT_METHOD.key:
|
||||||
|
config = {
|
||||||
|
oidc: {
|
||||||
|
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
|
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
|
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_PRIVATE_KEY_JWT,
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
authMethodType: APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return config;
|
||||||
|
case BASIC_AUTH_METHOD.key:
|
||||||
|
config = {
|
||||||
|
oidc: {
|
||||||
|
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
authMethodType: APIAuthMethodType.APIAUTHMETHODTYPE_BASIC,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return config;
|
return config;
|
||||||
// case PK_JWT_METHOD.key:
|
|
||||||
// config = {
|
|
||||||
// responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
|
||||||
// grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
|
||||||
// authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
|
||||||
// };
|
|
||||||
// return config;
|
|
||||||
case IMPLICIT_METHOD.key:
|
case IMPLICIT_METHOD.key:
|
||||||
config = {
|
config = {
|
||||||
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN],
|
oidc: {
|
||||||
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_IMPLICIT],
|
responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN],
|
||||||
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_IMPLICIT],
|
||||||
|
authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
authMethodType: APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return config;
|
return config;
|
||||||
default:
|
default:
|
||||||
@ -112,55 +160,66 @@ export function getPartialConfigFromAuthMethod(authMethod: string): Partial<OIDC
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAuthMethodFromPartialConfig(config: Partial<OIDCConfig.AsObject> | OIDCConfig.AsObject): string {
|
export function getAuthMethodFromPartialConfig(config: { oidc?: Partial<OIDCConfig.AsObject>, api?: Partial<APIConfig.AsObject>; }): string {
|
||||||
const toCheck = [config.responseTypesList, config.grantTypesList, config.authMethodType];
|
if (config?.oidc) {
|
||||||
const code = JSON.stringify(
|
const toCheck = [config.oidc.responseTypesList, config.oidc.grantTypesList, config.oidc.authMethodType];
|
||||||
[
|
const code = JSON.stringify(
|
||||||
[OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
[
|
||||||
[OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
[OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
[OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
]
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
||||||
);
|
]
|
||||||
|
);
|
||||||
|
|
||||||
const pkce = JSON.stringify(
|
const pkce = JSON.stringify(
|
||||||
[
|
[
|
||||||
[OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
[OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
[OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
[OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
const post = JSON.stringify(
|
const post = JSON.stringify(
|
||||||
[
|
[
|
||||||
[OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
[OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
[OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
[OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
// const pk_jwt = JSON.stringify(
|
const pk_jwt = JSON.stringify(
|
||||||
// [
|
[
|
||||||
// [OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
[OIDCResponseType.OIDCRESPONSETYPE_CODE],
|
||||||
// [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
[OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
|
||||||
// OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_PRIVATE_KEY_JWT,
|
||||||
// ]
|
]
|
||||||
// );
|
);
|
||||||
|
|
||||||
const implicit = JSON.stringify(
|
const implicit = JSON.stringify(
|
||||||
[
|
[
|
||||||
[OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN],
|
[OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN],
|
||||||
[OIDCGrantType.OIDCGRANTTYPE_IMPLICIT],
|
[OIDCGrantType.OIDCGRANTTYPE_IMPLICIT],
|
||||||
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (JSON.stringify(toCheck)) {
|
switch (JSON.stringify(toCheck)) {
|
||||||
case code: return CODE_METHOD.key;
|
case code: return CODE_METHOD.key;
|
||||||
case pkce: return PKCE_METHOD.key;
|
case pkce: return PKCE_METHOD.key;
|
||||||
case post: return POST_METHOD.key;
|
case post: return POST_METHOD.key;
|
||||||
// case pk_jwt: return PK_JWT_METHOD.key;
|
case pk_jwt: return PK_JWT_METHOD.key;
|
||||||
case implicit: return IMPLICIT_METHOD.key;
|
case implicit: return IMPLICIT_METHOD.key;
|
||||||
default:
|
default:
|
||||||
return CUSTOM_METHOD.key;
|
return CUSTOM_METHOD.key;
|
||||||
|
}
|
||||||
|
} else if (config.api && config.api.authMethodType !== undefined) {
|
||||||
|
switch (config.api.authMethodType.toString()) {
|
||||||
|
case APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT.toString(): return PK_JWT_METHOD.key;
|
||||||
|
case APIAuthMethodType.APIAUTHMETHODTYPE_BASIC.toString(): return BASIC_AUTH_METHOD.key;
|
||||||
|
default:
|
||||||
|
return CUSTOM_METHOD.key;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return CUSTOM_METHOD.key;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,25 +1,62 @@
|
|||||||
import { OIDCApplicationType } from 'src/app/proto/generated/management_pb';
|
import { OIDCApplicationType } from 'src/app/proto/generated/management_pb';
|
||||||
|
|
||||||
|
// export enum AppType {
|
||||||
|
// "WEB",
|
||||||
|
// "USER_AGENT",
|
||||||
|
// "NATIVE",
|
||||||
|
// "API"
|
||||||
|
// }
|
||||||
|
|
||||||
|
export enum AppCreateType {
|
||||||
|
API = "API",
|
||||||
|
OIDC = "OIDC"
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RadioItemAppType {
|
||||||
|
// key: string;
|
||||||
|
createType: AppCreateType;
|
||||||
|
oidcApplicationType?: OIDCApplicationType;
|
||||||
|
titleI18nKey: string;
|
||||||
|
descI18nKey: string;
|
||||||
|
prefix: string;
|
||||||
|
background: string;
|
||||||
|
}
|
||||||
|
|
||||||
export const WEB_TYPE = {
|
export const WEB_TYPE = {
|
||||||
|
// key: AppType.WEB,
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.APPTYPE.WEB.TITLE',
|
titleI18nKey: 'APP.OIDC.SELECTION.APPTYPE.WEB.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.APPTYPE.WEB.DESCRIPTION',
|
descI18nKey: 'APP.OIDC.SELECTION.APPTYPE.WEB.DESCRIPTION',
|
||||||
type: OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB,
|
createType: AppCreateType.OIDC,
|
||||||
|
oidcApplicationType: OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB,
|
||||||
prefix: 'WEB',
|
prefix: 'WEB',
|
||||||
background: 'rgb(80, 110, 110)',
|
background: 'rgb(80, 110, 110)',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const USER_AGENT_TYPE = {
|
export const USER_AGENT_TYPE = {
|
||||||
|
// key: AppType.USER_AGENT,
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.APPTYPE.USERAGENT.TITLE',
|
titleI18nKey: 'APP.OIDC.SELECTION.APPTYPE.USERAGENT.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.APPTYPE.USERAGENT.DESCRIPTION',
|
descI18nKey: 'APP.OIDC.SELECTION.APPTYPE.USERAGENT.DESCRIPTION',
|
||||||
type: OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT,
|
createType: AppCreateType.OIDC,
|
||||||
|
oidcApplicationType: OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT,
|
||||||
prefix: 'UA',
|
prefix: 'UA',
|
||||||
background: '#6a506e',
|
background: '#6a506e',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const NATIVE_TYPE = {
|
export const NATIVE_TYPE = {
|
||||||
|
// key: AppType.NATIVE,
|
||||||
titleI18nKey: 'APP.OIDC.SELECTION.APPTYPE.NATIVE.TITLE',
|
titleI18nKey: 'APP.OIDC.SELECTION.APPTYPE.NATIVE.TITLE',
|
||||||
descI18nKey: 'APP.OIDC.SELECTION.APPTYPE.NATIVE.DESCRIPTION',
|
descI18nKey: 'APP.OIDC.SELECTION.APPTYPE.NATIVE.DESCRIPTION',
|
||||||
type: OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE,
|
createType: AppCreateType.OIDC,
|
||||||
|
oidcApplicationType: OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE,
|
||||||
prefix: 'N',
|
prefix: 'N',
|
||||||
background: '#595d80',
|
background: '#595d80',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const API_TYPE = {
|
||||||
|
// key: AppType.API,
|
||||||
|
titleI18nKey: 'APP.API.SELECTION.TITLE',
|
||||||
|
descI18nKey: 'APP.API.SELECTION.DESCRIPTION',
|
||||||
|
createType: AppCreateType.API,
|
||||||
|
prefix: 'API',
|
||||||
|
background: 'rgb(73,73,73)',
|
||||||
|
};
|
||||||
|
@ -15,8 +15,7 @@
|
|||||||
<span class="uri"
|
<span class="uri"
|
||||||
[ngClass]="{'green': !devMode && uri?.startsWith('https://'), 'red': !devMode && !uri?.startsWith('https://')}">{{uri}}</span>
|
[ngClass]="{'green': !devMode && uri?.startsWith('https://'), 'red': !devMode && !uri?.startsWith('https://')}">{{uri}}</span>
|
||||||
<span class="fill-space"></span>
|
<span class="fill-space"></span>
|
||||||
<i *ngIf="!devMode && !uri?.startsWith('https://')" class="las la-exclamation red"></i>
|
<i *ngIf="!devMode && !(uri | redirect : isNative)" class="las la-exclamation red"></i>
|
||||||
<!-- <i *ngIf="!devMode && uri?.startsWith('https://')" class="las la-check green"></i> -->
|
|
||||||
|
|
||||||
<button matTooltip="{{'ACTIONS.DELETE' | translate}}" mat-icon-button (click)="remove(uri)" class="icon-button">
|
<button matTooltip="{{'ACTIONS.DELETE' | translate}}" mat-icon-button (click)="remove(uri)" class="icon-button">
|
||||||
<mat-icon>cancel</mat-icon>
|
<mat-icon>cancel</mat-icon>
|
||||||
|
@ -1,24 +1,38 @@
|
|||||||
import { Component, EventEmitter, Input, OnInit } from '@angular/core';
|
import { Component, EventEmitter, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { FormControl } from '@angular/forms';
|
import { FormControl } from '@angular/forms';
|
||||||
|
import { Observable, Subscription } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'cnsl-redirect-uris',
|
selector: 'cnsl-redirect-uris',
|
||||||
templateUrl: './redirect-uris.component.html',
|
templateUrl: './redirect-uris.component.html',
|
||||||
styleUrls: ['./redirect-uris.component.scss']
|
styleUrls: ['./redirect-uris.component.scss']
|
||||||
})
|
})
|
||||||
export class RedirectUrisComponent implements OnInit {
|
export class RedirectUrisComponent implements OnInit, OnDestroy {
|
||||||
@Input() title: string = '';
|
@Input() title: string = '';
|
||||||
@Input() devMode: boolean = false;
|
@Input() devMode: boolean = false;
|
||||||
@Input() canWrite: boolean = false;
|
@Input() canWrite: boolean = false;
|
||||||
|
@Input() isNative!: boolean;
|
||||||
@Input() public urisList: string[] = [];
|
@Input() public urisList: string[] = [];
|
||||||
@Input() public redirectControl: FormControl = new FormControl({ value: '', disabled: true });
|
@Input() public redirectControl: FormControl = new FormControl({ value: '', disabled: true });
|
||||||
@Input() public changedUris: EventEmitter<string[]> = new EventEmitter();
|
@Input() public changedUris: EventEmitter<string[]> = new EventEmitter();
|
||||||
|
@Input() public getValues: Observable<void> = new Observable();
|
||||||
|
|
||||||
|
@ViewChild('redInput') input!: any;
|
||||||
|
private sub: Subscription = new Subscription();
|
||||||
constructor() { }
|
constructor() { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.canWrite) {
|
if (this.canWrite) {
|
||||||
this.redirectControl.enable();
|
this.redirectControl.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.sub = this.getValues.subscribe(() => {
|
||||||
|
this.add(this.input.nativeElement);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
this.sub.unsubscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
public add(input: any): void {
|
public add(input: any): void {
|
||||||
@ -33,7 +47,6 @@ export class RedirectUrisComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public remove(redirect: any): void {
|
public remove(redirect: any): void {
|
||||||
console.log(redirect);
|
|
||||||
const index = this.urisList.indexOf(redirect);
|
const index = this.urisList.indexOf(redirect);
|
||||||
|
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
|
@ -12,18 +12,23 @@
|
|||||||
|
|
||||||
<div [routerLink]="['/projects', projectId, 'apps', app.id ]" class="app-wrap"
|
<div [routerLink]="['/projects', projectId, 'apps', app.id ]" class="app-wrap"
|
||||||
*ngFor="let app of appsSubject | async"
|
*ngFor="let app of appsSubject | async"
|
||||||
matTooltip="{{'APP.OIDC.APPTYPE'+app.oidcConfig.applicationType | translate}}">
|
matTooltip="{{'ACTIONS.EDIT' | translate}}">
|
||||||
<cnsl-app-card class="grid-card" matRipple [type]="app.oidcConfig?.applicationType">
|
<cnsl-app-card class="grid-card" matRipple [type]="app.oidcConfig?.applicationType"
|
||||||
|
[isApiApp]="app.apiConfig !== undefined">
|
||||||
{{ app.name.charAt(0)}}
|
{{ app.name.charAt(0)}}
|
||||||
<i *ngIf="app.oidcConfig.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE"
|
<i *ngIf="app.oidcConfig?.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE"
|
||||||
class="las la-mobile"></i>
|
class="las la-mobile"></i>
|
||||||
<i *ngIf="app.oidcConfig.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB"
|
<i *ngIf="app.oidcConfig?.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB"
|
||||||
class="las la-code"></i>
|
class="las la-code"></i>
|
||||||
<i *ngIf="app.oidcConfig.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT"
|
<i *ngIf="app.oidcConfig?.applicationType == OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT"
|
||||||
class="las la-code"></i>
|
class="las la-code"></i>
|
||||||
|
<i *ngIf="app.apiConfig" class="las la-code"></i>
|
||||||
</cnsl-app-card>
|
</cnsl-app-card>
|
||||||
<span class="name">{{app.name}}</span>
|
<span class="name">{{app.name}}</span>
|
||||||
<span class="type">{{'APP.OIDC.APPTYPE'+app.oidcConfig.applicationType | translate}}</span>
|
<span *ngIf="app.oidcConfig?.applicationType !== undefined && app.oidcConfig?.applicationType !== null"
|
||||||
|
class="type">
|
||||||
|
{{'APP.OIDC.APPTYPE.'+app.oidcConfig?.applicationType | translate}}</span>
|
||||||
|
<span *ngIf="app.apiConfig !== undefined" class="type"> API</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -31,10 +31,14 @@
|
|||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<ng-container matColumnDef="type">
|
<ng-container matColumnDef="type">
|
||||||
<th mat-header-cell *matHeaderCellDef> {{ 'APP.OIDC.APPTYPE' | translate }} </th>
|
<th mat-header-cell *matHeaderCellDef> {{ 'APP.TYPE' | translate }} </th>
|
||||||
<td class="pointer" [routerLink]="['/projects', projectId, 'apps', app.id ]" mat-cell
|
<td class="pointer" [routerLink]="['/projects', projectId, 'apps', app.id ]" mat-cell
|
||||||
*matCellDef="let app">
|
*matCellDef="let app">
|
||||||
{{'APP.OIDC.APPTYPE'+app?.oidcConfig?.applicationType | translate}} </td>
|
<span *ngIf="app?.oidcConfig?.applicationType !== undefined && app?.oidcConfig?.applicationType !== null">
|
||||||
|
{{'APP.OIDC.APPTYPE.'+app?.oidcConfig?.applicationType | translate}}
|
||||||
|
</span>
|
||||||
|
<span *ngIf="app.apiConfig">API</span>
|
||||||
|
</td>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|
||||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||||
|
@ -19,9 +19,10 @@
|
|||||||
<div class="left">
|
<div class="left">
|
||||||
<span class="label">{{ 'USER.EMAIL' | translate }}</span>
|
<span class="label">{{ 'USER.EMAIL' | translate }}</span>
|
||||||
<span class="name">{{human?.email}}</span>
|
<span class="name">{{human?.email}}</span>
|
||||||
<span *ngIf="human?.isEmailVerified" class="state verified">{{'USER.EMAILVERIFIED' | translate}}</span>
|
<span *ngIf="human?.isEmailVerified" class="contact-state verified">{{'USER.EMAILVERIFIED' |
|
||||||
|
translate}}</span>
|
||||||
<div *ngIf="!human?.isEmailVerified" class="block">
|
<div *ngIf="!human?.isEmailVerified" class="block">
|
||||||
<span class="state notverified">{{'USER.NOTVERIFIED' | translate}}</span>
|
<span class="contact-state notverified">{{'USER.NOTVERIFIED' | translate}}</span>
|
||||||
|
|
||||||
<ng-container *ngIf="human?.email">
|
<ng-container *ngIf="human?.email">
|
||||||
<a *ngIf="canWrite && state != userStateEnum?.USERSTATE_INITIAL" class="verify"
|
<a *ngIf="canWrite && state != userStateEnum?.USERSTATE_INITIAL" class="verify"
|
||||||
@ -45,9 +46,10 @@
|
|||||||
<div class="left">
|
<div class="left">
|
||||||
<span class="label">{{ 'USER.PHONE' | translate }}</span>
|
<span class="label">{{ 'USER.PHONE' | translate }}</span>
|
||||||
<span class="name">{{human?.phone ? human.phone : ('USER.PHONEEMPTY' | translate)}}</span>
|
<span class="name">{{human?.phone ? human.phone : ('USER.PHONEEMPTY' | translate)}}</span>
|
||||||
<span *ngIf="human?.isPhoneVerified" class="state verified">{{'USER.PHONEVERIFIED' | translate}}</span>
|
<span *ngIf="human?.isPhoneVerified" class="contact-state verified">{{'USER.PHONEVERIFIED' |
|
||||||
|
translate}}</span>
|
||||||
<div *ngIf="!human?.isPhoneVerified" class="block">
|
<div *ngIf="!human?.isPhoneVerified" class="block">
|
||||||
<span class="state notverified">{{'USER.NOTVERIFIED' | translate}}</span>
|
<span class="contact-state notverified">{{'USER.NOTVERIFIED' | translate}}</span>
|
||||||
|
|
||||||
<ng-container *ngIf="human?.phone">
|
<ng-container *ngIf="human?.phone">
|
||||||
<a *ngIf="!disablePhoneCode && canWrite" class="verify"
|
<a *ngIf="!disablePhoneCode && canWrite" class="verify"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.state {
|
.contact-state {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-bottom: .5rem;
|
margin-bottom: .5rem;
|
||||||
|
|
||||||
|
@ -42,15 +42,13 @@ import { ContactComponent } from './contact/contact.component';
|
|||||||
import { DetailFormMachineModule } from './detail-form-machine/detail-form-machine.module';
|
import { DetailFormMachineModule } from './detail-form-machine/detail-form-machine.module';
|
||||||
import { DetailFormModule } from './detail-form/detail-form.module';
|
import { DetailFormModule } from './detail-form/detail-form.module';
|
||||||
import { ExternalIdpsComponent } from './external-idps/external-idps.component';
|
import { ExternalIdpsComponent } from './external-idps/external-idps.component';
|
||||||
import { AddKeyDialogModule } from './machine-keys/add-key-dialog/add-key-dialog.module';
|
|
||||||
import { MachineKeysComponent } from './machine-keys/machine-keys.component';
|
|
||||||
import { ShowKeyDialogModule } from './machine-keys/show-key-dialog/show-key-dialog.module';
|
|
||||||
import { MembershipsComponent } from './memberships/memberships.component';
|
import { MembershipsComponent } from './memberships/memberships.component';
|
||||||
import { PasswordComponent } from './password/password.component';
|
import { PasswordComponent } from './password/password.component';
|
||||||
import { UserDetailRoutingModule } from './user-detail-routing.module';
|
import { UserDetailRoutingModule } from './user-detail-routing.module';
|
||||||
import { PasswordlessComponent } from './user-detail/passwordless/passwordless.component';
|
import { PasswordlessComponent } from './user-detail/passwordless/passwordless.component';
|
||||||
import { UserDetailComponent } from './user-detail/user-detail.component';
|
import { UserDetailComponent } from './user-detail/user-detail.component';
|
||||||
import { UserMfaComponent } from './user-detail/user-mfa/user-mfa.component';
|
import { UserMfaComponent } from './user-detail/user-mfa/user-mfa.component';
|
||||||
|
import { MachineKeysModule } from 'src/app/modules/machine-keys/machine-keys.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [
|
declarations: [
|
||||||
@ -66,7 +64,6 @@ import { UserMfaComponent } from './user-detail/user-mfa/user-mfa.component';
|
|||||||
PasswordComponent,
|
PasswordComponent,
|
||||||
CodeDialogComponent,
|
CodeDialogComponent,
|
||||||
MembershipsComponent,
|
MembershipsComponent,
|
||||||
MachineKeysComponent,
|
|
||||||
ExternalIdpsComponent,
|
ExternalIdpsComponent,
|
||||||
ContactComponent,
|
ContactComponent,
|
||||||
ResendEmailDialogComponent,
|
ResendEmailDialogComponent,
|
||||||
@ -84,8 +81,6 @@ import { UserMfaComponent } from './user-detail/user-mfa/user-mfa.component';
|
|||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
QRCodeModule,
|
QRCodeModule,
|
||||||
MetaLayoutModule,
|
MetaLayoutModule,
|
||||||
AddKeyDialogModule,
|
|
||||||
ShowKeyDialogModule,
|
|
||||||
MatCheckboxModule,
|
MatCheckboxModule,
|
||||||
HasRolePipeModule,
|
HasRolePipeModule,
|
||||||
UserGrantsModule,
|
UserGrantsModule,
|
||||||
@ -108,6 +103,7 @@ import { UserMfaComponent } from './user-detail/user-mfa/user-mfa.component';
|
|||||||
TimestampToDatePipeModule,
|
TimestampToDatePipeModule,
|
||||||
LocalizedDatePipeModule,
|
LocalizedDatePipeModule,
|
||||||
InputModule,
|
InputModule,
|
||||||
|
MachineKeysModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class UserDetailModule { }
|
export class UserDetailModule { }
|
||||||
|
@ -51,7 +51,6 @@ export class PasswordlessComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
public getPasswordless(): void {
|
public getPasswordless(): void {
|
||||||
this.service.GetPasswordless(this.user.id).then(passwordless => {
|
this.service.GetPasswordless(this.user.id).then(passwordless => {
|
||||||
console.log(passwordless.toObject().tokensList);
|
|
||||||
this.dataSource = new MatTableDataSource(passwordless.toObject().tokensList);
|
this.dataSource = new MatTableDataSource(passwordless.toObject().tokensList);
|
||||||
this.dataSource.sort = this.sort;
|
this.dataSource.sort = this.sort;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
@ -47,7 +47,6 @@ export class UserMfaComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
public getMFAs(): void {
|
public getMFAs(): void {
|
||||||
this.mgmtUserService.getUserMfas(this.user.id).then(mfas => {
|
this.mgmtUserService.getUserMfas(this.user.id).then(mfas => {
|
||||||
console.log(mfas.toObject().mfasList);
|
|
||||||
this.dataSource = new MatTableDataSource(mfas.toObject().mfasList);
|
this.dataSource = new MatTableDataSource(mfas.toObject().mfasList);
|
||||||
this.dataSource.sort = this.sort;
|
this.dataSource.sort = this.sort;
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
@ -56,7 +55,6 @@ export class UserMfaComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public deleteMFA(type: MfaType, id?: string): void {
|
public deleteMFA(type: MfaType, id?: string): void {
|
||||||
console.log(type, id);
|
|
||||||
const dialogRef = this.dialog.open(WarnDialogComponent, {
|
const dialogRef = this.dialog.open(WarnDialogComponent, {
|
||||||
data: {
|
data: {
|
||||||
confirmKey: 'ACTIONS.DELETE',
|
confirmKey: 'ACTIONS.DELETE',
|
||||||
@ -82,7 +80,6 @@ export class UserMfaComponent implements OnInit, OnDestroy {
|
|||||||
this.toast.showError(error);
|
this.toast.showError(error);
|
||||||
});
|
});
|
||||||
} else if (type === MfaType.MFATYPE_U2F && id) {
|
} else if (type === MfaType.MFATYPE_U2F && id) {
|
||||||
console.log(this.user.id, id);
|
|
||||||
this.mgmtUserService.RemoveMfaU2F(this.user.id, id).then(() => {
|
this.mgmtUserService.RemoveMfaU2F(this.user.id, id).then(() => {
|
||||||
this.toast.showInfo('USER.TOAST.U2FREMOVED', true);
|
this.toast.showInfo('USER.TOAST.U2FREMOVED', true);
|
||||||
|
|
||||||
|
@ -69,21 +69,3 @@
|
|||||||
td {
|
td {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.state {
|
|
||||||
border-radius: 50vw;
|
|
||||||
padding: 2px .5rem;
|
|
||||||
letter-spacing: .05em;
|
|
||||||
font-size: 11px;
|
|
||||||
background-color: #8795a120;
|
|
||||||
|
|
||||||
&.active {
|
|
||||||
background-color: #85d996;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.inactive {
|
|
||||||
background-color: #ff8981;
|
|
||||||
color: black;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
18
console/src/app/pipes/redirect-pipe/redirect-pipe.module.ts
Normal file
18
console/src/app/pipes/redirect-pipe/redirect-pipe.module.ts
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
|
||||||
|
import { RedirectPipe } from './redirect.pipe';
|
||||||
|
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
declarations: [
|
||||||
|
RedirectPipe,
|
||||||
|
],
|
||||||
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
],
|
||||||
|
exports: [
|
||||||
|
RedirectPipe,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class RedirectPipeModule { }
|
25
console/src/app/pipes/redirect-pipe/redirect.pipe.ts
Normal file
25
console/src/app/pipes/redirect-pipe/redirect.pipe.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { Pipe, PipeTransform } from '@angular/core';
|
||||||
|
|
||||||
|
@Pipe({
|
||||||
|
name: 'redirect',
|
||||||
|
})
|
||||||
|
export class RedirectPipe implements PipeTransform {
|
||||||
|
public transform(uri: string, isNative: boolean): boolean {
|
||||||
|
if (isNative) {
|
||||||
|
if (uri.startsWith('http://localhost')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!uri.startsWith('https://') && !uri.startsWith('http://')) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (uri.startsWith('https://')) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,10 +5,16 @@ import { BehaviorSubject } from 'rxjs';
|
|||||||
|
|
||||||
import { MultiFactorsResult } from '../proto/generated/admin_pb';
|
import { MultiFactorsResult } from '../proto/generated/admin_pb';
|
||||||
import {
|
import {
|
||||||
|
AddClientKeyRequest,
|
||||||
|
AddClientKeyResponse,
|
||||||
AddMachineKeyRequest,
|
AddMachineKeyRequest,
|
||||||
AddMachineKeyResponse,
|
AddMachineKeyResponse,
|
||||||
AddOrgDomainRequest,
|
AddOrgDomainRequest,
|
||||||
AddOrgMemberRequest,
|
AddOrgMemberRequest,
|
||||||
|
APIApplicationCreate,
|
||||||
|
APIAuthMethodType,
|
||||||
|
APIConfig,
|
||||||
|
APIConfigUpdate,
|
||||||
Application,
|
Application,
|
||||||
ApplicationID,
|
ApplicationID,
|
||||||
ApplicationSearchQuery,
|
ApplicationSearchQuery,
|
||||||
@ -16,9 +22,14 @@ import {
|
|||||||
ApplicationSearchResponse,
|
ApplicationSearchResponse,
|
||||||
ApplicationUpdate,
|
ApplicationUpdate,
|
||||||
ApplicationView,
|
ApplicationView,
|
||||||
|
AuthNKeyType,
|
||||||
ChangeOrgMemberRequest,
|
ChangeOrgMemberRequest,
|
||||||
ChangeRequest,
|
ChangeRequest,
|
||||||
Changes,
|
Changes,
|
||||||
|
ClientKeyIDRequest,
|
||||||
|
ClientKeySearchRequest,
|
||||||
|
ClientKeySearchResponse,
|
||||||
|
ClientSecret,
|
||||||
CreateHumanRequest,
|
CreateHumanRequest,
|
||||||
CreateMachineRequest,
|
CreateMachineRequest,
|
||||||
CreateUserRequest,
|
CreateUserRequest,
|
||||||
@ -365,6 +376,23 @@ export class ManagementService {
|
|||||||
return this.grpcService.mgmt.addMachineKey(req);
|
return this.grpcService.mgmt.addMachineKey(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public addClientKey(
|
||||||
|
projectId: string,
|
||||||
|
appId: string,
|
||||||
|
type: AuthNKeyType,
|
||||||
|
date?: Timestamp,
|
||||||
|
): Promise<AddClientKeyResponse> {
|
||||||
|
const req = new AddClientKeyRequest();
|
||||||
|
req.setType(type);
|
||||||
|
req.setProjectId(projectId);
|
||||||
|
req.setApplicationId(appId);
|
||||||
|
if (date) {
|
||||||
|
req.setExpirationDate(date);
|
||||||
|
}
|
||||||
|
return this.grpcService.mgmt.addClientKey(req);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public DeleteMachineKey(
|
public DeleteMachineKey(
|
||||||
keyId: string,
|
keyId: string,
|
||||||
userId: string,
|
userId: string,
|
||||||
@ -376,6 +404,20 @@ export class ManagementService {
|
|||||||
return this.grpcService.mgmt.deleteMachineKey(req);
|
return this.grpcService.mgmt.deleteMachineKey(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DeleteClientKey(
|
||||||
|
keyId: string,
|
||||||
|
projectId: string,
|
||||||
|
appId: string,
|
||||||
|
): Promise<Empty> {
|
||||||
|
const req = new ClientKeyIDRequest();
|
||||||
|
req.setKeyId(keyId);
|
||||||
|
req.setProjectId(projectId);
|
||||||
|
req.setApplicationId(appId);
|
||||||
|
console.log(keyId, projectId, appId);
|
||||||
|
|
||||||
|
return this.grpcService.mgmt.deleteClientKey(req);
|
||||||
|
}
|
||||||
|
|
||||||
public SearchMachineKeys(
|
public SearchMachineKeys(
|
||||||
userId: string,
|
userId: string,
|
||||||
limit: number,
|
limit: number,
|
||||||
@ -392,6 +434,24 @@ export class ManagementService {
|
|||||||
return this.grpcService.mgmt.searchMachineKeys(req);
|
return this.grpcService.mgmt.searchMachineKeys(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SearchClientKeys(
|
||||||
|
projectId: string,
|
||||||
|
appId: string,
|
||||||
|
limit: number,
|
||||||
|
offset: number,
|
||||||
|
asc?: boolean,
|
||||||
|
): Promise<ClientKeySearchResponse> {
|
||||||
|
const req = new ClientKeySearchRequest();
|
||||||
|
req.setProjectId(projectId);
|
||||||
|
req.setApplicationId(appId);
|
||||||
|
req.setLimit(limit);
|
||||||
|
req.setOffset(offset);
|
||||||
|
if (asc) {
|
||||||
|
req.setAsc(asc);
|
||||||
|
}
|
||||||
|
return this.grpcService.mgmt.searchClientKeys(req);
|
||||||
|
}
|
||||||
|
|
||||||
public RemoveExternalIDP(
|
public RemoveExternalIDP(
|
||||||
externalUserId: string,
|
externalUserId: string,
|
||||||
idpConfigId: string,
|
idpConfigId: string,
|
||||||
@ -974,6 +1034,7 @@ export class ManagementService {
|
|||||||
req.setId(id);
|
req.setId(id);
|
||||||
req.setSecId(secId);
|
req.setSecId(secId);
|
||||||
req.setLimit(limit);
|
req.setLimit(limit);
|
||||||
|
req.setAsc(false);
|
||||||
req.setSequenceOffset(offset);
|
req.setSequenceOffset(offset);
|
||||||
return this.grpcService.mgmt.applicationChanges(req);
|
return this.grpcService.mgmt.applicationChanges(req);
|
||||||
}
|
}
|
||||||
@ -982,6 +1043,7 @@ export class ManagementService {
|
|||||||
const req = new ChangeRequest();
|
const req = new ChangeRequest();
|
||||||
req.setId(id);
|
req.setId(id);
|
||||||
req.setLimit(limit);
|
req.setLimit(limit);
|
||||||
|
req.setAsc(false);
|
||||||
req.setSequenceOffset(offset);
|
req.setSequenceOffset(offset);
|
||||||
return this.grpcService.mgmt.orgChanges(req);
|
return this.grpcService.mgmt.orgChanges(req);
|
||||||
}
|
}
|
||||||
@ -990,6 +1052,7 @@ export class ManagementService {
|
|||||||
const req = new ChangeRequest();
|
const req = new ChangeRequest();
|
||||||
req.setId(id);
|
req.setId(id);
|
||||||
req.setLimit(limit);
|
req.setLimit(limit);
|
||||||
|
req.setAsc(false);
|
||||||
req.setSequenceOffset(offset);
|
req.setSequenceOffset(offset);
|
||||||
return this.grpcService.mgmt.projectChanges(req);
|
return this.grpcService.mgmt.projectChanges(req);
|
||||||
}
|
}
|
||||||
@ -998,6 +1061,7 @@ export class ManagementService {
|
|||||||
const req = new ChangeRequest();
|
const req = new ChangeRequest();
|
||||||
req.setId(id);
|
req.setId(id);
|
||||||
req.setLimit(limit);
|
req.setLimit(limit);
|
||||||
|
req.setAsc(false);
|
||||||
req.setSequenceOffset(sequenceoffset);
|
req.setSequenceOffset(sequenceoffset);
|
||||||
return this.grpcService.mgmt.userChanges(req);
|
return this.grpcService.mgmt.userChanges(req);
|
||||||
}
|
}
|
||||||
@ -1208,13 +1272,20 @@ export class ManagementService {
|
|||||||
return this.grpcService.mgmt.deactivateApplication(req);
|
return this.grpcService.mgmt.deactivateApplication(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RegenerateOIDCClientSecret(id: string, projectId: string): Promise<any> {
|
public RegenerateOIDCClientSecret(id: string, projectId: string): Promise<ClientSecret> {
|
||||||
const req = new ApplicationID();
|
const req = new ApplicationID();
|
||||||
req.setId(id);
|
req.setId(id);
|
||||||
req.setProjectId(projectId);
|
req.setProjectId(projectId);
|
||||||
return this.grpcService.mgmt.regenerateOIDCClientSecret(req);
|
return this.grpcService.mgmt.regenerateOIDCClientSecret(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RegenerateAPIClientSecret(id: string, projectId: string): Promise<ClientSecret> {
|
||||||
|
const req = new ApplicationID();
|
||||||
|
req.setId(id);
|
||||||
|
req.setProjectId(projectId);
|
||||||
|
return this.grpcService.mgmt.regenerateAPIClientSecret(req);
|
||||||
|
}
|
||||||
|
|
||||||
public SearchProjectRoles(
|
public SearchProjectRoles(
|
||||||
projectId: string,
|
projectId: string,
|
||||||
limit: number,
|
limit: number,
|
||||||
@ -1351,6 +1422,15 @@ export class ManagementService {
|
|||||||
return this.grpcService.mgmt.createOIDCApplication(req);
|
return this.grpcService.mgmt.createOIDCApplication(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CreateAPIApplication(app: APIApplicationCreate.AsObject): Promise<Application> {
|
||||||
|
const req = new APIApplicationCreate();
|
||||||
|
req.setProjectId(app.projectId);
|
||||||
|
req.setName(app.name);
|
||||||
|
req.setAuthMethodType(app.authMethodType);
|
||||||
|
|
||||||
|
return this.grpcService.mgmt.createAPIApplication(req);
|
||||||
|
}
|
||||||
|
|
||||||
public UpdateApplication(projectId: string, appId: string, name: string): Promise<Application> {
|
public UpdateApplication(projectId: string, appId: string, name: string): Promise<Application> {
|
||||||
const req = new ApplicationUpdate();
|
const req = new ApplicationUpdate();
|
||||||
req.setId(appId);
|
req.setId(appId);
|
||||||
@ -1363,6 +1443,10 @@ export class ManagementService {
|
|||||||
return this.grpcService.mgmt.updateApplicationOIDCConfig(req);
|
return this.grpcService.mgmt.updateApplicationOIDCConfig(req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UpdateAPIAppConfig(req: APIConfigUpdate): Promise<APIConfig> {
|
||||||
|
return this.grpcService.mgmt.updateApplicationAPIConfig(req);
|
||||||
|
}
|
||||||
|
|
||||||
public RemoveApplication(projectId: string, appId: string): Promise<Empty> {
|
public RemoveApplication(projectId: string, appId: string): Promise<Empty> {
|
||||||
const req = new ApplicationID();
|
const req = new ApplicationID();
|
||||||
req.setId(appId);
|
req.setId(appId);
|
||||||
|
@ -99,6 +99,7 @@
|
|||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"SAVE": "Speichern",
|
"SAVE": "Speichern",
|
||||||
|
"SAVENOW":"Speichern",
|
||||||
"NEW": "Neu",
|
"NEW": "Neu",
|
||||||
"ADD":"Hinzufügen",
|
"ADD":"Hinzufügen",
|
||||||
"CREATE": "Erstellen",
|
"CREATE": "Erstellen",
|
||||||
@ -833,6 +834,9 @@
|
|||||||
"DELETED":"Projekt gelöscht."
|
"DELETED":"Projekt gelöscht."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"NEXTSTEPS": {
|
||||||
|
"TITLE":"Nächste Schritte"
|
||||||
|
},
|
||||||
"IDP":{
|
"IDP":{
|
||||||
"LIST": {
|
"LIST": {
|
||||||
"TITLE":"Identitäts Provider",
|
"TITLE":"Identitäts Provider",
|
||||||
@ -969,7 +973,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"NEXTSTEPS": {
|
"NEXTSTEPS": {
|
||||||
"TITLE":"Nächste Schritte",
|
|
||||||
"0": {
|
"0": {
|
||||||
"TITLE":"Rollen festlegen",
|
"TITLE":"Rollen festlegen",
|
||||||
"DESC":"Erfassen Sie Rollen für ihr Projekt"
|
"DESC":"Erfassen Sie Rollen für ihr Projekt"
|
||||||
@ -986,8 +989,14 @@
|
|||||||
},
|
},
|
||||||
"NAME": "Name",
|
"NAME": "Name",
|
||||||
"TYPE":"Anwendungstyp",
|
"TYPE":"Anwendungstyp",
|
||||||
|
"AUTHMETHOD":"Authentifizierungsmethode",
|
||||||
|
"AUTHMETHODSECTION":"Authentifizierungsmethode",
|
||||||
"GRANT":"Berechtigungstypen",
|
"GRANT":"Berechtigungstypen",
|
||||||
"OIDC": {
|
"OIDC": {
|
||||||
|
"INFO": {
|
||||||
|
"ISSUER":"Issuer",
|
||||||
|
"CLIENTID":"Client Id"
|
||||||
|
},
|
||||||
"CURRENT":"Aktuelle Konfiguration",
|
"CURRENT":"Aktuelle Konfiguration",
|
||||||
"TOKENSECTIONTITLE":"AuthToken Optionen",
|
"TOKENSECTIONTITLE":"AuthToken Optionen",
|
||||||
"REDIRECTSECTIONTITLE":"Weiterleitungseinstellungen",
|
"REDIRECTSECTIONTITLE":"Weiterleitungseinstellungen",
|
||||||
@ -1012,26 +1021,32 @@
|
|||||||
"REDIRECT": "Weiterleitungs-URIs",
|
"REDIRECT": "Weiterleitungs-URIs",
|
||||||
"REDIRECTSECTION": "Weiterleitungs-URIs",
|
"REDIRECTSECTION": "Weiterleitungs-URIs",
|
||||||
"POSTLOGOUTREDIRECT":"URIs für Post-Log-out",
|
"POSTLOGOUTREDIRECT":"URIs für Post-Log-out",
|
||||||
"RESPONSE": "Antworttypen",
|
|
||||||
"RESPONSESECTION": "Antworttypen",
|
"RESPONSESECTION": "Antworttypen",
|
||||||
"GRANT": "Berechtigungstypen",
|
|
||||||
"GRANTSECTION":"Berechtigungstypen",
|
"GRANTSECTION":"Berechtigungstypen",
|
||||||
"GRANTTITLE":"Wähle Deine Berechtigungstypen aus. Hinweis: \"Implizit\" ist nur für browser-basierte Anwendungen verfügbar.",
|
"GRANTTITLE":"Wähle Deine Berechtigungstypen aus. Hinweis: \"Implizit\" ist nur für browser-basierte Anwendungen verfügbar.",
|
||||||
"APPTYPE": "Anwendungstypen",
|
"APPTYPE": {
|
||||||
"RESPONSE0": "Code",
|
"0": "Web",
|
||||||
"RESPONSE1": "ID-Token",
|
"1": "User Agent",
|
||||||
"RESPONSE2": "Token-ID-Token",
|
"2": "Native"
|
||||||
"GRANT0": "Authorisation Code",
|
},
|
||||||
"GRANT1": "Implicit",
|
"RESPONSETYPE": "Antworttypen",
|
||||||
"GRANT2": "Refresh Token",
|
"RESPONSE": {
|
||||||
"APPTYPE0": "Web",
|
"0": "Code",
|
||||||
"APPTYPE1": "User Agent",
|
"1": "ID-Token",
|
||||||
"APPTYPE2": "Native",
|
"2": "Token-ID-Token"
|
||||||
"AUTHMETHOD":"Authentifizierungsmethode",
|
},
|
||||||
"AUTHMETHODSECTION":"Authentifizierungsmethode",
|
"GRANTTYPE": "Berechtigungstypen",
|
||||||
"AUTHMETHOD0":"Basic",
|
"GRANT": {
|
||||||
"AUTHMETHOD1":"Post",
|
"0": "Authorisation Code",
|
||||||
"AUTHMETHOD2":"None",
|
"1": "Implicit",
|
||||||
|
"2": "Refresh Token"
|
||||||
|
},
|
||||||
|
"AUTHMETHOD": {
|
||||||
|
"0":"Basic",
|
||||||
|
"1":"Post",
|
||||||
|
"2":"None",
|
||||||
|
"3":"Private Key JWT"
|
||||||
|
},
|
||||||
"TOKENTYPE":"Auth Token Typ",
|
"TOKENTYPE":"Auth Token Typ",
|
||||||
"TOKENTYPE0": "Bearer Token",
|
"TOKENTYPE0": "Bearer Token",
|
||||||
"TOKENTYPE1": "JWT",
|
"TOKENTYPE1": "JWT",
|
||||||
@ -1054,48 +1069,65 @@
|
|||||||
"DESCRIPTION":"Standard Web applications wie .net, PHP, Node.js, Java, etc."
|
"DESCRIPTION":"Standard Web applications wie .net, PHP, Node.js, Java, etc."
|
||||||
},
|
},
|
||||||
"NATIVE": {
|
"NATIVE": {
|
||||||
"TITLE":"NATIVE",
|
"TITLE":"Native",
|
||||||
"DESCRIPTION":"Mobile Apps, Desktop, Smart Devices, etc."
|
"DESCRIPTION":"Mobile Apps, Desktop, Smart Devices, etc."
|
||||||
},
|
},
|
||||||
"USERAGENT": {
|
"USERAGENT": {
|
||||||
"TITLE":"User Agent",
|
"TITLE":"User Agent",
|
||||||
"DESCRIPTION":"Single Page Applications (SPA) und grundsätzlich alle im Browser aufgeführten JS Frameworks"
|
"DESCRIPTION":"Single Page Applications (SPA) und grundsätzlich alle im Browser aufgeführten JS Frameworks"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"AUTHMETHOD": {
|
|
||||||
"CODE": {
|
|
||||||
"TITLE":"Code",
|
|
||||||
"DESCRIPTION":"Tausche den Authorization Code gegen Tokens ein"
|
|
||||||
},
|
|
||||||
"PKCE": {
|
|
||||||
"TITLE":"PKCE",
|
|
||||||
"DESCRIPTION":"Nutze einen Zufalls Hash Wert anstelle des Client Secret für mehr Sicherheit"
|
|
||||||
},
|
|
||||||
"POST": {
|
|
||||||
"TITLE":"POST",
|
|
||||||
"DESCRIPTION":"Sende client_id und client_secret im (HTML) Formular"
|
|
||||||
},
|
|
||||||
"PK_JWT": {
|
|
||||||
"TITLE":"Private Key JWT",
|
|
||||||
"DESCRIPTION":"Nutze einen Private Key um deine Application zu authentifizieren"
|
|
||||||
},
|
|
||||||
"IMPLICIT": {
|
|
||||||
"TITLE":"Implicit",
|
|
||||||
"DESCRIPTION":"Erhalte die Token direkt vom authorize Endpoint"
|
|
||||||
},
|
|
||||||
"CUSTOM": {
|
|
||||||
"TITLE":"Custom",
|
|
||||||
"DESCRIPTION":"Deine Konfiguration entspricht keiner anderen Option."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"API": {
|
||||||
|
"REGENERATESECRET": "Client Secret neu generieren",
|
||||||
|
"SELECTION":{
|
||||||
|
"TITLE":"API",
|
||||||
|
"DESCRIPTION":"APIs im Allgemeinen"
|
||||||
|
},
|
||||||
|
"AUTHMETHOD": {
|
||||||
|
"0":"Basic",
|
||||||
|
"1":"Private Key JWT"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AUTHMETHODS": {
|
||||||
|
"CODE": {
|
||||||
|
"TITLE":"Code",
|
||||||
|
"DESCRIPTION":"Tausche den Authorization Code gegen Tokens ein"
|
||||||
|
},
|
||||||
|
"PKCE": {
|
||||||
|
"TITLE":"PKCE",
|
||||||
|
"DESCRIPTION":"Nutze einen Zufalls Hash Wert anstelle des Client Secret für mehr Sicherheit"
|
||||||
|
},
|
||||||
|
"POST": {
|
||||||
|
"TITLE":"POST",
|
||||||
|
"DESCRIPTION":"Sende client_id und client_secret im (HTML) Formular"
|
||||||
|
},
|
||||||
|
"PK_JWT": {
|
||||||
|
"TITLE":"Private Key JWT",
|
||||||
|
"DESCRIPTION":"Nutze einen Private Key um deine Application zu authentifizieren"
|
||||||
|
},
|
||||||
|
"BASIC": {
|
||||||
|
"TITLE":"Basic",
|
||||||
|
"DESCRIPTION":"Authentifizierung mittels Nutzername und Passwort"
|
||||||
|
},
|
||||||
|
"IMPLICIT": {
|
||||||
|
"TITLE":"Implicit",
|
||||||
|
"DESCRIPTION":"Erhalte die Token direkt vom authorize Endpoint"
|
||||||
|
},
|
||||||
|
"CUSTOM": {
|
||||||
|
"TITLE":"Custom",
|
||||||
|
"DESCRIPTION":"Deine Konfiguration entspricht keiner anderen Option."
|
||||||
|
}
|
||||||
|
},
|
||||||
"TOAST": {
|
"TOAST": {
|
||||||
"REACTIVATED":"Anwendung reaktiviert.",
|
"REACTIVATED":"Anwendung reaktiviert.",
|
||||||
"DEACTIVATED":"Anwendung deaktiviert.",
|
"DEACTIVATED":"Anwendung deaktiviert.",
|
||||||
"OIDCUPDATED":"OIDC-Konfiguration geändert.",
|
"OIDCUPDATED":"OIDC-Konfiguration geändert.",
|
||||||
"OIDCCLIENTSECRETREGENERATED":"OIDC-Client Secret generiert.",
|
"UPDATED":"App geändert.",
|
||||||
"DELETED":"App gelöscht."
|
"CLIENTSECRETREGENERATED":"Client Secret generiert.",
|
||||||
|
"DELETED":"App gelöscht.",
|
||||||
|
"CONFIGCHANGED":"Konfigurationsänderung entdeckt."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GENDERS": {
|
"GENDERS": {
|
||||||
|
@ -99,6 +99,7 @@
|
|||||||
},
|
},
|
||||||
"ACTIONS": {
|
"ACTIONS": {
|
||||||
"SAVE": "Save",
|
"SAVE": "Save",
|
||||||
|
"SAVENOW":"Save now",
|
||||||
"NEW": "New",
|
"NEW": "New",
|
||||||
"ADD":"Add",
|
"ADD":"Add",
|
||||||
"CREATE": "Create",
|
"CREATE": "Create",
|
||||||
@ -589,7 +590,7 @@
|
|||||||
},
|
},
|
||||||
"LOGIN_POLICY": {
|
"LOGIN_POLICY": {
|
||||||
"TITLE":"Login Policy",
|
"TITLE":"Login Policy",
|
||||||
"DESCRIPTION":"Define how Users can be authenticated",
|
"DESCRIPTION":"Define how Users can be authenticated and configure Identity Providers",
|
||||||
"DESCRIPTIONCREATEADMIN":"Users can choose from the available identity providers below.",
|
"DESCRIPTIONCREATEADMIN":"Users can choose from the available identity providers below.",
|
||||||
"DESCRIPTIONCREATEMGMT":"Users can choose from the available identity providers below. Note: You can use System-set providers as well as providers set for your organisation only.",
|
"DESCRIPTIONCREATEMGMT":"Users can choose from the available identity providers below. Note: You can use System-set providers as well as providers set for your organisation only.",
|
||||||
"SAVED":"Saved successfully!"
|
"SAVED":"Saved successfully!"
|
||||||
@ -833,6 +834,9 @@
|
|||||||
"DELETED":"Deleted Project."
|
"DELETED":"Deleted Project."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"NEXTSTEPS": {
|
||||||
|
"TITLE":"Next Steps"
|
||||||
|
},
|
||||||
"IDP":{
|
"IDP":{
|
||||||
"LIST": {
|
"LIST": {
|
||||||
"TITLE":"Identity Providers",
|
"TITLE":"Identity Providers",
|
||||||
@ -859,7 +863,7 @@
|
|||||||
"1":"active",
|
"1":"active",
|
||||||
"2":"inactive"
|
"2":"inactive"
|
||||||
},
|
},
|
||||||
"MAPPINTFIELD": {
|
"MAPPINGFIELD": {
|
||||||
"1": "Preferred Username",
|
"1": "Preferred Username",
|
||||||
"2": "Email"
|
"2": "Email"
|
||||||
},
|
},
|
||||||
@ -986,8 +990,14 @@
|
|||||||
},
|
},
|
||||||
"NAME": "Name",
|
"NAME": "Name",
|
||||||
"TYPE":"Application Type",
|
"TYPE":"Application Type",
|
||||||
|
"AUTHMETHOD":"Authentication Method",
|
||||||
|
"AUTHMETHODSECTION":"Authentication Method",
|
||||||
"GRANT":"Grant Types",
|
"GRANT":"Grant Types",
|
||||||
"OIDC": {
|
"OIDC": {
|
||||||
|
"INFO": {
|
||||||
|
"ISSUER":"Issuer",
|
||||||
|
"CLIENTID":"Client Id"
|
||||||
|
},
|
||||||
"CURRENT":"Current Config",
|
"CURRENT":"Current Config",
|
||||||
"TOKENSECTIONTITLE":"AuthToken Options",
|
"TOKENSECTIONTITLE":"AuthToken Options",
|
||||||
"REDIRECTSECTIONTITLE":"Redirect Settings",
|
"REDIRECTSECTIONTITLE":"Redirect Settings",
|
||||||
@ -1012,26 +1022,32 @@
|
|||||||
"REDIRECT": "Redirect URIs",
|
"REDIRECT": "Redirect URIs",
|
||||||
"REDIRECTSECTION": "Redirect URIs",
|
"REDIRECTSECTION": "Redirect URIs",
|
||||||
"POSTLOGOUTREDIRECT":"Post Logout URIs",
|
"POSTLOGOUTREDIRECT":"Post Logout URIs",
|
||||||
"RESPONSE": "Response Types",
|
|
||||||
"RESPONSESECTION": "Response Types",
|
"RESPONSESECTION": "Response Types",
|
||||||
"GRANT": "Grant Types",
|
|
||||||
"GRANTSECTION":"Grant Types",
|
"GRANTSECTION":"Grant Types",
|
||||||
"GRANTTITLE":"Select your grant types. Note: Implicit is only available for browser-based applications.",
|
"GRANTTITLE":"Select your grant types. Note: Implicit is only available for browser-based applications.",
|
||||||
"APPTYPE": "Application Types",
|
"APPTYPE": {
|
||||||
"RESPONSE0": "Code",
|
"0": "Web",
|
||||||
"RESPONSE1": "ID Token",
|
"1": "User Agent",
|
||||||
"RESPONSE2": "Token-ID Token",
|
"2": "Native"
|
||||||
"GRANT0": "Authorization Code",
|
},
|
||||||
"GRANT1": "Implicit",
|
"RESPONSETYPE": "Response Types",
|
||||||
"GRANT2": "Refresh Token",
|
"RESPONSE": {
|
||||||
"APPTYPE0": "Web",
|
"0": "Code",
|
||||||
"APPTYPE1": "User Agent",
|
"1": "ID Token",
|
||||||
"APPTYPE2": "Native",
|
"2": "Token-ID Token"
|
||||||
"AUTHMETHOD":"Authentication Method",
|
},
|
||||||
"AUTHMETHODSECTION":"Authentication Method",
|
"GRANTTYPE": "Grant Types",
|
||||||
"AUTHMETHOD0":"Basic",
|
"GRANT": {
|
||||||
"AUTHMETHOD1":"Post",
|
"0": "Authorization Code",
|
||||||
"AUTHMETHOD2":"None",
|
"1": "Implicit",
|
||||||
|
"2": "Refresh Token"
|
||||||
|
},
|
||||||
|
"AUTHMETHOD": {
|
||||||
|
"0":"Basic",
|
||||||
|
"1":"Post",
|
||||||
|
"2":"None",
|
||||||
|
"3":"Private Key JWT"
|
||||||
|
},
|
||||||
"TOKENTYPE":"Auth Token Type",
|
"TOKENTYPE":"Auth Token Type",
|
||||||
"TOKENTYPE0": "Bearer Token",
|
"TOKENTYPE0": "Bearer Token",
|
||||||
"TOKENTYPE1": "JWT",
|
"TOKENTYPE1": "JWT",
|
||||||
@ -1054,48 +1070,65 @@
|
|||||||
"DESCRIPTION":"Regular Web applications like .net, PHP, Node.js, Java, etc."
|
"DESCRIPTION":"Regular Web applications like .net, PHP, Node.js, Java, etc."
|
||||||
},
|
},
|
||||||
"NATIVE": {
|
"NATIVE": {
|
||||||
"TITLE":"NATIVE",
|
"TITLE":"Native",
|
||||||
"DESCRIPTION":"Mobile Apps, Desktop, Smart Devices, etc."
|
"DESCRIPTION":"Mobile Apps, Desktop, Smart Devices, etc."
|
||||||
},
|
},
|
||||||
"USERAGENT": {
|
"USERAGENT": {
|
||||||
"TITLE":"User Agent",
|
"TITLE":"User Agent",
|
||||||
"DESCRIPTION":"Single Page Applications (SPA) and in general all JS frameworks executed in browsers"
|
"DESCRIPTION":"Single Page Applications (SPA) and in general all JS frameworks executed in browsers"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"AUTHMETHOD": {
|
|
||||||
"CODE": {
|
|
||||||
"TITLE":"Code",
|
|
||||||
"DESCRIPTION":"Exchange the authorization code for the tokens"
|
|
||||||
},
|
|
||||||
"PKCE": {
|
|
||||||
"TITLE":"PKCE",
|
|
||||||
"DESCRIPTION":"Use a random hash instead of a static client secret for more security"
|
|
||||||
},
|
|
||||||
"POST": {
|
|
||||||
"TITLE":"POST",
|
|
||||||
"DESCRIPTION":"Send client_id and client_secret as part of the form"
|
|
||||||
},
|
|
||||||
"PK_JWT": {
|
|
||||||
"TITLE":"Private Key JWT",
|
|
||||||
"DESCRIPTION":"Use a private key to authorize your application"
|
|
||||||
},
|
|
||||||
"IMPLICIT": {
|
|
||||||
"TITLE":"Implicit",
|
|
||||||
"DESCRIPTION":"Get the tokens directly from the authorization endpoint"
|
|
||||||
},
|
|
||||||
"CUSTOM": {
|
|
||||||
"TITLE":"Custom",
|
|
||||||
"DESCRIPTION":"Your setting doesn't correspond to any other option."
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"API": {
|
||||||
|
"REGENERATESECRET": "Regenerate Client Secret",
|
||||||
|
"SELECTION":{
|
||||||
|
"TITLE":"API",
|
||||||
|
"DESCRIPTION":"APIs in general"
|
||||||
|
},
|
||||||
|
"AUTHMETHOD": {
|
||||||
|
"0":"Basic",
|
||||||
|
"1":"Private Key JWT"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AUTHMETHODS": {
|
||||||
|
"CODE": {
|
||||||
|
"TITLE":"Code",
|
||||||
|
"DESCRIPTION":"Exchange the authorization code for the tokens"
|
||||||
|
},
|
||||||
|
"PKCE": {
|
||||||
|
"TITLE":"PKCE",
|
||||||
|
"DESCRIPTION":"Use a random hash instead of a static client secret for more security"
|
||||||
|
},
|
||||||
|
"POST": {
|
||||||
|
"TITLE":"POST",
|
||||||
|
"DESCRIPTION":"Send client_id and client_secret as part of the form"
|
||||||
|
},
|
||||||
|
"PK_JWT": {
|
||||||
|
"TITLE":"Private Key JWT",
|
||||||
|
"DESCRIPTION":"Use a private key to authorize your application"
|
||||||
|
},
|
||||||
|
"BASIC": {
|
||||||
|
"TITLE":"Basic",
|
||||||
|
"DESCRIPTION":"Authentication with Username and Passwort"
|
||||||
|
},
|
||||||
|
"IMPLICIT": {
|
||||||
|
"TITLE":"Implicit",
|
||||||
|
"DESCRIPTION":"Get the tokens directly from the authorization endpoint"
|
||||||
|
},
|
||||||
|
"CUSTOM": {
|
||||||
|
"TITLE":"Custom",
|
||||||
|
"DESCRIPTION":"Your setting doesn't correspond to any other option."
|
||||||
|
}
|
||||||
|
},
|
||||||
"TOAST": {
|
"TOAST": {
|
||||||
"REACTIVATED":"Application reactivated.",
|
"REACTIVATED":"Application reactivated.",
|
||||||
"DEACTIVATED":"Application deactivated.",
|
"DEACTIVATED":"Application deactivated.",
|
||||||
"OIDCUPDATED":"OIDC configuration updated.",
|
"OIDCUPDATED":"OIDC configuration updated.",
|
||||||
"OIDCCLIENTSECRETREGENERATED":"OIDC client secret generated.",
|
"UPDATED":"App updated.",
|
||||||
"DELETED":"App deleted."
|
"CLIENTSECRETREGENERATED":"client secret generated.",
|
||||||
|
"DELETED":"App deleted.",
|
||||||
|
"CONFIGCHANGED":"Changes detected!"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GENDERS": {
|
"GENDERS": {
|
||||||
|
BIN
console/src/assets/images/google.png
Normal file
BIN
console/src/assets/images/google.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
1
console/src/assets/mdi/api.svg
Normal file
1
console/src/assets/mdi/api.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M7 7H5A2 2 0 0 0 3 9V17H5V13H7V17H9V9A2 2 0 0 0 7 7M7 11H5V9H7M14 7H10V17H12V13H14A2 2 0 0 0 16 11V9A2 2 0 0 0 14 7M14 11H12V9H14M20 9V15H21V17H17V15H18V9H17V7H21V9Z" /></svg>
|
After Width: | Height: | Size: 460 B |
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user