Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
717bd4ba43 | ||
|
|
564b605d55 | ||
|
|
2ce14c8fe1 | ||
|
|
7af07c808b | ||
|
|
f089d59389 | ||
|
|
8ef5896077 | ||
|
|
57183eea13 | ||
|
|
27adfed9f0 | ||
|
|
02cd3b33b0 | ||
|
|
1a5bca9190 | ||
|
|
d75ef8212d | ||
|
|
703a32b41f | ||
|
|
9510fc9389 | ||
|
|
7fb8780c97 | ||
|
|
921db68bde | ||
|
|
6b1d71d91a | ||
|
|
c4c3012916 | ||
|
|
ac1595b304 | ||
|
|
15bb640a83 |
@@ -891,6 +891,11 @@ under the License.
|
||||
<set field="fromDate" from-field="parameters.fromDate" type="Timestamp"/>
|
||||
<set field="thruDate" from-field="parameters.thruDate" type="Timestamp"/>
|
||||
<set field="glFiscalTypeId" from-field="parameters.glFiscalTypeId" default-value="ACTUAL"/>
|
||||
<service service-name="getPartyAccountingPreferences" result-map="result">
|
||||
<field-map field-name="organizationPartyId" value="${groovy:parameters.get('ApplicationDecorator|organizationPartyId')}"/>
|
||||
</service>
|
||||
<set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/>
|
||||
<set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
|
||||
<script location="component://accounting/groovyScripts/reports/IncomeStatement.groovy"/>
|
||||
</actions>
|
||||
<widgets>
|
||||
|
||||
@@ -121,19 +121,7 @@ var rawdata = [
|
||||
EmpPosition: {
|
||||
label: "Add Employee Position",
|
||||
action: function (NODE, TREE_OBJ) {
|
||||
var dataSet = {};
|
||||
dataSet = {"partyId" : NODE.attr("id")};
|
||||
jQuery.ajax({
|
||||
type: "GET",
|
||||
url: "EditEmplPosition",
|
||||
data: dataSet,
|
||||
error: function(msg) {
|
||||
alert("An error occurred loading content! : " + msg);
|
||||
},
|
||||
success: function(msg) {
|
||||
jQuery('div.page-container').html(msg);
|
||||
}
|
||||
});
|
||||
window.location.href = "EditEmplPosition?partyId=" + NODE.attr("id");
|
||||
}
|
||||
},
|
||||
AddIntOrg: {
|
||||
|
||||
@@ -2119,14 +2119,14 @@ public class OrderServices {
|
||||
}
|
||||
}
|
||||
|
||||
String reasonEnumId = null;
|
||||
if (UtilValidate.isNotEmpty(itemReasonMap)) {
|
||||
reasonEnumId = itemReasonMap.get(orderItem.getString("orderItemSeqId"));
|
||||
}
|
||||
|
||||
// create order item change record
|
||||
if (!"Y".equals(orderItem.getString("isPromo"))) {
|
||||
String reasonEnumId = null;
|
||||
String changeComments = null;
|
||||
if (UtilValidate.isNotEmpty(itemReasonMap)) {
|
||||
reasonEnumId = itemReasonMap.get(orderItem.getString("orderItemSeqId"));
|
||||
}
|
||||
if (UtilValidate.isNotEmpty(itemCommentMap)) {
|
||||
changeComments = itemCommentMap.get(orderItem.getString("orderItemSeqId"));
|
||||
}
|
||||
@@ -2174,7 +2174,7 @@ public class OrderServices {
|
||||
}
|
||||
}
|
||||
// all items are cancelled -- mark the item as cancelled
|
||||
Map<String, Object> statusCtx = UtilMisc.<String, Object>toMap("orderId", orderId, "orderItemSeqId", orderItem.getString("orderItemSeqId"), "statusId", itemStatus, "userLogin", userLogin);
|
||||
Map<String, Object> statusCtx = UtilMisc.<String, Object>toMap("orderId", orderId, "orderItemSeqId", orderItem.getString("orderItemSeqId"), "statusId", itemStatus, "changeReason", reasonEnumId, "userLogin", userLogin);
|
||||
try {
|
||||
dispatcher.runSyncIgnore("changeOrderItemStatus", statusCtx);
|
||||
} catch (GenericServiceException e) {
|
||||
@@ -2215,6 +2215,7 @@ public class OrderServices {
|
||||
String orderId = (String) context.get("orderId");
|
||||
String orderItemSeqId = (String) context.get("orderItemSeqId");
|
||||
String fromStatusId = (String) context.get("fromStatusId");
|
||||
String changeReason = (String) context.get("changeReason");
|
||||
String statusId = (String) context.get("statusId");
|
||||
Timestamp statusDateTime = (Timestamp) context.get("statusDateTime");
|
||||
Locale locale = (Locale) context.get("locale");
|
||||
@@ -2290,6 +2291,7 @@ public class OrderServices {
|
||||
changeFields.put("statusId", statusId);
|
||||
changeFields.put("orderId", orderId);
|
||||
changeFields.put("orderItemSeqId", orderItem.getString("orderItemSeqId"));
|
||||
changeFields.put("changeReason", changeReason);
|
||||
changeFields.put("statusDatetime", statusDateTime);
|
||||
changeFields.put("statusUserLogin", userLogin.getString("userLoginId"));
|
||||
GenericValue orderStatus = delegator.makeValue("OrderStatus", changeFields);
|
||||
|
||||
+444
-353
File diff suppressed because it is too large
Load Diff
@@ -1422,6 +1422,10 @@ under the License.
|
||||
<description>Expire a FacilityLocationGeoPoint record</description>
|
||||
<auto-attributes include="pk" mode="IN" optional="false"/>
|
||||
</service>
|
||||
<service name="deleteFacilityLocationGeoPoint" default-entity-name="FacilityLocationGeoPoint" engine="entity-auto" invoke="delete" auth="true">
|
||||
<description>Delete a FacilityLocationGeoPoint record</description>
|
||||
<auto-attributes include="pk" mode="IN" optional="false"/>
|
||||
</service>
|
||||
|
||||
<!-- InventoryItemType services -->
|
||||
<service name="createInventoryItemType" engine="entity-auto" default-entity-name="InventoryItemType" invoke="create" auth="true">
|
||||
|
||||
+4
-3
@@ -171,8 +171,9 @@ dependencies {
|
||||
compile 'org.apache.httpcomponents:httpclient-cache:4.5.4'
|
||||
compile 'org.apache.logging.log4j:log4j-api:2.10.0' // the API of log4j 2
|
||||
compile 'org.apache.shiro:shiro-core:1.4.0'
|
||||
compile 'org.apache.tika:tika-core:1.24.1'
|
||||
compile 'org.apache.tika:tika-parsers:1.24.1'
|
||||
compile 'org.apache.tika:tika-core:1.26'
|
||||
compile 'org.apache.tika:tika-parsers:1.26'
|
||||
compile 'org.apache.pdfbox:pdfbox:2.0.23'
|
||||
compile 'org.apache.poi:poi:3.17'
|
||||
compile 'org.apache.tomcat:tomcat-catalina-ha:9.0.43'
|
||||
compile 'org.apache.tomcat:tomcat-catalina:9.0.43'
|
||||
@@ -182,7 +183,7 @@ dependencies {
|
||||
compile 'org.apache.xmlrpc:xmlrpc-client:3.1.3'
|
||||
compile 'org.apache.xmlrpc:xmlrpc-server:3.1.3'
|
||||
compile 'org.codehaus.groovy:groovy-all:2.4.13' // Remember to change the version number in javadoc.options block
|
||||
compile 'org.freemarker:freemarker:2.3.28' // Remember to change the version number in FreeMarkerWorker class when upgrading
|
||||
compile 'org.freemarker:freemarker:2.3.31' // Remember to change the version number in FreeMarkerWorker class when upgrading
|
||||
compile 'org.hamcrest:hamcrest-all:1.3'
|
||||
compile 'org.owasp.esapi:esapi:2.1.0.1'
|
||||
compile 'org.springframework:spring-test:5.0.2.RELEASE'
|
||||
|
||||
@@ -17,13 +17,18 @@
|
||||
# under the License.
|
||||
###############################################################################
|
||||
|
||||
# Because of OFBIZ-10837 - Improve ObjectInputStream class.
|
||||
# If you encounter a related issue (object not in the whitelist),
|
||||
# you must provide a complete list of objects to pass to ObjectInputStream
|
||||
# through ListOfSafeObjectsForInputStream property
|
||||
# As an example, the a complete list of objects used by OFBiz OOTB is here.
|
||||
# Because of OFBIZ-10837 "Improve ObjectInputStream class."
|
||||
# If you encounter a related issue (object not in the allowList),
|
||||
# you must provide a complete list of objects to pass to ObjectInputStream through allowList property
|
||||
# As an example, the a complete list of objects used by OFBiz OOTB is here in allowList.
|
||||
# You will need to add your objects/classes to this list.
|
||||
# OFBiz committers: don't forget to add newobjects in SafeObjectInputStream class too (as default there).
|
||||
|
||||
# OFBiz committers:
|
||||
# . don't forget to add new objects in SafeObjectInputStream class too (as default there).
|
||||
# . "foo" and "SerializationInjector" are used in OFBiz tests
|
||||
|
||||
listOfSafeObjectsForInputStream=byte\\\\[\\\\], foo, SerializationInjector, \\\\[Z,\\\\[B,\\\\[S,\\\\[I,\\\\[J,\\\\[F,\\\\[D,\\\\[C, java..*, sun.util.calendar..*, org.apache.ofbiz..*, org.codehaus.groovy.runtime.GStringImpl, groovy.lang.GString
|
||||
allowList=byte\\[\\], foo, SerializationInjector, \\[Z,\\[B,\\[S,\\[I,\\[J,\\[F,\\[D,\\[C, java..*, sun.util.calendar..*, org.apache.ofbiz..*, org.codehaus.groovy.runtime.GStringImpl, groovy.lang.GString
|
||||
|
||||
#-- List of strings rejected for serialisation
|
||||
#-- The same comments than for allowList apply to denyList
|
||||
denyList=rmi, <
|
||||
|
||||
+17
-20
@@ -24,6 +24,7 @@ import static org.apache.ofbiz.base.util.UtilProperties.getPropertyValue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InvalidClassException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectStreamClass;
|
||||
import java.util.Arrays;
|
||||
@@ -36,26 +37,26 @@ import java.util.regex.Pattern;
|
||||
* only authorized class can be read from it.
|
||||
*/
|
||||
public final class SafeObjectInputStream extends ObjectInputStream {
|
||||
private static final String[] DEFAULT_WHITELIST_PATTERN = {
|
||||
private static final String[] DEFAULT_ALLOWLIST_PATTERN = {
|
||||
"byte\\[\\]", "foo", "SerializationInjector",
|
||||
"\\[Z", "\\[B", "\\[S", "\\[I", "\\[J", "\\[F", "\\[D", "\\[C",
|
||||
"java..*", "sun.util.calendar..*", "org.apache.ofbiz..*",
|
||||
"org.codehaus.groovy.runtime.GStringImpl", "groovy.lang.GString"};
|
||||
private static final String[] DEFAULT_DENYLIST = { "rmi", "<" };
|
||||
|
||||
/** The regular expression used to match serialized types. */
|
||||
private final Pattern whitelistPattern;
|
||||
private final Pattern allowlistPattern;
|
||||
|
||||
/**
|
||||
* Instantiates a safe object input stream.
|
||||
*
|
||||
* @param in the input stream to read
|
||||
* @throws IOException when reading is not possible.
|
||||
*/
|
||||
public SafeObjectInputStream(InputStream in) throws IOException {
|
||||
super(in);
|
||||
String safeObjectsProp = getPropertyValue("SafeObjectInputStream", "ListOfSafeObjectsForInputStream", "");
|
||||
String[] whitelist = safeObjectsProp.isEmpty() ? DEFAULT_WHITELIST_PATTERN : safeObjectsProp.split(",");
|
||||
whitelistPattern = Arrays.stream(whitelist)
|
||||
String allowListProp = getPropertyValue("SafeObjectInputStream", "allowList", "");
|
||||
String[] allowList = allowListProp.isEmpty() ? DEFAULT_ALLOWLIST_PATTERN : allowListProp.split(",");
|
||||
allowlistPattern = Arrays.stream(allowList)
|
||||
.map(String::trim)
|
||||
.filter(str -> !str.isEmpty())
|
||||
.collect(collectingAndThen(joining("|", "(", ")"), Pattern::compile));
|
||||
@@ -64,21 +65,17 @@ public final class SafeObjectInputStream extends ObjectInputStream {
|
||||
@Override
|
||||
protected Class<?> resolveClass(ObjectStreamClass classDesc) throws IOException, ClassNotFoundException {
|
||||
String className = classDesc.getName();
|
||||
// BlackList exploits; eg: don't allow RMI here
|
||||
if (className.contains("java.rmi.server")) {
|
||||
Debug.logWarning("***Incompatible class***: "
|
||||
+ classDesc.getName()
|
||||
+ ". java.rmi.server classes are not allowed for security reason",
|
||||
"SafeObjectInputStream");
|
||||
return null;
|
||||
}
|
||||
if (!whitelistPattern.matcher(className).find()) {
|
||||
// DiskFileItem, FileItemHeadersImpl are not serializable.
|
||||
if (className.contains("org.apache.commons.fileupload")) {
|
||||
return null;
|
||||
// DenyList
|
||||
String rejectedObjectsProp = getPropertyValue("security", "denyList", "");
|
||||
String[] denyList = rejectedObjectsProp.isEmpty() ? DEFAULT_DENYLIST : rejectedObjectsProp.split(",");
|
||||
// For now DEFAULT_DENYLIST: don't allow RMI, prevent generics markup in string type names
|
||||
for (String deny : denyList) {
|
||||
if (className.contains(deny)) {
|
||||
throw new InvalidClassException(className, "Unauthorized deserialisation attempt");
|
||||
}
|
||||
Debug.logWarning("***Incompatible class***: "
|
||||
+ classDesc.getName()
|
||||
}
|
||||
if (!allowlistPattern.matcher(className).find()) {
|
||||
Debug.logWarning("***Incompatible class***: " + className
|
||||
+ ". Please see OFBIZ-10837. Report to dev ML if you use OFBiz without changes. "
|
||||
+ "Else follow https://s.apache.org/45war",
|
||||
"SafeObjectInputStream");
|
||||
|
||||
@@ -93,12 +93,11 @@ public final class UtilObject {
|
||||
Object obj = null;
|
||||
try {
|
||||
obj = getObjectException(bytes);
|
||||
// DiskFileItem, FileItemHeadersImpl are not serializable. So SafeObjectInputStream::resolveClass return null
|
||||
if (obj == null) {
|
||||
return null;
|
||||
}
|
||||
} catch (ClassNotFoundException | IOException e) {
|
||||
} catch (IOException e) {
|
||||
Debug.logError(e, module);
|
||||
} catch (ClassNotFoundException e1) {
|
||||
// DiskFileItem, FileItemHeadersImpl are not serializable. So SafeObjectInputStream::resolveClass return ClassNotFoundException
|
||||
return null;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ public final class FreeMarkerWorker {
|
||||
|
||||
public static final String module = FreeMarkerWorker.class.getName();
|
||||
|
||||
public static final Version version = Configuration.VERSION_2_3_28;
|
||||
public static final Version version = Configuration.VERSION_2_3_31;
|
||||
|
||||
private FreeMarkerWorker () {}
|
||||
|
||||
|
||||
@@ -775,24 +775,24 @@
|
||||
<value xml:lang="zh-TW">SecurityViewPermissionError 你沒有權限檢視本頁面. (需要"SECURITY_VIEW" 或 "SECURITY_ADMIN")</value>
|
||||
</property>
|
||||
<property key="SupportedFileFormatsIncludingSvg">
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), SVG, PDF, and ZIP or text files with safe contents are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers SVG, PDF, et les fichiers ZIP ou texte aux contenus sûrs sont acceptés.</value>
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), SVG, PDF, and ZIP or text files with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) and contents are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers SVG, PDF, et les fichiers ZIP ou texte avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) et aux contenus sûrs sont acceptés.</value>
|
||||
</property>
|
||||
<property key="SupportedFileFormats">
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), PDF or text files with safe contents are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers PDF ou les fichiers texte aux contenus sûrs sont acceptés.</value>
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), PDF or text files with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) and contents are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides de formats d'image pris en charge (GIF, JPEG, PNG, TIFF), les fichiers PDF ou les fichiers texte avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) et aux contenus sûrs sont acceptés.</value>
|
||||
</property>
|
||||
<property key="SupportedImageFormatsIncludingSvg">
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), or SVG format are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) ou au format SVG sont acceptés.</value>
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF), or SVG format with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) ou au format SVG avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) sont acceptés.</value>
|
||||
</property>
|
||||
<property key="SupportedImageFormats">
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF) are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) sont acceptés.</value>
|
||||
<value xml:lang="en">For security reason only valid files of supported image formats (GIF, JPEG, PNG, TIFF) with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers valides des formats d'image pris en charge (GIF, JPEG, PNG, TIFF) avec des noms sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) sont acceptés.</value>
|
||||
</property>
|
||||
<property key="SupportedTextFileFormats">
|
||||
<value xml:lang="en">For security reason only text files with safe contents are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers texte dont les contenus sont sûrs sont acceptés.</value>
|
||||
<value xml:lang="en">For security reason only text files with safe names (only Alpha-Numeric characters, hyphen, underscore and spaces, only 1 dot, name and extension not empty) and contents are accepted.</value>
|
||||
<value xml:lang="fr">Pour des raisons de sécurité, seuls les fichiers texte dont les contenus et les noms sont sûrs (uniquement des caractères alphanumériques, 1 seul point, nom et extension non vides) sont acceptés</value>
|
||||
</property>
|
||||
<property key="UserLogin">
|
||||
<value xml:lang="de">Benutzeranmeldung</value>
|
||||
|
||||
@@ -71,13 +71,13 @@ under the License.
|
||||
|
||||
<service name="groupTest" engine="group" location="testGroup" invoke=""/>
|
||||
|
||||
<service name="testHttp" engine="http" location="main-http" invoke="testScv">
|
||||
<!-- <service name="testHttp" engine="http" location="main-http" invoke="testScv">
|
||||
<description>HTTP service wrapper around the test service</description>
|
||||
<attribute name="message" type="String" mode="IN" optional="true"/>
|
||||
<attribute name="resp" type="String" mode="OUT"/>
|
||||
</service>
|
||||
</service> -->
|
||||
|
||||
<service name="testSoap" engine="soap" export="true" location="main-soap" invoke="testSOAPScv">
|
||||
<!-- <service name="testSoap" engine="soap" export="true" location="main-soap" invoke="testSOAPScv">
|
||||
<description>SOAP service; calls the OFBiz test SOAP service</description>
|
||||
<implements service="testSOAPScv"/>
|
||||
</service>
|
||||
@@ -87,12 +87,12 @@ under the License.
|
||||
<implements service="testScv"/>
|
||||
</service>
|
||||
|
||||
<!-- test service for local loopback testing (OFBiz Client SOAP -> OFBiz Server SOAP)
|
||||
https://ofbiz-vm2.apache.org:8443/webtools/control/SOAPService is the ultimate location for the testRemoteSoap
|
||||
test service for local loopback testing (OFBiz Client SOAP -> OFBiz Server SOAP)
|
||||
https://ofbiz-vm2.apache.org:8443/webtools/control/SOAPService is the ultimate location for the testRemoteSoap
|
||||
It's redirected from https://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService by the HTTPD frontend installed by Puppet in the demo server, ie ofbiz-vm2.apache.org
|
||||
We could use also http://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService but HSTS would sent it to https anyway
|
||||
So this can be used only against trunk demo and is not in the tests set to avoid a dependency on Internet -->
|
||||
<service name="testRemoteSoap" engine="soap" export="true"
|
||||
So this can be used only against trunk demo and is not in the tests set to avoid a dependency on Internet
|
||||
<service name="testRemoteSoap" engine="soap" export="true"
|
||||
location="https://demo-trunk.ofbiz.apache.org/webtools/control/SOAPService"
|
||||
invoke="testSoapSimple">
|
||||
<attribute name="defaultValue" type="Double" mode="IN" default-value="999.9999"/>
|
||||
@@ -100,12 +100,12 @@ under the License.
|
||||
<attribute name="resp" type="String" mode="OUT"/>
|
||||
</service>
|
||||
|
||||
<!-- FIXME For now, not sure why, the 4 remote SOAP services below don't work -->
|
||||
FIXME For now, not sure why, the 4 remote SOAP services below don't work
|
||||
|
||||
<!-- the location = endpoint = SOAP action -->
|
||||
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListZipCode -->
|
||||
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
|
||||
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
|
||||
the location = endpoint = SOAP action
|
||||
invoke parameter is the name of the operation to invoke, for example LatLonListZipCode
|
||||
invoke parameter is needed when there are several possible operations for the SOAP action
|
||||
FIXME For now, not sure why, this remote SOAP service does not work
|
||||
<service name="testRemoteSoap1" engine="soap" export="true"
|
||||
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
|
||||
invoke="LatLonListZipCode">
|
||||
@@ -118,10 +118,10 @@ under the License.
|
||||
<attribute name="result" type="String" mode="OUT"/>
|
||||
</service>
|
||||
|
||||
<!-- the location = endpoint = SOAP action -->
|
||||
<!-- invoke parameter is the name of the operation to invoke, for example LatLonListCityNames -->
|
||||
<!-- invoke parameter is needed when there are several possible operations for the SOAP action -->
|
||||
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
|
||||
the location = endpoint = SOAP action
|
||||
invoke parameter is the name of the operation to invoke, for example LatLonListCityNames
|
||||
invoke parameter is needed when there are several possible operations for the SOAP action
|
||||
FIXME For now, not sure why, this remote SOAP service does not work
|
||||
<service name="testRemoteSoap2" engine="soap" export="true"
|
||||
location="http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php"
|
||||
invoke="LatLonListCityNames">
|
||||
@@ -134,7 +134,7 @@ under the License.
|
||||
<attribute name="result" type="String" mode="OUT"/>
|
||||
</service>
|
||||
|
||||
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
|
||||
FIXME For now, not sure why, this remote SOAP service does not work
|
||||
<service name="testRemoteSoap3" engine="soap" export="true"
|
||||
location="http://www.restfulwebservices.net/wcf/EmailValidationService.svc"
|
||||
invoke="EmailValidationService">
|
||||
@@ -143,13 +143,13 @@ under the License.
|
||||
<attribute name="result" type="String" mode="OUT"/>
|
||||
</service>
|
||||
|
||||
<!-- FIXME For now, not sure why, this remote SOAP service does not work -->
|
||||
FIXME For now, not sure why, this remote SOAP service does not work
|
||||
<service name="testRemoteSoap4" engine="soap" export="true"
|
||||
location="http://www.webservicex.net/geoipservice.asmx"
|
||||
invoke="GetGeoIPContext">
|
||||
<attribute name="invoke" type="String" mode="IN" />
|
||||
<attribute name="result" type="String" mode="OUT"/>
|
||||
</service>
|
||||
</service> -->
|
||||
|
||||
<service name="testGroovy" engine="groovy" location="component://common/minilang/GroovyServiceTest.groovy" invoke="">
|
||||
<description>Test Groovy Script Service</description>
|
||||
|
||||
@@ -24,7 +24,7 @@ under the License.
|
||||
|
||||
<!-- event handlers -->
|
||||
<handler name="java" type="request" class="org.apache.ofbiz.webapp.event.JavaEventHandler"/>
|
||||
<handler name="soap" type="request" class="org.apache.ofbiz.webapp.event.SOAPEventHandler"/>
|
||||
<!-- <handler name="soap" type="request" class="org.apache.ofbiz.webapp.event.SOAPEventHandler"/> -->
|
||||
<handler name="xmlrpc" type="request" class="org.apache.ofbiz.webapp.event.XmlRpcEventHandler"/>
|
||||
<handler name="service" type="request" class="org.apache.ofbiz.webapp.event.ServiceEventHandler"/>
|
||||
<handler name="service-multi" type="request" class="org.apache.ofbiz.webapp.event.ServiceMultiEventHandler"/>
|
||||
|
||||
@@ -105,32 +105,43 @@ public class SecuredUpload {
|
||||
return true;
|
||||
}
|
||||
|
||||
String imageServerUrl = EntityUtilProperties.getPropertyValue("catalog", "image.management.url", delegator);
|
||||
Path p = Paths.get(fileToCheck);
|
||||
String file = p.getFileName().toString();
|
||||
boolean wrongFile = true;
|
||||
if (org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS) {
|
||||
if (fileToCheck.length() > 259) {
|
||||
Debug.logError("Uploaded file name too long", MODULE);
|
||||
return false;
|
||||
} else if (!file.matches("[a-zA-Z0-9]{1,249}.[a-zA-Z0-9]{1,10}")) {
|
||||
Debug.logError("Uploaded file "
|
||||
+ " should contain only Alpha-Numeric characters, only 1 dot as an input for the file name and the extension."
|
||||
+ "The file name and the extension should not be empty at all",
|
||||
MODULE);
|
||||
return false;
|
||||
} else if (p.toString().contains(imageServerUrl.replaceAll("/", "\\\\"))) {
|
||||
if (file.matches("[a-zA-Z0-9-_ ()]{1,249}.[a-zA-Z0-9-_ ]{1,10}")) { // "(" and ")" for duplicates files
|
||||
wrongFile = false;
|
||||
}
|
||||
} else if (file.matches("[a-zA-Z0-9-_ ]{1,249}.[a-zA-Z0-9-_ ]{1,10}")) {
|
||||
wrongFile = false;
|
||||
}
|
||||
} else {
|
||||
} else { // Suppose a *nix system
|
||||
if (fileToCheck.length() > 4096) {
|
||||
Debug.logError("Uploaded file name too long", MODULE);
|
||||
return false;
|
||||
} else if (!file.matches("[a-zA-Z0-9]{1,4086}.[a-zA-Z0-9]{1,10}")) {
|
||||
Debug.logError("Uploaded file "
|
||||
+ " should contain only Alpha-Numeric characters, only 1 dot as an input for the file name and the extension."
|
||||
+ "Tthe file name and the extension should not be empty at all",
|
||||
MODULE);
|
||||
return false;
|
||||
} else if (p.toString().contains(imageServerUrl)) {
|
||||
if (file.matches("[a-zA-Z0-9-_ ()]{1,4086}.[a-zA-Z0-9-_ ]{1,10}")) { // "(" and ")" for duplicates files
|
||||
wrongFile = false;
|
||||
}
|
||||
} else if (file.matches("[a-zA-Z0-9-_ ]{1,4086}.[a-zA-Z0-9-_ ]{1,10}")) {
|
||||
wrongFile = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (wrongFile) {
|
||||
Debug.logError("Uploaded file "
|
||||
+ " should contain only Alpha-Numeric characters, hyphen, underscore and spaces,"
|
||||
+ " only 1 dot as an input for the file name and the extension."
|
||||
+ "The file name and extension should not be empty at all",
|
||||
MODULE);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isExecutable(fileToCheck)) {
|
||||
return false;
|
||||
}
|
||||
@@ -217,10 +228,10 @@ public class SecuredUpload {
|
||||
Path filePath = Paths.get(fileName);
|
||||
byte[] bytesFromFile = Files.readAllBytes(filePath);
|
||||
ImageFormat imageFormat = Imaging.guessFormat(bytesFromFile);
|
||||
return imageFormat.equals(ImageFormats.PNG)
|
||||
return (imageFormat.equals(ImageFormats.PNG)
|
||||
|| imageFormat.equals(ImageFormats.GIF)
|
||||
|| imageFormat.equals(ImageFormats.TIFF)
|
||||
|| imageFormat.equals(ImageFormats.JPEG)
|
||||
|| imageFormat.equals(ImageFormats.JPEG))
|
||||
&& imageMadeSafe(fileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@ under the License.
|
||||
<engine name="javascript" class="org.apache.ofbiz.service.engine.ScriptEngine"/>
|
||||
<!-- -->
|
||||
<engine name="route" class="org.apache.ofbiz.service.engine.RouteEngine"/>
|
||||
<engine name="http" class="org.apache.ofbiz.service.engine.HttpEngine"/>
|
||||
<!-- <engine name="http" class="org.apache.ofbiz.service.engine.HttpEngine"/> -->
|
||||
<engine name="jms" class="org.apache.ofbiz.service.jms.JmsServiceEngine"/>
|
||||
<engine name="rmi" class="org.apache.ofbiz.service.rmi.RmiServiceEngine"/>
|
||||
<engine name="soap" class="org.apache.ofbiz.service.engine.SOAPClientEngine"/>
|
||||
<!-- <engine name="soap" class="org.apache.ofbiz.service.engine.SOAPClientEngine"/> -->
|
||||
<!-- The engine xml-rpc-local is only used by a test service and for this reason it is configured to run on port 8080.
|
||||
In order to use this in OFBiz change the port accordingly (for demo the default value is 8080)
|
||||
-->
|
||||
@@ -66,14 +66,14 @@ under the License.
|
||||
</engine>
|
||||
|
||||
<service-location name="main-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
|
||||
<service-location name="main-http" location="http://localhost:8080/webtools/control/httpService"/>
|
||||
<service-location name="main-soap" location="http://localhost:8080/webtools/control/SOAPService"/>
|
||||
<!-- <service-location name="main-http" location="http://localhost:8080/webtools/control/httpService"/>
|
||||
<service-location name="main-soap" location="http://localhost:8080/webtools/control/SOAPService"/> -->
|
||||
|
||||
<service-location name="entity-sync-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
|
||||
<service-location name="entity-sync-http" location="https://localhost:8443/webtools/control/httpService"/>
|
||||
<!-- <service-location name="entity-sync-http" location="https://localhost:8443/webtools/control/httpService"/> -->
|
||||
|
||||
<service-location name="rita-rmi" location="rmi://localhost:1099/RMIDispatcher"/>
|
||||
<service-location name="eedcc-test" location="https://localhost:8443/webtools/control/httpService"/>
|
||||
<!-- <service-location name="eedcc-test" location="https://localhost:8443/webtools/control/httpService"/> -->
|
||||
|
||||
<!-- default notification group for all services loaded with 'main' loader
|
||||
- uncomment this to enable error notification for all services
|
||||
|
||||
@@ -22,7 +22,7 @@ under the License.
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
|
||||
<test-case case-name="service-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceEngineTests"/></test-case>
|
||||
<test-case case-name="service-soap-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceSOAPTests"/></test-case>
|
||||
<!-- <test-case case-name="service-soap-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceSOAPTests"/></test-case> -->
|
||||
<test-case case-name="service-entity-auto-tests"><junit-test-suite class-name="org.apache.ofbiz.service.test.ServiceEntityAutoTests"/></test-case>
|
||||
|
||||
<test-case case-name="load-service-test-data">
|
||||
|
||||
@@ -43,7 +43,8 @@ under the License.
|
||||
<!-- Request Mappings -->
|
||||
|
||||
<!-- Begin Utility Requests -->
|
||||
<request-map uri="httpService">
|
||||
<!-- The 2 services below have been commented out for security reason, see OFBIZ-12212 -->
|
||||
<!-- <request-map uri="httpService">
|
||||
<event type="java" path="org.apache.ofbiz.service.engine.HttpEngine" invoke="httpEngine"/>
|
||||
<response name="success" type="none"/>
|
||||
<response name="error" type="none"/>
|
||||
@@ -53,7 +54,7 @@ under the License.
|
||||
<event type="soap"/>
|
||||
<response name="error" type="none"/>
|
||||
<response name="success" type="none"/>
|
||||
</request-map>
|
||||
</request-map> -->
|
||||
<request-map uri="xmlrpc" track-serverhit="false" track-visit="false">
|
||||
<security auth="true"/>
|
||||
<event type="xmlrpc"/>
|
||||
|
||||
@@ -25,6 +25,14 @@ If ($ExecutionContext.SessionState.LanguageMode -eq "ConstrainedLanguage") {
|
||||
Invoke-WebRequest -outf gradle\wrapper\gradle-wrapper.jar https://github.com/gradle/gradle/raw/v4.5.1/gradle/wrapper/gradle-wrapper.jar
|
||||
}
|
||||
|
||||
$expected = "00d0743607178962f8b120da4ccad2c64c698aec"
|
||||
$actual = (Get-FileHash gradle\wrapper\gradle-wrapper.jar -Algorithm SHA1).Hash.ToLower()
|
||||
@{$true = 'OK: Checksum match'; $false = "ERROR: Checksum mismatch!`nExpected: $expected`nActual: $actual"}[$actual -eq $expected]
|
||||
|
||||
if (!$true) {
|
||||
Remove-Item gradle\wrapper\gradle-wrapper.jar
|
||||
}
|
||||
|
||||
#Write-Host $ExecutionContext.SessionState.LanguageMode
|
||||
|
||||
Start-Sleep -s 3
|
||||
|
||||
Reference in New Issue
Block a user