mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-06 06:12:16 +00:00
feat(console): identity providers and login policies (#722)
* idp list, idp create route * idp modules, lazy import, i18n, routing * generic service, i18n * seperate lockout, age policy component * seperate component modules * routing * enum class * login policy * iam policy grid * login policy providers * idps login policy * add idp dialog component * add idp to loginpolicy * delete idp config, iam policy grid * remove idp from loginpolicy * idp detail component, generic idp create * lint * idp detail clientid-secrets, issuer, scopes * hide clientsecret on update * rm background style, idp config * app tooltip fix * lint * dont refresh on idp select * Update console/src/app/modules/idp-create/idp-create.component.html Co-authored-by: Fabiennne <[email protected]> Co-authored-by: Fabi <[email protected]>
This commit is contained in:
co-authored by
Fabiennne
Fabi
parent
845026e43f
commit
58b01cdf3f
@@ -7,6 +7,7 @@ import {
|
||||
CreateHumanRequest,
|
||||
CreateOrgRequest,
|
||||
CreateUserRequest,
|
||||
DefaultLoginPolicy,
|
||||
DefaultLoginPolicyView,
|
||||
FailedEventID,
|
||||
FailedEvents,
|
||||
@@ -15,6 +16,18 @@ import {
|
||||
IamMemberSearchQuery,
|
||||
IamMemberSearchRequest,
|
||||
IamMemberSearchResponse,
|
||||
Idp,
|
||||
IdpID,
|
||||
IdpProviderID,
|
||||
IdpProviderSearchRequest,
|
||||
IdpProviderSearchResponse,
|
||||
IdpSearchQuery,
|
||||
IdpSearchRequest,
|
||||
IdpSearchResponse,
|
||||
IdpView,
|
||||
OidcIdpConfig,
|
||||
OidcIdpConfigCreate,
|
||||
OidcIdpConfigUpdate,
|
||||
OrgIamPolicy,
|
||||
OrgIamPolicyID,
|
||||
OrgIamPolicyRequest,
|
||||
@@ -52,11 +65,6 @@ export class AdminService {
|
||||
return this.grpcService.admin.getIamMemberRoles(req);
|
||||
}
|
||||
|
||||
public async getDefaultLoginPolicy(): Promise<DefaultLoginPolicyView> {
|
||||
const req = new Empty();
|
||||
return this.grpcService.admin.getDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async GetViews(): Promise<Views> {
|
||||
const req = new Empty();
|
||||
return this.grpcService.admin.getViews(req);
|
||||
@@ -82,6 +90,101 @@ export class AdminService {
|
||||
return this.grpcService.admin.removeFailedEvent(req);
|
||||
}
|
||||
|
||||
public async GetDefaultLoginPolicy(
|
||||
): Promise<DefaultLoginPolicyView> {
|
||||
const req = new Empty();
|
||||
return this.grpcService.admin.getDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async UpdateDefaultLoginPolicy(req: DefaultLoginPolicy): Promise<DefaultLoginPolicy> {
|
||||
return this.grpcService.admin.updateDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async AddIdpProviderToDefaultLoginPolicy(configId: string): Promise<IdpProviderID> {
|
||||
const req = new IdpProviderID();
|
||||
req.setIdpConfigId(configId);
|
||||
return this.grpcService.admin.addIdpProviderToDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async RemoveIdpProviderFromDefaultLoginPolicy(configId: string): Promise<Empty> {
|
||||
const req = new IdpProviderID();
|
||||
req.setIdpConfigId(configId);
|
||||
return this.grpcService.admin.removeIdpProviderFromDefaultLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async GetDefaultLoginPolicyIdpProviders(limit?: number, offset?: number): Promise<IdpProviderSearchResponse> {
|
||||
const req = new IdpProviderSearchRequest();
|
||||
if (limit) {
|
||||
req.setLimit(limit);
|
||||
}
|
||||
if (offset) {
|
||||
req.setOffset(offset);
|
||||
}
|
||||
return this.grpcService.admin.getDefaultLoginPolicyIdpProviders(req);
|
||||
}
|
||||
|
||||
public async SearchIdps(
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
queryList?: IdpSearchQuery[],
|
||||
): Promise<IdpSearchResponse> {
|
||||
const req = new IdpSearchRequest();
|
||||
if (limit) {
|
||||
req.setLimit(limit);
|
||||
}
|
||||
if (offset) {
|
||||
req.setOffset(offset);
|
||||
}
|
||||
if (queryList) {
|
||||
req.setQueriesList(queryList);
|
||||
}
|
||||
return this.grpcService.admin.searchIdps(req);
|
||||
}
|
||||
|
||||
public async IdpByID(
|
||||
id: string,
|
||||
): Promise<IdpView> {
|
||||
const req = new IdpID();
|
||||
req.setId(id);
|
||||
return this.grpcService.admin.idpByID(req);
|
||||
}
|
||||
|
||||
public async CreateOidcIdp(
|
||||
req: OidcIdpConfigCreate,
|
||||
): Promise<Idp> {
|
||||
return this.grpcService.admin.createOidcIdp(req);
|
||||
}
|
||||
|
||||
public async UpdateOidcIdpConfig(
|
||||
req: OidcIdpConfigUpdate,
|
||||
): Promise<OidcIdpConfig> {
|
||||
return this.grpcService.mgmt.updateOidcIdpConfig(req);
|
||||
}
|
||||
|
||||
public async RemoveIdpConfig(
|
||||
id: string,
|
||||
): Promise<Empty> {
|
||||
const req = new IdpID;
|
||||
req.setId(id);
|
||||
return this.grpcService.admin.removeIdpConfig(req);
|
||||
}
|
||||
|
||||
public async DeactivateIdpConfig(
|
||||
id: string,
|
||||
): Promise<Empty> {
|
||||
const req = new IdpID;
|
||||
req.setId(id);
|
||||
return this.grpcService.admin.deactivateIdpConfig(req);
|
||||
}
|
||||
|
||||
public async ReactivateIdpConfig(
|
||||
id: string,
|
||||
): Promise<Empty> {
|
||||
const req = new IdpID;
|
||||
req.setId(id);
|
||||
return this.grpcService.admin.reactivateIdpConfig(req);
|
||||
}
|
||||
|
||||
public async SearchIamMembers(
|
||||
limit: number,
|
||||
offset: number,
|
||||
|
||||
@@ -24,7 +24,20 @@ import {
|
||||
Gender,
|
||||
GrantedProjectSearchRequest,
|
||||
Iam,
|
||||
Idp,
|
||||
IdpID,
|
||||
IdpProviderAdd,
|
||||
IdpProviderID,
|
||||
IdpProviderSearchRequest,
|
||||
IdpProviderSearchResponse,
|
||||
IdpProviderType,
|
||||
IdpSearchQuery,
|
||||
IdpSearchRequest,
|
||||
IdpSearchResponse,
|
||||
IdpView,
|
||||
LoginName,
|
||||
LoginPolicy,
|
||||
LoginPolicyView,
|
||||
MachineKeyIDRequest,
|
||||
MachineKeySearchRequest,
|
||||
MachineKeySearchResponse,
|
||||
@@ -35,6 +48,9 @@ import {
|
||||
OIDCApplicationCreate,
|
||||
OIDCConfig,
|
||||
OIDCConfigUpdate,
|
||||
OidcIdpConfig,
|
||||
OidcIdpConfigCreate,
|
||||
OidcIdpConfigUpdate,
|
||||
Org,
|
||||
OrgCreateRequest,
|
||||
OrgDomain,
|
||||
@@ -145,6 +161,105 @@ export type ResponseMapper<TResp, TMappedResp> = (resp: TResp) => TMappedResp;
|
||||
export class ManagementService {
|
||||
constructor(private readonly grpcService: GrpcService) { }
|
||||
|
||||
public async SearchIdps(
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
queryList?: IdpSearchQuery[],
|
||||
): Promise<IdpSearchResponse> {
|
||||
const req = new IdpSearchRequest();
|
||||
if (limit) {
|
||||
req.setLimit(limit);
|
||||
}
|
||||
if (offset) {
|
||||
req.setOffset(offset);
|
||||
}
|
||||
if (queryList) {
|
||||
req.setQueriesList(queryList);
|
||||
}
|
||||
return this.grpcService.mgmt.searchIdps(req);
|
||||
}
|
||||
|
||||
public async GetLoginPolicy(): Promise<LoginPolicyView> {
|
||||
const req = new Empty();
|
||||
return this.grpcService.mgmt.getLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async UpdateLoginPolicy(req: LoginPolicy): Promise<LoginPolicy> {
|
||||
return this.grpcService.mgmt.updateLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async RemoveLoginPolicy(): Promise<Empty> {
|
||||
return this.grpcService.mgmt.removeLoginPolicy(new Empty());
|
||||
}
|
||||
|
||||
public async addIdpProviderToLoginPolicy(configId: string, idpType: IdpProviderType): Promise<IdpProviderID> {
|
||||
const req = new IdpProviderAdd();
|
||||
req.setIdpProviderType(idpType);
|
||||
req.setIdpConfigId(configId);
|
||||
return this.grpcService.mgmt.addIdpProviderToLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async RemoveIdpProviderFromLoginPolicy(configId: string): Promise<Empty> {
|
||||
const req = new IdpProviderID();
|
||||
req.setIdpConfigId(configId);
|
||||
return this.grpcService.mgmt.removeIdpProviderFromLoginPolicy(req);
|
||||
}
|
||||
|
||||
public async GetLoginPolicyIdpProviders(limit?: number, offset?: number): Promise<IdpProviderSearchResponse> {
|
||||
const req = new IdpProviderSearchRequest();
|
||||
if (limit) {
|
||||
req.setLimit(limit);
|
||||
}
|
||||
if (offset) {
|
||||
req.setOffset(offset);
|
||||
}
|
||||
return this.grpcService.mgmt.getLoginPolicyIdpProviders(req);
|
||||
}
|
||||
|
||||
public async IdpByID(
|
||||
id: string,
|
||||
): Promise<IdpView> {
|
||||
const req = new IdpID();
|
||||
req.setId(id);
|
||||
return this.grpcService.mgmt.idpByID(req);
|
||||
}
|
||||
|
||||
public async CreateOidcIdp(
|
||||
req: OidcIdpConfigCreate,
|
||||
): Promise<Idp> {
|
||||
return this.grpcService.mgmt.createOidcIdp(req);
|
||||
}
|
||||
|
||||
public async UpdateOidcIdpConfig(
|
||||
req: OidcIdpConfigUpdate,
|
||||
): Promise<OidcIdpConfig> {
|
||||
return this.grpcService.mgmt.updateOidcIdpConfig(req);
|
||||
}
|
||||
|
||||
public async RemoveIdpConfig(
|
||||
id: string,
|
||||
): Promise<Empty> {
|
||||
const req = new IdpID;
|
||||
req.setId(id);
|
||||
return this.grpcService.mgmt.removeIdpConfig(req);
|
||||
}
|
||||
|
||||
public async DeactivateIdpConfig(
|
||||
id: string,
|
||||
): Promise<Empty> {
|
||||
const req = new IdpID;
|
||||
req.setId(id);
|
||||
return this.grpcService.mgmt.deactivateIdpConfig(req);
|
||||
}
|
||||
|
||||
public async ReactivateIdpConfig(
|
||||
id: string,
|
||||
): Promise<Empty> {
|
||||
const req = new IdpID;
|
||||
req.setId(id);
|
||||
return this.grpcService.mgmt.reactivateIdpConfig(req);
|
||||
}
|
||||
|
||||
public async CreateUserHuman(username: string, user: CreateHumanRequest): Promise<UserResponse> {
|
||||
const req = new CreateUserRequest();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user