Commit Graph
10472 Commits
Author SHA1 Message Date
Jacques Le Roux 6accef9785 No functional change, formatting while reviewing r1812049
Actually I'm unsure of how to present multiple expressions for autocloseables
in try blocks (here automatically done by my Eclipse formatter). This should be 
discussed with the community so we agreed on formatting rules to create an
official Eclipse formatter as being discussed at https://s.apache.org/0ptF

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813854 13f79535-47bb-0310-9956-ffa450edef68
2017-10-31 08:15:00 +00:00
Jacques Le Roux 6fe07e9961 Implemented: Token Based Authentication
(OFBIZ-9833)

Fixes a typo

Thanks: Deepak on dev ML 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813732 13f79535-47bb-0310-9956-ffa450edef68
2017-10-30 08:19:08 +00:00
Jacques Le Roux 90a349b441 Implemented: Token Based Authentication
(OFBIZ-9833)

This works the same way than externalLoginKey but between 2 servers, 
not 2 webapps on the same server. 

The Single Sign On (SSO) is ensured by a JWT token, then all is handled as 
normal by a session on the reached server. The servers may or may not share a 
database but the loginUserIds on the 2 servers must be the same.

OOTB the JWT masterSecretKey is not properly initialised and can not be OOTB.
As we sign on on several servers, so have different sessions, we can't use the 
externalLoginKey way to create the JWT masterSecretKey.
The best way to create the JWT masterSecretKey is to use a temporary way to load 
in a static final key when compiling. This is simple and most secure. 
One of the proposed way is to use sed and uuidgen to modify the masterSecretKey 
value. The magic words here are TEMPORARY and FINAL!

I have not tested this between 2 servers yet, only locally where it works well.
I'll do after this commit between my local instance and the trunk demo.

Thanks: Nicolas for the sed ans uuidgen suggestion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813679 13f79535-47bb-0310-9956-ffa450edef68
2017-10-29 11:02:00 +00:00
Jacques Le Roux 7ca508d5c7 No functional change.
While reviewing r1813634, I found that we could use a multi-catch, and while
doing so found that we were missing a CertificateException according to Eclipse

Confirmed by Java:
:compileJava
ofbiz\framework\service\src\main\java\org\apache\ofbiz\service\rmi\socket\ssl\
SSLServerSocketFactory.java:75: error: 
unreported exception CertificateException; must be caught or declared to be
thrown
                ks.load(fis, passphrase);

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813671 13f79535-47bb-0310-9956-ffa450edef68
2017-10-29 08:16:58 +00:00
Michael Brohl 89b36c49a8 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.
(OFBIZ-9716)

I modified the patch slightly.

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813640 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 15:19:56 +00:00
Michael Brohl 6ec41780eb Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.datafile.
(OFBIZ-9715)

I modified the patch slightly and did some additional code cleanup by 
removing commented out code and some formatting.

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813637 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 14:45:17 +00:00
Michael Brohl b73414c870 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.rmi.socket.ssl.
(OFBIZ-9714)

I modified the patch to keep the previous logic to get the SSL server 
socket. The cast should be safe because of the SSLServerSocketFactory
being used to get the socket.

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813634 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 14:19:22 +00:00
Michael Brohl 972cf88c01 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.condition.
(OFBIZ-9713)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813633 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 14:10:07 +00:00
Michael Brohl e687edb25f Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.finder.
(OFBIZ-9712)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813632 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 13:39:24 +00:00
Michael Brohl e3665de1f2 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.cache.
(OFBIZ-9711)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813631 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 13:36:26 +00:00
Deepak Dixit 982fe0c58a Added missing licence header
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813620 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 12:46:43 +00:00
Michael Brohl 03175996f2 Fixed: X-Frame-Options configuration is not working
(OFBIZ-9891)

This fixes a bug where the configuration attribute in the view-map 
differs from what is read in the configuration handler. 

Aditionally,
a new option "none" is introduced. If it is set, no X-Frame-Options 
header will be set.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813276 13f79535-47bb-0310-9956-ffa450edef68
2017-10-25 12:56:01 +00:00
Deepak Dixit eea53baef0 Fixed: Moved enabled attribute definition to its correct place, it was added in wrong attribute group
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813219 13f79535-47bb-0310-9956-ffa450edef68
2017-10-24 18:33:04 +00:00
Jacques Le Roux 3c6a52f7da Fixed: Not setting VIEW_INDEX for IterateSectionWidget.renderWidgetString causes
rendering error
(OFBIZ-9889)

A bug was introduced in OFBIZ-9710, that created a catch block for a 
RuntimeException that would be thrown again. Unfortunately the code block relied 
on catching a NumberFormatException in case VIEW_INDEX was not set, which in the
original code was not intuitively recognisable, because only Exception was caught.

