@@ -58,7 +59,7 @@
{{ 'IDP.STATE' | translate }} |
{{
+ [ngClass]="{'active': idp.state === IDPState.IDP_STATE_ACTIVE, 'inactive': idp.state === IDPState.IDP_STATE_INACTIVE}">{{
'IDP.STATES.'+idp.state | translate }}
|
@@ -87,7 +88,7 @@
|

+ *ngIf="idp.stylingType == IDPStylingType.STYLING_TYPE_GOOGLE" alt="google" />
{{idp.name}}
{{ 'IDP.TYPE' | translate }}: {{ 'IDP.TYPES.'+idp.type | translate }}
diff --git a/console/src/app/modules/policies/login-policy/login-policy.component.ts b/console/src/app/modules/policies/login-policy/login-policy.component.ts
index 32f1ee3ac5..28e99e89c8 100644
--- a/console/src/app/modules/policies/login-policy/login-policy.component.ts
+++ b/console/src/app/modules/policies/login-policy/login-policy.component.ts
@@ -5,29 +5,28 @@ import { Subscription } from 'rxjs';
import { switchMap } from 'rxjs/operators';
import { LoginMethodComponentType } from 'src/app/modules/mfa-table/mfa-table.component';
import {
- DefaultLoginPolicy,
- DefaultLoginPolicyRequest,
- DefaultLoginPolicyView,
- IdpProviderView as AdminIdpProviderView,
- IdpStylingType,
- IdpView as AdminIdpView,
- PasswordlessType as AdminPasswordlessType,
-} from 'src/app/proto/generated/admin_pb';
+ GetLoginPolicyResponse as AdminGetLoginPolicyResponse,
+ UpdateLoginPolicyRequest,
+ UpdateLoginPolicyResponse,
+} from 'src/app/proto/generated/zitadel/admin_pb';
+import { IDP, IDPLoginPolicyLink, IDPStylingType } from 'src/app/proto/generated/zitadel/idp_pb';
import {
- IdpProviderType,
- IdpProviderView as MgmtIdpProviderView,
- IdpView as MgmtIdpView,
- LoginPolicy,
- LoginPolicyRequest,
- LoginPolicyView,
- PasswordlessType as MgmtPasswordlessType,
-} from 'src/app/proto/generated/management_pb';
+ AddCustomLoginPolicyRequest,
+ GetLoginPolicyResponse as MgmtGetLoginPolicyResponse,
+} from 'src/app/proto/generated/zitadel/management_pb';
+import { LoginPolicy, PasswordlessType } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ManagementService } from 'src/app/services/mgmt.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 { CnslLinks } from '../../links/links.component';
+import {
+ IAM_COMPLEXITY_LINK,
+ IAM_LABEL_LINK,
+ IAM_POLICY_LINK,
+ ORG_COMPLEXITY_LINK,
+ ORG_IAM_POLICY_LINK,
+} from '../../policy-grid/policy-links';
import { PolicyComponentServiceType } from '../policy-component-types.enum';
import { AddIdpDialogComponent } from './add-idp-dialog/add-idp-dialog.component';
@@ -38,19 +37,19 @@ import { AddIdpDialogComponent } from './add-idp-dialog/add-idp-dialog.component
})
export class LoginPolicyComponent implements OnDestroy {
public LoginMethodComponentType: any = LoginMethodComponentType;
- public passwordlessTypes: Array = [];
- public loginData!: LoginPolicyView.AsObject | DefaultLoginPolicyView.AsObject;
+ public passwordlessTypes: Array = [];
+ public loginData!: LoginPolicy.AsObject;
private sub: Subscription = new Subscription();
public service!: ManagementService | AdminService;
public PolicyComponentServiceType: any = PolicyComponentServiceType;
public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;
- public idps: MgmtIdpProviderView.AsObject[] | AdminIdpProviderView.AsObject[] = [];
+ public idps: IDPLoginPolicyLink.AsObject[] = [];
public loading: boolean = false;
public disabled: boolean = true;
- public IdpStylingType: any = IdpStylingType;
+ public IDPStylingType: any = IDPStylingType;
public nextLinks: CnslLinks[] = [];
constructor(
private route: ActivatedRoute,
@@ -63,8 +62,10 @@ export class LoginPolicyComponent implements OnDestroy {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
this.service = this.injector.get(ManagementService as Type);
- this.passwordlessTypes = [MgmtPasswordlessType.PASSWORDLESSTYPE_ALLOWED,
- MgmtPasswordlessType.PASSWORDLESSTYPE_NOT_ALLOWED];
+ this.passwordlessTypes = [
+ PasswordlessType.PASSWORDLESS_TYPE_ALLOWED,
+ PasswordlessType.PASSWORDLESS_TYPE_NOT_ALLOWED,
+ ];
this.nextLinks = [
ORG_COMPLEXITY_LINK,
ORG_IAM_POLICY_LINK,
@@ -72,8 +73,10 @@ export class LoginPolicyComponent implements OnDestroy {
break;
case PolicyComponentServiceType.ADMIN:
this.service = this.injector.get(AdminService as Type);
- this.passwordlessTypes = [AdminPasswordlessType.PASSWORDLESSTYPE_ALLOWED,
- AdminPasswordlessType.PASSWORDLESSTYPE_NOT_ALLOWED];
+ this.passwordlessTypes = [
+ PasswordlessType.PASSWORDLESS_TYPE_ALLOWED,
+ PasswordlessType.PASSWORDLESS_TYPE_NOT_ALLOWED,
+ ];
this.nextLinks = [
IAM_COMPLEXITY_LINK,
IAM_POLICY_LINK,
@@ -89,15 +92,15 @@ export class LoginPolicyComponent implements OnDestroy {
}
private fetchData(): void {
- this.getData().then(data => {
- if (data) {
- this.loginData = data.toObject();
+ this.getData().then(resp => {
+ if (resp.policy) {
+ this.loginData = resp.policy;
this.loading = false;
- this.disabled = ((this.loginData as LoginPolicyView.AsObject)?.pb_default) ?? false;
+ this.disabled = ((this.loginData as LoginPolicy.AsObject)?.isDefault) ?? false;
}
});
- this.getIdps().then(idps => {
- this.idps = idps;
+ this.getIdps().then(resp => {
+ this.idps = resp;
});
}
@@ -106,48 +109,48 @@ export class LoginPolicyComponent implements OnDestroy {
}
private async getData():
- Promise {
+ Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- return (this.service as ManagementService).GetLoginPolicy();
+ return (this.service as ManagementService).getLoginPolicy();
case PolicyComponentServiceType.ADMIN:
- return (this.service as AdminService).GetDefaultLoginPolicy();
+ return (this.service as AdminService).getLoginPolicy();
}
}
- private async getIdps(): Promise {
+ private async getIdps(): Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- return (this.service as ManagementService).GetLoginPolicyIdpProviders()
- .then((providers) => {
- return providers.toObject().resultList;
+ return (this.service as ManagementService).listLoginPolicyIDPs()
+ .then((resp) => {
+ return resp.resultList;
});
case PolicyComponentServiceType.ADMIN:
- return (this.service as AdminService).GetDefaultLoginPolicyIdpProviders()
+ return (this.service as AdminService).listLoginPolicyIDPs()
.then((providers) => {
- return providers.toObject().resultList;
+ return providers.resultList;
});
}
}
private async updateData():
- Promise {
+ Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- const mgmtreq = new LoginPolicyRequest();
+ const mgmtreq = new AddCustomLoginPolicyRequest();
mgmtreq.setAllowExternalIdp(this.loginData.allowExternalIdp);
mgmtreq.setAllowRegister(this.loginData.allowRegister);
mgmtreq.setAllowUsernamePassword(this.loginData.allowUsernamePassword);
mgmtreq.setForceMfa(this.loginData.forceMfa);
mgmtreq.setPasswordlessType(this.loginData.passwordlessType);
// console.log(mgmtreq.toObject());
- if ((this.loginData as LoginPolicyView.AsObject).pb_default) {
- return (this.service as ManagementService).CreateLoginPolicy(mgmtreq);
+ if ((this.loginData as LoginPolicy.AsObject).isDefault) {
+ return (this.service as ManagementService).addCustomLoginPolicy(mgmtreq);
} else {
- return (this.service as ManagementService).UpdateLoginPolicy(mgmtreq);
+ return (this.service as ManagementService).updateCustomLoginPolicy(mgmtreq);
}
case PolicyComponentServiceType.ADMIN:
- const adminreq = new DefaultLoginPolicyRequest();
+ const adminreq = new UpdateLoginPolicyRequest();
adminreq.setAllowExternalIdp(this.loginData.allowExternalIdp);
adminreq.setAllowRegister(this.loginData.allowRegister);
adminreq.setAllowUsernamePassword(this.loginData.allowUsernamePassword);
@@ -156,7 +159,7 @@ export class LoginPolicyComponent implements OnDestroy {
// console.log(adminreq.toObject());
- return (this.service as AdminService).UpdateDefaultLoginPolicy(adminreq);
+ return (this.service as AdminService).updateLoginPolicy(adminreq);
}
}
@@ -174,7 +177,7 @@ export class LoginPolicyComponent implements OnDestroy {
public removePolicy(): void {
if (this.serviceType === PolicyComponentServiceType.MGMT) {
- (this.service as ManagementService).RemoveLoginPolicy().then(() => {
+ (this.service as ManagementService).resetLoginPolicyToDefault().then(() => {
this.toast.showInfo('POLICY.TOAST.RESETSUCCESS', true);
this.loading = true;
setTimeout(() => {
@@ -195,8 +198,8 @@ export class LoginPolicyComponent implements OnDestroy {
});
dialogRef.afterClosed().subscribe(resp => {
- if (resp && resp.idp && resp.type) {
- this.addIdp(resp.idp, resp.type).then(() => {
+ if (resp && resp.idp) {
+ this.addIdp(resp.idp).then(() => {
this.loading = true;
setTimeout(() => {
this.fetchData();
@@ -208,29 +211,28 @@ export class LoginPolicyComponent implements OnDestroy {
});
}
- private addIdp(idp: AdminIdpView.AsObject | MgmtIdpView.AsObject,
- type: IdpProviderType = IdpProviderType.IDPPROVIDERTYPE_SYSTEM): Promise {
+ private addIdp(idp: IDP.AsObject | IDP.AsObject): Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- return (this.service as ManagementService).addIdpProviderToLoginPolicy(idp.id, type);
+ return (this.service as ManagementService).addIDPToLoginPolicy(idp.id);
case PolicyComponentServiceType.ADMIN:
- return (this.service as AdminService).AddIdpProviderToDefaultLoginPolicy(idp.id);
+ return (this.service as AdminService).addIDPToLoginPolicy(idp.id);
}
}
- public removeIdp(idp: AdminIdpProviderView.AsObject | MgmtIdpProviderView.AsObject): void {
+ public removeIdp(idp: IDPLoginPolicyLink.AsObject): void {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- (this.service as ManagementService).RemoveIdpProviderFromLoginPolicy(idp.idpConfigId).then(() => {
- const index = (this.idps as MgmtIdpProviderView.AsObject[]).findIndex(temp => temp === idp);
+ (this.service as ManagementService).removeIDPFromLoginPolicy(idp.idpId).then(() => {
+ const index = this.idps.findIndex(temp => temp === idp);
if (index > -1) {
this.idps.splice(index, 1);
}
});
break;
case PolicyComponentServiceType.ADMIN:
- (this.service as AdminService).RemoveIdpProviderFromDefaultLoginPolicy(idp.idpConfigId).then(() => {
- const index = (this.idps as AdminIdpProviderView.AsObject[]).findIndex(temp => temp === idp);
+ (this.service as AdminService).removeIDPFromLoginPolicy(idp.idpId).then(() => {
+ const index = this.idps.findIndex(temp => temp === idp);
if (index > -1) {
this.idps.splice(index, 1);
}
@@ -241,7 +243,7 @@ export class LoginPolicyComponent implements OnDestroy {
public get isDefault(): boolean {
if (this.loginData && this.serviceType === PolicyComponentServiceType.MGMT) {
- return (this.loginData as LoginPolicyView.AsObject).pb_default;
+ return (this.loginData as LoginPolicy.AsObject).isDefault;
} else {
return false;
}
diff --git a/console/src/app/modules/policies/org-iam-policy/org-iam-policy.component.ts b/console/src/app/modules/policies/org-iam-policy/org-iam-policy.component.ts
index 408866a560..98e5d883db 100644
--- a/console/src/app/modules/policies/org-iam-policy/org-iam-policy.component.ts
+++ b/console/src/app/modules/policies/org-iam-policy/org-iam-policy.component.ts
@@ -2,16 +2,23 @@ import { Component, Injector, Input, OnDestroy, Type } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { switchMap } from 'rxjs/operators';
-import { OrgIamPolicyView as AdminOrgIamPolicyView } from 'src/app/proto/generated/admin_pb';
-import { Org } from 'src/app/proto/generated/auth_pb';
-import { OrgIamPolicyView as MgmtOrgIamPolicyView } from 'src/app/proto/generated/management_pb';
+import { GetCustomOrgIAMPolicyResponse } from 'src/app/proto/generated/zitadel/admin_pb';
+import { GetOrgIAMPolicyResponse } from 'src/app/proto/generated/zitadel/management_pb';
+import { Org } from 'src/app/proto/generated/zitadel/org_pb';
+import { OrgIAMPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { StorageService } from 'src/app/services/storage.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 { CnslLinks } from '../../links/links.component';
+import {
+ IAM_COMPLEXITY_LINK,
+ IAM_LABEL_LINK,
+ IAM_LOGIN_POLICY_LINK,
+ ORG_COMPLEXITY_LINK,
+ ORG_LOGIN_POLICY_LINK,
+} from '../../policy-grid/policy-links';
import { PolicyComponentServiceType } from '../policy-component-types.enum';
@Component({
@@ -24,7 +31,7 @@ export class OrgIamPolicyComponent implements OnDestroy {
private managementService!: ManagementService;
public serviceType!: PolicyComponentServiceType;
- public iamData!: AdminOrgIamPolicyView.AsObject | MgmtOrgIamPolicyView.AsObject;
+ public iamData!: OrgIAMPolicy.AsObject;
private sub: Subscription = new Subscription();
private org!: Org.AsObject;
@@ -68,20 +75,20 @@ export class OrgIamPolicyComponent implements OnDestroy {
}
public fetchData(): void {
- this.getData().then(data => {
- if (data) {
- this.iamData = data.toObject();
+ this.getData().then(resp => {
+ if (resp?.policy) {
+ this.iamData = resp.policy;
}
});
}
- private async getData(): Promise {
+ private async getData(): Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- return this.managementService.GetMyOrgIamPolicy();
+ return this.managementService.getOrgIAMPolicy();
case PolicyComponentServiceType.ADMIN:
if (this.org?.id) {
- return this.adminService.GetOrgIamPolicy(this.org.id);
+ return this.adminService.getCustomOrgIAMPolicy(this.org.id);
}
break;
}
@@ -90,8 +97,8 @@ export class OrgIamPolicyComponent implements OnDestroy {
public savePolicy(): void {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- if ((this.iamData as MgmtOrgIamPolicyView.AsObject).pb_default) {
- this.adminService.CreateOrgIamPolicy(
+ if ((this.iamData as OrgIAMPolicy.AsObject).isDefault) {
+ this.adminService.addCustomOrgIAMPolicy(
this.org.id,
this.iamData.userLoginMustBeDomain,
).then(() => {
@@ -101,7 +108,7 @@ export class OrgIamPolicyComponent implements OnDestroy {
});
break;
} else {
- this.adminService.UpdateOrgIamPolicy(
+ this.adminService.updateCustomOrgIAMPolicy(
this.org.id,
this.iamData.userLoginMustBeDomain,
).then(() => {
@@ -113,8 +120,7 @@ export class OrgIamPolicyComponent implements OnDestroy {
}
case PolicyComponentServiceType.ADMIN:
// update Default org iam policy?
- this.adminService.UpdateOrgIamPolicy(
- this.org.id,
+ this.adminService.updateOrgIAMPolicy(
this.iamData.userLoginMustBeDomain,
).then(() => {
this.toast.showInfo('POLICY.TOAST.SET', true);
@@ -127,7 +133,7 @@ export class OrgIamPolicyComponent implements OnDestroy {
public removePolicy(): void {
if (this.serviceType === PolicyComponentServiceType.MGMT) {
- this.adminService.RemoveOrgIamPolicy(this.org.id).then(() => {
+ this.adminService.resetCustomOrgIAMPolicyToDefault(this.org.id).then(() => {
this.toast.showInfo('POLICY.TOAST.RESETSUCCESS', true);
setTimeout(() => {
this.fetchData();
@@ -140,7 +146,7 @@ export class OrgIamPolicyComponent implements OnDestroy {
public get isDefault(): boolean {
if (this.iamData && this.serviceType === PolicyComponentServiceType.MGMT) {
- return (this.iamData as MgmtOrgIamPolicyView.AsObject).pb_default;
+ return (this.iamData as OrgIAMPolicy.AsObject).isDefault;
} else {
return false;
}
diff --git a/console/src/app/modules/policies/password-age-policy/password-age-policy.component.ts b/console/src/app/modules/policies/password-age-policy/password-age-policy.component.ts
index 86fca53382..c3cb43d630 100644
--- a/console/src/app/modules/policies/password-age-policy/password-age-policy.component.ts
+++ b/console/src/app/modules/policies/password-age-policy/password-age-policy.component.ts
@@ -2,8 +2,11 @@ import { Component, Injector, OnDestroy, Type } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { switchMap } from 'rxjs/operators';
-import { DefaultPasswordAgePolicyView } from 'src/app/proto/generated/admin_pb';
-import { PasswordAgePolicyView } from 'src/app/proto/generated/management_pb';
+import { GetPasswordAgePolicyResponse as AdminGetPasswordAgePolicyResponse } from 'src/app/proto/generated/zitadel/admin_pb';
+import {
+ GetPasswordAgePolicyResponse as MgmtGetPasswordAgePolicyResponse,
+} from 'src/app/proto/generated/zitadel/management_pb';
+import { PasswordAgePolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -20,7 +23,7 @@ export class PasswordAgePolicyComponent implements OnDestroy {
public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;
public service!: AdminService | ManagementService;
- public ageData!: PasswordAgePolicyView.AsObject | DefaultPasswordAgePolicyView.AsObject;
+ public ageData!: PasswordAgePolicy.AsObject | PasswordAgePolicy.AsObject;
private sub: Subscription = new Subscription();
@@ -43,9 +46,9 @@ export class PasswordAgePolicyComponent implements OnDestroy {
return this.route.params;
})).subscribe(() => {
- this.getData().then(data => {
- if (data) {
- this.ageData = data.toObject();
+ this.getData().then(resp => {
+ if (resp.policy) {
+ this.ageData = resp.policy;
}
});
});
@@ -56,19 +59,19 @@ export class PasswordAgePolicyComponent implements OnDestroy {
}
private async getData():
- Promise {
+ Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- return (this.service as ManagementService).GetPasswordAgePolicy();
+ return (this.service as ManagementService).getPasswordAgePolicy();
case PolicyComponentServiceType.ADMIN:
- return (this.service as AdminService).GetDefaultPasswordAgePolicy();
+ return (this.service as AdminService).getPasswordAgePolicy();
}
}
public removePolicy(): void {
if (this.serviceType === PolicyComponentServiceType.MGMT) {
- (this.service as ManagementService).RemovePasswordAgePolicy().then(() => {
+ (this.service as ManagementService).resetPasswordAgePolicyToDefault().then(() => {
this.toast.showInfo('POLICY.TOAST.RESETSUCCESS', true);
setTimeout(() => {
this.getData();
@@ -106,8 +109,8 @@ export class PasswordAgePolicyComponent implements OnDestroy {
public savePolicy(): void {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- if ((this.ageData as PasswordAgePolicyView.AsObject).pb_default) {
- (this.service as ManagementService).CreatePasswordAgePolicy(
+ if (this.ageData.isDefault) {
+ (this.service as ManagementService).addCustomPasswordAgePolicy(
this.ageData.maxAgeDays,
this.ageData.expireWarnDays,
).then(() => {
@@ -116,7 +119,7 @@ export class PasswordAgePolicyComponent implements OnDestroy {
this.toast.showError(error);
});
} else {
- (this.service as ManagementService).UpdatePasswordAgePolicy(
+ (this.service as ManagementService).updateCustomPasswordAgePolicy(
this.ageData.maxAgeDays,
this.ageData.expireWarnDays,
).then(() => {
@@ -127,7 +130,7 @@ export class PasswordAgePolicyComponent implements OnDestroy {
}
break;
case PolicyComponentServiceType.ADMIN:
- (this.service as AdminService).UpdateDefaultPasswordAgePolicy(
+ (this.service as AdminService).updatePasswordAgePolicy(
this.ageData.maxAgeDays,
this.ageData.expireWarnDays,
).then(() => {
@@ -141,7 +144,7 @@ export class PasswordAgePolicyComponent implements OnDestroy {
public get isDefault(): boolean {
if (this.ageData && this.serviceType === PolicyComponentServiceType.MGMT) {
- return (this.ageData as PasswordAgePolicyView.AsObject).pb_default;
+ return (this.ageData as PasswordAgePolicy.AsObject).isDefault;
} else {
return false;
}
diff --git a/console/src/app/modules/policies/password-complexity-policy/password-complexity-policy.component.ts b/console/src/app/modules/policies/password-complexity-policy/password-complexity-policy.component.ts
index eeab223485..0fedeb4890 100644
--- a/console/src/app/modules/policies/password-complexity-policy/password-complexity-policy.component.ts
+++ b/console/src/app/modules/policies/password-complexity-policy/password-complexity-policy.component.ts
@@ -2,14 +2,25 @@ import { Component, Injector, OnDestroy, Type } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { switchMap } from 'rxjs/operators';
-import { DefaultPasswordComplexityPolicy } from 'src/app/proto/generated/admin_pb';
-import { PasswordComplexityPolicyView } from 'src/app/proto/generated/management_pb';
+import {
+ GetPasswordComplexityPolicyResponse as AdminGetPasswordComplexityPolicyResponse,
+} from 'src/app/proto/generated/zitadel/admin_pb';
+import {
+ GetPasswordComplexityPolicyResponse as MgmtGetPasswordComplexityPolicyResponse,
+} from 'src/app/proto/generated/zitadel/management_pb';
+import { PasswordComplexityPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ManagementService } from 'src/app/services/mgmt.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 { 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';
@Component({
@@ -21,7 +32,7 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;
public service!: ManagementService | AdminService;
- public complexityData!: PasswordComplexityPolicyView.AsObject | DefaultPasswordComplexityPolicy.AsObject;
+ public complexityData!: PasswordComplexityPolicy.AsObject;
private sub: Subscription = new Subscription();
public PolicyComponentServiceType: any = PolicyComponentServiceType;
@@ -64,8 +75,8 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
this.loading = true;
this.getData().then(data => {
- if (data) {
- this.complexityData = data.toObject();
+ if (data.policy) {
+ this.complexityData = data.policy;
this.loading = false;
}
});
@@ -76,18 +87,18 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
}
private async getData():
- Promise {
+ Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- return (this.service as ManagementService).GetPasswordComplexityPolicy();
+ return (this.service as ManagementService).getPasswordComplexityPolicy();
case PolicyComponentServiceType.ADMIN:
- return (this.service as AdminService).GetDefaultPasswordComplexityPolicy();
+ return (this.service as AdminService).getPasswordComplexityPolicy();
}
}
public removePolicy(): void {
if (this.service instanceof ManagementService) {
- this.service.removePasswordComplexityPolicy().then(() => {
+ this.service.resetPasswordComplexityPolicyToDefault().then(() => {
this.toast.showInfo('POLICY.TOAST.RESETSUCCESS', true);
setTimeout(() => {
this.fetchData();
@@ -113,8 +124,8 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
public savePolicy(): void {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- if ((this.complexityData as PasswordComplexityPolicyView.AsObject).pb_default) {
- (this.service as ManagementService).CreatePasswordComplexityPolicy(
+ if ((this.complexityData as PasswordComplexityPolicy.AsObject).isDefault) {
+ (this.service as ManagementService).addCustomPasswordComplexityPolicy(
this.complexityData.hasLowercase,
this.complexityData.hasUppercase,
@@ -127,7 +138,7 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
this.toast.showError(error);
});
} else {
- (this.service as ManagementService).UpdatePasswordComplexityPolicy(
+ (this.service as ManagementService).updateCustomPasswordComplexityPolicy(
this.complexityData.hasLowercase,
this.complexityData.hasUppercase,
this.complexityData.hasNumber,
@@ -141,7 +152,7 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
}
break;
case PolicyComponentServiceType.ADMIN:
- (this.service as AdminService).UpdateDefaultPasswordComplexityPolicy(
+ (this.service as AdminService).updatePasswordComplexityPolicy(
this.complexityData.hasLowercase,
this.complexityData.hasUppercase,
this.complexityData.hasNumber,
@@ -158,7 +169,7 @@ export class PasswordComplexityPolicyComponent implements OnDestroy {
public get isDefault(): boolean {
if (this.complexityData && this.serviceType === PolicyComponentServiceType.MGMT) {
- return (this.complexityData as PasswordComplexityPolicyView.AsObject).pb_default;
+ return (this.complexityData as PasswordComplexityPolicy.AsObject).isDefault;
} else {
return false;
}
diff --git a/console/src/app/modules/policies/password-lockout-policy/password-lockout-policy.component.ts b/console/src/app/modules/policies/password-lockout-policy/password-lockout-policy.component.ts
index a01cb8eda6..0a96506f1b 100644
--- a/console/src/app/modules/policies/password-lockout-policy/password-lockout-policy.component.ts
+++ b/console/src/app/modules/policies/password-lockout-policy/password-lockout-policy.component.ts
@@ -3,8 +3,13 @@ import { FormGroup } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { Subscription } from 'rxjs';
import { switchMap } from 'rxjs/operators';
-import { DefaultPasswordLockoutPolicyView } from 'src/app/proto/generated/admin_pb';
-import { PasswordLockoutPolicyView } from 'src/app/proto/generated/management_pb';
+import {
+ GetPasswordLockoutPolicyResponse as AdminGetPasswordLockoutPolicyResponse,
+} from 'src/app/proto/generated/zitadel/admin_pb';
+import {
+ GetPasswordLockoutPolicyResponse as MgmtGetPasswordLockoutPolicyResponse,
+} from 'src/app/proto/generated/zitadel/management_pb';
+import { PasswordLockoutPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -22,7 +27,7 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
public lockoutForm!: FormGroup;
- public lockoutData!: PasswordLockoutPolicyView.AsObject;
+ public lockoutData!: PasswordLockoutPolicy.AsObject;
private sub: Subscription = new Subscription();
public PolicyComponentServiceType: any = PolicyComponentServiceType;
@@ -54,25 +59,25 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
}
private fetchData(): void {
- this.getData().then(data => {
- if (data) {
- this.lockoutData = data.toObject() as PasswordLockoutPolicyView.AsObject;
+ this.getData().then(resp => {
+ if (resp.policy) {
+ this.lockoutData = resp.policy;
}
});
}
- private getData(): Promise {
+ private getData(): Promise {
switch (this.serviceType) {
case PolicyComponentServiceType.MGMT:
- return (this.service as ManagementService).GetPasswordLockoutPolicy();
+ return (this.service as ManagementService).getPasswordLockoutPolicy();
case PolicyComponentServiceType.ADMIN:
- return (this.service as AdminService).GetDefaultPasswordLockoutPolicy();
+ return (this.service as AdminService).getPasswordLockoutPolicy();
}
}
public removePolicy(): void {
if (this.service instanceof ManagementService) {
- this.service.RemovePasswordLockoutPolicy().then(() => {
+ this.service.resetPasswordLockoutPolicyToDefault().then(() => {
this.toast.showInfo('POLICY.TOAST.RESETSUCCESS', true);
this.fetchData();
}).catch(error => {
@@ -96,7 +101,7 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
public savePolicy(): void {
let promise: Promise;
if (this.service instanceof AdminService) {
- promise = this.service.UpdateDefaultPasswordLockoutPolicy(
+ promise = this.service.updatePasswordLockoutPolicy(
this.lockoutData.maxAttempts,
this.lockoutData.showLockoutFailure,
).then(() => {
@@ -105,8 +110,8 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
this.toast.showError(error);
});
} else {
- if ((this.lockoutData as PasswordLockoutPolicyView.AsObject).pb_default) {
- promise = this.service.CreatePasswordLockoutPolicy(
+ if ((this.lockoutData as PasswordLockoutPolicy.AsObject).isDefault) {
+ promise = this.service.addCustomPasswordLockoutPolicy(
this.lockoutData.maxAttempts,
this.lockoutData.showLockoutFailure,
).then(() => {
@@ -115,7 +120,7 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
this.toast.showError(error);
});
} else {
- promise = this.service.UpdatePasswordLockoutPolicy(
+ promise = this.service.updateCustomPasswordLockoutPolicy(
this.lockoutData.maxAttempts,
this.lockoutData.showLockoutFailure,
).then(() => {
@@ -129,7 +134,7 @@ export class PasswordLockoutPolicyComponent implements OnDestroy {
public get isDefault(): boolean {
if (this.lockoutData && this.serviceType === PolicyComponentServiceType.MGMT) {
- return (this.lockoutData as PasswordLockoutPolicyView.AsObject).pb_default;
+ return (this.lockoutData as PasswordLockoutPolicy.AsObject).isDefault;
} else {
return false;
}
diff --git a/console/src/app/modules/policy-grid/policy-grid.component.ts b/console/src/app/modules/policy-grid/policy-grid.component.ts
index ba66e493dc..3f8fbf1b97 100644
--- a/console/src/app/modules/policy-grid/policy-grid.component.ts
+++ b/console/src/app/modules/policy-grid/policy-grid.component.ts
@@ -1,9 +1,8 @@
import { Component, Input, OnInit } from '@angular/core';
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 { PasswordComplexityPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
import { AdminService } from 'src/app/services/admin.service';
+import { ManagementService } from 'src/app/services/mgmt.service';
export enum PolicyGridType {
ORG,
@@ -20,18 +19,22 @@ export class PolicyGridComponent implements OnInit {
public PolicyComponentType: any = PolicyComponentType;
public PolicyGridType: any = PolicyGridType;
- public complexityPolicy!: MgmtPasswordComplexityPolicyView.AsObject | AdminPasswordComplexityPolicyView.AsObject | any;
+ public complexityPolicy!: PasswordComplexityPolicy.AsObject;
constructor(private mgmtService: ManagementService, private adminService: AdminService) { }
public ngOnInit(): void {
if (this.type == PolicyGridType.ORG) {
- this.mgmtService.GetDefaultPasswordComplexityPolicy().then((policy) => {
- this.complexityPolicy = policy.toObject();
+ this.mgmtService.getPasswordComplexityPolicy().then((resp) => {
+ if (resp.policy) {
+ this.complexityPolicy = resp.policy;
+ }
});
} else if (this.type == PolicyGridType.IAM) {
- this.adminService.GetDefaultPasswordComplexityPolicy().then((policy) => {
- this.complexityPolicy = policy.toObject();
+ this.adminService.getPasswordComplexityPolicy().then((resp) => {
+ if (resp.policy) {
+ this.complexityPolicy = resp.policy;
+ }
});
}
}
diff --git a/console/src/app/modules/project-members/project-members-datasource.ts b/console/src/app/modules/project-members/project-members-datasource.ts
index 43a0f0b637..9f37e8c97f 100644
--- a/console/src/app/modules/project-members/project-members-datasource.ts
+++ b/console/src/app/modules/project-members/project-members-datasource.ts
@@ -2,19 +2,22 @@ import { DataSource } from '@angular/cdk/collections';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
-import { ProjectMember, ProjectMemberSearchResponse, ProjectType } from 'src/app/proto/generated/management_pb';
+import { ListProjectGrantMembersResponse, ListProjectMembersResponse } from 'src/app/proto/generated/zitadel/management_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
+import { ProjectType } from './project-members.component';
+
/**
* Data source for the ProjectMembers view. This class should
* encapsulate all logic for fetching and manipulating the displayed data
* (including sorting, pagination, and filtering).
*/
-export class ProjectMembersDataSource extends DataSource {
+export class ProjectMembersDataSource extends DataSource {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
- public membersSubject: BehaviorSubject = new BehaviorSubject([]);
+ public membersSubject: BehaviorSubject = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -29,21 +32,22 @@ export class ProjectMembersDataSource extends DataSource
this.loadingSubject.next(true);
- const promise: Promise | undefined =
+ const promise: Promise | Promise | undefined =
projectType === ProjectType.PROJECTTYPE_OWNED ?
- this.mgmtService.SearchProjectMembers(projectId, pageSize, offset) :
+ this.mgmtService.listProjectMembers(projectId, pageSize, offset) :
projectType === ProjectType.PROJECTTYPE_GRANTED && grantId ?
- this.mgmtService.SearchProjectGrantMembers(projectId,
+ this.mgmtService.listProjectGrantMembers(projectId,
grantId, pageSize, offset) : undefined;
if (promise) {
from(promise).pipe(
map(resp => {
- const response = resp.toObject();
- this.totalResult = response.totalResult;
- if (response.viewTimestamp) {
- this.viewTimestamp = response.viewTimestamp;
+ if (resp.details?.totalResult) {
+ this.totalResult = resp.details?.totalResult;
}
- return response.resultList;
+ if (resp.details?.viewTimestamp) {
+ this.viewTimestamp = resp.details.viewTimestamp;
+ }
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -59,7 +63,7 @@ export class ProjectMembersDataSource extends DataSource
* the returned stream emits new items.
* @returns A stream of the items to be rendered.
*/
- public connect(): Observable {
+ public connect(): Observable {
return this.membersSubject.asObservable();
}
diff --git a/console/src/app/modules/project-members/project-members.component.html b/console/src/app/modules/project-members/project-members.component.html
index 7d845b04fb..09e87d1c22 100644
--- a/console/src/app/modules/project-members/project-members.component.html
+++ b/console/src/app/modules/project-members/project-members.component.html
@@ -1,14 +1,14 @@
-
+ [appHasRole]="['project.member.delete:' + (projectType === ProjectType.PROJECTTYPE_OWNED) ? $any(project)?.id : (projectType === ProjectType.PROJECTTYPE_GRANTED) ? $any(project)?.projectId: '', 'project.member.delete']">
@@ -16,7 +16,7 @@
+ [appHasRole]="['project.member.write:'+(projectType === ProjectType.PROJECTTYPE_OWNED) ? $any(project)?.id : (projectType === ProjectType.PROJECTTYPE_GRANTED) ? $any(project)?.projectId: '','project.member.write']">
add{{ 'ACTIONS.NEW' | translate }}
diff --git a/console/src/app/modules/project-members/project-members.component.ts b/console/src/app/modules/project-members/project-members.component.ts
index 5cde0de798..d39153ae7a 100644
--- a/console/src/app/modules/project-members/project-members.component.ts
+++ b/console/src/app/modules/project-members/project-members.component.ts
@@ -4,21 +4,19 @@ import { PageEvent } from '@angular/material/paginator';
import { MatSelectChange } from '@angular/material/select';
import { ActivatedRoute } from '@angular/router';
import { take } from 'rxjs/operators';
-import {
- ProjectGrantMemberView,
- ProjectGrantView,
- ProjectMember,
- ProjectMemberView,
- ProjectType,
- ProjectView,
- UserView,
-} from 'src/app/proto/generated/management_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
+import { GrantedProject, Project } from 'src/app/proto/generated/zitadel/project_pb';
+import { User } from 'src/app/proto/generated/zitadel/user_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
import { CreationType, MemberCreateDialogComponent } from '../add-member-dialog/member-create-dialog.component';
import { ProjectMembersDataSource } from './project-members-datasource';
+export enum ProjectType {
+ PROJECTTYPE_OWNED = "OWNED",
+ PROJECTTYPE_GRANTED = "GRANTED"
+}
@Component({
selector: 'app-project-members',
@@ -27,7 +25,7 @@ import { ProjectMembersDataSource } from './project-members-datasource';
})
export class ProjectMembersComponent {
public INITIALPAGESIZE: number = 25;
- public project!: ProjectView.AsObject | ProjectGrantView.AsObject;
+ public project!: Project.AsObject | GrantedProject.AsObject;
public projectType: ProjectType = ProjectType.PROJECTTYPE_OWNED;
public grantId: string = '';
public projectName: string = '';
@@ -36,7 +34,9 @@ export class ProjectMembersComponent {
public changePageFactory!: Function;
public changePage: EventEmitter = new EventEmitter();
- public selection: Array = [];
+ public selection: Array = [];
+
+ public ProjectType: any = ProjectType;
constructor(
private mgmtService: ManagementService,
private dialog: MatDialog,
@@ -50,43 +50,47 @@ export class ProjectMembersComponent {
this.route.params.subscribe(params => {
this.grantId = params.grantid;
if (this.projectType === ProjectType.PROJECTTYPE_OWNED) {
- this.mgmtService.GetProjectById(params.projectid).then(project => {
- this.project = project.toObject();
- this.projectName = this.project.name;
- this.dataSource = new ProjectMembersDataSource(this.mgmtService);
- this.dataSource.loadMembers(this.project.projectId, this.projectType, 0, this.INITIALPAGESIZE);
+ this.mgmtService.getProjectByID(params.projectid).then(resp => {
+ if (resp.project) {
+ this.project = resp.project;
+ this.projectName = this.project.name;
+ this.dataSource = new ProjectMembersDataSource(this.mgmtService);
+ this.dataSource.loadMembers(this.project.id, this.projectType, 0, this.INITIALPAGESIZE);
- this.changePageFactory = (event?: PageEvent) => {
- return this.dataSource.loadMembers(
- this.project.projectId,
- this.projectType,
- event?.pageIndex ?? 0,
- event?.pageSize ?? this.INITIALPAGESIZE,
- this.grantId,
- );
- };
+ this.changePageFactory = (event?: PageEvent) => {
+ return this.dataSource.loadMembers(
+ (this.project as Project.AsObject).id,
+ this.projectType,
+ event?.pageIndex ?? 0,
+ event?.pageSize ?? this.INITIALPAGESIZE,
+ this.grantId,
+ );
+ };
+ }
});
} else if (this.projectType === ProjectType.PROJECTTYPE_GRANTED) {
- this.mgmtService.GetGrantedProjectByID(params.projectid, params.grantid).then(project => {
- this.project = project.toObject();
- this.projectName = this.project.projectName;
- this.dataSource = new ProjectMembersDataSource(this.mgmtService);
- this.dataSource.loadMembers(this.project.projectId,
- this.projectType,
- 0,
- this.INITIALPAGESIZE,
- this.grantId,
- );
-
- this.changePageFactory = (event?: PageEvent) => {
- return this.dataSource.loadMembers(
- this.project.projectId,
+ this.mgmtService.getGrantedProjectByID(params.projectid, params.grantid).then(resp => {
+ if (resp.grantedProject) {
+ this.project = resp.grantedProject;
+ this.projectName = this.project.projectName;
+ this.dataSource = new ProjectMembersDataSource(this.mgmtService);
+ this.dataSource.loadMembers(this.project.projectId,
this.projectType,
- event?.pageIndex ?? 0,
- event?.pageSize ?? this.INITIALPAGESIZE,
+ 0,
+ this.INITIALPAGESIZE,
this.grantId,
);
- };
+
+ this.changePageFactory = (event?: PageEvent) => {
+ return this.dataSource.loadMembers(
+ (this.project as GrantedProject.AsObject).projectId,
+ this.projectType,
+ event?.pageIndex ?? 0,
+ event?.pageSize ?? this.INITIALPAGESIZE,
+ this.grantId,
+ );
+ };
+ }
});
}
});
@@ -95,14 +99,14 @@ export class ProjectMembersComponent {
public getRoleOptions(): void {
if (this.projectType === ProjectType.PROJECTTYPE_GRANTED) {
- this.mgmtService.GetProjectGrantMemberRoles().then(resp => {
- this.memberRoleOptions = resp.toObject().rolesList;
+ this.mgmtService.listProjectGrantMemberRoles().then(resp => {
+ this.memberRoleOptions = resp.resultList;
}).catch(error => {
this.toast.showError(error);
});
} else if (this.projectType === ProjectType.PROJECTTYPE_OWNED) {
- this.mgmtService.GetProjectMemberRoles().then(resp => {
- this.memberRoleOptions = resp.toObject().rolesList;
+ this.mgmtService.listProjectMemberRoles().then(resp => {
+ this.memberRoleOptions = resp.resultList;
}).catch(error => {
this.toast.showError(error);
});
@@ -112,13 +116,13 @@ export class ProjectMembersComponent {
public removeProjectMemberSelection(): void {
Promise.all(this.selection.map(member => {
if (this.projectType === ProjectType.PROJECTTYPE_OWNED) {
- return this.mgmtService.RemoveProjectMember(this.project.projectId, member.userId).then(() => {
+ return this.mgmtService.removeProjectMember((this.project as Project.AsObject).id, member.userId).then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERREMOVED', true);
}).catch(error => {
this.toast.showError(error);
});
} else if (this.projectType === ProjectType.PROJECTTYPE_GRANTED) {
- return this.mgmtService.RemoveProjectGrantMember(this.project.projectId, this.grantId,
+ return this.mgmtService.removeProjectGrantMember((this.project as GrantedProject.AsObject).projectId, this.grantId,
member.userId).then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERREMOVED', true);
}).catch(error => {
@@ -132,9 +136,9 @@ export class ProjectMembersComponent {
});
}
- public removeProjectMember(member: ProjectMemberView.AsObject | ProjectGrantMemberView.AsObject): void {
+ public removeProjectMember(member: Member.AsObject | Member.AsObject): void {
if (this.projectType === ProjectType.PROJECTTYPE_OWNED) {
- this.mgmtService.RemoveProjectMember(this.project.projectId, member.userId).then(() => {
+ this.mgmtService.removeProjectMember((this.project as Project.AsObject).id, member.userId).then(() => {
setTimeout(() => {
this.changePage.emit();
}, 1000);
@@ -143,7 +147,7 @@ export class ProjectMembersComponent {
this.toast.showError(error);
});
} else if (this.projectType === ProjectType.PROJECTTYPE_GRANTED) {
- this.mgmtService.RemoveProjectGrantMember(this.project.projectId, this.grantId,
+ this.mgmtService.removeProjectGrantMember((this.project as GrantedProject.AsObject).projectId, this.grantId,
member.userId).then(() => {
setTimeout(() => {
this.changePage.emit();
@@ -165,16 +169,16 @@ export class ProjectMembersComponent {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- const users: UserView.AsObject[] = resp.users;
+ const users: User.AsObject[] = resp.users;
const roles: string[] = resp.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
if (this.projectType === ProjectType.PROJECTTYPE_OWNED) {
- return this.mgmtService.AddProjectMember(this.project.projectId, user.id, roles);
+ return this.mgmtService.addProjectMember((this.project as Project.AsObject).id, user.id, roles);
} else if (this.projectType === ProjectType.PROJECTTYPE_GRANTED) {
- return this.mgmtService.AddProjectGrantMember(this.project.projectId, this.grantId,
+ return this.mgmtService.addProjectGrantMember((this.project as GrantedProject.AsObject).projectId, this.grantId,
user.id, roles);
}
})).then(() => {
@@ -190,18 +194,18 @@ export class ProjectMembersComponent {
});
}
- updateRoles(member: ProjectMember.AsObject, selectionChange: MatSelectChange): void {
+ updateRoles(member: Member.AsObject, selectionChange: MatSelectChange): void {
if (this.projectType === ProjectType.PROJECTTYPE_OWNED) {
- this.mgmtService.ChangeProjectMember(this.project.projectId, member.userId, selectionChange.value)
- .then((_: ProjectMember) => {
+ this.mgmtService.updateProjectMember((this.project as Project.AsObject).id, member.userId, selectionChange.value)
+ .then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERCHANGED', true);
}).catch(error => {
this.toast.showError(error);
});
} else if (this.projectType === ProjectType.PROJECTTYPE_GRANTED) {
- this.mgmtService.ChangeProjectGrantMember(this.project.projectId,
+ this.mgmtService.updateProjectGrantMember((this.project as GrantedProject.AsObject).projectId,
this.grantId, member.userId, selectionChange.value)
- .then((_: ProjectMember) => {
+ .then(() => {
this.toast.showInfo('PROJECT.TOAST.MEMBERCHANGED', true);
}).catch(error => {
this.toast.showError(error);
diff --git a/console/src/app/modules/project-roles/project-role-detail/project-role-detail.component.ts b/console/src/app/modules/project-roles/project-role-detail/project-role-detail.component.ts
index cb6fa62a65..e876445e94 100644
--- a/console/src/app/modules/project-roles/project-role-detail/project-role-detail.component.ts
+++ b/console/src/app/modules/project-roles/project-role-detail/project-role-detail.component.ts
@@ -29,7 +29,7 @@ export class ProjectRoleDetailComponent {
submitForm(): void {
if (this.formGroup.valid && this.key?.value && this.group?.value && this.displayName?.value) {
- this.mgmtService.ChangeProjectRole(this.projectId, this.key.value, this.displayName.value, this.group.value)
+ this.mgmtService.updateProjectRole(this.projectId, this.key.value, this.displayName.value, this.group.value)
.then(() => {
this.toast.showInfo('PROJECT.TOAST.ROLECHANGED', true);
this.dialogRef.close(true);
diff --git a/console/src/app/modules/project-roles/project-roles-datasource.ts b/console/src/app/modules/project-roles/project-roles-datasource.ts
index 3418a256fc..1c027fb82c 100644
--- a/console/src/app/modules/project-roles/project-roles-datasource.ts
+++ b/console/src/app/modules/project-roles/project-roles-datasource.ts
@@ -2,7 +2,7 @@ import { DataSource } from '@angular/cdk/collections';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
-import { ProjectRole } from 'src/app/proto/generated/management_pb';
+import { Role } from 'src/app/proto/generated/zitadel/project_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
/**
@@ -10,11 +10,11 @@ import { ManagementService } from 'src/app/services/mgmt.service';
* encapsulate all logic for fetching and manipulating the displayed data
* (including sorting, pagination, and filtering).
*/
-export class ProjectRolesDataSource extends DataSource {
+export class ProjectRolesDataSource extends DataSource {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
- public rolesSubject: BehaviorSubject = new BehaviorSubject([]);
+ public rolesSubject: BehaviorSubject = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -26,14 +26,15 @@ export class ProjectRolesDataSource extends DataSource {
const offset = pageIndex * pageSize;
this.loadingSubject.next(true);
- from(this.mgmtService.SearchProjectRoles(projectId, pageSize, offset)).pipe(
+ from(this.mgmtService.listProjectRoles(projectId, pageSize, offset)).pipe(
map(resp => {
- const response = resp.toObject();
- this.totalResult = response.totalResult;
- if (response.viewTimestamp) {
- this.viewTimestamp = response.viewTimestamp;
+ if (resp.details?.totalResult !== undefined) {
+ this.totalResult = resp.details.totalResult;
}
- return resp.toObject().resultList;
+ if (resp.details?.viewTimestamp) {
+ this.viewTimestamp = resp.details.viewTimestamp;
+ }
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -48,7 +49,7 @@ export class ProjectRolesDataSource extends DataSource {
* the returned stream emits new items.
* @returns A stream of the items to be rendered.
*/
- public connect(): Observable {
+ public connect(): Observable {
return this.rolesSubject.asObservable();
}
diff --git a/console/src/app/modules/project-roles/project-roles.component.ts b/console/src/app/modules/project-roles/project-roles.component.ts
index ff08a20d06..f5dee5c2de 100644
--- a/console/src/app/modules/project-roles/project-roles.component.ts
+++ b/console/src/app/modules/project-roles/project-roles.component.ts
@@ -4,7 +4,7 @@ import { MatDialog } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
import { MatTable } from '@angular/material/table';
import { tap } from 'rxjs/operators';
-import { ProjectRole } from 'src/app/proto/generated/management_pb';
+import { Role } from 'src/app/proto/generated/zitadel/project_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -22,10 +22,10 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
@Input() public disabled: boolean = false;
@Input() public actionsVisible: boolean = false;
@ViewChild(MatPaginator) public paginator!: MatPaginator;
- @ViewChild(MatTable) public table!: MatTable;
+ @ViewChild(MatTable) public table!: MatTable;
public dataSource!: ProjectRolesDataSource;
- public selection: SelectionModel = new SelectionModel(true, []);
- @Output() public changedSelection: EventEmitter> = new EventEmitter();
+ public selection: SelectionModel = new SelectionModel(true, []);
+ @Output() public changedSelection: EventEmitter> = new EventEmitter();
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
public displayedColumns: string[] = ['select', 'key', 'displayname', 'group', 'creationDate'];
@@ -51,7 +51,7 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
}
public selectAllOfGroup(group: string): void {
- const groupRoles: ProjectRole.AsObject[] = this.dataSource.rolesSubject.getValue()
+ const groupRoles: Role.AsObject[] = this.dataSource.rolesSubject.getValue()
.filter(role => role.group === group);
this.selection.select(...groupRoles);
}
@@ -73,7 +73,7 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
public masterToggle(): void {
this.isAllSelected() ?
this.selection.clear() :
- this.dataSource.rolesSubject.value.forEach((row: ProjectRole.AsObject) => this.selection.select(row));
+ this.dataSource.rolesSubject.value.forEach((row: Role.AsObject) => this.selection.select(row));
}
public deleteSelectedRoles(): Promise {
@@ -83,7 +83,7 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
});
return Promise.all(this.selection.selected.map(role => {
- return this.mgmtService.RemoveProjectRole(role.projectId, role.key);
+ return this.mgmtService.removeProjectRole(this.projectId, role.key);
})).then(() => {
this.toast.showInfo('PROJECT.TOAST.ROLEREMOVED', true);
indexes.forEach(index => {
@@ -98,9 +98,9 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
});
}
- public removeRole(role: ProjectRole.AsObject, index: number): void {
+ public removeRole(role: Role.AsObject, index: number): void {
this.mgmtService
- .RemoveProjectRole(role.projectId, role.key)
+ .removeProjectRole(this.projectId, role.key)
.then(() => {
this.toast.showInfo('PROJECT.TOAST.ROLEREMOVED', true);
this.dataSource.rolesSubject.value.splice(index, 1);
@@ -111,7 +111,7 @@ export class ProjectRolesComponent implements AfterViewInit, OnInit {
});
}
- public openDetailDialog(role: ProjectRole.AsObject): void {
+ public openDetailDialog(role: Role.AsObject): void {
this.dialog.open(ProjectRoleDetailComponent, {
data: {
role,
diff --git a/console/src/app/modules/search-project-autocomplete/search-project-autocomplete.component.ts b/console/src/app/modules/search-project-autocomplete/search-project-autocomplete.component.ts
index 6847950379..c5c3632d11 100644
--- a/console/src/app/modules/search-project-autocomplete/search-project-autocomplete.component.ts
+++ b/console/src/app/modules/search-project-autocomplete/search-project-autocomplete.component.ts
@@ -5,15 +5,8 @@ import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material
import { MatChipInputEvent } from '@angular/material/chips';
import { forkJoin, from, Subject } from 'rxjs';
import { debounceTime, switchMap, takeUntil, tap } from 'rxjs/operators';
-import {
- ProjectGrantSearchResponse,
- ProjectGrantView,
- ProjectSearchKey,
- ProjectSearchQuery,
- ProjectSearchResponse,
- ProjectView,
- SearchMethod,
-} from 'src/app/proto/generated/management_pb';
+import { ListProjectGrantsResponse, ListProjectsResponse } from 'src/app/proto/generated/zitadel/management_pb';
+import { GrantedProject, Project, ProjectNameQuery, ProjectQuery } from 'src/app/proto/generated/zitadel/project_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
@@ -34,18 +27,18 @@ export class SearchProjectAutocompleteComponent implements OnDestroy {
public separatorKeysCodes: number[] = [ENTER, COMMA];
public myControl: FormControl = new FormControl();
public names: string[] = [];
- public projects: Array = [];
- public filteredProjects: Array = [];
+ public projects: Array = [];
+ public filteredProjects: Array = [];
public isLoading: boolean = false;
@ViewChild('nameInput') public nameInput!: ElementRef;
@ViewChild('auto') public matAutocomplete!: MatAutocomplete;
@Input() public singleOutput: boolean = false;
@Input() public autocompleteType!: ProjectAutocompleteType;
@Output() public selectionChanged: EventEmitter<
- ProjectGrantView.AsObject[]
- | ProjectGrantView.AsObject
- | ProjectView.AsObject
- | ProjectView.AsObject[]
+ GrantedProject.AsObject[]
+ | GrantedProject.AsObject
+ | Project.AsObject
+ | Project.AsObject[]
> = new EventEmitter();
private unsubscribed$: Subject = new Subject();
@@ -56,20 +49,20 @@ export class SearchProjectAutocompleteComponent implements OnDestroy {
debounceTime(200),
tap(() => this.isLoading = true),
switchMap(value => {
- const query = new ProjectSearchQuery();
- query.setKey(ProjectSearchKey.PROJECTSEARCHKEY_PROJECT_NAME);
- query.setValue(value);
- query.setMethod(SearchMethod.SEARCHMETHOD_CONTAINS_IGNORE_CASE);
+ const query = new ProjectQuery();
+ const nameQuery = new ProjectNameQuery();
+ nameQuery.setName(value);
+ query.setNameQuery(nameQuery);
switch (this.autocompleteType) {
case ProjectAutocompleteType.PROJECT_GRANTED:
- return from(this.mgmtService.SearchGrantedProjects(10, 0, [query]));
+ return from(this.mgmtService.listGrantedProjects(10, 0, [query]));
case ProjectAutocompleteType.PROJECT_OWNED:
- return from(this.mgmtService.SearchProjects(10, 0, [query]));
+ return from(this.mgmtService.listProjects(10, 0, [query]));
default:
return forkJoin([
- from(this.mgmtService.SearchGrantedProjects(10, 0, [query])),
- from(this.mgmtService.SearchProjects(10, 0, [query])),
+ from(this.mgmtService.listGrantedProjects(10, 0, [query])),
+ from(this.mgmtService.listProjects(10, 0, [query])),
]);
}
}),
@@ -77,19 +70,19 @@ export class SearchProjectAutocompleteComponent implements OnDestroy {
switch (this.autocompleteType) {
case ProjectAutocompleteType.PROJECT_GRANTED:
this.isLoading = false;
- this.filteredProjects = [...(returnValue as ProjectGrantSearchResponse).toObject().resultList];
+ this.filteredProjects = [...(returnValue as ListProjectGrantsResponse.AsObject).resultList];
break;
case ProjectAutocompleteType.PROJECT_OWNED:
this.isLoading = false;
- this.filteredProjects = [...(returnValue as ProjectSearchResponse).toObject().resultList];
+ this.filteredProjects = [...(returnValue as ListProjectsResponse.AsObject).resultList];
break;
default:
this.isLoading = false;
this.filteredProjects = [
- ...(returnValue as (ProjectSearchResponse | ProjectGrantSearchResponse)[])[0]
- .toObject().resultList,
- ...(returnValue as (ProjectSearchResponse | ProjectGrantSearchResponse)[])[1]
- .toObject().resultList,
+ ...(returnValue as (ListProjectsResponse.AsObject | ListProjectGrantsResponse.AsObject)[])[0]
+ .resultList,
+ ...(returnValue as (ListProjectsResponse.AsObject | ListProjectGrantsResponse.AsObject)[])[1]
+ .resultList,
];
break;
}
@@ -133,7 +126,7 @@ export class SearchProjectAutocompleteComponent implements OnDestroy {
}
}
- public remove(project: ProjectGrantView.AsObject): void {
+ public remove(project: GrantedProject.AsObject): void {
const index = this.projects.indexOf(project);
if (index >= 0) {
diff --git a/console/src/app/modules/search-roles-autocomplete/search-roles-autocomplete.component.ts b/console/src/app/modules/search-roles-autocomplete/search-roles-autocomplete.component.ts
index f97568a0aa..ec69459ca5 100644
--- a/console/src/app/modules/search-roles-autocomplete/search-roles-autocomplete.component.ts
+++ b/console/src/app/modules/search-roles-autocomplete/search-roles-autocomplete.component.ts
@@ -5,12 +5,7 @@ import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material
import { MatChipInputEvent } from '@angular/material/chips';
import { from, Subject } from 'rxjs';
import { debounceTime, switchMap, takeUntil, tap } from 'rxjs/operators';
-import {
- ProjectRole,
- ProjectRoleSearchKey,
- ProjectRoleSearchQuery,
- SearchMethod,
-} from 'src/app/proto/generated/management_pb';
+import { Role, RoleDisplayNameQuery, RoleQuery } from 'src/app/proto/generated/zitadel/project_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
@@ -26,14 +21,14 @@ export class SearchRolesAutocompleteComponent implements OnDestroy {
public separatorKeysCodes: number[] = [ENTER, COMMA];
public myControl: FormControl = new FormControl();
public names: string[] = [];
- public roles: Array = [];
- public filteredRoles: Array = [];
+ public roles: Array = [];
+ public filteredRoles: Array = [];
public isLoading: boolean = false;
@ViewChild('nameInput') public nameInput!: ElementRef;
@ViewChild('auto') public matAutocomplete!: MatAutocomplete;
@Input() public projectId: string = '';
@Input() public singleOutput: boolean = false;
- @Output() public selectionChanged: EventEmitter = new EventEmitter();
+ @Output() public selectionChanged: EventEmitter = new EventEmitter();
private unsubscribed$: Subject = new Subject();
constructor(private mgmtService: ManagementService) {
@@ -43,15 +38,21 @@ export class SearchRolesAutocompleteComponent implements OnDestroy {
debounceTime(200),
tap(() => this.isLoading = true),
switchMap(value => {
- const query = new ProjectRoleSearchQuery();
- query.setKey(ProjectRoleSearchKey.PROJECTROLESEARCHKEY_DISPLAY_NAME);
- query.setMethod(SearchMethod.SEARCHMETHOD_CONTAINS_IGNORE_CASE);
- query.setValue(value);
- return from(this.mgmtService.SearchProjectRoles(this.projectId, 10, 0, [query]));
+ const query = new RoleQuery();
+
+ // const key = new RoleKeyQuery();
+ // key.setKey(key)
+ // query.setKey(key)
+
+ const dQuery = new RoleDisplayNameQuery();
+ dQuery.setDisplayName(value);
+ query.setDisplayNameQuery(dQuery);
+
+ return from(this.mgmtService.listProjectRoles(this.projectId, 10, 0, [query]));
}),
- ).subscribe((roles) => {
+ ).subscribe((resp) => {
this.isLoading = false;
- this.filteredRoles = roles.toObject().resultList;
+ this.filteredRoles = resp.resultList;
}, error => {
this.isLoading = false;
});
@@ -61,7 +62,7 @@ export class SearchRolesAutocompleteComponent implements OnDestroy {
this.unsubscribed$.next();
}
- public displayFn(project?: ProjectRole.AsObject): string | undefined {
+ public displayFn(project?: Role.AsObject): string | undefined {
return project ? `${project.displayName}` : undefined;
}
@@ -91,7 +92,7 @@ export class SearchRolesAutocompleteComponent implements OnDestroy {
}
}
- public remove(role: ProjectRole.AsObject): void {
+ public remove(role: Role.AsObject): void {
const index = this.roles.indexOf(role);
if (index >= 0) {
diff --git a/console/src/app/modules/search-user-autocomplete/search-user-autocomplete.component.ts b/console/src/app/modules/search-user-autocomplete/search-user-autocomplete.component.ts
index d4809db3e4..524acad866 100644
--- a/console/src/app/modules/search-user-autocomplete/search-user-autocomplete.component.ts
+++ b/console/src/app/modules/search-user-autocomplete/search-user-autocomplete.component.ts
@@ -15,7 +15,8 @@ import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material
import { MatChipInputEvent } from '@angular/material/chips';
import { from, of, Subject } from 'rxjs';
import { debounceTime, switchMap, takeUntil, tap } from 'rxjs/operators';
-import { SearchMethod, UserSearchKey, UserSearchQuery, UserView } from 'src/app/proto/generated/management_pb';
+import { TextQueryMethod } from 'src/app/proto/generated/zitadel/object_pb';
+import { SearchQuery, User, UserNameQuery } from 'src/app/proto/generated/zitadel/user_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -39,15 +40,15 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
public globalLoginNameControl: FormControl = new FormControl();
public loginNames: string[] = [];
- @Input() public users: Array = [];
- public filteredUsers: Array = [];
+ @Input() public users: Array = [];
+ public filteredUsers: Array = [];
public isLoading: boolean = false;
@Input() public target: UserTarget = UserTarget.SELF;
public hint: string = '';
public UserTarget: any = UserTarget;
@ViewChild('usernameInput') public usernameInput!: ElementRef;
@ViewChild('auto') public matAutocomplete!: MatAutocomplete;
- @Output() public selectionChanged: EventEmitter = new EventEmitter();
+ @Output() public selectionChanged: EventEmitter = new EventEmitter();
@Input() public singleOutput: boolean = false;
private unsubscribed$: Subject = new Subject();
@@ -71,14 +72,15 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
takeUntil(this.unsubscribed$),
tap(() => this.isLoading = true),
switchMap(value => {
- const query = new UserSearchQuery();
- query.setKey(UserSearchKey.USERSEARCHKEY_USER_NAME);
- query.setValue(value);
- query.setMethod(SearchMethod.SEARCHMETHOD_CONTAINS_IGNORE_CASE);
+ const query = new SearchQuery();
+ const unQuery = new UserNameQuery();
+ unQuery.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
+ query.setUserNameQuery(value);
+
if (this.target === UserTarget.SELF) {
- return from(this.userService.SearchUsers(10, 0, [query]));
+ return from(this.userService.listUsers(10, 0, [query]));
} else {
- return of(); // from(this.userService.GetUserByEmailGlobal(value));
+ return of();
}
}),
).subscribe((userresp: any) => {
@@ -89,7 +91,7 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
});
}
- public displayFn(user?: UserView.AsObject): string | undefined {
+ public displayFn(user?: User.AsObject): string | undefined {
return user ? `${user.preferredLoginName}` : undefined;
}
@@ -119,7 +121,7 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
}
}
- public remove(user: UserView.AsObject): void {
+ public remove(user: User.AsObject): void {
const index = this.users.indexOf(user);
if (index >= 0) {
@@ -163,12 +165,12 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
}
public getGlobalUser(): void {
- this.userService.GetUserByLoginNameGlobal(this.globalLoginNameControl.value).then(user => {
- if (this.singleOutput) {
- this.users = [user.toObject()];
+ this.userService.getUserByLoginNameGlobal(this.globalLoginNameControl.value).then(resp => {
+ if (this.singleOutput && resp.user) {
+ this.users = [resp.user];
this.selectionChanged.emit(this.users[0]);
- } else {
- this.users.push(user.toObject());
+ } else if (resp.user) {
+ this.users.push(resp.user);
this.selectionChanged.emit(this.users);
}
}).catch(error => {
diff --git a/console/src/app/modules/show-key-dialog/show-key-dialog.component.html b/console/src/app/modules/show-key-dialog/show-key-dialog.component.html
index bf0bdde670..0064ae1c3b 100644
--- a/console/src/app/modules/show-key-dialog/show-key-dialog.component.html
+++ b/console/src/app/modules/show-key-dialog/show-key-dialog.component.html
@@ -1,23 +1,22 @@
{{'USER.MACHINE.ADDED.TITLE' | translate}}
{{'USER.MACHINE.ADDED.DESCRIPTION' | translate}}
-
+
{{'USER.MACHINE.ID' | translate}}
- {{addedKey?.id}}
-
-
- {{'USER.MACHINE.TYPE' | translate}}
- {{'USER.MACHINE.KEYTYPES.'+addedKey?.type | translate}}
+ {{keyResponse?.keyId}}
+
{{'USER.MACHINE.CREATIONDATE' | translate}}
- {{addedKey?.creationDate | timestampToDate | localizedDate: 'EEE dd. MMM YYYY, HH:mm' }}
+ {{keyResponse?.details?.creationDate | timestampToDate | localizedDate: 'EEE dd. MMM YYYY,
+ HH:mm' }}
{{'USER.MACHINE.EXPIRATIONDATE' | translate}}
- {{addedKey?.expirationDate | timestampToDate | localizedDate: 'EEE dd. MMM YYYY, HH:mm'}}
+ {{keyResponse?.details.expirationDate | timestampToDate | localizedDate: 'EEE dd. MMM YYYY,
+ HH:mm'}}
Download
diff --git a/console/src/app/modules/show-key-dialog/show-key-dialog.component.ts b/console/src/app/modules/show-key-dialog/show-key-dialog.component.ts
index cc45b76c7a..531f8de6aa 100644
--- a/console/src/app/modules/show-key-dialog/show-key-dialog.component.ts
+++ b/console/src/app/modules/show-key-dialog/show-key-dialog.component.ts
@@ -1,7 +1,7 @@
import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { saveAs } from 'file-saver';
-import { AddMachineKeyResponse } from 'src/app/proto/generated/management_pb';
+import { AddMachineKeyResponse } from 'src/app/proto/generated/zitadel/management_pb';
@Component({
selector: 'app-show-key-dialog',
@@ -9,19 +9,19 @@ import { AddMachineKeyResponse } from 'src/app/proto/generated/management_pb';
styleUrls: ['./show-key-dialog.component.scss'],
})
export class ShowKeyDialogComponent {
- public addedKey!: AddMachineKeyResponse.AsObject;
+ public keyResponse!: AddMachineKeyResponse.AsObject;
constructor(
public dialogRef: MatDialogRef,
@Inject(MAT_DIALOG_DATA) public data: any,
) {
- this.addedKey = data.key;
+ this.keyResponse = data.key;
}
public saveFile(): void {
- const json = atob(this.addedKey.keyDetails.toString());
+ const json = atob(this.keyResponse.keyDetails.toString());
const blob = new Blob([json], { type: 'text/plain;charset=utf-8' });
- saveAs(blob, `${this.addedKey.id}.json`);
+ saveAs(blob, `${this.keyResponse.keyId}.json`);
}
public closeDialog(): void {
diff --git a/console/src/app/modules/user-grants/user-grants-datasource.ts b/console/src/app/modules/user-grants/user-grants-datasource.ts
index c01cbcb2ca..ddb4a3ad6c 100644
--- a/console/src/app/modules/user-grants/user-grants-datasource.ts
+++ b/console/src/app/modules/user-grants/user-grants-datasource.ts
@@ -2,14 +2,14 @@ import { DataSource } from '@angular/cdk/collections';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
+import { ListUserGrantResponse } from 'src/app/proto/generated/zitadel/management_pb';
import {
- SearchMethod,
UserGrant,
- UserGrantSearchKey,
- UserGrantSearchQuery,
- UserGrantSearchResponse,
- UserGrantView,
-} from 'src/app/proto/generated/management_pb';
+ UserGrantProjectGrantIDQuery,
+ UserGrantProjectIDQuery,
+ UserGrantQuery,
+ UserGrantUserIDQuery,
+} from 'src/app/proto/generated/zitadel/user_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
export enum UserGrantContext {
@@ -23,7 +23,7 @@ export class UserGrantsDataSource extends DataSource {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
- public grantsSubject: BehaviorSubject = new BehaviorSubject([]);
+ public grantsSubject: BehaviorSubject = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -40,40 +40,44 @@ export class UserGrantsDataSource extends DataSource {
grantId?: string;
userId?: string;
},
- queries?: UserGrantSearchQuery[],
+ queries?: UserGrantQuery[],
): void {
switch (context) {
case UserGrantContext.USER:
if (data && data.userId) {
this.loadingSubject.next(true);
- const userfilter = new UserGrantSearchQuery();
- userfilter.setKey(UserGrantSearchKey.USERGRANTSEARCHKEY_USER_ID);
- userfilter.setMethod(SearchMethod.SEARCHMETHOD_EQUALS);
- userfilter.setValue(data.userId);
+
+ const userfilter = new UserGrantQuery();
+ const ugUiq = new UserGrantUserIDQuery();
+ ugUiq.setUserId(data.userId);
+ userfilter.setUserIdQuery(ugUiq);
+
if (queries) {
queries.push(userfilter);
} else {
queries = [userfilter];
}
- const promise = this.userService.SearchUserGrants(pageSize, pageSize * pageIndex, queries);
+ const promise = this.userService.listUserGrants(pageSize, pageSize * pageIndex, queries);
this.loadResponse(promise);
}
break;
case UserGrantContext.OWNED_PROJECT:
if (data && data.projectId) {
this.loadingSubject.next(true);
- const projectfilter = new UserGrantSearchQuery();
- projectfilter.setKey(UserGrantSearchKey.USERGRANTSEARCHKEY_PROJECT_ID);
- projectfilter.setMethod(SearchMethod.SEARCHMETHOD_EQUALS);
- projectfilter.setValue(data.projectId);
+
+ const projectfilter = new UserGrantQuery();
+ const ugPfq = new UserGrantProjectIDQuery();
+ ugPfq.setProjectId(data.projectId);
+ projectfilter.setProjectIdQuery(ugPfq);
+
if (queries) {
queries.push(projectfilter);
} else {
queries = [projectfilter];
}
- const promise1 = this.userService.SearchUserGrants(pageSize, pageSize * pageIndex, queries);
+ const promise1 = this.userService.listUserGrants(pageSize, pageSize * pageIndex, queries);
this.loadResponse(promise1);
}
break;
@@ -81,43 +85,45 @@ export class UserGrantsDataSource extends DataSource {
if (data && data.grantId && data.projectId) {
this.loadingSubject.next(true);
- const grantquery: UserGrantSearchQuery = new UserGrantSearchQuery();
- grantquery.setKey(UserGrantSearchKey.USERGRANTSEARCHKEY_GRANT_ID);
- grantquery.setMethod(SearchMethod.SEARCHMETHOD_EQUALS);
- grantquery.setValue(data.grantId);
+ const grantfilter = new UserGrantQuery();
- const projectfilter = new UserGrantSearchQuery();
- projectfilter.setKey(UserGrantSearchKey.USERGRANTSEARCHKEY_PROJECT_ID);
- projectfilter.setValue(data.projectId);
+ const uggiq = new UserGrantProjectGrantIDQuery();
+ uggiq.setProjectGrantId(data.grantId);
+ grantfilter.setProjectGrantIdQuery(uggiq);
+
+ const projectfilter = new UserGrantQuery();
+ const ugPfq = new UserGrantProjectIDQuery();
+ ugPfq.setProjectId(data.projectId);
+ projectfilter.setProjectIdQuery(ugPfq);
if (queries) {
- queries.push(projectfilter);
- queries.push(grantquery);
+ queries.push(grantfilter);
} else {
- queries = [projectfilter, grantquery];
+ queries = [grantfilter];
}
- const promise2 = this.userService.SearchUserGrants(pageSize, pageSize * pageIndex, queries);
+ const promise2 = this.userService.listUserGrants(pageSize, pageSize * pageIndex, queries);
this.loadResponse(promise2);
}
break;
default:
this.loadingSubject.next(true);
- const promise3 = this.userService.SearchUserGrants(pageSize, pageSize * pageIndex, queries ?? []);
+ const promise3 = this.userService.listUserGrants(pageSize, pageSize * pageIndex, queries ?? []);
this.loadResponse(promise3);
break;
}
}
- private loadResponse(promise: Promise): void {
+ private loadResponse(promise: Promise): void {
from(promise).pipe(
map(resp => {
- const response = resp.toObject();
- this.totalResult = response.totalResult;
- if (response.viewTimestamp) {
- this.viewTimestamp = response.viewTimestamp;
+ if (resp.details?.totalResult) {
+ this.totalResult = resp.details.totalResult;
}
- return response.resultList;
+ if (resp.details?.viewTimestamp) {
+ this.viewTimestamp = resp.details.viewTimestamp;
+ }
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -132,7 +138,7 @@ export class UserGrantsDataSource extends DataSource {
* the returned stream emits new items.
* @returns A stream of the items to be rendered.
*/
- public connect(): Observable {
+ public connect(): Observable {
return this.grantsSubject.asObservable();
}
diff --git a/console/src/app/modules/user-grants/user-grants.component.html b/console/src/app/modules/user-grants/user-grants.component.html
index 85e77309e5..5fe6e401e1 100644
--- a/console/src/app/modules/user-grants/user-grants.component.html
+++ b/console/src/app/modules/user-grants/user-grants.component.html
@@ -1,9 +1,9 @@
-
+
+ [placeholder]="('USER.TABLE.FILTER.' + userGrantListSearchKey.toString()) | translate" #input>
{{ 'PROJECT.GRANT.USER' | translate }}
+ [ngTemplateOutletContext]="{key: UserGrantListSearchKey.DISPLAY_NAME}">
|
{{grant?.displayName}} |
@@ -49,7 +49,7 @@
{{ 'PROJECT.GRANT.GRANTEDORGDOMAIN' | translate }}
+ [ngTemplateOutletContext]="{key: UserGrantListSearchKey.ORG_NAME}">
|
{{grant.orgName}} |
@@ -58,7 +58,7 @@
{{ 'PROJECT.GRANT.PROJECTNAME' | translate }}
+ [ngTemplateOutletContext]="{key: UserGrantListSearchKey.PROJECT_NAME}">
|
{{grant.projectName}} |
@@ -82,7 +82,7 @@
{{ 'PROJECT.GRANT.ROLENAMESLIST' | translate }}
+ [ngTemplateOutletContext]="{key: UserGrantListSearchKey.ROLE_KEY}">
|
- search
- search_off
+ search
+ search_off
\ No newline at end of file
diff --git a/console/src/app/modules/user-grants/user-grants.component.ts b/console/src/app/modules/user-grants/user-grants.component.ts
index 9263d85fc6..74a056fa9b 100644
--- a/console/src/app/modules/user-grants/user-grants.component.ts
+++ b/console/src/app/modules/user-grants/user-grants.component.ts
@@ -6,19 +6,27 @@ import { MatSelectChange } from '@angular/material/select';
import { MatTable } from '@angular/material/table';
import { tap } from 'rxjs/operators';
import { enterAnimations } from 'src/app/animations';
+import { TextQueryMethod } from 'src/app/proto/generated/zitadel/object_pb';
+import { Role } from 'src/app/proto/generated/zitadel/project_pb';
import {
- ProjectRoleView,
- SearchMethod,
UserGrant,
- UserGrantSearchKey,
- UserGrantSearchQuery,
- UserGrantView,
-} from 'src/app/proto/generated/management_pb';
+ UserGrantDisplayNameQuery,
+ UserGrantOrgNameQuery,
+ UserGrantProjectNameQuery,
+ UserGrantQuery,
+ UserGrantRoleKeyQuery,
+} from 'src/app/proto/generated/zitadel/user_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
import { UserGrantContext, UserGrantsDataSource } from './user-grants-datasource';
+export enum UserGrantListSearchKey {
+ DISPLAY_NAME,
+ ORG_NAME,
+ PROJECT_NAME,
+ ROLE_KEY,
+}
@Component({
selector: 'app-user-grants',
templateUrl: './user-grants.component.html',
@@ -28,17 +36,17 @@ import { UserGrantContext, UserGrantsDataSource } from './user-grants-datasource
],
})
export class UserGrantsComponent implements OnInit, AfterViewInit {
- public userGrantSearchKey: UserGrantSearchKey | undefined = undefined;
- public UserGrantSearchKey: any = UserGrantSearchKey;
+ public userGrantListSearchKey: UserGrantListSearchKey | undefined = undefined;
+ public UserGrantListSearchKey: any = UserGrantListSearchKey;
public INITIAL_PAGE_SIZE: number = 50;
@Input() context: UserGrantContext = UserGrantContext.NONE;
@Input() refreshOnPreviousRoutes: string[] = [];
public dataSource!: UserGrantsDataSource;
- public selection: SelectionModel = new SelectionModel(true, []);
+ public selection: SelectionModel = new SelectionModel(true, []);
@ViewChild(MatPaginator) public paginator!: MatPaginator;
- @ViewChild(MatTable) public table!: MatTable;
+ @ViewChild(MatTable) public table!: MatTable;
@Input() disableWrite: boolean = false;
@Input() disableDelete: boolean = false;
@@ -49,7 +57,7 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
@ViewChild('input') public filter!: MatInput;
public grantRoleOptions: string[] = [];
- public projectRoleOptions: ProjectRoleView.AsObject[] = [];
+ public projectRoleOptions: Role.AsObject[] = [];
public routerLink: any = [''];
public loadedGrantId: string = '';
@@ -106,12 +114,36 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
}
private loadGrantsPage(filterValue?: string): void {
- let queries: UserGrantSearchQuery[] = [];
- if (this.userGrantSearchKey !== undefined && filterValue) {
- const query = new UserGrantSearchQuery();
- query.setKey(this.userGrantSearchKey);
- query.setMethod(SearchMethod.SEARCHMETHOD_CONTAINS_IGNORE_CASE);
- query.setValue(filterValue);
+ let queries: UserGrantQuery[] = [];
+ if (this.userGrantListSearchKey !== undefined && filterValue) {
+ const query = new UserGrantQuery();
+ switch (this.userGrantListSearchKey) {
+ case UserGrantListSearchKey.DISPLAY_NAME:
+ const ugDnQ = new UserGrantDisplayNameQuery();
+ ugDnQ.setDisplayName(filterValue);
+ ugDnQ.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
+ query.setDisplayNameQuery(ugDnQ);
+ break;
+ case UserGrantListSearchKey.ORG_NAME:
+ const ugOnQ = new UserGrantOrgNameQuery();
+ ugOnQ.setOrgName(filterValue);
+ ugOnQ.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
+ query.setOrgNameQuery(ugOnQ);
+ break;
+ case UserGrantListSearchKey.PROJECT_NAME:
+ const ugPnQ = new UserGrantProjectNameQuery();
+ ugPnQ.setProjectName(filterValue);
+ ugPnQ.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
+ query.setProjectNameQuery(ugPnQ);
+ break;
+ case UserGrantListSearchKey.ROLE_KEY:
+ const ugRkQ = new UserGrantRoleKeyQuery();
+ ugRkQ.setRoleKey(filterValue);
+ ugRkQ.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
+ query.setRoleKeyQuery(ugRkQ);
+ break;
+
+ }
queries = [query];
}
@@ -140,8 +172,8 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
this.dataSource.grantsSubject.value.forEach(row => this.selection.select(row));
}
- public loadGrantOptions(grant: UserGrantView.AsObject): void {
- this.grantToEdit = grant.id;
+ public loadGrantOptions(grant: UserGrant.AsObject): void {
+ this.grantToEdit = grant.grantId;
if (grant.grantId && grant.projectId) {
this.getGrantRoleOptions(grant.grantId, grant.projectId);
} else if (grant.projectId) {
@@ -150,23 +182,25 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
}
private getGrantRoleOptions(grantId: string, projectId: string): void {
- this.mgmtService.GetGrantedProjectByID(projectId, grantId).then(resp => {
- this.loadedGrantId = grantId;
- this.grantRoleOptions = resp.toObject().roleKeysList;
+ this.mgmtService.getGrantedProjectByID(projectId, grantId).then(resp => {
+ if (resp.grantedProject) {
+ this.loadedGrantId = grantId;
+ this.grantRoleOptions = resp.grantedProject?.grantedRoleKeysList;
+ }
}).catch(error => {
this.toast.showError(error);
});
}
private getProjectRoleOptions(projectId: string): void {
- this.mgmtService.SearchProjectRoles(projectId, 100, 0).then(resp => {
+ this.mgmtService.listProjectRoles(projectId, 100, 0).then(resp => {
this.loadedProjectId = projectId;
- this.projectRoleOptions = resp.toObject().resultList;
+ this.projectRoleOptions = resp.resultList;
});
}
updateRoles(grant: UserGrant.AsObject, selectionChange: MatSelectChange): void {
- this.userService.UpdateUserGrant(grant.id, grant.userId, selectionChange.value)
+ this.userService.updateUserGrant(grant.grantId, grant.userId, selectionChange.value)
.then(() => {
this.toast.showInfo('GRANTS.TOAST.UPDATED', true);
}).catch(error => {
@@ -175,11 +209,11 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
}
deleteGrantSelection(): void {
- this.userService.BulkRemoveUserGrant(this.selection.selected.map(grant => grant.id)).then(() => {
+ this.userService.bulkRemoveUserGrant(this.selection.selected.map(grant => grant.grantId)).then(() => {
this.toast.showInfo('GRANTS.TOAST.BULKREMOVED', true);
const data = this.dataSource.grantsSubject.getValue();
this.selection.selected.forEach((item) => {
- const index = data.findIndex(i => i.id === item.id);
+ const index = data.findIndex(i => i.grantId === item.grantId);
if (index > -1) {
data.splice(index, 1);
this.dataSource.grantsSubject.next(data);
@@ -211,17 +245,17 @@ export class UserGrantsComponent implements OnInit, AfterViewInit {
this.loadGrantsPage(filterValue);
}
- public setFilter(key: UserGrantSearchKey): void {
+ public setFilter(key: UserGrantListSearchKey): void {
setTimeout(() => {
if (this.filter) {
(this.filter as any).nativeElement.focus();
}
}, 100);
- if (this.userGrantSearchKey !== key) {
- this.userGrantSearchKey = key;
+ if (this.userGrantListSearchKey !== key) {
+ this.userGrantListSearchKey = key;
} else {
- this.userGrantSearchKey = undefined;
+ this.userGrantListSearchKey = undefined;
this.loadGrantsPage();
}
}
diff --git a/console/src/app/pages/iam/failed-events/failed-events.component.ts b/console/src/app/pages/iam/failed-events/failed-events.component.ts
index e76a28428b..f971a5e543 100644
--- a/console/src/app/pages/iam/failed-events/failed-events.component.ts
+++ b/console/src/app/pages/iam/failed-events/failed-events.component.ts
@@ -3,7 +3,7 @@ import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
-import { FailedEvent } from 'src/app/proto/generated/admin_pb';
+import { FailedEvent } from 'src/app/proto/generated/zitadel/admin_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -32,13 +32,9 @@ export class FailedEventsComponent implements AfterViewInit {
public loadEvents(): void {
this.loadingSubject.next(true);
- from(this.adminService.GetFailedEvents()).pipe(
+ from(this.adminService.listFailedEvents()).pipe(
map(resp => {
- const response = resp.toObject();
- // if (response.viewTimestamp) {
- // this.viewTimestamp = response.viewTimestamp;
- // }
- return response.failedEventsList;
+ return resp?.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -49,7 +45,7 @@ export class FailedEventsComponent implements AfterViewInit {
}
public cancelEvent(viewname: string, db: string, seq: number): void {
- this.adminService.RemoveFailedEvent(viewname, db, seq).then(() => {
+ this.adminService.removeFailedEvent(viewname, db, seq).then(() => {
this.toast.showInfo('IAM.FAILEDEVENTS.DELETESUCCESS', true);
});
}
diff --git a/console/src/app/pages/iam/iam-members/iam-members-datasource.ts b/console/src/app/pages/iam/iam-members/iam-members-datasource.ts
index 7aca1514ae..f6b684253c 100644
--- a/console/src/app/pages/iam/iam-members/iam-members-datasource.ts
+++ b/console/src/app/pages/iam/iam-members/iam-members-datasource.ts
@@ -2,7 +2,7 @@ import { DataSource } from '@angular/cdk/collections';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
-import { IamMemberView } from 'src/app/proto/generated/admin_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
import { AdminService } from 'src/app/services/admin.service';
/**
@@ -10,10 +10,10 @@ import { AdminService } from 'src/app/services/admin.service';
* encapsulate all logic for fetching and manipulating the displayed data
* (including sorting, pagination, and filtering).
*/
-export class IamMembersDataSource extends DataSource {
+export class IamMembersDataSource extends DataSource {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
- public membersSubject: BehaviorSubject = new BehaviorSubject([]);
+ public membersSubject: BehaviorSubject = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -27,14 +27,13 @@ export class IamMembersDataSource extends DataSource {
this.loadingSubject.next(true);
- from(this.adminService.SearchIamMembers(pageSize, offset)).pipe(
+ from(this.adminService.listIAMMembers(pageSize, offset)).pipe(
map(resp => {
- const response = resp.toObject();
- this.totalResult = response.totalResult;
- if (response.viewTimestamp) {
- this.viewTimestamp = response.viewTimestamp;
+ this.totalResult = resp.details?.totalResult || 0;
+ if (resp.details?.viewTimestamp) {
+ this.viewTimestamp = resp.details?.viewTimestamp;
}
- return response.resultList;
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -49,7 +48,7 @@ export class IamMembersDataSource extends DataSource {
* the returned stream emits new items.
* @returns A stream of the items to be rendered.
*/
- public connect(): Observable {
+ public connect(): Observable {
return this.membersSubject.asObservable();
}
diff --git a/console/src/app/pages/iam/iam-members/iam-members.component.ts b/console/src/app/pages/iam/iam-members/iam-members.component.ts
index 731a83dd87..c6d4257d72 100644
--- a/console/src/app/pages/iam/iam-members/iam-members.component.ts
+++ b/console/src/app/pages/iam/iam-members/iam-members.component.ts
@@ -3,8 +3,9 @@ import { MatDialog } from '@angular/material/dialog';
import { PageEvent } from '@angular/material/paginator';
import { MatSelectChange } from '@angular/material/select';
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
-import { IamMember, IamMemberView } from 'src/app/proto/generated/admin_pb';
-import { ProjectMember, ProjectType, UserView } from 'src/app/proto/generated/management_pb';
+import { ProjectType } from 'src/app/modules/project-members/project-members.component';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
+import { User } from 'src/app/proto/generated/zitadel/user_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -23,7 +24,7 @@ export class IamMembersComponent {
public memberRoleOptions: string[] = [];
public changePageFactory!: Function;
public changePage: EventEmitter = new EventEmitter();
- public selection: Array = [];
+ public selection: Array = [];
constructor(private adminService: AdminService,
private dialog: MatDialog,
@@ -42,16 +43,16 @@ export class IamMembersComponent {
}
public getRoleOptions(): void {
- this.adminService.GetIamMemberRoles().then(resp => {
- this.memberRoleOptions = resp.toObject().rolesList;
+ this.adminService.listIAMMemberRoles().then(resp => {
+ this.memberRoleOptions = resp.rolesList;
}).catch(error => {
this.toast.showError(error);
});
}
- updateRoles(member: IamMemberView.AsObject, selectionChange: MatSelectChange): void {
- this.adminService.ChangeIamMember(member.userId, selectionChange.value)
- .then((newmember: IamMember) => {
+ updateRoles(member: Member.AsObject, selectionChange: MatSelectChange): void {
+ this.adminService.updateIAMMember(member.userId, selectionChange.value)
+ .then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERCHANGED', true);
}).catch(error => {
this.toast.showError(error);
@@ -60,7 +61,7 @@ export class IamMembersComponent {
public removeMemberSelection(): void {
Promise.all(this.selection.map(member => {
- return this.adminService.RemoveIamMember(member.userId).then(() => {
+ return this.adminService.removeIAMMember(member.userId).then(() => {
this.toast.showInfo('IAM.TOAST.MEMBERREMOVED', true);
this.changePage.emit();
}).catch(error => {
@@ -69,8 +70,8 @@ export class IamMembersComponent {
}));
}
- public removeMember(member: ProjectMember.AsObject): void {
- this.adminService.RemoveIamMember(member.userId).then(() => {
+ public removeMember(member: Member.AsObject): void {
+ this.adminService.removeIAMMember(member.userId).then(() => {
this.toast.showInfo('IAM.TOAST.MEMBERREMOVED', true);
setTimeout(() => {
this.changePage.emit();
@@ -90,12 +91,12 @@ export class IamMembersComponent {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- const users: UserView.AsObject[] = resp.users;
+ const users: User.AsObject[] = resp.users;
const roles: string[] = resp.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
- return this.adminService.AddIamMember(user.id, roles);
+ return this.adminService.addIAMMember(user.id, roles);
})).then(() => {
this.toast.showInfo('IAM.TOAST.MEMBERADDED', true);
setTimeout(() => {
diff --git a/console/src/app/pages/iam/iam-views/iam-views.component.ts b/console/src/app/pages/iam/iam-views/iam-views.component.ts
index c1f07a3fb5..fef8432e61 100644
--- a/console/src/app/pages/iam/iam-views/iam-views.component.ts
+++ b/console/src/app/pages/iam/iam-views/iam-views.component.ts
@@ -6,7 +6,7 @@ import { MatTableDataSource } from '@angular/material/table';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
-import { View } from 'src/app/proto/generated/admin_pb';
+import { View } from 'src/app/proto/generated/zitadel/admin_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -35,9 +35,9 @@ export class IamViewsComponent implements AfterViewInit {
public loadViews(): void {
this.loadingSubject.next(true);
- from(this.adminService.GetViews()).pipe(
+ from(this.adminService.listViews()).pipe(
map(resp => {
- return resp.toObject().viewsList;
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -61,7 +61,7 @@ export class IamViewsComponent implements AfterViewInit {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- this.adminService.ClearView(viewname, db).then(() => {
+ this.adminService.clearView(viewname, db).then(() => {
this.toast.showInfo('IAM.VIEWS.CLEARED', true);
this.loadViews();
}).catch(error => {
diff --git a/console/src/app/pages/iam/iam.component.ts b/console/src/app/pages/iam/iam.component.ts
index 55d248c5d0..ad4a4eedff 100644
--- a/console/src/app/pages/iam/iam.component.ts
+++ b/console/src/app/pages/iam/iam.component.ts
@@ -6,7 +6,8 @@ import { catchError, finalize, map } from 'rxjs/operators';
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
import { PolicyComponentServiceType } from 'src/app/modules/policies/policy-component-types.enum';
import { PolicyGridType } from 'src/app/modules/policy-grid/policy-grid.component';
-import { OrgMemberView, UserView } from 'src/app/proto/generated/management_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
+import { User } from 'src/app/proto/generated/zitadel/user_pb';
import { AdminService } from 'src/app/services/admin.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -20,8 +21,8 @@ export class IamComponent {
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
public totalMemberResult: number = 0;
- public membersSubject: BehaviorSubject
- = new BehaviorSubject([]);
+ public membersSubject: BehaviorSubject
+ = new BehaviorSubject([]);
public PolicyGridType: any = PolicyGridType;
@@ -32,10 +33,12 @@ export class IamComponent {
public loadMembers(): void {
this.loadingSubject.next(true);
- from(this.adminService.SearchIamMembers(100, 0)).pipe(
+ from(this.adminService.listIAMMembers(100, 0)).pipe(
map(resp => {
- this.totalMemberResult = resp.toObject().totalResult;
- return resp.toObject().resultList;
+ if (resp.details?.totalResult) {
+ this.totalMemberResult = resp.details.totalResult;
+ }
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -54,12 +57,12 @@ export class IamComponent {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- const users: UserView.AsObject[] = resp.users;
+ const users: User.AsObject[] = resp.users;
const roles: string[] = resp.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
- return this.adminService.AddIamMember(user.id, roles);
+ return this.adminService.addIAMMember(user.id, roles);
})).then(() => {
this.toast.showInfo('IAM.TOAST.MEMBERADDED');
setTimeout(() => {
diff --git a/console/src/app/pages/orgs/org-create/org-create.component.ts b/console/src/app/pages/orgs/org-create/org-create.component.ts
index 5261a80d69..0ec3e1e08b 100644
--- a/console/src/app/pages/orgs/org-create/org-create.component.ts
+++ b/console/src/app/pages/orgs/org-create/org-create.component.ts
@@ -6,8 +6,9 @@ import { MatSlideToggleChange } from '@angular/material/slide-toggle';
import { Router } from '@angular/router';
import { take } from 'rxjs/operators';
import { lowerCaseValidator, numberValidator, symbolValidator, upperCaseValidator } from 'src/app/pages/validators';
-import { CreateHumanRequest, CreateOrgRequest, Gender, OrgSetUpResponse } from 'src/app/proto/generated/admin_pb';
-import { PasswordComplexityPolicy as MgmtPasswordComplexityPolicy } from 'src/app/proto/generated/management_pb';
+import { SetUpOrgRequest } from 'src/app/proto/generated/zitadel/admin_pb';
+import { PasswordComplexityPolicy } from 'src/app/proto/generated/zitadel/policy_pb';
+import { Gender } from 'src/app/proto/generated/zitadel/user_pb';
import { AdminService } from 'src/app/services/admin.service';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
import { ManagementService } from 'src/app/services/mgmt.service';
@@ -57,7 +58,7 @@ export class OrgCreateComponent {
public genders: Gender[] = [Gender.GENDER_FEMALE, Gender.GENDER_MALE, Gender.GENDER_UNSPECIFIED];
public languages: string[] = ['de', 'en'];
- public policy!: MgmtPasswordComplexityPolicy.AsObject;
+ public policy!: PasswordComplexityPolicy.AsObject;
public usePassword: boolean = false;
public forSelf: boolean = true;
@@ -89,25 +90,29 @@ export class OrgCreateComponent {
public currentCreateStep: number = 1;
public finish(): void {
- const createOrgRequest: CreateOrgRequest = new CreateOrgRequest();
+ const createOrgRequest: SetUpOrgRequest.Org = new SetUpOrgRequest.Org();
createOrgRequest.setName(this.name?.value);
createOrgRequest.setDomain(this.domain?.value);
- const humanRequest: CreateHumanRequest = new CreateHumanRequest();
+ const humanRequest: SetUpOrgRequest.Human = new SetUpOrgRequest.Human();
humanRequest.setEmail(this.email?.value);
- humanRequest.setFirstName(this.firstName?.value);
- humanRequest.setLastName(this.lastName?.value);
- humanRequest.setNickName(this.nickName?.value);
- humanRequest.setGender(this.gender?.value);
- humanRequest.setPreferredLanguage(this.preferredLanguage?.value);
+ humanRequest.setUserName(this.userName?.value);
+ const profile: SetUpOrgRequest.Human.Profile = new SetUpOrgRequest.Human.Profile();
+ profile.setFirstName(this.firstName?.value);
+ profile.setLastName(this.lastName?.value);
+ profile.setNickName(this.nickName?.value);
+ profile.setGender(this.gender?.value);
+ profile.setPreferredLanguage(this.preferredLanguage?.value);
+
+ humanRequest.setProfile(this.firstName?.value);
if (this.usePassword && this.password) {
humanRequest.setPassword(this.password?.value);
}
this.adminService
.SetUpOrg(createOrgRequest, humanRequest)
- .then((org: OrgSetUpResponse) => {
+ .then(() => {
this.router.navigate(['/org/overview']);
// const orgResp = org.getOrg();
// if (orgResp) {
@@ -146,31 +151,33 @@ export class OrgCreateComponent {
const validators: Validators[] = [Validators.required];
if (this.usePassword) {
- this.mgmtService.GetDefaultPasswordComplexityPolicy().then(data => {
- this.policy = data.toObject();
+ this.mgmtService.getDefaultPasswordComplexityPolicy().then(data => {
+ if (data.policy) {
+ this.policy = data.policy;
- if (this.policy.minLength) {
- validators.push(Validators.minLength(this.policy.minLength));
- }
- if (this.policy.hasLowercase) {
- validators.push(lowerCaseValidator);
- }
- if (this.policy.hasUppercase) {
- validators.push(upperCaseValidator);
- }
- if (this.policy.hasNumber) {
- validators.push(numberValidator);
- }
- if (this.policy.hasSymbol) {
- validators.push(symbolValidator);
- }
+ if (this.policy.minLength) {
+ validators.push(Validators.minLength(this.policy.minLength));
+ }
+ if (this.policy.hasLowercase) {
+ validators.push(lowerCaseValidator);
+ }
+ if (this.policy.hasUppercase) {
+ validators.push(upperCaseValidator);
+ }
+ if (this.policy.hasNumber) {
+ validators.push(numberValidator);
+ }
+ if (this.policy.hasSymbol) {
+ validators.push(symbolValidator);
+ }
- const pwdValidators = [...validators] as ValidatorFn[];
- const confirmPwdValidators = [...validators, passwordConfirmValidator] as ValidatorFn[];
- this.pwdForm = this.fb.group({
- password: ['', pwdValidators],
- confirmPassword: ['', confirmPwdValidators],
- });
+ const pwdValidators = [...validators] as ValidatorFn[];
+ const confirmPwdValidators = [...validators, passwordConfirmValidator] as ValidatorFn[];
+ this.pwdForm = this.fb.group({
+ password: ['', pwdValidators],
+ confirmPassword: ['', confirmPwdValidators],
+ });
+ }
});
} else {
this.pwdForm = this.fb.group({
@@ -199,7 +206,7 @@ export class OrgCreateComponent {
public createOrgForSelf(): void {
if (this.name && this.name.value) {
- this.mgmtService.CreateOrg(this.name.value).then((org) => {
+ this.mgmtService.addOrg(this.name.value).then(() => {
this.router.navigate(['/org/overview']);
// const newOrg = org.toObject();
// setTimeout(() => {
diff --git a/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.html b/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.html
index c8c7dea050..fa71741792 100644
--- a/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.html
+++ b/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.html
@@ -1,16 +1,16 @@
-{{'ORG.PAGES.ORGDOMAIN.TITLE' | translate}} {{domain.domain}}
+{{'ORG.PAGES.ORGDOMAIN.TITLE' | translate}} {{domain.domainName}}
{{ 'ORG.PAGES.ORGDOMAIN.VERIFICATION' | translate }}
{{ 'ORG.PAGES.ORGDOMAIN.VERIFICATION_VALIDATION_DESC' | translate }}
-
{{'ORG.PAGES.ORGDOMAIN.VERIFICATION_VALIDATION_ONGOING' | translate: domain }}
{{'ORG.PAGES.ORGDOMAIN.VERIFICATION_VALIDATION_ONGOING_TYPE' | translate}}
{{'ORG.PAGES.ORGDOMAIN.TYPES.'+ domain.validationType | translate}}
-
{{ 'ACTIONS.VERIFY' | translate }}
@@ -34,8 +34,8 @@
{{http?.url}}.txt
- {{ 'ORG.PAGES.DOWNLOAD_FILE' | translate }}
+ {{ 'ORG.PAGES.DOWNLOAD_FILE' | translate
+ }}
{{ 'ACTIONS.VERIFY' | translate }}
diff --git a/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.ts b/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.ts
index 0fbbf41ef3..4c5fbf9b0c 100644
--- a/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.ts
+++ b/console/src/app/pages/orgs/org-detail/domain-verification/domain-verification.component.ts
@@ -1,7 +1,8 @@
import { Component, Inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { saveAs } from 'file-saver';
-import { OrgDomainValidationResponse, OrgDomainValidationType, OrgDomainView } from 'src/app/proto/generated/management_pb';
+import { GenerateOrgDomainValidationResponse } from 'src/app/proto/generated/zitadel/management_pb';
+import { Domain, DomainValidationType } from 'src/app/proto/generated/zitadel/org_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -11,12 +12,13 @@ import { ToastService } from 'src/app/services/toast.service';
styleUrls: ['./domain-verification.component.scss'],
})
export class DomainVerificationComponent {
- public domain!: OrgDomainView.AsObject;
+ public domain!: Domain.AsObject;
- public OrgDomainValidationType: any = OrgDomainValidationType;
+ public DomainValidationType: any = DomainValidationType;
+
+ public http!: GenerateOrgDomainValidationResponse.AsObject;
+ public dns!: GenerateOrgDomainValidationResponse.AsObject;
- public http!: OrgDomainValidationResponse.AsObject;
- public dns!: OrgDomainValidationResponse.AsObject;
public copied: string = '';
public showNew: boolean = false;
@@ -29,24 +31,24 @@ export class DomainVerificationComponent {
private mgmtService: ManagementService,
) {
this.domain = data.domain;
- if (this.domain.validationType === OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_UNSPECIFIED) {
+ if (this.domain.validationType === DomainValidationType.DOMAIN_VALIDATION_TYPE_UNSPECIFIED) {
this.showNew = true;
}
}
async loadHttpToken(): Promise {
- this.mgmtService.GenerateMyOrgDomainValidation(
- this.domain.domain,
- OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_HTTP).then((http) => {
- this.http = http.toObject();
+ this.mgmtService.generateOrgDomainValidation(
+ this.domain.domainName,
+ DomainValidationType.DOMAIN_VALIDATION_TYPE_HTTP).then((http) => {
+ this.http = http;
});
}
async loadDnsToken(): Promise {
- this.mgmtService.GenerateMyOrgDomainValidation(
- this.domain.domain,
- OrgDomainValidationType.ORGDOMAINVALIDATIONTYPE_DNS).then((dns) => {
- this.dns = dns.toObject();
+ this.mgmtService.generateOrgDomainValidation(
+ this.domain.domainName,
+ DomainValidationType.DOMAIN_VALIDATION_TYPE_DNS).then((dns) => {
+ this.dns = dns;
});
}
@@ -56,7 +58,7 @@ export class DomainVerificationComponent {
public validate(): void {
this.validating = true;
- this.mgmtService.ValidateMyOrgDomain(this.domain.domain).then(() => {
+ this.mgmtService.validateOrgDomain(this.domain.domainName).then(() => {
this.dialogRef.close(true);
this.toast.showInfo('ORG.PAGES.ORGDOMAIN.VERIFICATION_SUCCESSFUL', true);
this.validating = false;
diff --git a/console/src/app/pages/orgs/org-detail/org-detail.component.ts b/console/src/app/pages/orgs/org-detail/org-detail.component.ts
index 64c2584535..c338b82207 100644
--- a/console/src/app/pages/orgs/org-detail/org-detail.component.ts
+++ b/console/src/app/pages/orgs/org-detail/org-detail.component.ts
@@ -1,26 +1,18 @@
-import { SelectionModel } from '@angular/cdk/collections';
-import { Component, OnDestroy, OnInit } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
import { MatButtonToggleChange } from '@angular/material/button-toggle';
import { MatDialog } from '@angular/material/dialog';
-import { MatTableDataSource } from '@angular/material/table';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
-import { BehaviorSubject, from, Observable, of, Subscription } from 'rxjs';
+import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
import { ChangeType } from 'src/app/modules/changes/changes.component';
import { PolicyComponentServiceType } from 'src/app/modules/policies/policy-component-types.enum';
import { PolicyGridType } from 'src/app/modules/policy-grid/policy-grid.component';
import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.component';
-import {
- Org,
- OrgDomainView,
- OrgMember,
- OrgMemberSearchResponse,
- OrgMemberView,
- OrgState,
- UserView,
-} from 'src/app/proto/generated/management_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
+import { Domain, Org, OrgState } from 'src/app/proto/generated/zitadel/org_pb';
+import { User } from 'src/app/proto/generated/zitadel/user_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -33,28 +25,22 @@ import { DomainVerificationComponent } from './domain-verification/domain-verifi
templateUrl: './org-detail.component.html',
styleUrls: ['./org-detail.component.scss'],
})
-export class OrgDetailComponent implements OnInit, OnDestroy {
+export class OrgDetailComponent implements OnInit {
public org!: Org.AsObject;
public PolicyComponentServiceType: any = PolicyComponentServiceType;
- public dataSource: MatTableDataSource = new MatTableDataSource();
- public memberResult!: OrgMemberSearchResponse.AsObject;
- public displayedColumns: string[] = ['select', 'firstname', 'lastname', 'username', 'email', 'roles'];
- public selection: SelectionModel = new SelectionModel(true, []);
public OrgState: any = OrgState;
public ChangeType: any = ChangeType;
- private subscription: Subscription = new Subscription();
-
- public domains: OrgDomainView.AsObject[] = [];
+ public domains: Domain.AsObject[] = [];
public primaryDomain: string = '';
// members
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
public totalMemberResult: number = 0;
- public membersSubject: BehaviorSubject
- = new BehaviorSubject([]);
+ public membersSubject: BehaviorSubject
+ = new BehaviorSubject([]);
public PolicyGridType: any = PolicyGridType;
constructor(
@@ -69,13 +55,11 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
this.getData();
}
- public ngOnDestroy(): void {
- this.subscription.unsubscribe();
- }
-
private async getData(): Promise {
- this.mgmtService.GetMyOrg().then((org: Org) => {
- this.org = org.toObject();
+ this.mgmtService.getMyOrg().then((resp) => {
+ if (resp.org) {
+ this.org = resp.org;
+ }
}).catch(error => {
this.toast.showError(error);
});
@@ -84,14 +68,14 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
}
public loadDomains(): void {
- this.mgmtService.SearchMyOrgDomains().then(result => {
- this.domains = result.toObject().resultList;
- this.primaryDomain = this.domains.find(domain => domain.primary)?.domain ?? '';
+ this.mgmtService.listOrgDomains().then(result => {
+ this.domains = result.resultList;
+ this.primaryDomain = this.domains.find(domain => domain.isPrimary)?.domainName ?? '';
});
}
- public setPrimary(domain: OrgDomainView.AsObject): void {
- this.mgmtService.setMyPrimaryOrgDomain(domain.domain).then(() => {
+ public setPrimary(domain: Domain.AsObject): void {
+ this.mgmtService.setPrimaryOrgDomain(domain.domainName).then(() => {
this.toast.showInfo('ORG.TOAST.SETPRIMARY', true);
this.loadDomains();
}).catch((error) => {
@@ -100,14 +84,14 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
}
public changeState(event: MatButtonToggleChange | any): void {
- if (event.value === OrgState.ORGSTATE_ACTIVE) {
- this.mgmtService.ReactivateMyOrg().then(() => {
+ if (event.value === OrgState.ORG_STATE_ACTIVE) {
+ this.mgmtService.reactivateOrg().then(() => {
this.toast.showInfo('ORG.TOAST.REACTIVATED', true);
}).catch((error) => {
this.toast.showError(error);
});
- } else if (event.value === OrgState.ORGSTATE_INACTIVE) {
- this.mgmtService.DeactivateMyOrg().then(() => {
+ } else if (event.value === OrgState.ORG_STATE_INACTIVE) {
+ this.mgmtService.deactivateOrg().then(() => {
this.toast.showInfo('ORG.TOAST.DEACTIVATED', true);
}).catch((error) => {
this.toast.showError(error);
@@ -123,21 +107,11 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- this.mgmtService.AddMyOrgDomain(resp).then(domain => {
- const newDomain = domain;
+ this.mgmtService.addOrgDomain(resp).then(resp => {
+ const newDomain = resp;
- const newDomainView = new OrgDomainView();
- newDomainView.setChangeDate(newDomain.getChangeDate());
- newDomainView.setCreationDate(newDomain.getCreationDate());
- newDomainView.setDomain(newDomain.getDomain());
- newDomainView.setOrgId(newDomain.getOrgId());
- newDomainView.setPrimary(newDomain.getPrimary());
- newDomainView.setSequence(newDomain.getSequence());
- newDomainView.setVerified(newDomain.getVerified());
-
- this.domains.push(newDomainView.toObject());
-
- this.verifyDomain(newDomainView.toObject());
+ // TODO send domainname only
+ // this.verifyDomain(newDomainView.toObject());
this.toast.showInfo('ORG.TOAST.DOMAINADDED', true);
});
}
@@ -157,9 +131,9 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- this.mgmtService.RemoveMyOrgDomain(domain).then(() => {
+ this.mgmtService.removeOrgDomain(domain).then(() => {
this.toast.showInfo('ORG.TOAST.DOMAINREMOVED', true);
- const index = this.domains.findIndex(d => d.domain === domain);
+ const index = this.domains.findIndex(d => d.domainName === domain);
if (index > -1) {
this.domains.splice(index, 1);
}
@@ -180,12 +154,12 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- const users: UserView.AsObject[] = resp.users;
+ const users: User.AsObject[] = resp.users;
const roles: string[] = resp.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
- return this.mgmtService.AddMyOrgMember(user.id, roles);
+ return this.mgmtService.addOrgMember(user.id, roles);
})).then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERADDED', true);
setTimeout(() => {
@@ -203,7 +177,7 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
this.router.navigate(['org/members']);
}
- public verifyDomain(domain: OrgDomainView.AsObject): void {
+ public verifyDomain(domain: Domain.AsObject): void {
const dialogRef = this.dialog.open(DomainVerificationComponent, {
data: {
domain: domain,
@@ -220,10 +194,12 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
public loadMembers(): void {
this.loadingSubject.next(true);
- from(this.mgmtService.SearchMyOrgMembers(100, 0)).pipe(
+ from(this.mgmtService.listOrgMembers(100, 0)).pipe(
map(resp => {
- this.totalMemberResult = resp.toObject().totalResult;
- return resp.toObject().resultList;
+ if (resp.details?.totalResult) {
+ this.totalMemberResult = resp.details?.totalResult;
+ }
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
diff --git a/console/src/app/pages/orgs/org-list/org-list.component.html b/console/src/app/pages/orgs/org-list/org-list.component.html
index 6c1432639b..b319068149 100644
--- a/console/src/app/pages/orgs/org-list/org-list.component.html
+++ b/console/src/app/pages/orgs/org-list/org-list.component.html
@@ -31,10 +31,10 @@
+ [ngClass]="{'search-active': this.orgSearchKey == OrgListSearchKey.NAME}">
{{ 'ORG.PAGES.NAME' | translate }}
+ [ngTemplateOutletContext]="{key: OrgListSearchKey.NAME}">
|
{{org.name}} |
diff --git a/console/src/app/pages/orgs/org-list/org-list.component.ts b/console/src/app/pages/orgs/org-list/org-list.component.ts
index a614451773..572aa0e416 100644
--- a/console/src/app/pages/orgs/org-list/org-list.component.ts
+++ b/console/src/app/pages/orgs/org-list/org-list.component.ts
@@ -6,9 +6,14 @@ import { Router } from '@angular/router';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
import { enterAnimations } from 'src/app/animations';
-import { MyProjectOrgSearchKey, MyProjectOrgSearchQuery, Org, SearchMethod } from 'src/app/proto/generated/auth_pb';
+import { TextQueryMethod } from 'src/app/proto/generated/zitadel/object_pb';
+import { Org, OrgNameQuery, OrgQuery } from 'src/app/proto/generated/zitadel/org_pb';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
+enum OrgListSearchKey {
+ NAME = "NAME",
+}
+
@Component({
selector: 'app-org-list',
templateUrl: './org-list.component.html',
@@ -18,7 +23,7 @@ import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
],
})
export class OrgListComponent implements AfterViewInit {
- public orgSearchKey: MyProjectOrgSearchKey | undefined = undefined;
+ public orgSearchKey: OrgListSearchKey | undefined = undefined;
@ViewChild(MatPaginator) public paginator!: MatPaginator;
@ViewChild(MatSort) sort!: MatSort;
@@ -29,7 +34,7 @@ export class OrgListComponent implements AfterViewInit {
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
public activeOrg!: Org.AsObject;
- public MyProjectOrgSearchKey: any = MyProjectOrgSearchKey;
+ public OrgListSearchKey: any = OrgListSearchKey;
constructor(
private authService: GrpcAuthService,
@@ -37,7 +42,7 @@ export class OrgListComponent implements AfterViewInit {
) {
this.loadOrgs(10, 0);
- this.authService.GetActiveOrg().then(org => this.activeOrg = org);
+ this.authService.getActiveOrg().then(org => this.activeOrg = org);
}
public ngAfterViewInit(): void {
@@ -48,15 +53,16 @@ export class OrgListComponent implements AfterViewInit {
this.loadingSubject.next(true);
let query;
if (filter) {
- query = new MyProjectOrgSearchQuery();
- query.setMethod(SearchMethod.SEARCHMETHOD_CONTAINS_IGNORE_CASE);
- query.setKey(MyProjectOrgSearchKey.MYPROJECTORGSEARCHKEY_ORG_NAME);
- query.setValue(filter);
+ const query = new OrgQuery();
+ const orgNameQuery = new OrgNameQuery();
+ orgNameQuery.setMethod(TextQueryMethod.TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE);
+ orgNameQuery.setName(filter);
+ query.setNameQuery(orgNameQuery);
}
- from(this.authService.SearchMyProjectOrgs(limit, offset, query ? [query] : undefined)).pipe(
+ from(this.authService.listMyProjectOrgs(limit, offset, query ? [query] : undefined)).pipe(
map(resp => {
- return resp.toObject().resultList;
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -75,7 +81,7 @@ export class OrgListComponent implements AfterViewInit {
this.loadOrgs(this.paginator.length, this.paginator.pageSize * this.paginator.pageIndex);
}
- public setFilter(key: MyProjectOrgSearchKey): void {
+ public setFilter(key: OrgListSearchKey): void {
setTimeout(() => {
if (this.filter) {
(this.filter as any).nativeElement.focus();
diff --git a/console/src/app/pages/orgs/org-member-roles-autocomplete/org-member-roles-autocomplete.component.ts b/console/src/app/pages/orgs/org-member-roles-autocomplete/org-member-roles-autocomplete.component.ts
index a8469433b6..3cf8314418 100644
--- a/console/src/app/pages/orgs/org-member-roles-autocomplete/org-member-roles-autocomplete.component.ts
+++ b/console/src/app/pages/orgs/org-member-roles-autocomplete/org-member-roles-autocomplete.component.ts
@@ -19,8 +19,8 @@ export class OrgMemberRolesAutocompleteComponent {
@ViewChild('auto') public matAutocomplete!: MatAutocomplete;
@Output() public selectionChanged: EventEmitter = new EventEmitter();
constructor(private mgmtService: ManagementService, private toast: ToastService) {
- this.mgmtService.GetOrgMemberRoles().then(resp => {
- this.allRoles = resp.toObject().rolesList;
+ this.mgmtService.listOrgMemberRoles().then(resp => {
+ this.allRoles = resp.resultList;
}).catch(error => {
this.toast.showError(error);
});
diff --git a/console/src/app/pages/orgs/org-members/org-members-datasource.ts b/console/src/app/pages/orgs/org-members/org-members-datasource.ts
index b161e5d74b..fdbced5bfd 100644
--- a/console/src/app/pages/orgs/org-members/org-members-datasource.ts
+++ b/console/src/app/pages/orgs/org-members/org-members-datasource.ts
@@ -2,13 +2,13 @@ import { DataSource } from '@angular/cdk/collections';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
-import { OrgMemberView } from 'src/app/proto/generated/management_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
-export class OrgMembersDataSource extends DataSource {
+export class OrgMembersDataSource extends DataSource {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
- public membersSubject: BehaviorSubject = new BehaviorSubject([]);
+ public membersSubject: BehaviorSubject = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -20,14 +20,13 @@ export class OrgMembersDataSource extends DataSource {
const offset = pageIndex * pageSize;
this.loadingSubject.next(true);
- from(this.mgmtService.SearchMyOrgMembers(pageSize, offset)).pipe(
+ from(this.mgmtService.listOrgMembers(pageSize, offset)).pipe(
map(resp => {
- const response = resp.toObject();
- this.totalResult = response.totalResult;
- if (response.viewTimestamp) {
- this.viewTimestamp = response.viewTimestamp;
+ this.totalResult = resp.details?.totalResult || 0;
+ if (resp.details?.viewTimestamp) {
+ this.viewTimestamp = resp.details.viewTimestamp;
}
- return response.resultList;
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -42,7 +41,7 @@ export class OrgMembersDataSource extends DataSource {
* the returned stream emits new items.
* @returns A stream of the items to be rendered.
*/
- public connect(): Observable {
+ public connect(): Observable {
return this.membersSubject.asObservable();
}
diff --git a/console/src/app/pages/orgs/org-members/org-members.component.ts b/console/src/app/pages/orgs/org-members/org-members.component.ts
index 37e9e01a42..68a9058d14 100644
--- a/console/src/app/pages/orgs/org-members/org-members.component.ts
+++ b/console/src/app/pages/orgs/org-members/org-members.component.ts
@@ -3,7 +3,9 @@ import { MatDialog } from '@angular/material/dialog';
import { PageEvent } from '@angular/material/paginator';
import { MatSelectChange } from '@angular/material/select';
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
-import { Org, OrgMemberView, UserView } from 'src/app/proto/generated/management_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
+import { Org } from 'src/app/proto/generated/zitadel/org_pb';
+import { User } from 'src/app/proto/generated/zitadel/user_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -23,17 +25,19 @@ export class OrgMembersComponent {
public memberRoleOptions: string[] = [];
public changePageFactory!: Function;
public changePage: EventEmitter = new EventEmitter();
- public selection: Array = [];
+ public selection: Array = [];
constructor(
private mgmtService: ManagementService,
private dialog: MatDialog,
private toast: ToastService,
) {
- this.mgmtService.GetMyOrg().then(org => {
- this.org = org.toObject();
- this.dataSource = new OrgMembersDataSource(this.mgmtService);
- this.dataSource.loadMembers(0, this.INITIALPAGESIZE);
+ this.mgmtService.getMyOrg().then(resp => {
+ if (resp.org) {
+ this.org = resp.org;
+ this.dataSource = new OrgMembersDataSource(this.mgmtService);
+ this.dataSource.loadMembers(0, this.INITIALPAGESIZE);
+ }
});
this.getRoleOptions();
@@ -47,15 +51,15 @@ export class OrgMembersComponent {
}
public getRoleOptions(): void {
- this.mgmtService.GetOrgMemberRoles().then(resp => {
- this.memberRoleOptions = resp.toObject().rolesList;
+ this.mgmtService.listOrgMemberRoles().then(resp => {
+ this.memberRoleOptions = resp.resultList;
}).catch(error => {
this.toast.showError(error);
});
}
- updateRoles(member: OrgMemberView.AsObject, selectionChange: MatSelectChange): void {
- this.mgmtService.ChangeMyOrgMember(member.userId, selectionChange.value)
+ updateRoles(member: Member.AsObject, selectionChange: MatSelectChange): void {
+ this.mgmtService.updateOrgMember(member.userId, selectionChange.value)
.then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERCHANGED', true);
}).catch(error => {
@@ -65,7 +69,7 @@ export class OrgMembersComponent {
public removeOrgMemberSelection(): void {
Promise.all(this.selection.map(member => {
- return this.mgmtService.RemoveMyOrgMember(member.userId).then(() => {
+ return this.mgmtService.removeOrgMember(member.userId).then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERREMOVED', true);
}).catch(error => {
this.toast.showError(error);
@@ -77,8 +81,8 @@ export class OrgMembersComponent {
});
}
- public removeOrgMember(member: OrgMemberView.AsObject): void {
- this.mgmtService.RemoveMyOrgMember(member.userId).then(() => {
+ public removeOrgMember(member: Member.AsObject): void {
+ this.mgmtService.removeOrgMember(member.userId).then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERREMOVED', true);
setTimeout(() => {
@@ -99,12 +103,12 @@ export class OrgMembersComponent {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- const users: UserView.AsObject[] = resp.users;
+ const users: User.AsObject[] = resp.users;
const roles: string[] = resp.roles;
if (users && users.length && roles && roles.length) {
Promise.all(users.map(user => {
- return this.mgmtService.AddMyOrgMember(user.id, roles);
+ return this.mgmtService.addOrgMember(user.id, roles);
})).then(() => {
this.toast.showInfo('ORG.TOAST.MEMBERADDED', true);
setTimeout(() => {
diff --git a/console/src/app/pages/projects/apps/app-create/app-create.component.html b/console/src/app/pages/projects/apps/app-create/app-create.component.html
index 901659fa17..6d12c2bebb 100644
--- a/console/src/app/pages/projects/apps/app-create/app-create.component.html
+++ b/console/src/app/pages/projects/apps/app-create/app-create.component.html
@@ -41,8 +41,8 @@
-
+
{{ 'APP.GRANT' | translate }}
- 0">
- [
+ 0">
+ [
{{'APP.OIDC.GRANT.'+element | translate}}
- {{i < oidcApp.grantTypesList.length - 1 ? ', ' : '' }} ]
+ {{i < oidcAppRequest.grantTypesList.length - 1 ? ', ' : '' }} ]
{{ 'APP.OIDC.RESPONSETYPE' | translate }}
- 0">
- [
+ 0">
+ [
{{('APP.OIDC.RESPONSE.'+element | translate)}}
- {{i < oidcApp.responseTypesList.length - 1 ? ', ' : '' }} ]
+ {{i < oidcAppRequest.responseTypesList.length - 1 ? ', ' : '' }} ]
@@ -147,7 +145,7 @@
- {{'APP.OIDC.AUTHMETHOD.'+oidcApp?.authMethodType | translate}}
+ {{'APP.OIDC.AUTHMETHOD.'+oidcAppRequest?.authMethodType | translate}}
@@ -156,10 +154,10 @@
{{ 'APP.OIDC.REDIRECT' | translate }}
- 0">
- [
+ 0">
+ [
{{redirect}}
- {{i < oidcApp.redirectUrisList.length - 1 ? ', ' : '' }} ]
+ {{i < oidcAppRequest.redirectUrisList.length - 1 ? ', ' : '' }} ]
@@ -167,10 +165,10 @@
{{ 'APP.OIDC.POSTLOGOUTREDIRECT' | translate }}
- 0">
- [
+ 0">
+ [
{{redirect}}
- {{i < oidcApp.postLogoutRedirectUrisList.length - 1 ? ', ' : '' }} ]
+ {{i < oidcAppRequest.postLogoutRedirectUrisList.length - 1 ? ', ' : '' }} ]
@@ -182,7 +180,7 @@
- {{'APP.API.AUTHMETHOD.'+apiApp?.authMethodType | translate}}
+ {{'APP.API.AUTHMETHOD.'+oidcAppRequest?.authMethodType | translate}}
@@ -247,17 +245,18 @@
+ (changedUris)="oidcAppRequest.redirectUrisList = $event"
+ [urisList]="oidcAppRequest.redirectUrisList" title="{{ 'APP.OIDC.REDIRECT' | translate }}"
+ [getValues]="requestRedirectValuesSubject$"
+ [isNative]="oidcAppRequest.appType == OIDCAppType.OIDC_APP_TYPE_NATIVE">
+ [isNative]="oidcAppRequest.appType == OIDCAppType.OIDC_APP_TYPE_NATIVE">
diff --git a/console/src/app/pages/projects/apps/app-create/app-create.component.ts b/console/src/app/pages/projects/apps/app-create/app-create.component.ts
index 2175ed2b05..8fdb0508cf 100644
--- a/console/src/app/pages/projects/apps/app-create/app-create.component.ts
+++ b/console/src/app/pages/projects/apps/app-create/app-create.component.ts
@@ -1,4 +1,5 @@
import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
+import { StepperSelectionEvent } from '@angular/cdk/stepper';
import { Location } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
@@ -8,31 +9,28 @@ import { Subject, Subscription } from 'rxjs';
import { debounceTime, takeUntil } from 'rxjs/operators';
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
import {
- APIApplicationCreate,
APIAuthMethodType,
- Application,
- OIDCApplicationCreate,
- OIDCApplicationType,
+ App,
+ OIDCAppType,
OIDCAuthMethodType,
- OIDCConfig,
OIDCGrantType,
OIDCResponseType,
-} from 'src/app/proto/generated/management_pb';
+} from 'src/app/proto/generated/zitadel/app_pb';
+import { AddAPIAppRequest, AddOIDCAppRequest } from 'src/app/proto/generated/zitadel/management_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
-import {
- WEB_TYPE,
- NATIVE_TYPE,
- USER_AGENT_TYPE,
- API_TYPE,
- RadioItemAppType,
- AppCreateType
-} from '../authtypes';
-
import { AppSecretDialogComponent } from '../app-secret-dialog/app-secret-dialog.component';
-import { CODE_METHOD, getPartialConfigFromAuthMethod, IMPLICIT_METHOD, BASIC_AUTH_METHOD, PKCE_METHOD, PK_JWT_METHOD, POST_METHOD } from '../authmethods';
-import { StepperSelectionEvent } from '@angular/cdk/stepper';
+import {
+ BASIC_AUTH_METHOD,
+ CODE_METHOD,
+ getPartialConfigFromAuthMethod,
+ IMPLICIT_METHOD,
+ PK_JWT_METHOD,
+ PKCE_METHOD,
+ POST_METHOD,
+} from '../authmethods';
+import { API_TYPE, AppCreateType, NATIVE_TYPE, RadioItemAppType, USER_AGENT_TYPE, WEB_TYPE } from '../authtypes';
@Component({
@@ -47,19 +45,19 @@ export class AppCreateComponent implements OnInit, OnDestroy {
public projectId: string = '';
public loading: boolean = false;
- public oidcApp: OIDCApplicationCreate.AsObject = new OIDCApplicationCreate().toObject();
- public apiApp: APIApplicationCreate.AsObject = new APIApplicationCreate().toObject();
+ public oidcAppRequest: AddOIDCAppRequest.AsObject = new AddOIDCAppRequest().toObject();
+ public apiAppRequest: AddAPIAppRequest.AsObject = new AddAPIAppRequest().toObject();
public oidcResponseTypes: { type: OIDCResponseType, checked: boolean; disabled: boolean; }[] = [
- { type: OIDCResponseType.OIDCRESPONSETYPE_CODE, checked: false, disabled: false },
- { type: OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN, checked: false, disabled: false },
- { type: OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN, checked: false, disabled: false },
+ { type: OIDCResponseType.OIDC_RESPONSE_TYPE_CODE, checked: false, disabled: false },
+ { type: OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN, checked: false, disabled: false },
+ { type: OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN, checked: false, disabled: false },
];
- public oidcAppTypes: OIDCApplicationType[] = [
- OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB,
- OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE,
- OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT,
+ public oidcAppTypes: OIDCAppType[] = [
+ OIDCAppType.OIDC_APP_TYPE_WEB,
+ OIDCAppType.OIDC_APP_TYPE_NATIVE,
+ OIDCAppType.OIDC_APP_TYPE_USER_AGENT,
];
public appTypes: any = [
WEB_TYPE,
@@ -77,9 +75,9 @@ export class AppCreateComponent implements OnInit, OnDestroy {
// set to oidc first
public authMethodTypes: { type: OIDCAuthMethodType | APIAuthMethodType, checked: boolean, disabled: boolean; api?: boolean; oidc?: boolean; }[] = [
- { 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 },
+ { type: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC, checked: false, disabled: false, oidc: true },
+ { type: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE, checked: false, disabled: false, oidc: true },
+ { type: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_POST, checked: false, disabled: false, oidc: true },
];
// stepper
@@ -90,7 +88,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
public form!: FormGroup;
public AppCreateType: any = AppCreateType;
- public OIDCApplicationType: any = OIDCApplicationType;
+ public OIDCAppType: any = OIDCAppType;
public OIDCGrantType: any = OIDCGrantType;
public OIDCAuthMethodType: any = OIDCAuthMethodType;
@@ -99,8 +97,8 @@ export class AppCreateComponent implements OnInit, OnDestroy {
checked: boolean,
disabled: boolean,
}[] = [
- { type: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE, checked: true, disabled: false },
- { type: OIDCGrantType.OIDCGRANTTYPE_IMPLICIT, checked: false, disabled: true },
+ { type: OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE, checked: true, disabled: false },
+ { type: OIDCGrantType.OIDC_GRANT_TYPE_IMPLICIT, checked: false, disabled: true },
// { type: OIDCGrantType.OIDCGRANTTYPE_REFRESH_TOKEN, checked: false, disabled: true },
// TODO show when implemented
];
@@ -134,28 +132,28 @@ export class AppCreateComponent implements OnInit, OnDestroy {
this.firstFormGroup.valueChanges.subscribe(value => {
if (this.firstFormGroup.valid) {
- this.oidcApp.name = this.name?.value;
- this.apiApp.name = this.name?.value;
+ this.oidcAppRequest.name = this.name?.value;
+ this.apiAppRequest.name = this.name?.value;
if (this.isStepperOIDC) {
- const oidcAppType = (this.appType?.value as RadioItemAppType).oidcApplicationType;
+ const oidcAppType = (this.appType?.value as RadioItemAppType).oidcAppType;
if (oidcAppType !== undefined) {
- this.oidcApp.applicationType = oidcAppType;
+ this.oidcAppRequest.appType = oidcAppType;
}
- switch (this.oidcApp.applicationType) {
- case OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE:
+ switch (this.oidcAppRequest.appType) {
+ case OIDCAppType.OIDC_APP_TYPE_NATIVE:
this.authMethods = [
PKCE_METHOD,
];
// automatically set to PKCE and skip step
- this.oidcApp.responseTypesList = [OIDCResponseType.OIDCRESPONSETYPE_CODE];
- this.oidcApp.grantTypesList = [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE];
- this.oidcApp.authMethodType = OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
+ this.oidcAppRequest.responseTypesList = [OIDCResponseType.OIDC_RESPONSE_TYPE_CODE];
+ this.oidcAppRequest.grantTypesList = [OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE];
+ this.oidcAppRequest.authMethodType = OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE;
break;
- case OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB:
+ case OIDCAppType.OIDC_APP_TYPE_WEB:
// PK_JWT_METHOD.recommended = false;
this.authMethods = [
PKCE_METHOD,
@@ -166,7 +164,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
this.authMethod?.setValue(PKCE_METHOD.key);
break;
- case OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT:
+ case OIDCAppType.OIDC_APP_TYPE_USER_AGENT:
this.authMethods = [
PKCE_METHOD,
IMPLICIT_METHOD,
@@ -194,11 +192,11 @@ export class AppCreateComponent implements OnInit, OnDestroy {
const partialConfig = getPartialConfigFromAuthMethod(form.authMethod);
if (this.isStepperOIDC && partialConfig && partialConfig.oidc) {
- this.oidcApp.responseTypesList = partialConfig.oidc?.responseTypesList ?? [];
- this.oidcApp.grantTypesList = partialConfig.oidc?.grantTypesList ?? [];
- this.oidcApp.authMethodType = partialConfig.oidc?.authMethodType ?? OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
+ this.oidcAppRequest.responseTypesList = partialConfig.oidc?.responseTypesList ?? [];
+ this.oidcAppRequest.grantTypesList = partialConfig.oidc?.grantTypesList ?? [];
+ this.oidcAppRequest.authMethodType = partialConfig.oidc?.authMethodType ?? OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE;
} else if (this.isStepperAPI && partialConfig && partialConfig.api) {
- this.apiApp.authMethodType = partialConfig.api?.authMethodType ?? APIAuthMethodType.APIAUTHMETHODTYPE_BASIC;
+ this.apiAppRequest.authMethodType = partialConfig.api?.authMethodType ?? APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC;
}
});
}
@@ -216,18 +214,18 @@ export class AppCreateComponent implements OnInit, OnDestroy {
this.form.valueChanges.pipe(
takeUntil(this.destroyed$),
debounceTime(150)).subscribe(() => {
- this.oidcApp.name = this.formname?.value;
- this.apiApp.name = this.formname?.value;
+ this.oidcAppRequest.name = this.formname?.value;
+ this.apiAppRequest.name = this.formname?.value;
- this.oidcApp.responseTypesList = this.formresponseTypesList?.value;
- this.oidcApp.grantTypesList = this.formgrantTypesList?.value;
+ this.oidcAppRequest.responseTypesList = this.formresponseTypesList?.value;
+ this.oidcAppRequest.grantTypesList = this.formgrantTypesList?.value;
- this.oidcApp.authMethodType = this.formauthMethodType?.value;
- this.apiApp.authMethodType = this.formauthMethodType?.value;
+ this.oidcAppRequest.authMethodType = this.formauthMethodType?.value;
+ this.apiAppRequest.authMethodType = this.formauthMethodType?.value;
- const oidcAppType = (this.formappType?.value as RadioItemAppType).oidcApplicationType;
+ const oidcAppType = (this.formappType?.value as RadioItemAppType).oidcAppType;
if (oidcAppType !== undefined) {
- this.oidcApp.applicationType = oidcAppType;
+ this.oidcAppRequest.appType = oidcAppType;
}
});
@@ -245,20 +243,20 @@ export class AppCreateComponent implements OnInit, OnDestroy {
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 },
+ { type: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC, checked: false, disabled: false, oidc: true },
+ { type: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE, checked: false, disabled: false, oidc: true },
+ { type: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_POST, checked: false, disabled: false, oidc: true },
];
- this.authMethod?.setValue(OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC);
+ this.authMethod?.setValue(OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_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 },
+ { type: APIAuthMethodType.API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT, checked: false, disabled: false, api: true },
+ { type: APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC, checked: false, disabled: false, api: true },
];
- this.authMethod?.setValue(APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT);
+ this.authMethod?.setValue(APIAuthMethodType.API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT);
}
this.form.updateValueAndValidity();
}
@@ -271,8 +269,8 @@ export class AppCreateComponent implements OnInit, OnDestroy {
private async getData({ projectid }: Params): Promise {
this.projectId = projectid;
- this.oidcApp.projectId = projectid;
- this.apiApp.projectId = projectid;
+ this.oidcAppRequest.projectId = projectid;
+ this.apiAppRequest.projectId = projectid;
}
public close(): void {
@@ -288,15 +286,14 @@ export class AppCreateComponent implements OnInit, OnDestroy {
this.loading = true;
this.mgmtService
- .CreateOIDCApp(this.oidcApp)
- .then((data: Application) => {
+ .addOIDCApp(this.oidcAppRequest)
+ .then((resp) => {
this.loading = false;
- const response = data.toObject();
- if (response.oidcConfig?.authMethodType !== OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE) {
- this.showSavedDialog(response);
- } else {
- this.router.navigate(['projects', this.projectId, 'apps', response.id]);
- }
+ // if (resp.oidcConfig?.authMethodType !== OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE) {
+ // this.showSavedDialog(resp);
+ // } else {
+ // this.router.navigate(['projects', this.projectId, 'apps', response.id]);
+ // }
})
.catch(error => {
this.loading = false;
@@ -305,15 +302,15 @@ export class AppCreateComponent implements OnInit, OnDestroy {
} else if (appAPICheck) {
this.loading = true;
this.mgmtService
- .CreateAPIApplication(this.apiApp)
- .then((data: Application) => {
+ .addAPIApp(this.apiAppRequest)
+ .then((resp) => {
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]);
- }
+ // const response = resp.toObject();
+ // if (response.apiConfig?.authMethodType == APIAuthMethodType.APIAUTHMETHODTYPE_BASIC) {
+ // this.showSavedDialog(resp);
+ // } else {
+ // this.router.navigate(['projects', this.projectId, 'apps', response.id]);
+ // }
})
.catch(error => {
this.loading = false;
@@ -322,7 +319,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
}
}
- public showSavedDialog(app: Application.AsObject): void {
+ public showSavedDialog(app: App.AsObject): void {
if (app.oidcConfig?.clientSecret !== undefined) {
const dialogRef = this.dialog.open(AppSecretDialogComponent, {
data: app.oidcConfig,
diff --git a/console/src/app/pages/projects/apps/app-detail/app-detail.component.html b/console/src/app/pages/projects/apps/app-detail/app-detail.component.html
index 3391d3b569..bac4068bf5 100644
--- a/console/src/app/pages/projects/apps/app-detail/app-detail.component.html
+++ b/console/src/app/pages/projects/apps/app-detail/app-detail.component.html
@@ -106,29 +106,28 @@
{{ 'APP.OIDC.DEVMODE' | translate }}
-
+
{{'APP.OIDC.REDIRECTDESCRIPTIONNATIVE' | translate}}
+ *ngIf="OIDCAppType?.value == OIDCAppType.OIDC_APP_TYPE_WEB || appType?.value == OIDCAppType.OIDC_APP_TYPE_USER_AGENT">
{{'APP.OIDC.REDIRECTDESCRIPTIONWEB' | translate}}
-
+ [isNative]="appType?.value == OIDCAppType.OIDC_APP_TYPE_NATIVE">
-
+ [isNative]="appType?.value == OIDCAppType.OIDC_APP_TYPE_NATIVE">
@@ -262,7 +261,7 @@
{{'PROJECT.STATE.TITLE' | translate}}:
{{'APP.PAGES.DETAIL.STATE.'+app.state | translate}}
diff --git a/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts b/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts
index 0e305606c5..2001818cef 100644
--- a/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts
+++ b/console/src/app/pages/projects/apps/app-detail/app-detail.component.ts
@@ -2,11 +2,11 @@ import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
import { Location } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { Component, OnDestroy, OnInit } from '@angular/core';
-import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
+import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatButtonToggleChange } from '@angular/material/button-toggle';
import { MatDialog } from '@angular/material/dialog';
import { MatSnackBar } from '@angular/material/snack-bar';
-import { ActivatedRoute, Params, Router, RouterLink } from '@angular/router';
+import { ActivatedRoute, Params, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
import { Subject, Subscription } from 'rxjs';
@@ -18,25 +18,36 @@ import { WarnDialogComponent } from 'src/app/modules/warn-dialog/warn-dialog.com
import {
APIAuthMethodType,
APIConfig,
- APIConfigUpdate,
- Application,
+ App,
AppState,
- ClientSecret,
- OIDCApplicationType,
+ OIDCAppType,
OIDCAuthMethodType,
OIDCConfig,
- OIDCConfigUpdate,
OIDCGrantType,
OIDCResponseType,
OIDCTokenType,
- ZitadelDocs,
-} from 'src/app/proto/generated/management_pb';
+} from 'src/app/proto/generated/zitadel/app_pb';
+import {
+ GetOIDCInformationResponse,
+ UpdateAPIAppConfigRequest,
+ UpdateOIDCAppConfigRequest,
+} from 'src/app/proto/generated/zitadel/management_pb';
import { GrpcAuthService } from 'src/app/services/grpc-auth.service';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
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, BASIC_AUTH_METHOD } from '../authmethods';
+import {
+ BASIC_AUTH_METHOD,
+ CODE_METHOD,
+ CUSTOM_METHOD,
+ getAuthMethodFromPartialConfig,
+ getPartialConfigFromAuthMethod,
+ IMPLICIT_METHOD,
+ PK_JWT_METHOD,
+ PKCE_METHOD,
+ POST_METHOD,
+} from '../authmethods';
@Component({
selector: 'app-app-detail',
@@ -56,33 +67,33 @@ export class AppDetailComponent implements OnInit, OnDestroy {
public authMethods: RadioItemAuthType[] = [];
private subscription?: Subscription;
public projectId: string = '';
- public app!: Application.AsObject;
+ public app!: App.AsObject;
public oidcResponseTypes: OIDCResponseType[] = [
- OIDCResponseType.OIDCRESPONSETYPE_CODE,
- OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN,
- OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN,
+ OIDCResponseType.OIDC_RESPONSE_TYPE_CODE,
+ OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN,
+ OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN,
];
public oidcGrantTypes: OIDCGrantType[] = [
- OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
- OIDCGrantType.OIDCGRANTTYPE_IMPLICIT,
- OIDCGrantType.OIDCGRANTTYPE_REFRESH_TOKEN,
+ OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE,
+ OIDCGrantType.OIDC_GRANT_TYPE_IMPLICIT,
+ OIDCGrantType.OIDC_GRANT_TYPE_REFRESH_TOKEN,
];
- public oidcAppTypes: OIDCApplicationType[] = [
- OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB,
- OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT,
- OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE,
+ public oidcAppTypes: OIDCAppType[] = [
+ OIDCAppType.OIDC_APP_TYPE_WEB,
+ OIDCAppType.OIDC_APP_TYPE_USER_AGENT,
+ OIDCAppType.OIDC_APP_TYPE_NATIVE,
];
public oidcAuthMethodType: OIDCAuthMethodType[] = [
- OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
- OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
- OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
- OIDCAuthMethodType.OIDCAUTHMETHODTYPE_PRIVATE_KEY_JWT,
+ OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC,
+ OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_POST,
+ OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE,
+ OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT,
];
public oidcTokenTypes: OIDCTokenType[] = [
- OIDCTokenType.OIDCTOKENTYPE_BEARER,
- OIDCTokenType.OIDCTOKENTYPE_JWT,
+ OIDCTokenType.OIDC_TOKEN_TYPE_BEARER,
+ OIDCTokenType.OIDC_TOKEN_TYPE_JWT,
];
public AppState: any = AppState;
@@ -94,9 +105,9 @@ export class AppDetailComponent implements OnInit, OnDestroy {
public postLogoutRedirectUrisList: string[] = [];
public isZitadel: boolean = false;
- public docs!: ZitadelDocs.AsObject;
+ public docs!: GetOIDCInformationResponse.AsObject;
- public OIDCApplicationType: any = OIDCApplicationType;
+ public OIDCAppType: any = OIDCAppType;
public OIDCAuthMethodType: any = OIDCAuthMethodType;
public APIAuthMethodType: any = APIAuthMethodType;
public OIDCTokenType: any = OIDCTokenType;
@@ -142,7 +153,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
clientId: [{ value: '', disabled: true }],
responseTypesList: [{ value: [], disabled: true }],
grantTypesList: [{ value: [], disabled: true }],
- applicationType: [{ value: '', disabled: true }],
+ appType: [{ value: '', disabled: true }],
authMethodType: [{ value: '', disabled: true }],
accessTokenType: [{ value: '', disabled: true }],
accessTokenRoleAssertion: [{ value: false, disabled: true }],
@@ -192,93 +203,95 @@ export class AppDetailComponent implements OnInit, OnDestroy {
this.initLinks();
- this.mgmtService.GetIam().then(iam => {
- this.isZitadel = iam.toObject().iamProjectId === this.projectId;
+ this.mgmtService.getIAM().then(iam => {
+ this.isZitadel = iam.iamProjectId === this.projectId;
});
this.authService.isAllowed(['project.app.write$', 'project.app.write:' + projectid]).pipe(take(1)).subscribe((allowed) => {
this.canWrite = allowed;
- this.mgmtService.GetApplicationById(projectid, id).then(app => {
- this.app = app.toObject();
- this.appNameForm.patchValue(this.app);
+ this.mgmtService.getAppByID(projectid, id).then(app => {
+ if (app.app) {
+ this.app = app.app;
+ this.appNameForm.patchValue(this.app);
- if (this.app.oidcConfig) {
- this.getAuthMethodOptions('OIDC');
+ if (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);
+ 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 {
- this.authMethods = this.authMethods.filter(element => element != CUSTOM_METHOD);
- }
- } else if (this.app.apiConfig) {
- this.getAuthMethodOptions('API');
+ } else if (this.app.apiConfig) {
+ this.getAuthMethodOptions('API');
- this.initialAuthMethod = this.authMethodFromPartialConfig({ api: this.app.apiConfig });
- this.currentAuthMethod = this.initialAuthMethod;
- if (this.initialAuthMethod === CUSTOM_METHOD.key) {
- if (!this.authMethods.includes(CUSTOM_METHOD)) {
- this.authMethods.push(CUSTOM_METHOD);
+ this.initialAuthMethod = this.authMethodFromPartialConfig({ api: this.app.apiConfig });
+ 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 {
- this.authMethods = this.authMethods.filter(element => element != CUSTOM_METHOD);
- }
- }
-
- if (allowed) {
- this.appNameForm.enable();
- this.oidcForm.enable();
- this.apiForm.enable();
- }
-
- if (this.app.oidcConfig?.redirectUrisList) {
- this.redirectUrisList = this.app.oidcConfig.redirectUrisList;
- }
- if (this.app.oidcConfig?.postLogoutRedirectUrisList) {
- this.postLogoutRedirectUrisList = this.app.oidcConfig.postLogoutRedirectUrisList;
- }
- if (this.app.oidcConfig?.clockSkew) {
- const inSecs = this.app.oidcConfig?.clockSkew.seconds + this.app.oidcConfig?.clockSkew.nanos / 100000;
- this.oidcForm.controls['clockSkewSeconds'].setValue(inSecs);
- }
- if (this.app.oidcConfig) {
- this.oidcForm.patchValue(this.app.oidcConfig);
- }
-
- this.oidcForm.valueChanges.subscribe((oidcConfig) => {
- this.initialAuthMethod = this.authMethodFromPartialConfig({ oidc: oidcConfig });
- 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();
- });
-
- 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);
+ if (allowed) {
+ this.appNameForm.enable();
+ this.oidcForm.enable();
+ this.apiForm.enable();
}
- this.showSaveSnack();
- });
+ if (this.app.oidcConfig?.redirectUrisList) {
+ this.redirectUrisList = this.app.oidcConfig.redirectUrisList;
+ }
+ if (this.app.oidcConfig?.postLogoutRedirectUrisList) {
+ this.postLogoutRedirectUrisList = this.app.oidcConfig.postLogoutRedirectUrisList;
+ }
+ if (this.app.oidcConfig?.clockSkew) {
+ const inSecs = this.app.oidcConfig?.clockSkew.seconds + this.app.oidcConfig?.clockSkew.nanos / 100000;
+ this.oidcForm.controls['clockSkewSeconds'].setValue(inSecs);
+ }
+ if (this.app.oidcConfig) {
+ this.oidcForm.patchValue(this.app.oidcConfig);
+ }
+
+ this.oidcForm.valueChanges.subscribe((oidcConfig) => {
+ this.initialAuthMethod = this.authMethodFromPartialConfig({ oidc: oidcConfig });
+ 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();
+ });
+
+ 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 => {
console.error(error);
this.toast.showError(error);
this.errorMessage = error.message;
});
});
- this.docs = (await this.mgmtService.GetZitadelDocs()).toObject();
+ this.docs = (await this.mgmtService.getOIDCInformation());
}
private async showSaveSnack(): Promise {
@@ -297,14 +310,14 @@ export class AppDetailComponent implements OnInit, OnDestroy {
private getAuthMethodOptions(type: string): void {
if (type == 'OIDC') {
- switch (this.app.oidcConfig?.applicationType) {
- case OIDCApplicationType.OIDCAPPLICATIONTYPE_NATIVE:
+ switch (this.app.oidcConfig?.appType) {
+ case OIDCAppType.OIDC_APP_TYPE_NATIVE:
this.authMethods = [
PKCE_METHOD,
CUSTOM_METHOD,
];
break;
- case OIDCApplicationType.OIDCAPPLICATIONTYPE_WEB:
+ case OIDCAppType.OIDC_APP_TYPE_WEB:
this.authMethods = [
PKCE_METHOD,
CODE_METHOD,
@@ -312,7 +325,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
POST_METHOD,
];
break;
- case OIDCApplicationType.OIDCAPPLICATIONTYPE_USER_AGENT:
+ case OIDCAppType.OIDC_APP_TYPE_USER_AGENT:
this.authMethods = [
PKCE_METHOD,
IMPLICIT_METHOD,
@@ -338,10 +351,10 @@ export class AppDetailComponent implements OnInit, OnDestroy {
if (partialConfig && partialConfig.oidc && this.app.oidcConfig) {
this.app.oidcConfig.responseTypesList = (partialConfig.oidc as Partial).responseTypesList ?? [];
this.app.oidcConfig.grantTypesList = (partialConfig.oidc as Partial).grantTypesList ?? [];
- this.app.oidcConfig.authMethodType = (partialConfig.oidc as Partial).authMethodType ?? OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE;
+ this.app.oidcConfig.authMethodType = (partialConfig.oidc as Partial).authMethodType ?? OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE;
this.oidcForm.patchValue(this.app.oidcConfig);
} else if (partialConfig && partialConfig.api && this.app.apiConfig) {
- this.app.apiConfig.authMethodType = (partialConfig.api as Partial).authMethodType ?? APIAuthMethodType.APIAUTHMETHODTYPE_BASIC;
+ this.app.apiConfig.authMethodType = (partialConfig.api as Partial).authMethodType ?? APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC;
this.apiAuthMethodType?.setValue(this.app.apiConfig.authMethodType);
}
}
@@ -358,7 +371,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
});
dialogRef.afterClosed().subscribe(resp => {
if (resp && this.projectId && this.app.id) {
- this.mgmtService.RemoveApplication(this.projectId, this.app.id).then(() => {
+ this.mgmtService.removeApp(this.projectId, this.app.id).then(() => {
this.toast.showInfo('APP.TOAST.DELETED', true);
this.router.navigate(['/projects', this.projectId]);
@@ -370,14 +383,14 @@ export class AppDetailComponent implements OnInit, OnDestroy {
}
public changeState(event: MatButtonToggleChange): void {
- if (event.value === AppState.APPSTATE_ACTIVE) {
- this.mgmtService.ReactivateApplication(this.projectId, this.app.id).then(() => {
+ if (event.value === AppState.APP_STATE_ACTIVE) {
+ this.mgmtService.reactivateApp(this.projectId, this.app.id).then(() => {
this.toast.showInfo('APP.TOAST.REACTIVATED', true);
}).catch((error: any) => {
this.toast.showError(error);
});
- } else if (event.value === AppState.APPSTATE_INACTIVE) {
- this.mgmtService.DeactivateApplication(this.projectId, this.app.id).then(() => {
+ } else if (event.value === AppState.APP_STATE_INACTIVE) {
+ this.mgmtService.deactivateApp(this.projectId, this.app.id).then(() => {
this.toast.showInfo('APP.TOAST.DEACTIVATED', true);
}).catch((error: any) => {
this.toast.showError(error);
@@ -390,7 +403,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
this.app.name = this.name?.value;
this.mgmtService
- .UpdateApplication(this.projectId, this.app.id, this.name?.value)
+ .updateApp(this.projectId, this.app.id, this.name?.value)
.then(() => {
this.toast.showInfo('APP.TOAST.UPDATED', true);
this.editState = false;
@@ -412,7 +425,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
if (this.app.oidcConfig) {
this.app.oidcConfig.responseTypesList = this.responseTypesList?.value;
this.app.oidcConfig.grantTypesList = this.grantTypesList?.value;
- this.app.oidcConfig.applicationType = this.applicationType?.value;
+ this.app.oidcConfig.appType = this.appType?.value;
this.app.oidcConfig.authMethodType = this.authMethodType?.value;
this.app.oidcConfig.redirectUrisList = this.redirectUrisList;
this.app.oidcConfig.postLogoutRedirectUrisList = this.postLogoutRedirectUrisList;
@@ -422,16 +435,15 @@ export class AppDetailComponent implements OnInit, OnDestroy {
this.app.oidcConfig.idTokenRoleAssertion = this.idTokenRoleAssertion?.value;
this.app.oidcConfig.idTokenUserinfoAssertion = this.idTokenUserinfoAssertion?.value;
-
- const req = new OIDCConfigUpdate();
+ const req = new UpdateOIDCAppConfigRequest();
req.setProjectId(this.projectId);
- req.setApplicationId(this.app.id);
+ req.setAppId(this.app.id);
req.setRedirectUrisList(this.app.oidcConfig.redirectUrisList);
req.setResponseTypesList(this.app.oidcConfig.responseTypesList);
req.setAuthMethodType(this.app.oidcConfig.authMethodType);
req.setPostLogoutRedirectUrisList(this.app.oidcConfig.postLogoutRedirectUrisList);
req.setGrantTypesList(this.app.oidcConfig.grantTypesList);
- req.setApplicationType(this.app.oidcConfig.applicationType);
+ req.setAppType(this.app.oidcConfig.appType);
req.setDevMode(this.app.oidcConfig.devMode);
req.setAccessTokenType(this.app.oidcConfig.accessTokenType);
req.setAccessTokenRoleAssertion(this.app.oidcConfig.accessTokenRoleAssertion);
@@ -444,7 +456,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
req.setClockSkew(dur);
}
this.mgmtService
- .UpdateOIDCAppConfig(req)
+ .updateOIDCAppConfig(req)
.then(() => {
if (this.app.oidcConfig) {
const config = { oidc: this.app.oidcConfig };
@@ -463,13 +475,13 @@ export class AppDetailComponent implements OnInit, OnDestroy {
if (this.apiForm.valid && this.app.apiConfig) {
this.app.apiConfig.authMethodType = this.apiAuthMethodType?.value;
- const req = new APIConfigUpdate();
+ const req = new UpdateAPIAppConfigRequest();
req.setProjectId(this.projectId);
- req.setApplicationId(this.app.id);
+ req.setAppId(this.app.id);
req.setAuthMethodType(this.app.apiConfig.authMethodType);
this.mgmtService
- .UpdateAPIAppConfig(req)
+ .updateAPIAppConfig(req)
.then(() => {
if (this.app.apiConfig) {
const config = { api: this.app.apiConfig };
@@ -484,12 +496,12 @@ export class AppDetailComponent implements OnInit, OnDestroy {
}
public regenerateOIDCClientSecret(): void {
- this.mgmtService.RegenerateOIDCClientSecret(this.app.id, this.projectId).then((data: ClientSecret) => {
+ this.mgmtService.regenerateOIDCClientSecret(this.app.id, this.projectId).then(resp => {
this.toast.showInfo('APP.TOAST.CLIENTSECRETREGENERATED', true);
this.dialog.open(AppSecretDialogComponent, {
data: {
// clientId: data.toObject() as ClientSecret.AsObject.clientId,
- clientSecret: data.toObject().clientSecret,
+ clientSecret: resp.clientSecret,
},
width: '400px',
});
@@ -500,12 +512,12 @@ export class AppDetailComponent implements OnInit, OnDestroy {
}
public regenerateAPIClientSecret(): void {
- this.mgmtService.RegenerateAPIClientSecret(this.app.id, this.projectId).then((data: ClientSecret) => {
+ this.mgmtService.regenerateAPIClientSecret(this.app.id, this.projectId).then(resp => {
this.toast.showInfo('APP.TOAST.CLIENTSECRETREGENERATED', true);
this.dialog.open(AppSecretDialogComponent, {
data: {
// clientId: data.toObject().clientId ?? '',
- clientSecret: data.toObject().clientSecret,
+ clientSecret: resp.clientSecret,
},
width: '400px',
});
@@ -535,8 +547,8 @@ export class AppDetailComponent implements OnInit, OnDestroy {
return this.oidcForm.get('grantTypesList');
}
- public get applicationType(): AbstractControl | null {
- return this.oidcForm.get('applicationType');
+ public get appType(): AbstractControl | null {
+ return this.oidcForm.get('appType');
}
public get authMethodType(): AbstractControl | null {
diff --git a/console/src/app/pages/projects/apps/authmethods.ts b/console/src/app/pages/projects/apps/authmethods.ts
index 335f886dc7..7ea6ceeb7d 100644
--- a/console/src/app/pages/projects/apps/authmethods.ts
+++ b/console/src/app/pages/projects/apps/authmethods.ts
@@ -1,5 +1,12 @@
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
-import { APIAuthMethodType, APIConfig, OIDCAuthMethodType, OIDCConfig, OIDCGrantType, OIDCResponseType } from 'src/app/proto/generated/management_pb';
+import {
+ APIAuthMethodType,
+ APIConfig,
+ OIDCAuthMethodType,
+ OIDCConfig,
+ OIDCGrantType,
+ OIDCResponseType,
+} from 'src/app/proto/generated/zitadel/app_pb';
export const CODE_METHOD: RadioItemAuthType = {
key: 'CODE',
@@ -8,9 +15,9 @@ export const CODE_METHOD: RadioItemAuthType = {
disabled: false,
prefix: 'CODE',
background: 'rgb(89 115 128)',
- responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
- grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
- authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
+ responseType: OIDCResponseType.OIDC_RESPONSE_TYPE_CODE,
+ grantType: OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE,
+ authMethod: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC,
recommended: false,
};
export const PKCE_METHOD: RadioItemAuthType = {
@@ -20,9 +27,9 @@ export const PKCE_METHOD: RadioItemAuthType = {
disabled: false,
prefix: 'PKCE',
background: 'rgb(80 110 92)',
- responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
- grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
- authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
+ responseType: OIDCResponseType.OIDC_RESPONSE_TYPE_CODE,
+ grantType: OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE,
+ authMethod: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE,
recommended: true,
};
export const POST_METHOD: RadioItemAuthType = {
@@ -32,9 +39,9 @@ export const POST_METHOD: RadioItemAuthType = {
disabled: false,
prefix: 'POST',
background: 'rgb(144 75 75)',
- responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
- grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
- authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
+ responseType: OIDCResponseType.OIDC_RESPONSE_TYPE_CODE,
+ grantType: OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE,
+ authMethod: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_POST,
notRecommended: true,
};
export const PK_JWT_METHOD: RadioItemAuthType = {
@@ -44,10 +51,10 @@ export const PK_JWT_METHOD: RadioItemAuthType = {
disabled: false,
prefix: 'JWT',
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,
+ responseType: OIDCResponseType.OIDC_RESPONSE_TYPE_CODE,
+ grantType: OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE,
+ authMethod: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT,
+ apiAuthMethod: APIAuthMethodType.API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT,
// recommended: true,
};
export const BASIC_AUTH_METHOD: RadioItemAuthType = {
@@ -57,10 +64,10 @@ export const BASIC_AUTH_METHOD: RadioItemAuthType = {
disabled: false,
prefix: 'BASIC',
background: 'rgb(144 75 75)',
- responseType: OIDCResponseType.OIDCRESPONSETYPE_CODE,
- grantType: OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE,
- authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
- apiAuthMethod: APIAuthMethodType.APIAUTHMETHODTYPE_BASIC,
+ responseType: OIDCResponseType.OIDC_RESPONSE_TYPE_CODE,
+ grantType: OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE,
+ authMethod: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_POST,
+ apiAuthMethod: APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC,
};
export const IMPLICIT_METHOD: RadioItemAuthType = {
@@ -70,9 +77,9 @@ export const IMPLICIT_METHOD: RadioItemAuthType = {
disabled: false,
prefix: 'IMP',
background: 'rgb(144 75 75)',
- responseType: OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN,
- grantType: OIDCGrantType.OIDCGRANTTYPE_IMPLICIT,
- authMethod: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
+ responseType: OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN,
+ grantType: OIDCGrantType.OIDC_GRANT_TYPE_IMPLICIT,
+ authMethod: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE,
notRecommended: true,
};
@@ -97,61 +104,61 @@ export function getPartialConfigFromAuthMethod(authMethod: string): {
case CODE_METHOD.key:
config = {
oidc: {
- responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
- grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
- authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
+ responseTypesList: [OIDCResponseType.OIDC_RESPONSE_TYPE_CODE],
+ grantTypesList: [OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE],
+ authMethodType: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC,
},
};
return config;
case PKCE_METHOD.key:
config = {
oidc: {
- responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
- grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
- authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
+ responseTypesList: [OIDCResponseType.OIDC_RESPONSE_TYPE_CODE],
+ grantTypesList: [OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE],
+ authMethodType: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE,
}
};
return config;
case POST_METHOD.key:
config = {
oidc: {
- responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_CODE],
- grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_AUTHORIZATION_CODE],
- authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_POST,
+ responseTypesList: [OIDCResponseType.OIDC_RESPONSE_TYPE_CODE],
+ grantTypesList: [OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE],
+ authMethodType: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_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,
+ responseTypesList: [OIDCResponseType.OIDC_RESPONSE_TYPE_CODE],
+ grantTypesList: [OIDCGrantType.OIDC_GRANT_TYPE_AUTHORIZATION_CODE],
+ authMethodType: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT,
},
api: {
- authMethodType: APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT,
+ authMethodType: APIAuthMethodType.API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT,
}
};
return config;
case BASIC_AUTH_METHOD.key:
config = {
oidc: {
- authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_BASIC,
+ authMethodType: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_BASIC,
},
api: {
- authMethodType: APIAuthMethodType.APIAUTHMETHODTYPE_BASIC,
+ authMethodType: APIAuthMethodType.API_AUTH_METHOD_TYPE_BASIC,
}
};
return config;
case IMPLICIT_METHOD.key:
config = {
oidc: {
- responseTypesList: [OIDCResponseType.OIDCRESPONSETYPE_ID_TOKEN_TOKEN],
- grantTypesList: [OIDCGrantType.OIDCGRANTTYPE_IMPLICIT],
- authMethodType: OIDCAuthMethodType.OIDCAUTHMETHODTYPE_NONE,
+ responseTypesList: [OIDCResponseType.OIDC_RESPONSE_TYPE_ID_TOKEN_TOKEN],
+ grantTypesList: [OIDCGrantType.OIDC_GRANT_TYPE_IMPLICIT],
+ authMethodType: OIDCAuthMethodType.OIDC_AUTH_METHOD_TYPE_NONE,
},
api: {
- authMethodType: APIAuthMethodType.APIAUTHMETHODTYPE_PRIVATE_KEY_JWT,
+ authMethodType: APIAuthMethodType.API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT,
}
};
return config;
@@ -165,41 +172,41 @@ export function getAuthMethodFromPartialConfig(config: { oidc?: Partial
-
+
arrow_back
diff --git a/console/src/app/pages/projects/granted-projects/granted-project-detail/granted-project-detail.component.ts b/console/src/app/pages/projects/granted-projects/granted-project-detail/granted-project-detail.component.ts
index 06406be216..bf93b74d89 100644
--- a/console/src/app/pages/projects/granted-projects/granted-project-detail/granted-project-detail.component.ts
+++ b/console/src/app/pages/projects/granted-projects/granted-project-detail/granted-project-detail.component.ts
@@ -1,29 +1,17 @@
-import { SelectionModel } from '@angular/cdk/collections';
import { Location } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
-import { MatTableDataSource } from '@angular/material/table';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { BehaviorSubject, from, Observable, of, Subscription } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
import { CreationType, MemberCreateDialogComponent } from 'src/app/modules/add-member-dialog/member-create-dialog.component';
import { ChangeType } from 'src/app/modules/changes/changes.component';
+import { ProjectType } from 'src/app/modules/project-members/project-members.component';
import { UserGrantContext } from 'src/app/modules/user-grants/user-grants-datasource';
-import {
- Application,
- ApplicationSearchResponse,
- ProjectGrantView,
- ProjectMember,
- ProjectMemberSearchResponse,
- ProjectMemberView,
- ProjectRole,
- ProjectRoleSearchResponse,
- ProjectState,
- ProjectType,
- UserGrantSearchKey,
- UserView,
-} from 'src/app/proto/generated/management_pb';
+import { Member } from 'src/app/proto/generated/zitadel/member_pb';
+import { GrantedProject, ProjectState } from 'src/app/proto/generated/zitadel/project_pb';
+import { User } from 'src/app/proto/generated/zitadel/user_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -35,41 +23,22 @@ import { ToastService } from 'src/app/services/toast.service';
export class GrantedProjectDetailComponent implements OnInit, OnDestroy {
public projectId: string = '';
public grantId: string = '';
- public project!: ProjectGrantView.AsObject;
-
- public pageSizeRoles: number = 10;
- public roleDataSource: MatTableDataSource = new MatTableDataSource();
- public roleResult!: ProjectRoleSearchResponse.AsObject;
- public roleColumns: string[] = ['name', 'displayname', 'group', 'actions'];
-
- public pageSizeMembers: number = 10;
- public projectDataSource: MatTableDataSource = new MatTableDataSource();
- public memberResult!: ProjectMemberSearchResponse.AsObject;
- public memberColumns: string[] = ['firstname', 'lastname', 'username', 'email', 'roles'];
- public selection: SelectionModel = new SelectionModel(true, []);
-
- public pageSizeApps: number = 10;
- public appsDataSource: MatTableDataSource = new MatTableDataSource();
- public appsResult!: ApplicationSearchResponse.AsObject;
- public appsColumns: string[] = ['name'];
+ public project!: GrantedProject.AsObject;
public ProjectState: any = ProjectState;
public ProjectType: any = ProjectType;
public ChangeType: any = ChangeType;
- public grid: boolean = true;
private subscription?: Subscription;
- public editstate: boolean = false;
public isZitadel: boolean = false;
UserGrantContext: any = UserGrantContext;
- public userGrantSearchKey: UserGrantSearchKey = UserGrantSearchKey.USERGRANTSEARCHKEY_PROJECT_ID;
// members
public totalMemberResult: number = 0;
- public membersSubject: BehaviorSubject
- = new BehaviorSubject([]);
+ public membersSubject: BehaviorSubject
+ = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(true);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -96,13 +65,15 @@ export class GrantedProjectDetailComponent implements OnInit, OnDestroy {
this.projectId = id;
this.grantId = grantId;
- this.mgmtService.GetIam().then(iam => {
- this.isZitadel = iam.toObject().iamProjectId === this.projectId;
+ this.mgmtService.getIAM().then(iam => {
+ this.isZitadel = iam.iamProjectId === this.projectId;
});
if (this.projectId && this.grantId) {
- this.mgmtService.GetGrantedProjectByID(this.projectId, this.grantId).then(proj => {
- this.project = proj.toObject();
+ this.mgmtService.getGrantedProjectByID(this.projectId, this.grantId).then(proj => {
+ if (proj.grantedProject) {
+ this.project = proj.grantedProject;
+ }
}).catch(error => {
this.toast.showError(error);
});
@@ -113,11 +84,13 @@ export class GrantedProjectDetailComponent implements OnInit, OnDestroy {
public loadMembers(): void {
this.loadingSubject.next(true);
- from(this.mgmtService.SearchProjectGrantMembers(this.projectId,
+ from(this.mgmtService.listProjectGrantMembers(this.projectId,
this.grantId, 100, 0)).pipe(
map(resp => {
- this.totalMemberResult = resp.toObject().totalResult;
- return resp.toObject().resultList;
+ if (resp.details?.totalResult) {
+ this.totalMemberResult = resp.details.totalResult;
+ }
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
@@ -140,12 +113,12 @@ export class GrantedProjectDetailComponent implements OnInit, OnDestroy {
dialogRef.afterClosed().subscribe(resp => {
if (resp) {
- const users: UserView.AsObject[] = resp.users;
+ const users: User.AsObject[] = resp.users;
const roles: string[] = resp.roles;
if (users && users.length && roles && roles.length) {
users.forEach(user => {
- return this.mgmtService.AddProjectGrantMember(
+ return this.mgmtService.addProjectGrantMember(
this.projectId,
this.grantId,
user.id,
diff --git a/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-grid/granted-project-grid.component.ts b/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-grid/granted-project-grid.component.ts
index d4d5e7d5ec..371a66ab43 100644
--- a/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-grid/granted-project-grid.component.ts
+++ b/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-grid/granted-project-grid.component.ts
@@ -2,8 +2,9 @@ import { animate, animateChild, query, stagger, style, transition, trigger } fro
import { SelectionModel } from '@angular/cdk/collections';
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
import { Router } from '@angular/router';
-import { Org } from 'src/app/proto/generated/auth_pb';
-import { ProjectGrantView, ProjectState, ProjectType } from 'src/app/proto/generated/management_pb';
+import { ProjectType } from 'src/app/modules/project-members/project-members.component';
+import { Org } from 'src/app/proto/generated/zitadel/org_pb';
+import { GrantedProject, ProjectState } from 'src/app/proto/generated/zitadel/project_pb';
import { StorageKey, StorageService } from 'src/app/services/storage.service';
@Component({
@@ -31,12 +32,12 @@ import { StorageKey, StorageService } from 'src/app/services/storage.service';
],
})
export class GrantedProjectGridComponent implements OnChanges {
- @Input() items: Array = [];
- public notPinned: Array = [];
+ @Input() items: Array = [];
+ public notPinned: Array = [];
@Output() newClicked: EventEmitter = new EventEmitter();
@Output() changedView: EventEmitter = new EventEmitter();
@Input() loading: boolean = false;
- public selection: SelectionModel = new SelectionModel(true, []);
+ public selection: SelectionModel = new SelectionModel(true, []);
public showNewProject: boolean = false;
public ProjectState: any = ProjectState;
@@ -71,7 +72,7 @@ export class GrantedProjectGridComponent implements OnChanges {
this.getPrefixedItem('pinned-granted-projects').then(storageEntry => {
if (storageEntry) {
const array: string[] = JSON.parse(storageEntry);
- const toSelect: ProjectGrantView.AsObject[] = this.items.filter((item, index) => {
+ const toSelect: GrantedProject.AsObject[] = this.items.filter((item, index) => {
if (array.includes(item.projectId)) {
return true;
}
diff --git a/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-list.component.ts b/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-list.component.ts
index 9ceb8d451a..e788567e56 100644
--- a/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-list.component.ts
+++ b/console/src/app/pages/projects/granted-projects/granted-project-list/granted-project-list.component.ts
@@ -7,7 +7,7 @@ import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
-import { ProjectGrantView } from 'src/app/proto/generated/management_pb';
+import { GrantedProject } from 'src/app/proto/generated/zitadel/project_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -39,13 +39,13 @@ export class GrantedProjectListComponent implements OnInit, OnDestroy {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
- public dataSource: MatTableDataSource =
- new MatTableDataSource();
+ public dataSource: MatTableDataSource =
+ new MatTableDataSource();
@ViewChild(MatPaginator) public paginator!: MatPaginator;
- public grantedProjectList: ProjectGrantView.AsObject[] = [];
+ public grantedProjectList: GrantedProject.AsObject[] = [];
public displayedColumns: string[] = ['select', 'name', 'resourceOwnerName', 'state', 'creationDate', 'changeDate'];
- public selection: SelectionModel = new SelectionModel(true, []);
+ public selection: SelectionModel = new SelectionModel(true, []);
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -89,12 +89,13 @@ export class GrantedProjectListComponent implements OnInit, OnDestroy {
private async getData(limit: number, offset: number): Promise {
this.loadingSubject.next(true);
- this.mgmtService.SearchGrantedProjects(limit, offset).then(res => {
- const response = res.toObject();
- this.grantedProjectList = response.resultList;
- this.totalResult = response.totalResult;
- if (response.viewTimestamp) {
- this.viewTimestamp = response.viewTimestamp;
+ this.mgmtService.listGrantedProjects(limit, offset).then(resp => {
+ this.grantedProjectList = resp.resultList;
+ if (resp.details?.totalResult) {
+ this.totalResult = resp.details.totalResult;
+ }
+ if (resp.details?.viewTimestamp) {
+ this.viewTimestamp = resp.details?.viewTimestamp;
}
if (this.totalResult > 5) {
this.grid = false;
diff --git a/console/src/app/pages/projects/granted-projects/granted-projects-routing.module.ts b/console/src/app/pages/projects/granted-projects/granted-projects-routing.module.ts
index f602fc505c..ad3c492ba9 100644
--- a/console/src/app/pages/projects/granted-projects/granted-projects-routing.module.ts
+++ b/console/src/app/pages/projects/granted-projects/granted-projects-routing.module.ts
@@ -2,7 +2,7 @@ import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthGuard } from 'src/app/guards/auth.guard';
import { RoleGuard } from 'src/app/guards/role.guard';
-import { ProjectType } from 'src/app/proto/generated/management_pb';
+import { ProjectType } from 'src/app/modules/project-members/project-members.component';
import { GrantedProjectDetailComponent } from './granted-project-detail/granted-project-detail.component';
import { GrantedProjectsComponent } from './granted-projects.component';
diff --git a/console/src/app/pages/projects/owned-projects/owned-project-detail/application-grid/application-grid.component.ts b/console/src/app/pages/projects/owned-projects/owned-project-detail/application-grid/application-grid.component.ts
index a73e8687c2..9303519ee4 100644
--- a/console/src/app/pages/projects/owned-projects/owned-project-detail/application-grid/application-grid.component.ts
+++ b/console/src/app/pages/projects/owned-projects/owned-project-detail/application-grid/application-grid.component.ts
@@ -1,8 +1,9 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
-import { Application, OIDCApplicationType, OIDCResponseType } from 'src/app/proto/generated/management_pb';
+import { App, OIDCAppType } from 'src/app/proto/generated/zitadel/app_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
+
import { NATIVE_TYPE, USER_AGENT_TYPE, WEB_TYPE } from '../../../apps/authtypes';
@Component({
@@ -14,10 +15,10 @@ export class ApplicationGridComponent implements OnInit {
@Input() public projectId: string = '';
@Input() public disabled: boolean = false;
@Output() public changeView: EventEmitter = new EventEmitter();
- public appsSubject: BehaviorSubject = new BehaviorSubject([]);
+ public appsSubject: BehaviorSubject = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(true);
public loading$: Observable = this.loadingSubject.asObservable();
- public OIDCApplicationType: any = OIDCApplicationType;
+ public OIDCApplicationType: any = OIDCAppType;
public NATIVE_TYPE: any = NATIVE_TYPE;
public WEB_TYPE: any = WEB_TYPE;
@@ -30,14 +31,14 @@ export class ApplicationGridComponent implements OnInit {
}
public loadApps(): void {
- from(this.mgmtService.SearchApplications(this.projectId, 100, 0)).pipe(
+ from(this.mgmtService.listApps(this.projectId, 100, 0)).pipe(
map(resp => {
- return resp.toObject().resultList;
+ return resp.resultList;
}),
catchError(() => of([])),
finalize(() => this.loadingSubject.next(false)),
).subscribe((apps) => {
- this.appsSubject.next(apps as Application.AsObject[]);
+ this.appsSubject.next(apps as App.AsObject[]);
});
}
diff --git a/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications-datasource.ts b/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications-datasource.ts
index 97fe8a1c78..b04b9eccee 100644
--- a/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications-datasource.ts
+++ b/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications-datasource.ts
@@ -2,7 +2,7 @@ import { DataSource } from '@angular/cdk/collections';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, Observable, of } from 'rxjs';
import { catchError, finalize, map } from 'rxjs/operators';
-import { Application } from 'src/app/proto/generated/management_pb';
+import { App } from 'src/app/proto/generated/zitadel/app_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
/**
@@ -10,11 +10,11 @@ import { ManagementService } from 'src/app/services/mgmt.service';
* encapsulate all logic for fetching and manipulating the displayed data
* (including sorting, pagination, and filtering).
*/
-export class ProjectApplicationsDataSource extends DataSource {
+export class ProjectApplicationsDataSource extends DataSource {
public totalResult: number = 0;
public viewTimestamp!: Timestamp.AsObject;
- public appsSubject: BehaviorSubject = new BehaviorSubject([]);
+ public appsSubject: BehaviorSubject = new BehaviorSubject([]);
private loadingSubject: BehaviorSubject = new BehaviorSubject(false);
public loading$: Observable = this.loadingSubject.asObservable();
@@ -26,12 +26,14 @@ export class ProjectApplicationsDataSource extends DataSource {
- const response = resp.toObject();
- this.totalResult = response.totalResult;
- if (response.viewTimestamp) {
- this.viewTimestamp = response.viewTimestamp;
+ const response = resp;
+ if (response.details?.totalResult) {
+ this.totalResult = response.details.totalResult;
+ }
+ if (response.details?.viewTimestamp) {
+ this.viewTimestamp = response.details.viewTimestamp;
}
return response.resultList;
}),
@@ -48,7 +50,7 @@ export class ProjectApplicationsDataSource extends DataSource {
+ public connect(): Observable {
return this.appsSubject.asObservable();
}
diff --git a/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications.component.ts b/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications.component.ts
index c4b70f1431..e2532bd928 100644
--- a/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications.component.ts
+++ b/console/src/app/pages/projects/owned-projects/owned-project-detail/applications/applications.component.ts
@@ -5,9 +5,8 @@ import { MatSort } from '@angular/material/sort';
import { MatTable } from '@angular/material/table';
import { merge, of } from 'rxjs';
import { tap } from 'rxjs/operators';
-import { Application } from 'src/app/proto/generated/management_pb';
+import { App } from 'src/app/proto/generated/zitadel/app_pb';
import { ManagementService } from 'src/app/services/mgmt.service';
-import { ToastService } from 'src/app/services/toast.service';
import { ProjectApplicationsDataSource } from './applications-datasource';
@@ -22,13 +21,13 @@ export class ApplicationsComponent implements AfterViewInit, OnInit {
@Input() public disabled: boolean = false;
@ViewChild(MatPaginator) public paginator!: MatPaginator;
@ViewChild(MatSort) public sort!: MatSort;
- @ViewChild(MatTable) public table!: MatTable;
+ @ViewChild(MatTable) public table!: MatTable;
public dataSource!: ProjectApplicationsDataSource;
- public selection: SelectionModel = new SelectionModel(true, []);
+ public selection: SelectionModel = new SelectionModel(true, []);
public displayedColumns: string[] = ['select', 'name', 'type'];
- constructor(private mgmtService: ManagementService, private toast: ToastService) { }
+ constructor(private mgmtService: ManagementService) { }
public ngOnInit(): void {
this.dataSource = new ProjectApplicationsDataSource(this.mgmtService);
@@ -60,7 +59,7 @@ export class ApplicationsComponent implements AfterViewInit, OnInit {
public masterToggle(): void {
this.isAllSelected() ?
this.selection.clear() :
- this.dataSource.appsSubject.value.forEach((row: Application.AsObject) => this.selection.select(row));
+ this.dataSource.appsSubject.value.forEach((row: App.AsObject) => this.selection.select(row));
}
public refreshPage(): void {
diff --git a/console/src/app/pages/projects/owned-projects/owned-project-detail/owned-project-detail.component.html b/console/src/app/pages/projects/owned-projects/owned-project-detail/owned-project-detail.component.html
index d83a9208e7..30e25ed8d8 100644
--- a/console/src/app/pages/projects/owned-projects/owned-project-detail/owned-project-detail.component.html
+++ b/console/src/app/pages/projects/owned-projects/owned-project-detail/owned-project-detail.component.html
@@ -1,6 +1,6 @@
-
+
arrow_back
@@ -22,12 +22,12 @@
{{'PROJECT.TABLE.DEACTIVATE' |
translate}}
{{'PROJECT.TABLE.ACTIVATE' |
translate}}
@@ -53,7 +53,7 @@
-
+
@@ -68,18 +68,18 @@
+ [appHasRole]="['project.grant.read:' + project.id, 'project.grant.read']">
| |