Commit Graph
96 Commits
Author SHA1 Message Date
rainzm 54ed4b6194 fix(notify): avoid deadlock 2020-12-14 15:02:19 +08:00
Zexi Li 3f194b4ccf Merge pull request #9325 from rainzm/notify/config_change
Try to repull contacts when changing notify config
2020-12-10 17:22:06 +08:00
rainzm 75998a132b fix(notify): repull subcontact after changing config 2020-12-10 10:15:19 +08:00
rainzm 5bc847f052 fix(notify): check for changes before updating config 2020-12-10 10:11:22 +08:00
rainzm aabb200585 refactor(notify): add StartSubcontactPullTask for receiver 2020-12-10 10:09:41 +08:00
rainzm 6ed0b5e9fa feat(notify): add intellij-get for receiver 2020-12-09 16:45:23 +08:00
rainzm 8aeda8f841 feat(notify): add webconsole in enabled contact types 2020-12-07 19:10:30 +08:00
Zexi Li 5d63c907cf Merge pull request #9104 from rainzm/notify/second_try
fix(notify): return the result of the second attempt to execute the rpc call
2020-12-01 21:03:11 +08:00
rainzm 4135b3729b fix(notify): return the result of the second attempt to execute the rpc call 2020-12-01 14:35:04 +08:00
rainzm 3ba52355b8 feat(notify): permit admin sending notification via contact
In this way, you can easily send notification to non-existent receiver.
2020-11-30 17:45:48 +08:00
rainzm a4dc42e69a feat(notify): enable watching user in keystone 2020-11-17 16:34:08 +08:00
rainzm 7ed99506a5 fix(notify): be compatible with keystone's UsersV3.GetById
Fill UsersV3.GetById with user's name, it will return user's info.
2020-11-17 16:15:06 +08:00
rainzm fbc951330c fix(notify): add AllOkContactTypes in where permanently enabled and verified ContactType 2020-10-20 20:29:21 +08:00
rainzm 2e094a310a feat(notify): allow empty receivers for robot or webhook contact type 2020-10-19 11:56:50 +08:00
rainzm 012d9b1588 feat(notify): support webhook contact type 2020-10-17 18:03:19 +08:00
rainzm 0879278714 fix(notify): modify name of notification to avoid duplication 2020-09-22 20:17:39 +08:00
rainzm e47f8a8960 fix(notify): clean verifyNote when mark verified 2020-09-22 20:13:12 +08:00
rainzm c522b45242 fix(notify): return correct value when sortContactType 2020-09-22 20:13:11 +08:00
rainzm 5bfc3128c3 fix(notify): allow normal user create their receiver 2020-09-18 17:14:21 +08:00
rainzm 77bbb2cfd0 feat(notify): sort the returned contact type array 2020-09-14 20:33:42 +08:00
rainzm 1517ed79f2 fix(notify): pull contact for workwx, dingtalk and feishu 2020-09-10 14:33:09 +08:00
rainzm a9fafc4517 fix(notify): break down permissions of notifyconfigs
1. Only allow admin to create, list, update or delete.
2. Allow user to get types.
2020-09-07 18:55:19 +08:00
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 bf12f5b57c feat(notify): break down error from UseridByMobile 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
rainzm 9978f19542 fix(notify): use AfterSend for contact with succuessful sending 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
Yousong Zhou c2bca8ab39 Feature/yousong text (#7487)
* notify: log with context info

* region: guests: log with context info

* region: hosts: log with context info

* region: misc: remove redundant log

* region: skus: use NewInternalServerError instead of NewGeneralError

* appsrv: dispatcher: preserve text id

* appsrv: dispatcher: remove commented-out code

* cloudcommon: db_dispatcher: note errors that won't be translated

* cloudcommon: db: rbac: preserve text id

* cloudcommon: caller: preserve text id

* treewide: fix fmt string

* region: guest_actions: preserve text id

* region: guest_actions: fix fmt string

* region: usages: fix fmt string

* mcclient: hosts: remove redundant return value

* cloudcommon: fetch: preserve text id

* region: guest_template: preserve text id

* cloudcommon: db: db_dispatcher: preserve text id

* region: guest_actions: preserve text id

* httperrors: add funcs for wrap lang tag into context

* vendor: golang.org/x/text

* httperrors: error with context

* httperrors: HTTPError

* treewide: fix typo

* treewide: use en in source code

* locales: initial version
2020-08-25 15:26:31 +08:00
rainzm 17721c4d59 fix the bug introduced in #6643 2020-07-01 16:49:54 +08:00
Qu Xuan a07b112be1 feature: CloudId服务支持 2020-06-21 11:30:01 +08:00
rainzm 109bdc05d8 fix: Fix problems about sending verify email 2020-06-18 19:03:13 +08:00
rainzm 2cd2f3d029 fix: Add '/version' handler for notify 2020-06-09 18:45:54 +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
Yousong Zhou fb26b0c389 vet: composite literal uses unkeyed fields 2020-05-27 15:08:02 +08:00
rainzm f73bcf8ad1 feat: Supports disabling of feishu and dingtalk notification 2020-05-22 20:50:13 +08:00
rainzm ee85dec1ce fix: Support filtering notification with contactType 2020-05-22 20:06:07 +08:00
Qiu Jian c35758dd08 fix: avoid using background context 2020-05-14 16:15:54 +08:00
yunion-ci-robot adc5138781 Merge pull request #6073 from rainzm/fix/eamil_verify_url
fix/notify: remove 'v2' from email verify url
2020-04-27 14:38:32 +08:00
Rain 9aa132cf37 fix/notify: remove 'v2' from email verify url 2020-04-27 11:30:35 +08:00