feat(console): allow setting development mode when creating an OIDC app (#6593)

* fix: don't show verify domain if policy disabled

* feat: set dev mode on/off when oidc app is created

* fix: linting json files

* fix: add @peintnermax suggestions

---------

Co-authored-by: Max Peintner <max@caos.ch>
This commit is contained in:
Miguel Cabrerizo 2023-10-11 17:37:14 +02:00 committed by GitHub
parent dad1b4db7f
commit ef18cd2e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 72 additions and 8 deletions

View File

@ -2,7 +2,7 @@
title="{{ 'APP.PAGES.CREATE' | translate }}"
class="app-create-wrapper"
[createSteps]="
!devmode
!pro
? appType?.value?.createType === AppCreateType.OIDC
? appType?.value.oidcAppType !== OIDCAppType.OIDC_APP_TYPE_NATIVE
? 4
@ -20,13 +20,13 @@
<h1>{{ 'APP.PAGES.CREATE_DESC_TITLE' | translate }}</h1>
<mat-progress-bar class="progress-bar" color="primary" *ngIf="loading" mode="indeterminate"></mat-progress-bar>
<mat-checkbox class="proswitch" color="primary" [(ngModel)]="devmode">
<mat-checkbox class="proswitch" color="primary" [(ngModel)]="pro">
{{ 'APP.PROSWITCH' | translate }}
</mat-checkbox>
<mat-horizontal-stepper
class="stepper {{ 'last-edited-step-' + stepper.selectedIndex }}"
*ngIf="!devmode"
*ngIf="!pro"
linear
#stepper
labelPosition="bottom"
@ -109,6 +109,15 @@
{{ 'APP.OIDC.REDIRECTDESCRIPTIONWEB' | translate }}
</p>
<mat-slide-toggle
color="primary"
[(ngModel)]="devMode"
[ngModelOptions]="{ standalone: true }"
matTooltip="{{ 'APP.OIDC.DEVMODEDESC' | translate }}"
>
{{ 'APP.OIDC.DEVMODE' | translate }}
</mat-slide-toggle>
<cnsl-redirect-uris
class="redirect-section"
[disabled]="false"
@ -116,6 +125,7 @@
[(ngModel)]="redirectUris"
[getValues]="requestRedirectValuesSubject$"
title="{{ 'APP.OIDC.REDIRECT' | translate }}"
[devMode]="devMode"
data-e2e="redirect-uris"
>
</cnsl-redirect-uris>
@ -144,6 +154,7 @@
[getValues]="requestRedirectValuesSubject$"
title="{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}"
[isNative]="appType?.value.oidcAppType === OIDCAppType.OIDC_APP_TYPE_NATIVE"
[devMode]="devMode"
data-e2e="postlogout-uris"
>
</cnsl-redirect-uris>
@ -299,6 +310,19 @@
</div>
</ng-container>
<ng-container *ngIf="appType?.value?.createType === AppCreateType.OIDC">
<div class="row">
<span class="left cnsl-secondary-text">
{{ 'APP.OIDC.DEVMODE' | translate }}
</span>
<span class="right">
<span>
{{ devMode ? ('APP.OIDC.DEVMODE_ENABLED' | translate) : ('APP.OIDC.DEVMODE_DISABLED' | translate) }}
</span>
</span>
</div>
</ng-container>
<ng-container *ngIf="appType?.value?.createType === AppCreateType.API">
<div class="row">
<span class="left cnsl-secondary-text">
@ -342,7 +366,7 @@
</ng-template>
</mat-horizontal-stepper>
<div *ngIf="devmode" class="dev">
<div *ngIf="pro" class="dev">
<form [formGroup]="form" (ngSubmit)="createApp()" data-e2e="create-app-wizzard-3">
<div class="content">
<cnsl-form-field class="formfield">
@ -439,6 +463,14 @@
"
>
<div class="formfield full-width">
<mat-slide-toggle
color="primary"
[(ngModel)]="devMode"
[ngModelOptions]="{ standalone: true }"
matTooltip="{{ 'APP.OIDC.DEVMODEDESC' | translate }}"
>
{{ 'APP.OIDC.DEVMODE' | translate }}
</mat-slide-toggle>
<cnsl-redirect-uris
class="redirect-section"
[disabled]="false"

View File

@ -28,6 +28,7 @@ import { Breadcrumb, BreadcrumbService, BreadcrumbType } from 'src/app/services/
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
import { MatLegacySlideToggleChange } from '@angular/material/legacy-slide-toggle';
import { AppSecretDialogComponent } from '../app-secret-dialog/app-secret-dialog.component';
import {
BASIC_AUTH_METHOD,
@ -51,7 +52,7 @@ const MAX_ALLOWED_SIZE = 1 * 1024 * 1024;
export class AppCreateComponent implements OnInit, OnDestroy {
private subscription: Subscription = new Subscription();
private destroyed$: Subject<void> = new Subject();
public devmode: boolean = false;
public pro: boolean = false;
public projectId: string = '';
public loading: boolean = false;
@ -239,7 +240,16 @@ export class AppCreateComponent implements OnInit, OnDestroy {
this.oidcAppRequest.setPostLogoutRedirectUrisList(value);
}
public get devMode() {
return this.oidcAppRequest.toObject().devMode;
}
public set devMode(value: boolean) {
this.oidcAppRequest.setDevMode(value);
}
public ngOnInit(): void {
this.devMode = false;
this.subscription = this.route.params.subscribe((params) => this.getData(params));
const projectId = this.route.snapshot.paramMap.get('projectid');
@ -362,9 +372,9 @@ export class AppCreateComponent implements OnInit, OnDestroy {
}
public createApp(): void {
const appOIDCCheck = this.devmode ? this.isDevOIDC : this.isStepperOIDC;
const appAPICheck = this.devmode ? this.isDevAPI : this.isStepperAPI;
const appSAMLCheck = this.devmode ? this.isDevSAML : this.isStepperSAML;
const appOIDCCheck = this.pro ? this.isDevOIDC : this.isStepperOIDC;
const appAPICheck = this.pro ? this.isDevAPI : this.isStepperAPI;
const appSAMLCheck = this.pro ? this.isDevSAML : this.isStepperSAML;
if (appOIDCCheck) {
this.requestRedirectValuesSubject$.next();

View File

@ -1977,6 +1977,8 @@
"CLIENTSECRET_DESCRIPTION": "Пазете клиентската си тайна на сигурно място, тъй като тя ще изчезне, след като диалоговият прозорец бъде затворен.",
"REGENERATESECRET": "Повторно генериране на клиентска тайна",
"DEVMODE": "Режим на разработка",
"DEVMODE_ENABLED": "Активиран",
"DEVMODE_DISABLED": "Деактивиран",
"DEVMODEDESC": "Внимание: При активиран режим на разработка URI адресите за пренасочване няма да бъдат валидирани.",
"SKIPNATIVEAPPSUCCESSPAGE": "Пропуснете страницата за успешно влизане",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Пропуснете страницата за успех след влизане в това родно приложение.",

View File

@ -1986,6 +1986,8 @@
"CLIENTSECRET_DESCRIPTION": "Verwahre das Client Secret an einem sicheren Ort, da es nicht mehr angezeigt werden kann, sobald der Dialog geschlossen wird.",
"REGENERATESECRET": "Client Secret neu generieren",
"DEVMODE": "Entwicklermodus",
"DEVMODE_ENABLED": "Aktiviert",
"DEVMODE_DISABLED": "Deaktiviert",
"DEVMODEDESC": "Bei eingeschaltetem Entwicklermodus werden die Weiterleitungs-URIs im OIDC-Flow nicht validiert.",
"SKIPNATIVEAPPSUCCESSPAGE": "Login Erfolgseite überspringen",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Erfolgseite nach dem Login für diese Native Applikation überspringen.",

View File

@ -1995,6 +1995,8 @@
"CLIENTSECRET_DESCRIPTION": "Keep your client secret at a safe place as it will disappear once the dialog is closed.",
"REGENERATESECRET": "Regenerate Client Secret",
"DEVMODE": "Development Mode",
"DEVMODE_ENABLED": "Enabled",
"DEVMODE_DISABLED": "Disabled",
"DEVMODEDESC": "Beware: With development mode enabled redirect URIs will not be validated.",
"SKIPNATIVEAPPSUCCESSPAGE": "Skip Login Success Page",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Skip the success page after a login for this native app.",

View File

@ -1983,6 +1983,8 @@
"CLIENTSECRET_DESCRIPTION": "Mantén tu secreto de cliente en un lugar seguro puesto que desaparecerá una vez que se cierre el diálogo.",
"REGENERATESECRET": "Regenerar secreto de cliente",
"DEVMODE": "Modo Desarrollo",
"DEVMODE_ENABLED": "Activado",
"DEVMODE_DISABLED": "Desactivado",
"DEVMODEDESC": "Cuidado: Si el modo de desarrollo está activado las URIs de redirección no serán validadas.",
"SKIPNATIVEAPPSUCCESSPAGE": "Saltar página de inicio de sesión con éxito",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Sáltate la página de éxito después de iniciar sesión en esta app nativa.",

View File

@ -1987,6 +1987,8 @@
"CLIENTSECRET_DESCRIPTION": "Conservez votre secret client dans un endroit sûr car il disparaîtra une fois la boîte de dialogue fermée.",
"REGENERATESECRET": "Régénérer le secret du client",
"DEVMODE": "Mode développement",
"DEVMODE_ENABLED": "Activé",
"DEVMODE_DISABLED": "Désactivé",
"DEVMODEDESC": "Attention",
"SKIPNATIVEAPPSUCCESSPAGE": "Sauter la page de succès de connexion",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Sauter la page de succès après la connexion pour cette application native",

View File

@ -1987,6 +1987,8 @@
"CLIENTSECRET_DESCRIPTION": "Salvate il Client Secret in un luogo sicuro, perch\u00e9 non sarà più disponibile dopo aver chiuso la finestra di dialogo",
"REGENERATESECRET": "Rigenera il Client Secret",
"DEVMODE": "Modalit\u00e0 di sviluppo (DEV Mode)",
"DEVMODE_ENABLED": "Attivato",
"DEVMODE_DISABLED": "Disattivato",
"DEVMODEDESC": "Attenzione: Con la modalit\u00e0 di sviluppo abilitata, gli URI di reindirizzamento non saranno convalidati.",
"SKIPNATIVEAPPSUCCESSPAGE": "Salta la pagina di successo dopo il login",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Salta la pagina di successo dopo il login per questa applicazione nativa",

View File

@ -1978,6 +1978,8 @@
"CLIENTSECRET_DESCRIPTION": "クライアントシークレットは、ダイアログを閉じると消えてしまうので、安全な場所に保管してください。",
"REGENERATESECRET": "クライアントシークレットを再生成する",
"DEVMODE": "開発モード",
"DEVMODE_ENABLED": "アクティブ化された",
"DEVMODE_DISABLED": "無効化されました",
"DEVMODEDESC": "注意開発モードを有効にすると、URIが認証されません。",
"SKIPNATIVEAPPSUCCESSPAGE": "ログイン後に成功ページをスキップする",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "このネイティブアプリのログイン後に成功ページをスキップする",

View File

@ -1984,6 +1984,8 @@
"CLIENTSECRET_DESCRIPTION": "Чувајте ја вашата клиентска тајна на безбедно место, бидејќи ќе исчезне откако ќе се затвори дијалогот.",
"REGENERATESECRET": "Генерирај нова клиентска тајна",
"DEVMODE": "Development mode",
"DEVMODE_ENABLED": "Активиран",
"DEVMODE_DISABLED": "Деактивирано",
"DEVMODEDESC": "Внимавајте: Со овозможен Development mode, URIs за пренасочување нема да бидат валидирани.",
"SKIPNATIVEAPPSUCCESSPAGE": "Прескокни страница за успешна најава",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Прескокнете ја страницата за успешна најава за оваа нативна апликација.",

View File

@ -1987,6 +1987,8 @@
"CLIENTSECRET_DESCRIPTION": "Trzymaj swój sekret klienta w bezpiecznym miejscu, ponieważ zniknie on po zamknięciu okna dialogowego.",
"REGENERATESECRET": "Odtwórz sekret klienta",
"DEVMODE": "Tryb rozwoju",
"DEVMODE_ENABLED": "Aktywowany",
"DEVMODE_DISABLED": "Dezaktywowane",
"DEVMODEDESC": "Uwaga: przy włączonym trybie rozwoju adresy URI przekierowania nie będą sprawdzane.",
"SKIPNATIVEAPPSUCCESSPAGE": "Pomiń stronę sukcesu po zalogowaniu",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Pomiń stronę sukcesu po zalogowaniu dla tej Natywny aplikację",

View File

@ -1982,6 +1982,8 @@
"CLIENTSECRET_DESCRIPTION": "Mantenha o segredo do cliente em um local seguro, pois ele desaparecerá assim que o diálogo for fechado.",
"REGENERATESECRET": "Regenerar Segredo do Cliente",
"DEVMODE": "Modo de Desenvolvimento",
"DEVMODE_ENABLED": "Ativado",
"DEVMODE_DISABLED": "Desativado",
"DEVMODEDESC": "Atenção: Com o modo de desenvolvimento habilitado, as URIs de redirecionamento não serão validadas.",
"SKIPNATIVEAPPSUCCESSPAGE": "Pular Página de Sucesso de Login",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "Pule a página de sucesso após o login para este aplicativo nativo.",

View File

@ -1986,6 +1986,8 @@
"CLIENTSECRET_DESCRIPTION": "将您的客户保密在一个安全的地方,因为一旦对话框关闭,便无法再次查看。",
"REGENERATESECRET": "重新生成客户端密钥",
"DEVMODE": "开发模式",
"DEVMODE_ENABLED": "活性",
"DEVMODE_DISABLED": "已停用",
"DEVMODEDESC": "注意:启用开发模式的重定向 URI 将不会被验证。",
"SKIPNATIVEAPPSUCCESSPAGE": "登录后跳过成功页面",
"SKIPNATIVEAPPSUCCESSPAGE_DESCRIPTION": "登录后跳过本机应用的成功页面",