-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZCS-13176:Mail recall zimlet message verfication header
- Loading branch information
1 parent
06b49f0
commit def78ba
Showing
12 changed files
with
391 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
soap/src/java/com/zimbra/soap/admin/message/GenerateSecretKeyRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* ***** BEGIN LICENSE BLOCK ***** | ||
* Zimbra Collaboration Suite Server | ||
* Copyright (C) 2023 Synacor, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software Foundation, | ||
* version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License along with this program. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* ***** END LICENSE BLOCK ***** | ||
*/ | ||
|
||
package com.zimbra.soap.admin.message; | ||
|
||
import com.zimbra.common.soap.AdminConstants; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
/** | ||
* @zm-api-command-auth-required true | ||
* @zm-api-command-admin-auth-required true | ||
* @zm-api-command-description Create random secret key and update it to LDAP attribute. | ||
*/ | ||
@XmlAccessorType(XmlAccessType.NONE) | ||
@XmlRootElement(name = AdminConstants.E_GENERATE_SECRET_KEY_REQUEST) | ||
@XmlType(propOrder = {}) | ||
public class GenerateSecretKeyRequest { | ||
|
||
public GenerateSecretKeyRequest() { | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
soap/src/java/com/zimbra/soap/admin/message/GenerateSecretKeyResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* ***** BEGIN LICENSE BLOCK ***** | ||
* Zimbra Collaboration Suite Server | ||
* Copyright (C) 2023 Synacor, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software Foundation, | ||
* version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License along with this program. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* ***** END LICENSE BLOCK ***** | ||
*/ | ||
|
||
package com.zimbra.soap.admin.message; | ||
|
||
import com.zimbra.common.soap.AdminConstants; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
@XmlAccessorType(XmlAccessType.NONE) | ||
@XmlRootElement(name = AdminConstants.E_GENERATE_SECRET_KEY_RESPONSE) | ||
@XmlType(propOrder = {}) | ||
public class GenerateSecretKeyResponse { | ||
|
||
public GenerateSecretKeyResponse() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
store/src/java/com/zimbra/cs/account/callback/GenerateSecretKeyCallback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* ***** BEGIN LICENSE BLOCK ***** | ||
* Zimbra Collaboration Suite Server | ||
* Copyright (C) 2023 Synacor, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License as published by the Free Software Foundation, | ||
* version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License along with this program. | ||
* If not, see <https://www.gnu.org/licenses/>. | ||
* ***** END LICENSE BLOCK ***** | ||
*/ | ||
|
||
package com.zimbra.cs.account.callback; | ||
|
||
import com.google.common.base.Strings; | ||
import com.zimbra.common.service.ServiceException; | ||
import com.zimbra.cs.account.AttributeCallback; | ||
import com.zimbra.cs.account.Entry; | ||
import com.zimbra.cs.account.Provisioning; | ||
import com.zimbra.cs.account.soap.SoapProvisioning; | ||
import com.zimbra.soap.admin.message.GenerateSecretKeyRequest; | ||
|
||
import java.util.Map; | ||
|
||
public class GenerateSecretKeyCallback extends AttributeCallback { | ||
|
||
@Override | ||
public void preModify(CallbackContext context, String attrName, Object value, | ||
Map attrsToModify, Entry entry) throws ServiceException { | ||
String secretKey = null; | ||
try { | ||
if(value.equals("TRUE")) { | ||
secretKey = Provisioning.getInstance().getConfig().getFeatureMailRecallSecretKey(); | ||
if (Strings.isNullOrEmpty(secretKey)) { | ||
SoapProvisioning sp = SoapProvisioning.getAdminInstance(); | ||
sp.invokeJaxb(new GenerateSecretKeyRequest()); | ||
} | ||
} | ||
} catch (ServiceException e) { | ||
throw ServiceException.FAILURE("Unable to initialize SecureRandom for mail recall", e); | ||
} | ||
} | ||
|
||
@Override | ||
public void postModify(CallbackContext context, String attrName, Entry entry) { | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.