diff --git a/Bundle/pom.xml b/Bundle/pom.xml
index fa550330..c1c13903 100644
--- a/Bundle/pom.xml
+++ b/Bundle/pom.xml
@@ -6,7 +6,7 @@
net.sf.openas2OpenAS2
- 2.5.0-SNAPSHOT
+ 2.5.0openas2-osgi
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 3cadd44b..98a25a71 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -8,7 +8,7 @@ The release download file is: OpenAS2Server-2.5.0.zip
The zip file contains a PDF document (OpenAS2HowTo.pdf) providing information on installing and using the application.
-Version 2.5.0 - 2018-05-15
+Version 2.5.0 - 2018-07-02
This is an enhancement and bugfix release:
**IMPORTANT NOTE**: Please review upgrade notes below if you are upgrading
@@ -24,6 +24,9 @@ This is an enhancement and bugfix release:
10. Change attribute name for overriding Message-ID format at partnership level to match name at system level. NB See upgrade notes for attribute name change.
11. Allow modules to have scheduled tasks using the HasSchedule implementation.
12. Add scheduled task to detect failed sent messages where files are not cleaned up. (Fixes https://sourceforge.net/p/openas2/tickets/5/)
+ 13. Allow attributes in partnership element to reference other partnership elements and resolve the references at load time.
+ 14. Default sample in partnerships.xml for "as2_mdn_options" to use the "sign" attribute value for the micalg value.
+ 15. Support AS2 ID with spaces in the value.
##Upgrade Notes
See the openAS2HowTo appendix for the general process on upgrading OpenAS2.
@@ -34,6 +37,7 @@ This is an enhancement and bugfix release:
### If upgrading from versions older than 2.5.0:
1. Change the name of the MDN sender module from "AsynchMDNSenderModule" to "MDNSenderModule" in the config.xml if using your existing config.xml file in the upgrade.
2. Change the name of the partnership attribute "messageid" to "as2_message_id_format" if used in any partnership definition.
+ 3. Change the "as2_mdn_options" attribute to use $attribute.sign$ instead of hard coded signing algorithm
### If upgrading from versions older than 2.4.1:
diff --git a/Remote/pom.xml b/Remote/pom.xml
index 6dc2c450..8df445b3 100644
--- a/Remote/pom.xml
+++ b/Remote/pom.xml
@@ -4,7 +4,7 @@
net.sf.openas2OpenAS2
- 2.5.0-SNAPSHOT
+ 2.5.04.0.0
diff --git a/Server/pom.xml b/Server/pom.xml
index 11644b02..4c9eea1c 100644
--- a/Server/pom.xml
+++ b/Server/pom.xml
@@ -6,7 +6,7 @@
net.sf.openas2OpenAS2
- 2.5.0-SNAPSHOT2
+ 2.5.0openas2-server
diff --git a/Server/src/main/java/org/openas2/cert/PKCS12CertificateFactory.java b/Server/src/main/java/org/openas2/cert/PKCS12CertificateFactory.java
index 1d5e94ed..938c2c11 100644
--- a/Server/src/main/java/org/openas2/cert/PKCS12CertificateFactory.java
+++ b/Server/src/main/java/org/openas2/cert/PKCS12CertificateFactory.java
@@ -28,7 +28,6 @@
import org.openas2.message.MessageMDN;
import org.openas2.params.InvalidParameterException;
import org.openas2.partner.Partnership;
-import org.openas2.partner.SecurePartnership;
import org.openas2.schedule.HasSchedule;
import org.openas2.support.FileMonitorAdapter;
import org.openas2.util.AS2Util;
@@ -49,10 +48,10 @@ public String getAlias(Partnership partnership, String partnershipType) throws O
if (partnershipType == Partnership.PTYPE_RECEIVER)
{
- alias = partnership.getReceiverID(SecurePartnership.PID_X509_ALIAS);
+ alias = partnership.getReceiverID(Partnership.PID_X509_ALIAS);
} else if (partnershipType == Partnership.PTYPE_SENDER)
{
- alias = partnership.getSenderID(SecurePartnership.PID_X509_ALIAS);
+ alias = partnership.getSenderID(Partnership.PID_X509_ALIAS);
}
if (alias == null)
diff --git a/Server/src/main/java/org/openas2/lib/partner/IPartnership.java b/Server/src/main/java/org/openas2/lib/partner/IPartnership.java
deleted file mode 100644
index 15b9811c..00000000
--- a/Server/src/main/java/org/openas2/lib/partner/IPartnership.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.openas2.lib.partner;
-
-public class IPartnership {
- public static final String ATTRIBUTE_ENCRYPTION_ALGORITHM = "encrypt";
- public static final String ATTRIBUTE_SIGNATURE_ALGORITHM = "sign";
- public static final String ATTRIBUTE_SUBJECT = "subject";
- public static final String ATTRIBUTE_SOURCE = "source";
- public static final String ATTRIBUTE_DESTINATION = "destination";
- public static final String ATTRIBUTE_MDN_OPTIONS = "mdnoptions";
- public static final String ATTRIBUTE_COMPRESSION_TYPE = "compression";
-
-}
diff --git a/Server/src/main/java/org/openas2/message/AS2Message.java b/Server/src/main/java/org/openas2/message/AS2Message.java
index 75a2f939..848899c3 100644
--- a/Server/src/main/java/org/openas2/message/AS2Message.java
+++ b/Server/src/main/java/org/openas2/message/AS2Message.java
@@ -1,7 +1,6 @@
package org.openas2.message;
import org.openas2.params.InvalidParameterException;
-import org.openas2.partner.AS2Partnership;
import org.openas2.partner.Partnership;
@@ -26,8 +25,8 @@ public boolean isRequestingMDN() {
public boolean isConfiguredForMDN() {
Partnership p = getPartnership();
- return ((p.getAttribute(AS2Partnership.PA_AS2_MDN_TO) != null)
- && (p.getAttribute(AS2Partnership.PA_AS2_MDN_OPTIONS) != null));
+ return ((p.getAttribute(Partnership.PA_AS2_MDN_TO) != null)
+ && (p.getAttribute(Partnership.PA_AS2_MDN_OPTIONS) != null));
}
@@ -38,7 +37,7 @@ public boolean isRequestingAsynchMDN() {
public boolean isConfiguredForAsynchMDN() {
Partnership p = getPartnership();
- return (p.getAttribute(AS2Partnership.PA_AS2_RECEIPT_OPTION) != null);
+ return (p.getAttribute(Partnership.PA_AS2_RECEIPT_OPTION) != null);
}
public String getAsyncMDNurl() {
diff --git a/Server/src/main/java/org/openas2/partner/AS2Partnership.java b/Server/src/main/java/org/openas2/partner/AS2Partnership.java
deleted file mode 100644
index b0f41d63..00000000
--- a/Server/src/main/java/org/openas2/partner/AS2Partnership.java
+++ /dev/null
@@ -1,20 +0,0 @@
-
-package org.openas2.partner;
-
-
-public interface AS2Partnership {
- public static final String PID_AS2 = "as2_id"; // AS2 ID
- public static final String PA_AS2_URL = "as2_url"; // URL destination for AS2 transactions
- public static final String PA_AS2_MDN_TO = "as2_mdn_to"; // Fill in to request an MDN for a transaction
- public static final String PA_AS2_MDN_OPTIONS = "as2_mdn_options"; // Requested options for returned MDN
- public static final String PA_AS2_RECEIPT_OPTION = "as2_receipt_option"; // URL destination for an async MDN
- public static final String PA_RESEND_MAX_RETRIES = "resend_max_retries"; // format to use for message-id if not default
- public static final String PA_CUSTOM_MIME_HEADERS = "custom_mime_headers"; // list of nme/value pairs for setting custom mime headers
- public static final String PA_ADD_CUSTOM_MIME_HEADERS_TO_HTTP = "add_custom_mime_headers_to_http"; // Add the custom mime headers (if any) to HTTP header if "true"
- public static final String PA_CUSTOM_MIME_HEADER_NAMES_FROM_FILENAME = "custom_mime_header_names_from_filename"; // List of header names to be set from parsed filename
- public static final String PA_CUSTOM_MIME_HEADER_NAME_DELIMITERS_IN_FILENAME = "custom_mime_header_name_delimiters_in_filename"; // Delimiters to split filename into values
- public static final String PA_CUSTOM_MIME_HEADER_NAMES_REGEX_ON_FILENAME = "custom_mime_header_names_regex_on_filename"; // Regex to split filename into values
-
- public static final String PA_ATTRIB_NAMES_FROM_FILENAME = "attribute_names_from_filename"; // List of attribute names to be set from parsed filename
- public static final String PA_ATTRIB_VALUES_REGEX_ON_FILENAME = "attribute_values_regex_on_filename"; // Regex to split filename into values
-}
diff --git a/Server/src/main/java/org/openas2/partner/ASXPartnership.java b/Server/src/main/java/org/openas2/partner/ASXPartnership.java
deleted file mode 100644
index 433589d0..00000000
--- a/Server/src/main/java/org/openas2/partner/ASXPartnership.java
+++ /dev/null
@@ -1,12 +0,0 @@
-
-package org.openas2.partner;
-
-public interface ASXPartnership {
- public static final String PA_MDN_SUBJECT = "mdnsubject"; // Subject sent in MDN messages
- /*
- * If set and an error occurs while processing a document, an error MDN will not be sent. This
- * flag was made because some AS2 products don't provide email or some other external notification
- * when an error MDN is received.
- */
- public static final String PA_BLOCK_ERROR_MDN = "blockerrormdn";
-}
diff --git a/Server/src/main/java/org/openas2/partner/BasePartnershipFactory.java b/Server/src/main/java/org/openas2/partner/BasePartnershipFactory.java
index c077e9d0..4b954d6b 100644
--- a/Server/src/main/java/org/openas2/partner/BasePartnershipFactory.java
+++ b/Server/src/main/java/org/openas2/partner/BasePartnershipFactory.java
@@ -54,12 +54,12 @@ public void updatePartnership(Message msg, boolean overwrite) throws OpenAS2Exce
msg.getPartnership().copy(partnership);
// Now set dynamic parms based on file name if configured to
String filename = msg.getAttribute(FileAttribute.MA_FILENAME);
- String filenameToParmsList = msg.getPartnership().getAttribute(AS2Partnership.PA_ATTRIB_NAMES_FROM_FILENAME);
+ String filenameToParmsList = msg.getPartnership().getAttribute(Partnership.PAIB_NAMES_FROM_FILENAME);
if (filename != null && filenameToParmsList != null && filenameToParmsList.length() > 0)
{
String[] headerNames = filenameToParmsList.split("\\s*,\\s*");
- String regex = msg.getPartnership().getAttribute(AS2Partnership.PA_ATTRIB_VALUES_REGEX_ON_FILENAME);
+ String regex = msg.getPartnership().getAttribute(Partnership.PAIB_VALUES_REGEX_ON_FILENAME);
if (regex != null)
{
Pattern p = Pattern.compile(regex);
diff --git a/Server/src/main/java/org/openas2/partner/Partnership.java b/Server/src/main/java/org/openas2/partner/Partnership.java
index 3c64c306..44b99c4f 100644
--- a/Server/src/main/java/org/openas2/partner/Partnership.java
+++ b/Server/src/main/java/org/openas2/partner/Partnership.java
@@ -12,24 +12,51 @@
public class Partnership implements Serializable {
+
+ /* identifier to define if context is sending or receiving */
public static final String PTYPE_SENDER = "sender"; // Sender partner type
public static final String PTYPE_RECEIVER = "receiver"; // Receiver partner type
+
+ /* partner definition attributes */
+ public static final String PID_AS2 = "as2_id"; // AS2 ID
+ public static final String PID_X509_ALIAS = "x509_alias"; // Alias to an X509 Certificate
public static final String PID_EMAIL = "email"; // Email address
- public static final String PA_PROTOCOL = "protocol"; // AS1 or AS2
+
+ /* partnership definition attributes */
public static final String PA_SUBJECT = "subject"; // Subject sent in messages
public static final String PA_CONTENT_TRANSFER_ENCODING = "content_transfer_encoding"; // optional content transfer enc value
public static final String PA_REMOVE_PROTECTION_ATTRIB = "remove_cms_algorithm_protection_attrib"; // Some AS2 systems do not support the attribute
public static final String PA_SET_CONTENT_TRANSFER_ENCODING_OMBP = "set_content_transfer_encoding_on_outer_mime_bodypart"; // optional content transfer enc value
public static final String PA_RESEND_REQUIRES_NEW_MESSAGE_ID = "resend_requires_new_message_id"; // list of nme/value pairs for setting custom mime headers
- /**
- *
- */
+ public static final String PA_COMPRESSION_TYPE = "compression";
+ public static final String PA_SIGNATURE_ALGORITHM = "sign";
+ public static final String PA_ENCRYPTION_ALGORITHM = "encrypt";
+ public static final String PA_AS2_URL = "as2_url"; // URL destination for AS2 transactions
+ public static final String PA_AS2_MDN_TO = "as2_mdn_to"; // Fill in to request an MDN for a transaction
+ public static final String PA_AS2_MDN_OPTIONS = "as2_mdn_options"; // Requested options for returned MDN
+ public static final String PA_AS2_RECEIPT_OPTION = "as2_receipt_option"; // URL destination for an async MDN
+ public static final String PA_RESEND_MAX_RETRIES = "resend_max_retries"; // format to use for message-id if not default
+ public static final String PA_CUSTOM_MIME_HEADERS = "custom_mime_headers"; // list of nme/value pairs for setting custom mime headers
+ public static final String PA_ADD_CUSTOM_MIME_HEADERS_TO_HTTP = "add_custom_mime_headers_to_http"; // Add the custom mime headers (if any) to HTTP header if "true"
+ public static final String PA_CUSTOM_MIME_HEADER_NAMES_FROM_FILENAME = "custom_mime_header_names_from_filename"; // List of header names to be set from parsed filename
+ public static final String PA_CUSTOM_MIME_HEADER_NAME_DELIMITERS_IN_FILENAME = "custom_mime_header_name_delimiters_in_filename"; // Delimiters to split filename into values
+ public static final String PA_CUSTOM_MIME_HEADER_NAMES_REGEX_ON_FILENAME = "custom_mime_header_names_regex_on_filename"; // Regex to split filename into values
+ public static final String PAIB_NAMES_FROM_FILENAME = "attribute_names_from_filename"; // List of attribute names to be set from parsed filename
+ public static final String PAIB_VALUES_REGEX_ON_FILENAME = "attribute_values_regex_on_filename"; // Regex to split filename into values
+
+ /*
+ * If set and an error occurs while processing a document, an error MDN will not be sent. This
+ * flag was made because some AS2 products don't provide email or some other external notification
+ * when an error MDN is received.
+ */
+ public static final String PA_BLOCK_ERROR_MDN = "blockerrormdn";
+
+
private static final long serialVersionUID = -8365608387462470629L;
private Map attributes;
private Map receiverIDs;
private Map senderIDs;
private String name;
-
public String getName() {
return name;
}
@@ -173,7 +200,7 @@ public void copy(Partnership partnership) {
public boolean isAsyncMDN()
{
- String receiptOptions = getAttribute(AS2Partnership.PA_AS2_RECEIPT_OPTION);
+ String receiptOptions = getAttribute(Partnership.PA_AS2_RECEIPT_OPTION);
return (receiptOptions != null && receiptOptions.length() > 0);
}
diff --git a/Server/src/main/java/org/openas2/partner/SecurePartnership.java b/Server/src/main/java/org/openas2/partner/SecurePartnership.java
deleted file mode 100644
index 94695172..00000000
--- a/Server/src/main/java/org/openas2/partner/SecurePartnership.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.openas2.partner;
-
-
-public interface SecurePartnership {
- public static final String PID_X509_ALIAS = "x509_alias"; // Alias to an X509 Certificate
- public static final String PA_ENCRYPT = "encrypt"; // Set this to the algorithm to use for encryption, check AS2Util constants for values
- public static final String PA_SIGN = "sign"; // Set this to the signature digest algorithm to sign sent messages
-}
diff --git a/Server/src/main/java/org/openas2/partner/XMLPartnershipFactory.java b/Server/src/main/java/org/openas2/partner/XMLPartnershipFactory.java
index 3d963c61..201a425a 100644
--- a/Server/src/main/java/org/openas2/partner/XMLPartnershipFactory.java
+++ b/Server/src/main/java/org/openas2/partner/XMLPartnershipFactory.java
@@ -26,6 +26,7 @@
import org.openas2.WrappedException;
import org.openas2.params.InvalidParameterException;
import org.openas2.support.FileMonitorAdapter;
+import org.openas2.util.AS2Util;
import org.openas2.util.XMLUtil;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -128,6 +129,7 @@ private void loadAttributes(Node node, Partnership partnership)
{
Map nodes = XMLUtil.mapAttributeNodes(node.getChildNodes(), "attribute", "name", "value");
+ AS2Util.attributeEnhancer(nodes);
partnership.getAttributes().putAll(nodes);
}
@@ -155,7 +157,7 @@ private void loadPartnerIDs(Map partners, String partnershipName
if (partnerNode == null)
{
- throw new OpenAS2Exception("Partnership " + partnershipName + " is missing sender");
+ throw new OpenAS2Exception("Partnership \"" + partnershipName + "\" is missing sender");
}
Map partnerAttr = XMLUtil.mapAttributes(partnerNode);
diff --git a/Server/src/main/java/org/openas2/processor/msgtracking/BaseMsgTrackingModule.java b/Server/src/main/java/org/openas2/processor/msgtracking/BaseMsgTrackingModule.java
index 15240605..c6d1fe6b 100644
--- a/Server/src/main/java/org/openas2/processor/msgtracking/BaseMsgTrackingModule.java
+++ b/Server/src/main/java/org/openas2/processor/msgtracking/BaseMsgTrackingModule.java
@@ -5,11 +5,10 @@
import org.openas2.OpenAS2Exception;
import org.openas2.Session;
-import org.openas2.lib.partner.IPartnership;
import org.openas2.message.AS2MessageMDN;
import org.openas2.message.Message;
import org.openas2.message.MessageMDN;
-import org.openas2.partner.AS2Partnership;
+import org.openas2.partner.Partnership;
import org.openas2.processor.BaseProcessorModule;
import org.openas2.processor.resender.ResenderModule;
@@ -59,19 +58,19 @@ protected Map buildMap(Message msg, Map