In the provided patch I removed the catch block for the RTE und changed Exception 
to NumberFormatException, since it is the only Exception that is expected.

Thanks: Tobias Laufkötter

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813067 13f79535-47bb-0310-9956-ffa450edef68
2017-10-23 19:28:32 +00:00
Michael Brohl 3ce6210e58 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.widget.model.
(OFBIZ-9710)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812918 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:58:51 +00:00
Michael Brohl b29bb5df10 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.job.
(OFBIZ-9709)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812916 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:31:23 +00:00
Michael Brohl 8392d41d95 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.transaction.
(OFBIZ-9707)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812915 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:27:03 +00:00
Michael Brohl a886588282 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.test.
(OFBIZ-9706)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812912 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:07:12 +00:00
Michael Brohl dfbf625956 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.serialize.
(OFBIZ-9705)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812910 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:03:31 +00:00
Michael Brohl 75fd7fdde6 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.widget.renderer.
(OFBIZ-9704)

Applied a modified version of the patch, the null check for menuWarapper 
in MenuWrapTransfor is needed.

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812908 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 12:46:33 +00:00
Michael Brohl 4dd37a8401 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.widget.renderer.macro.
(OFBIZ-9702)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812899 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 11:53:14 +00:00
Michael Brohl c2d7f3622f Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.eca.
(OFBIZ-9683)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812897 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 11:24:21 +00:00
Michael Brohl 59370de2bc Fixed: Wrong String comparisons introduced in r1812255.
Also changed the method name from isswitch to isSwitch.

Thanks to FindBugs for pointing me to this :-)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812794 13f79535-47bb-0310-9956-ffa450edef68
2017-10-20 22:33:13 +00:00
Jacques Le Roux 7e3754293a Implemented: Secure HTTP headers
(OFBIZ-6766)

Adds a Content Security Policy

To not block anything for the moment I have committed a simple most restrictive
Content-Security-Policy-Report-Only header

Then we can look at the issues using browsers tools (there are so much)
The next step is to report the errors (when there will not be too much) in the 
log using a report-uri
And ultimately to use OOTB the most simple and constraining policy, with 
exceptions of course (as ever).




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812720 13f79535-47bb-0310-9956-ffa450edef68
2017-10-20 08:02:55 +00:00
Jacques Le Roux c174d69caa Reverted: Enhance cookies security
(OFBIZ-9865)

This reverts r1812540. It does not fit with OFBiz which then ask you to login
on any action!


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812623 13f79535-47bb-0310-9956-ffa450edef68
2017-10-19 11:47:09 +00:00
Jacques Le Roux 59f2542350 No functional security change,
Adds org.apache.catalina.connector.RECYCLE_FACADES=true
This is recommended by 
https://tomcat.apache.org/tomcat-8.5-doc/security-howto.html#System_Properties


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812612 13f79535-47bb-0310-9956-ffa450edef68
2017-10-19 10:14:19 +00:00
Jacques Le Roux 90a6bd3fa9 Implemented: Secure HTTP headers
(OFBIZ-6766)

Adds 
  the no-referrer-when-downgrade Referrer-Policy
  a comment about Public-Key-Pins-Report-Only
  a link to the related wiki page

This is my prior to last commit, before implementing a CSP policy which is quite
the stuff! Check yourself https://csp.withgoogle.com/docs/adopting-csp.html


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812609 13f79535-47bb-0310-9956-ffa450edef68
2017-10-19 10:00:48 +00:00
Jacques Le Roux 04e2e485d0 Improved: Enhance cookies security
(OFBIZ-9865)

Working on OFBIZ-6766, I was reading 
https://www.owasp.org/index.php/Session_Management_Cheat_Sheet#SameSite_Attribute 
and decided to slightly improve our cookies security


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812540 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 15:01:04 +00:00
Michael Brohl 2eaa1fcd78 Improved: Label Manager: Have totals shown at the top of the search
results.
(OFBIZ-6457)

Thanks Pierre Smits for reporting and providing the initial patch,
Aditya Sharma for the revised patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812479 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 09:05:42 +00:00
Jacques Le Roux a27122f819 Improved: Using try-with-resources with JDBC objects
(OFBIZ-9839)

Use try with resources for SQL objects like ResultSet and other objects. 
SQL classes have AutoCloseable interface.

Thanks: Pradhan Yash Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812466 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 07:56:49 +00:00
Deepak Dixit 651a17d213 Improved: Added ability to disable seca rule (OFBIZ-9826)
We have enabled flag in ServiceEcaRule class, if its set false then seca rule will not be executed.
But there is not way to disable seca.

