From 8a91c239bbb7ac63cda8b8fe46380e4f68e3362e Mon Sep 17 00:00:00 2001 From: Max Peintner Date: Tue, 20 Apr 2021 12:53:16 +0200 Subject: [PATCH] fix(console): idp name and type, disable toggle if not allowed (#1613) * fix: idp type * disable toggle * restrict access, i18n, fix auth factor remove * retention in days instead of hours * chore(deps): bump @types/google-protobuf in /console (#1607) Bumps [@types/google-protobuf](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/google-protobuf) from 3.7.4 to 3.15.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/google-protobuf) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @types/node from 14.14.37 to 14.14.41 in /console (#1602) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.37 to 14.14.41. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular/cli from 11.2.8 to 11.2.9 in /console (#1600) Bumps [@angular/cli](https://github.com/angular/angular-cli) from 11.2.8 to 11.2.9. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/compare/v11.2.8...v11.2.9) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump @angular-devkit/build-angular in /console (#1599) Bumps [@angular-devkit/build-angular](https://github.com/angular/angular-cli) from 0.1102.8 to 0.1102.9. - [Release notes](https://github.com/angular/angular-cli/releases) - [Commits](https://github.com/angular/angular-cli/commits) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Peintner * chore(deps-dev): bump @angular/language-service in /console (#1598) Bumps [@angular/language-service](https://github.com/angular/angular/tree/HEAD/packages/language-service) from 11.2.9 to 11.2.10. - [Release notes](https://github.com/angular/angular/releases) - [Changelog](https://github.com/angular/angular/blob/master/CHANGELOG.md) - [Commits](https://github.com/angular/angular/commits/11.2.10/packages/language-service) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update deps, remove zitadel prefix * min-width button * lint styles * downgrade * downgrade * down * lock custom * lock * pack Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../modules/features/features.component.html | 2 +- .../login-policy/login-policy.component.html | 53 ++++++++++++++----- console/src/app/pages/iam/iam.component.scss | 4 ++ .../orgs/org-detail/org-detail.component.html | 36 +++++++------ .../orgs/org-detail/org-detail.component.scss | 4 ++ .../user-mfa/user-mfa.component.ts | 2 +- .../timestamp-to-retention.pipe.ts | 26 ++++----- console/src/app/services/mgmt.service.ts | 3 +- console/src/assets/i18n/de.json | 12 +++-- console/src/assets/i18n/en.json | 10 ++-- 10 files changed, 100 insertions(+), 52 deletions(-) diff --git a/console/src/app/modules/features/features.component.html b/console/src/app/modules/features/features.component.html index 503ef78eb1..54ee63839e 100644 --- a/console/src/app/modules/features/features.component.html +++ b/console/src/app/modules/features/features.component.html @@ -49,7 +49,7 @@
{{'FEATURES.DATA.AUDITLOGRETENTION' | translate}} - {{features.auditLogRetention | timestampToRetention }} {{'FEATURES.RETENTIONHOURS' | + {{features.auditLogRetention | timestampToRetention }} {{'FEATURES.RETENTIONDAYS' | translate}}
diff --git a/console/src/app/modules/policies/login-policy/login-policy.component.html b/console/src/app/modules/policies/login-policy/login-policy.component.html index 00d3d957c1..bf17798f60 100644 --- a/console/src/app/modules/policies/login-policy/login-policy.component.html +++ b/console/src/app/modules/policies/login-policy/login-policy.component.html @@ -28,13 +28,24 @@ [(ngModel)]="loginData.allowUsernamePassword"> {{'POLICY.DATA.ALLOWUSERNAMEPASSWORD' | translate}} - - {{'POLICY.DATA.ALLOWUSERNAMEPASSWORD_DESC' | translate}} - + + + {{'FEATURES.NOTAVAILABLE' | translate: ({value: + 'login_policy.username_login'})}} + + + + + + {{'POLICY.DATA.ALLOWUSERNAMEPASSWORD_DESC' | translate}} + +
- + {{'POLICY.DATA.ALLOWREGISTER' | translate}} @@ -55,18 +66,34 @@ [(ngModel)]="loginData.allowExternalIdp"> {{'POLICY.DATA.ALLOWEXTERNALIDP' | translate}} - - {{'POLICY.DATA.ALLOWEXTERNALIDP_DESC' | translate}} - + + {{'FEATURES.NOTAVAILABLE' | translate: ({value: + 'login_policy.idp'})}} + + + + + {{'POLICY.DATA.ALLOWEXTERNALIDP_DESC' | translate}} + +
{{'POLICY.DATA.FORCEMFA' | translate}} - - {{'POLICY.DATA.FORCEMFA_DESC' | translate}} - + + {{'FEATURES.NOTAVAILABLE' | translate: ({value: + 'login_policy.factors'})}} + + + + + {{'POLICY.DATA.FORCEMFA_DESC' | translate}} + +
@@ -142,8 +169,8 @@ google
- {{idp.name}} - {{ 'IDP.TYPE' | translate }}: {{ 'IDP.OWNERTYPES.'+idp.idpType | + {{idp.idpName}} + {{ 'IDP.TYPE' | translate }}: {{ 'IDP.TYPES.'+idp.idpType | translate }} {{ 'IDP.ID' | translate }}: {{idp.idpId}} diff --git a/console/src/app/pages/iam/iam.component.scss b/console/src/app/pages/iam/iam.component.scss index c7c5d8d71d..ffdf43142a 100644 --- a/console/src/app/pages/iam/iam.component.scss +++ b/console/src/app/pages/iam/iam.component.scss @@ -57,4 +57,8 @@ h2 { .fill-space { flex: 1; } + + button { + min-width: 200px; + } } diff --git a/console/src/app/pages/orgs/org-detail/org-detail.component.html b/console/src/app/pages/orgs/org-detail/org-detail.component.html index ed717c9f80..e9db5f2023 100644 --- a/console/src/app/pages/orgs/org-detail/org-detail.component.html +++ b/console/src/app/pages/orgs/org-detail/org-detail.component.html @@ -6,7 +6,9 @@ - +
-

{{'FEATURES.TITLE' | translate}}

-

{{'FEATURES.DESCRIPTION' | translate}}

-
- stars -
-

ZITADEL {{features.tier.name}}

-

{{features.tier?.description}}

-

{{'FEATURES.TIERSTATES.'+features.tier.state | translate}}

-

{{features.tier?.statusInfo}}

-
- - + +

{{'FEATURES.TITLE' | translate}}

+

{{'FEATURES.DESCRIPTION' | translate}}

+
+ stars +
+

{{features.tier.name}}

+

{{features.tier?.description}}

+

{{'FEATURES.TIERSTATES.'+features.tier.state | translate}}

+

{{features.tier?.statusInfo}}

+
+ + - -
+ +
+ diff --git a/console/src/app/pages/orgs/org-detail/org-detail.component.scss b/console/src/app/pages/orgs/org-detail/org-detail.component.scss index d78c3282b9..03e9e449de 100644 --- a/console/src/app/pages/orgs/org-detail/org-detail.component.scss +++ b/console/src/app/pages/orgs/org-detail/org-detail.component.scss @@ -57,6 +57,10 @@ h2 { .fill-space { flex: 1; } + + button { + min-width: 200px; + } } .domain { diff --git a/console/src/app/pages/users/user-detail/user-detail/user-mfa/user-mfa.component.ts b/console/src/app/pages/users/user-detail/user-detail/user-mfa/user-mfa.component.ts index a168e03c55..d0f674dd1f 100644 --- a/console/src/app/pages/users/user-detail/user-detail/user-mfa/user-mfa.component.ts +++ b/console/src/app/pages/users/user-detail/user-detail/user-mfa/user-mfa.component.ts @@ -79,7 +79,7 @@ export class UserMfaComponent implements OnInit, OnDestroy { this.toast.showError(error); }); } else if (factor.u2f) { - this.mgmtUserService.removeHumanAuthFactorU2F(this.user.id).then(() => { + this.mgmtUserService.removeHumanAuthFactorU2F(this.user.id, factor.u2f.id).then(() => { this.toast.showInfo('USER.TOAST.U2FREMOVED', true); const index = this.dataSource.data.findIndex(mfa => !!mfa.u2f); diff --git a/console/src/app/pipes/timestamp-to-retention-pipe/timestamp-to-retention.pipe.ts b/console/src/app/pipes/timestamp-to-retention-pipe/timestamp-to-retention.pipe.ts index 3b3647f57e..668c219422 100644 --- a/console/src/app/pipes/timestamp-to-retention-pipe/timestamp-to-retention.pipe.ts +++ b/console/src/app/pipes/timestamp-to-retention-pipe/timestamp-to-retention.pipe.ts @@ -2,24 +2,24 @@ import { Pipe, PipeTransform } from '@angular/core'; import { Duration } from 'google-protobuf/google/protobuf/duration_pb'; @Pipe({ - name: 'timestampToRetention', + name: 'timestampToRetention', }) export class TimestampToRetentionPipe implements PipeTransform { - transform(value?: Duration.AsObject, ...args: unknown[]): unknown { - if (value) { - return this.retentionFromTimestamp(value); - } else { - return ''; - } + transform(value?: Duration.AsObject, ...args: unknown[]): unknown { + if (value) { + return this.retentionFromTimestamp(value); + } else { + return ''; } + } - private retentionFromTimestamp(date: Duration.AsObject): any { - if (date?.seconds !== undefined && date?.nanos !== undefined) { - const ms = (date.seconds * 1000 + date.nanos / 1000 / 1000); - const mins = ms / 1000 / 60; - return mins / 60; - } + private retentionFromTimestamp(date: Duration.AsObject): any { + if (date?.seconds !== undefined && date?.nanos !== undefined) { + const ms = (date.seconds * 1000 + date.nanos / 1000 / 1000); + const mins = ms / 1000 / 60; + return mins / 60 / 24; } + } } diff --git a/console/src/app/services/mgmt.service.ts b/console/src/app/services/mgmt.service.ts index 077167be06..4e46b71018 100644 --- a/console/src/app/services/mgmt.service.ts +++ b/console/src/app/services/mgmt.service.ts @@ -913,9 +913,10 @@ export class ManagementService { return this.grpcService.mgmt.removeHumanAuthFactorOTP(req, null).then(resp => resp.toObject()); } - public removeHumanAuthFactorU2F(userId: string): Promise { + public removeHumanAuthFactorU2F(userId: string, tokenId: string): Promise { const req = new RemoveHumanAuthFactorU2FRequest(); req.setUserId(userId); + req.setTokenId(tokenId); return this.grpcService.mgmt.removeHumanAuthFactorU2F(req, null).then(resp => resp.toObject()); } diff --git a/console/src/assets/i18n/de.json b/console/src/assets/i18n/de.json index d3c1352907..d83d33f3c5 100644 --- a/console/src/assets/i18n/de.json +++ b/console/src/assets/i18n/de.json @@ -583,8 +583,8 @@ }, "FEATURES": { "TITLE": "Features", - "DESCRIPTION": "Hier können Sie Funktionen von ZITADEL auf Basis von Ihrer Preisstufe aktivieren sowie deaktivieren.", - "BTN-EDIT": "Featureset anpassen", + "DESCRIPTION": "Hier können Sie Funktionen von ZITADEL auf Basis von Ihrer Preisstufe einsehen.", + "BTN-EDIT": "Featureset anzeigen", "TIER": { "NAME": "Preisstufe Name", "DETAILS": "Abrechnungsdetails", @@ -617,8 +617,8 @@ "2": "Annuliert", "3": "Durch IAM Owner gesetzt" }, - "NOTAVAILABLE": "Feature {{value}} ist auf Ihrer Organisation nicht freigeschaltet!", - "RETENTIONHOURS": "Stunden" + "NOTAVAILABLE": "Feature {{value}} ist auf Ihrer organisation nicht freigeschaltet!", + "RETENTIONDAYS": "Tage" }, "POLICY": { "TITLE": "Richtlinen entdecken", @@ -917,6 +917,10 @@ "1": "System", "2": "Organisation" }, + "TYPES": { + "0": "unknown", + "1": "OIDC" + }, "STATES": { "1": "aktiv", "2": "inaktiv" diff --git a/console/src/assets/i18n/en.json b/console/src/assets/i18n/en.json index 497040cdf6..1383c21853 100644 --- a/console/src/assets/i18n/en.json +++ b/console/src/assets/i18n/en.json @@ -583,8 +583,8 @@ }, "FEATURES": { "TITLE": "Features", - "DESCRIPTION": "here you can edit your ZITADEL Features based on your Tier", - "BTN-EDIT": "Edit Featureset", + "DESCRIPTION": "Here you can see your ZITADEL Features based on your Tier.", + "BTN-EDIT": "Display Featureset", "TIER": { "NAME": "Tier Name", "DETAILS": "Billing Details", @@ -618,7 +618,7 @@ "3": "Grandfathered" }, "NOTAVAILABLE": "Feature {{value}} is missing on your organization.", - "RETENTIONHOURS": "Hours" + "RETENTIONDAYS": "Days" }, "POLICY": { "TITLE": "Explore Policies", @@ -917,6 +917,10 @@ "1": "System", "2": "Organisation" }, + "TYPES": { + "0": "unknown", + "1": "OIDC" + }, "STATES": { "1": "active", "2": "inactive"