mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-12 00:55:12 +00:00
feat(console): grpc web interceptors, cleanup services (#631)
* managementservice, authservice, change all refs * refactor grpc auth * fix references * interceptor logic * new interceptor * appinitializers, environment loader, interceptors * remove circular dep * init authconfig in grpc service * authconfig * lint * update mgmt service * fix references * update clientid, fix interceptor * rm unused authconfig * todo auth interceptor
This commit is contained in:
+6
-10
@@ -24,8 +24,7 @@ import {
|
||||
User,
|
||||
UserGrantSearchKey,
|
||||
} from 'src/app/proto/generated/management_pb';
|
||||
import { OrgService } from 'src/app/services/org.service';
|
||||
import { ProjectService } from 'src/app/services/project.service';
|
||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
@@ -78,9 +77,8 @@ export class GrantedProjectDetailComponent implements OnInit, OnDestroy {
|
||||
public translate: TranslateService,
|
||||
private route: ActivatedRoute,
|
||||
private toast: ToastService,
|
||||
private projectService: ProjectService,
|
||||
private mgmtService: ManagementService,
|
||||
private _location: Location,
|
||||
private orgService: OrgService,
|
||||
private router: Router,
|
||||
private dialog: MatDialog,
|
||||
) {
|
||||
@@ -98,20 +96,18 @@ export class GrantedProjectDetailComponent implements OnInit, OnDestroy {
|
||||
this.projectId = id;
|
||||
this.grantId = grantId;
|
||||
|
||||
console.log(id, grantId);
|
||||
|
||||
this.orgService.GetIam().then(iam => {
|
||||
this.mgmtService.GetIam().then(iam => {
|
||||
this.isZitadel = iam.toObject().iamProjectId === this.projectId;
|
||||
});
|
||||
|
||||
if (this.projectId && this.grantId) {
|
||||
this.projectService.GetGrantedProjectByID(this.projectId, this.grantId).then(proj => {
|
||||
this.mgmtService.GetGrantedProjectByID(this.projectId, this.grantId).then(proj => {
|
||||
this.project = proj.toObject();
|
||||
}).catch(error => {
|
||||
this.toast.showError(error);
|
||||
});
|
||||
|
||||
from(this.projectService.SearchProjectGrantMembers(this.projectId,
|
||||
from(this.mgmtService.SearchProjectGrantMembers(this.projectId,
|
||||
this.grantId, 100, 0)).pipe(
|
||||
map(resp => {
|
||||
this.totalMemberResult = resp.toObject().totalResult;
|
||||
@@ -144,7 +140,7 @@ export class GrantedProjectDetailComponent implements OnInit, OnDestroy {
|
||||
|
||||
if (users && users.length && roles && roles.length) {
|
||||
users.forEach(user => {
|
||||
return this.projectService.AddProjectGrantMember(
|
||||
return this.mgmtService.AddProjectGrantMember(
|
||||
this.projectId,
|
||||
this.grantId,
|
||||
user.id,
|
||||
|
||||
+3
-3
@@ -8,7 +8,7 @@ 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 { ProjectService } from 'src/app/services/project.service';
|
||||
import { ManagementService } from 'src/app/services/mgmt.service';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
|
||||
@Component({
|
||||
@@ -55,7 +55,7 @@ export class GrantedProjectListComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(private router: Router,
|
||||
public translate: TranslateService,
|
||||
private projectService: ProjectService,
|
||||
private mgmtService: ManagementService,
|
||||
private toast: ToastService,
|
||||
) { }
|
||||
|
||||
@@ -89,7 +89,7 @@ export class GrantedProjectListComponent implements OnInit, OnDestroy {
|
||||
|
||||
private async getData(limit: number, offset: number): Promise<void> {
|
||||
this.loadingSubject.next(true);
|
||||
this.projectService.SearchGrantedProjects(limit, offset).then(res => {
|
||||
this.mgmtService.SearchGrantedProjects(limit, offset).then(res => {
|
||||
const response = res.toObject();
|
||||
this.grantedProjectList = response.resultList;
|
||||
this.totalResult = response.totalResult;
|
||||
|
||||
Reference in New Issue
Block a user