We can add enabled flag in SECA definition to disable the existing seca rule.
Here is the proposal:
- Add new attribute on seca tag named enabled
- Default value will be true for this.
- If user want to disable existing OOTB seca rule, then user can define same rule in custom component and set the enabled=false
Need to do some changes in code to honor the enabled attribute while loading seca rule.

Also as per current flow if same seca rule is define more then once, system will execute all the rule, ideally it should not execute same rule (same rule, condition and action) if its defined more than one.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812394 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 11:52:14 +00:00
Deepak Dixit 2a8a37f308 Improved: Manage life span of SecurityGroupPermission entity.
Applied patch from jira issue(OFBIZ-9801) Thanks Suraj Khurana for your contribution


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812383 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 10:47:47 +00:00
Deepak Dixit 9715eb8932 Improved: Proper use of if-has-permission, Apply slightly modified patch from jira issue, if if-has-permission uses _ADMIN permission to check condition, so its good to have old pattern instead of using permission/action pattern.
Thanks Suraj Khurana for your contribution(OFBIZ-9740)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812381 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 09:58:24 +00:00
Deepak Dixit 829856e5f6 Improved: Usage of factory method or Builder pattern for Locale object creation and usage.
Thanks Yash Sharma for your contribution. (OFBIZ-9488)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812350 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 06:06:56 +00:00
Deepak Dixit 1620e4e0ca Improved: No functional change, Only added license header
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812309 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 18:43:14 +00:00
Deepak Dixit c2c47188b7 Fixed: Added missing license header in some files.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812289 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 12:22:33 +00:00
Deepak Dixit d310aaf2cd Improved: Inconsistent String Comparisons, Applied patch for ftl file.
Thanks Devanshu Vyas for your contribution. (OFBIZ-9254)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812285 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 11:31:40 +00:00
Deepak Dixit 761959d47d Inconsistent String Comparisons, Applied patch for framework entityext, webapp, webtools and widgets classes.
Thanks Devanshu Vyas for your contribution (OFBIZ-9254)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812279 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 10:32:22 +00:00
Deepak Dixit 8dceb2fc0a Inconsistent String Comparisons, Applied patch for framework service classes.
Thanks Devanshu Vyas for your contribution (OFBIZ-9254)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812264 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 09:25:36 +00:00
Deepak Dixit 0bff35af99 Inconsistent String Comparisons, Applied patch for framework entity classes.
Thanks Devanshu Vyas for your contribution (OFBIZ-9254)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812257 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 08:25:33 +00:00
Deepak Dixit ba75a0f648 Inconsistent String Comparisons, Applied patch for framework base classes.
Thanks Devanshu Vyas for your contribution (OFBIZ-9254)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812255 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 08:09:25 +00:00
Jacques Le Roux 15deb25aae No functional change, fixes wrong ASL2 headers I introduced recently
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812235 13f79535-47bb-0310-9956-ffa450edef68
2017-10-15 21:02:52 +00:00
Jacques Le Roux 2382cd9cbd No functional change, these files were missing the ASL2 header
I stop here, please help at https://ci.apache.org/projects/ofbiz/rat-output.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812225 13f79535-47bb-0310-9956-ffa450edef68
2017-10-15 17:40:59 +00:00
Michael Brohl 934a0d86ff Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.widget.cache.
(OFBIZ-9695)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812164 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 21:05:55 +00:00
Michael Brohl ace34aa4f7 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.semaphore.
(OFBIZ-9693)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812163 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 20:57:01 +00:00
Michael Brohl 8d4dd73dd3 Improved: Update build.gradle to the latest dependencies.
(OFBIZ-9674)

Thanks Julian Leichert for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812161 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 20:42:25 +00:00
Jacques Le Roux 8f74333bc3 Improved: Implement AutoCloseable interface in SQLProcessor Class
(OFBIZ-9841)

Added AutoCloseable interface to SQLProcessor class and overridden Close method
Added closing of ResultSet, PreparedStatement and Connection Objects.
While calling SQLProcessor object in GenericDAO used Try-with-Resources and 
removed unnecessary calls of the same object before actual use, also removed 
finally blocks for method invocation. 

Thanks: Pradhan Yash Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812144 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 15:32:38 +00:00
Jacques Le Roux 20e8b43214 Improved: Using try-with-resources with JDBC objects
(OFBIZ-9839)

Use try with resources for SQL objects like ResultSet and other objects. 
SQL classes have AutoCloseable interface.

Thanks: Pradhan Yash Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812104 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 10:18:48 +00:00
Michael Brohl 1ced20acb0 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.test.
(OFBIZ-9694)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812061 13f79535-47bb-0310-9956-ffa450edef68
2017-10-12 22:54:12 +00:00
Michael Brohl 3bc917104a Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.base.util.
(OFBIZ-9692)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812059 13f79535-47bb-0310-9956-ffa450edef68
2017-10-12 22:29:10 +00:00