Commit Graph
52 Commits
Author SHA1 Message Date
rainzm 0a9a73587e feat(notify): Allow use topic to filter notification 2020-09-03 21:15:38 +08:00
rainzm 89ec96567b feat(notify): replace VerifiedContactTypes with VerifiedInfos in ReceiverDetails
VerifiedInfos will provide Note to display.
2020-09-03 15:08:13 +08:00
rainzm e179191dd3 feat(notify): Support trigger-verify for feishu, dingtalk and workwx 2020-09-03 15:08:13 +08:00
rainzm 3e982ab79a feat(notify): Add VerifiedNote for SSubContact
VerifiedNote will be 'ok' if SSubContact verified successfully.
Otherwise, there will be there value for VerifiedNote:
1. no such mobile: mobile is not exist, change and try again.
2. incomplete config: tell admin to improve the configuration.
3. service exceptions: try again or connect to admin.
2020-09-03 15:08:13 +08:00
rainzm 9af0fe1fe9 fix(notify): Set default priority 'normal' when creating notification 2020-09-03 15:08:13 +08:00
rainzm 9029e98c2f fix(notify): Mark verified not enabled in MarkContactTypeVerified 2020-09-03 15:08:13 +08:00
rainzm 8a80f96d62 refactor(notify): hide SSunContact webconsole
Every receiver has webconsole type contact that is equal with
receiverid.
Now, make webconsole invisible, and it does exist.
2020-09-03 15:08:13 +08:00
rainzm 2ea4138f3a fix(notify): Allow user list receivers 2020-09-03 15:08:13 +08:00
Rain Zheng 1ed65ddd1a Feature & Fix for Notify (#7714)
* feat(notify): Add 'get-types' action for ConfigManager

The List interface is only open to administrators,
because we don't want anyone other than administrators
to see the details of the notify configuration.
To let general user to kown available notification channels,
add 'get-types' actions of ConfigManager.

* feat(notify): Check the availability of contact type before creating notification

Creating notification with unconfigured contact type will fail at
sending message. Now, prevent creation in advance.

* feat(notify): Add workwx for NotifyNormal/Important/Critical

* feat(notify): Add Notify about robot in notifyclient

* fix(notify): Init ParentContactType for SSubContact

1. ParentContactType of SSubContact with webconsole type is empty.
2. ParentContactType of others SSubContact is mobile.

* fix(notify): Unverify SSubContact when ParentContactType match

* fix(notify): When no data is initialized, exit directly
2020-09-02 16:10:06 +08:00
Rain Zheng 74af85b8eb Fix for Notify (#7692)
* feat(notify): Support update for notify config

* fix(notify): Be compatible with the email configuration

Email config key text changed:
mail.username => username
mail.password => password
mail.smtp.hostname => hostname
mail.smtp.hostport => hostport

* fix(notify): Give users permission to operate receiver

* fix(notify): Allow negative update for receiver

Now, input.Email and input.Mobile can be empty which means
that do not update the corresponding field.

* feat(notify): Support for triggering validation on feishu, dingtalk and worwx

Triggering validation on these contact types means repulling a Contact about them.

* feat(notify): Adds validity period for verify

Verification beyond the expiration date will fail.

* fix(notify): SQuery of scopedomain in FilterByOwner
2020-09-01 10:45:36 +08:00
Rain Zheng 853153c739 Refactor for Notify (#7611)
* refactor(notify): ALL

* feat(climc): Notify v2

* feat: support notify for codegen.py

* delete deprecated code and Maintain SDK compatibility

* Adjust the template for mail validation to support captcha

* fix: The issue of notify refactoring

* add copyright for notifyv2 cli

* Adjust according to the advice of make check

* Remove utils package in notify

* fix import format

* remove redundant Template module

* fix validateCreate and validateUpdate of notifytemplate

* fix update issues of receivers

* fix: Add SetStageComplete in tasks
2020-08-25 17:19:02 +08:00
rainzm 17721c4d59 fix the bug introduced in #6643 2020-07-01 16:49:54 +08:00
rainzm 109bdc05d8 fix: Fix problems about sending verify email 2020-06-18 19:03:13 +08:00
yunion-ci-robot 734d7e9994 Merge pull request #6648 from zexi/feature/db-resource-informer
implement generic service informer
2020-06-08 14:58:49 +08:00
Zexi Li 9f4d4a450e refactor ITableSpec signature with context 2020-06-08 11:31:00 +08:00
rainzm 156ef6bd2e feat: Logo and copyright in verify email are same with these in company
info
2020-06-02 20:52:06 +08:00
rainzm cfcaa50e22 feat(notify): Support 'socpe:domain' when list contacts
This is a temporary solution.
2020-05-28 15:27:26 +08:00
rainzm ee85dec1ce fix: Support filtering notification with contactType 2020-05-22 20:06:07 +08:00
Rain 9aa132cf37 fix/notify: remove 'v2' from email verify url 2020-04-27 11:30:35 +08:00
Qiu Jian 068ea26c8d fix: remove notify option VerifyEmailUrlPath 2020-04-15 23:02:59 +08:00
Qiu Jian 5e6070d809 feature: make webconsole's api_server option common 2020-03-30 15:29:58 +08:00
Rain 5fdf9846f7 feat: Unified template 2020-03-19 15:57:48 +08:00
Rain 006ac48d6e fix(notify): Compatible with changes about list in schema 2020-03-19 14:23:58 +08:00
Rain 0cb0ba6f1b feat(notify): Compatibility and repair 2020-03-18 20:51:20 +08:00
Qiu Jian 3c9b368c43 feature: fix region list filters round 3 2020-03-12 20:55:22 +08:00
Rain 22bf66642d fix/notify: Fix the resend mechanism 2020-03-06 11:09:41 +08:00
yunion-ci-robot 5eab1ce5ef Merge pull request #5353 from rainzm/feature/notify_feishu
feature(notify): Add query and return value for contact UPDATE interface
2020-03-05 19:03:51 +08:00
Rain f876aed69f feature(notify): Add query and return value for contact UPDATE interface
1. Add same return value with contact GET interface when updating
2. Add pull params for query to pull subcontact by mobile number.
   For example, pull user_id from dingtalk throught user's mobile
   number.
3. Add corresponding feature based on above for climc.
4. UserCache will try FetchByName if there is no id matched user when
   fetching users from KeyStone.
2020-03-05 17:01:29 +08:00
Qiu Jian cf5498ac24 feature: recode structuralized GetExtraDetails and ListItemFilter 2020-03-04 14:01:25 +08:00
Rain a81004254f feature(notify): Validate config 2020-02-24 14:09:18 +08:00
Rain 0fe4f5ca1c fix(notify): Set some default template 2020-02-13 16:50:10 +08:00
Rain 762fcd90cf fix: Fix the bug introduced by pr #4921
1. The display problem of contact and notification in notify.
2. The display problem of snat's network info.
2020-02-11 16:49:36 +08:00
Qu Xuan 366cbd4e36 统一 details -> isList 2020-02-07 17:54:48 +08:00
Qu Xuan 76d974f6d8 feature: api -> response struct 2020-02-03 10:22:44 +08:00
Rain 7212ce84d1 feature(notify): Display id of notification from its ClusterID 2020-01-18 17:03:52 +08:00
Rain da3797275f fix(notify): Update template 2020-01-14 17:52:42 +08:00
Qiu Jian 45849355e6 fix: list documentation improvements 2020-01-14 04:17:15 +08:00
Rain 0cb2abe8a4 fix(notify): Always update websocket config 2020-01-02 18:13:29 +08:00
Rain 2fd569411d fix(notify): Fix for user cache and list contacts 2019-12-23 20:46:00 +08:00
Rain 6e7e55b930 feat(notify): Add default email tempalte with topic IMAGE_ACTIVED 2019-12-20 11:41:14 +08:00
Rain 61ff025886 Fix(notify): Unified the api params and fix some bug.
1. Config Verify 和 Contact 的 InitalizeData 写得过于直接了。
会导致正常的数据被覆盖。实际上,数据的Init只需要更换数据
库的时候更新,如何判断数据库要被更新了,就是判断新出现的
column 有没有非零值的,如果有,就说明数据库不是第一次更新。

2. 前端的请求经过yunionapi,最终会调用climc里面注册的ResourceManager,
所以这个地方一定要和后端的参数处理统一。之前因为添加 uname
的支持破坏了这个地方的统一,虽然climc可以调用成功但是前端接口调用会失败。

3. Resend 的bug,会导致任务的阻塞。

4. 为了兼容kapacitor对climc
notify的调用,分成了notify和notify-batch两个命令。
2019-12-20 11:39:17 +08:00
Rain 1cc8dacfa6 bugfix(notify): Fix the bug of notify config and verify
1. 优化了报错信息
2. 将验证信息的发送由异步改成了同步,这样前端可以方便的展示验证消息发送失败的原因
3. 主动初始化webconsole的配置信息,使得websocket能够马上正常工作
4. 修复了验证信息发送失败之后联系方式状态不正确的bug
5. 去掉有关email回调地址的api
6. 修复了 update config 首次不起作用的 bug
2019-12-18 19:01:25 +08:00
Rain 59a7b155a3 fix(notify): Fix the bugs of user cache and some api's params 2019-12-17 17:18:22 +08:00
Rain 2222c7779c feat(notify): Available uname in api & Unified template management
1. Uname is availbale now in api via adding "uname=true" in query.
So we can use uname in climc which is much more visual and use uid in
web client which avoid time-consuming remote calls that may occur.

2. Previously, the template for the message was managed by the
individual sending components. Now, these templats was managed uniformly
by Notify Service so that we can easily add and remove.

3. Now, failure to send a validation message will trigger a notification
to the user via websocket.
2019-12-14 16:49:26 +08:00
Qiu Jian 0d487cd601 bufix 20191209 2019-12-12 11:31:47 +08:00
Yousong Zhou 8ba5986d83 goimports: first run 2019-10-28 06:22:17 +00:00
Zexi Li c393c1deb3 fix: services model incorrect nullable define 2019-10-08 22:22:54 +08:00
Rain dc68d23ff6 support Secondary authority management for contact and notification
rpc=>grpc, go=>workerMan

pull dingtalk auto

grpc
2019-09-24 15:33:53 +08:00
Qiu Jian 77c4a53059 feature: 1. ak/sk auth support 2. a full feature s3gateway works with
Cyberduck

注意:以下两个文件的修改还未被官方合并,所以下次make
mod的时候会被覆盖,需要注意checkout恢复:

vendor/github.com/Azure/azure-sdk-for-go/storage/blockblob.go
vendor/github.com/tencentyun/cos-go-sdk-v5/object_part.go
2019-08-30 00:12:39 +08:00
Qiu Jian a177f8c2af fix: use policy match weight to override less specific policy 2019-08-23 21:14:47 +08:00