mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-03 01:18:51 +00:00
feat(console): getuserbyid, fix password policy validation, read iam (#233)
* remove displayname, show policy desc on patternerr * provide password complexity string, org create * user getuserbyid in userdetail, remove displayname * show multiple org domains * show zitadel project warnings, read iam * add missing ngondestroy impl
This commit is contained in:
@@ -5,8 +5,12 @@ import { Metadata } from 'grpc-web';
|
||||
import { ManagementServicePromiseClient } from '../proto/generated/management_grpc_web_pb';
|
||||
import {
|
||||
AddOrgMemberRequest,
|
||||
Iam,
|
||||
Org,
|
||||
OrgDomain,
|
||||
OrgDomainSearchQuery,
|
||||
OrgDomainSearchRequest,
|
||||
OrgDomainSearchResponse,
|
||||
OrgID,
|
||||
OrgMemberRoles,
|
||||
OrgMemberSearchRequest,
|
||||
@@ -51,6 +55,15 @@ export class OrgService {
|
||||
return responseMapper(response);
|
||||
}
|
||||
|
||||
public async GetIam(): Promise<Iam> {
|
||||
const req: Empty = new Empty();
|
||||
return await this.request(
|
||||
c => c.getIam,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async GetOrgById(orgId: string): Promise<Org> {
|
||||
const req: OrgID = new OrgID();
|
||||
req.setId(orgId);
|
||||
@@ -61,6 +74,22 @@ export class OrgService {
|
||||
);
|
||||
}
|
||||
|
||||
public async SearchMyOrgDomains(offset: number, limit: number, queryList?: OrgDomainSearchQuery[]):
|
||||
Promise<OrgDomainSearchResponse> {
|
||||
const req: OrgDomainSearchRequest = new OrgDomainSearchRequest();
|
||||
req.setLimit(limit);
|
||||
req.setOffset(offset);
|
||||
if (queryList) {
|
||||
req.setQueriesList(queryList);
|
||||
}
|
||||
|
||||
return await this.request(
|
||||
c => c.searchMyOrgDomains,
|
||||
req,
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public async SearchMyOrgMembers(limit: number, offset: number): Promise<OrgMemberSearchResponse> {
|
||||
const req = new OrgMemberSearchRequest();
|
||||
req.setLimit(limit);
|
||||
@@ -322,4 +351,16 @@ export class OrgService {
|
||||
f => f,
|
||||
);
|
||||
}
|
||||
|
||||
public getLocalizedComplexityPolicyPatternErrorString(policy: PasswordComplexityPolicy.AsObject): string {
|
||||
if (policy.hasNumber && policy.hasSymbol) {
|
||||
return 'ORG.POLICY.PWD_COMPLEXITY.SYMBOLANDNUMBERERROR';
|
||||
} else if (policy.hasNumber) {
|
||||
return 'ORG.POLICY.PWD_COMPLEXITY.NUMBERERROR';
|
||||
} else if (policy.hasSymbol) {
|
||||
return 'ORG.POLICY.PWD_COMPLEXITY.SYMBOLERROR';
|
||||
} else {
|
||||
return 'ORG.POLICY.PWD_COMPLEXITY.PATTERNERROR';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user