feat: add notification policy and password change message (#5065)

Implementation of new notification policy with functionality to send email when a password is changed
This commit is contained in:
Stefan Benz
2023-01-25 09:49:41 +01:00
committed by GitHub
parent 8b5894c0bb
commit 19621acfd3
73 changed files with 4196 additions and 83 deletions
+45
View File
@@ -204,6 +204,18 @@ import {
GetSecurityPolicyResponse,
SetSecurityPolicyRequest,
SetSecurityPolicyResponse,
GetNotificationPolicyRequest,
GetNotificationPolicyResponse,
UpdateNotificationPolicyRequest,
UpdateNotificationPolicyResponse,
GetDefaultPasswordChangeMessageTextResponse,
GetDefaultPasswordChangeMessageTextRequest,
GetCustomPasswordChangeMessageTextResponse,
SetDefaultPasswordChangeMessageTextRequest,
SetDefaultPasswordChangeMessageTextResponse,
GetCustomPasswordChangeMessageTextRequest,
AddNotificationPolicyRequest,
AddNotificationPolicyResponse,
} from '../proto/generated/zitadel/admin_pb';
import { SearchQuery } from '../proto/generated/zitadel/member_pb';
import { ListQuery } from '../proto/generated/zitadel/object_pb';
@@ -346,6 +358,24 @@ export class AdminService {
return this.grpcService.admin.setDefaultPasswordlessRegistrationMessageText(req, null).then((resp) => resp.toObject());
}
public getDefaultPasswordChangeMessageText(
req: GetDefaultPasswordChangeMessageTextRequest,
): Promise<GetDefaultPasswordChangeMessageTextResponse.AsObject> {
return this.grpcService.admin.getDefaultPasswordChangeMessageText(req, null).then((resp) => resp.toObject());
}
public getCustomPasswordChangeMessageText(
req: GetCustomPasswordChangeMessageTextRequest,
): Promise<GetCustomPasswordChangeMessageTextResponse.AsObject> {
return this.grpcService.admin.getCustomPasswordChangeMessageText(req, null).then((resp) => resp.toObject());
}
public setDefaultPasswordChangeMessageText(
req: SetDefaultPasswordChangeMessageTextRequest,
): Promise<SetDefaultPasswordChangeMessageTextResponse.AsObject> {
return this.grpcService.admin.setDefaultPasswordChangeMessageText(req, null).then((resp) => resp.toObject());
}
public SetUpOrg(org: SetUpOrgRequest.Org, human: SetUpOrgRequest.Human): Promise<SetUpOrgResponse.AsObject> {
const req = new SetUpOrgRequest();
@@ -484,6 +514,21 @@ export class AdminService {
return this.grpcService.admin.setDefaultLanguage(req, null).then((resp) => resp.toObject());
}
/* notification policy */
public getNotificationPolicy(): Promise<GetNotificationPolicyResponse.AsObject> {
const req = new GetNotificationPolicyRequest();
return this.grpcService.admin.getNotificationPolicy(req, null).then((resp) => resp.toObject());
}
public updateNotificationPolicy(req: UpdateNotificationPolicyRequest): Promise<UpdateNotificationPolicyResponse.AsObject> {
return this.grpcService.admin.updateNotificationPolicy(req, null).then((resp) => resp.toObject());
}
public addNotificationPolicy(req: AddNotificationPolicyRequest): Promise<AddNotificationPolicyResponse.AsObject> {
return this.grpcService.admin.addNotificationPolicy(req, null).then((resp) => resp.toObject());
}
/* security policy */
public getSecurityPolicy(): Promise<GetSecurityPolicyResponse.AsObject> {