Compare commits

...

131 Commits

Author SHA1 Message Date
Massimiliano Assante fc37ffec6f Update 'enunciate.xml' 2023-05-30 12:41:55 +02:00
lucio e0a50f2a72 added header for swagger 2023-05-29 12:17:59 +02:00
lucio b4c9cfeee6 updated 2023-05-25 15:01:40 +02:00
lucio 7920345286 theme modified 2023-05-25 15:00:10 +02:00
lucio 80704b9df2 basepath changed for swagger 2023-05-25 14:53:27 +02:00
lucio a42919ffcf enunciate updated 2023-05-24 17:13:46 +02:00
lucio 6b54bf4554 enunciate files updated 2023-05-24 17:11:14 +02:00
lucio 122cba00e4 added DocManager to jersey initialiser 2023-05-24 15:00:19 +02:00
Lucio Lelii 60d9bf570c Update 'CHANGELOG.md' 2023-05-23 14:37:19 +02:00
Lucio Lelii f9870a0190 Update 'CHANGELOG.md' 2023-05-23 14:36:56 +02:00
lucio d9a229929b enunciate documentation added 2023-05-22 11:23:32 +02:00
Lucio Lelii 0b907277cd Update 'pom.xml' 2022-11-15 11:06:55 +01:00
Lucio Lelii 500aaa3fc9 Update 'pom.xml' 2022-11-15 10:52:33 +01:00
Lucio Lelii e167aa24d9 smartgears bom updated 2022-11-15 10:23:01 +01:00
Lucio Lelii 39d73b97c4 aspectj updated for java11 2022-11-15 10:16:29 +01:00
Lucio Lelii 4dc547afd2 Update 'CHANGELOG.md' 2022-11-14 12:06:28 +01:00
Lucio Lelii 122b326203 update for release 2022-11-14 12:05:16 +01:00
Lucio Lelii 1bbd1d200f added library to manage particular jpeg 2022-11-14 12:04:29 +01:00
Lucio Lelii 647dbb651a Update 'src/main/java/org/gcube/data/access/storagehub/services/MessageManager.java'
solved Incident #22230
2021-10-15 17:06:32 +02:00
lucio.lelii 7f88e20a88 first message shown twice for new user issue solved 2021-10-13 13:48:37 +02:00
lucio.lelii 08f0160d8d changed vre recents parameter 2021-10-13 11:48:03 +02:00
lucio.lelii 2a46ac3aa2 solved error on vre recents 2021-10-13 11:35:19 +02:00
lucio.lelii 882f849e2f pom and changelog updated 2021-10-12 14:01:21 +02:00
lucio.lelii 8c934a138e Merge remote-tracking branch 'origin/vreQueryRemoval'
Conflicts:
	CHANGELOG.md
	pom.xml
2021-10-12 13:40:06 +02:00
lucio.lelii 20390e3147 incident https://support.d4science.org/issues/22184 solved 2021-10-12 13:12:02 +02:00
lucio.lelii 47bf9b57d2 pom and changelog update 2021-10-07 10:38:35 +02:00
lucio.lelii 27c6f2d3e1 scriptManager accept different names 2021-10-06 19:41:18 +02:00
lucio.lelii 586d9df939 removed a part of query to retrieve recents 2021-10-06 19:18:34 +02:00
lucio.lelii 7ebd1ae629 fix updated 2021-10-06 11:56:57 +02:00
lucio.lelii 51cbd0776a solved bug https://support.d4science.org/issues/22147 2021-10-06 11:44:23 +02:00
lucio.lelii f30029c052 - using groupHandler method to retrieve VRE
- added logs to ScriptManager error
2021-10-06 10:37:14 +02:00
Lucio Lelii 68eb65e168 removing query for retreiving VRE root Folder 2021-10-04 17:11:43 +02:00
lucio.lelii 8fd9bb5ac2 Merge branch 'master' of https://code-repo.d4science.org/gCubeSystem/storagehub.git 2021-09-28 13:37:32 +02:00
lucio.lelii 147e8a8961 solved bug on instantiation error for types that are not in the model 2021-09-28 13:36:56 +02:00
Roberto Cirillo 933009f8ab Update 'pom.xml' 2021-09-28 12:53:47 +02:00
Roberto Cirillo 0222d27a5e Update 'CHANGELOG.md' 2021-09-28 12:53:29 +02:00
Roberto Cirillo 082b49ebc6 Update 'CHANGELOG.md' 2021-09-28 12:40:39 +02:00
Roberto Cirillo e255a2ff5d Update 'pom.xml'
update to 1.3.2-SNAPSHOT
2021-09-28 12:39:36 +02:00
lucio.lelii 24576cd30f solved bug on messages attachments 2021-09-10 10:59:07 +02:00
Lucio Lelii f68588e05c solved issue on specific version download 2021-07-26 16:07:40 +02:00
Lucio Lelii cb609cf51c solved issue on deleting version content on empty trash 2021-07-26 10:40:05 +02:00
Lucio Lelii 8929ff579c storagebackends takes ids on delete 2021-07-21 17:36:27 +02:00
Lucio Lelii aeb434dd06 solved issue executing force delete on folder 2021-07-21 15:31:23 +02:00
lucio.lelii 470cc28035 solved issue on attachemnts 2021-07-02 13:17:25 +02:00
lucio.lelii 13016497f1 fixed a bug on Excludes 2021-05-04 18:26:30 +02:00
lucio.lelii eab7dc19b4 commit for release 2021-05-04 12:35:39 +02:00
lucio.lelii 3723ac730c script utils dep added 2021-05-04 12:30:03 +02:00
lucio.lelii 2aadb9cce7 - External Folder imporvements - Inbox and Outbox creation 2021-05-04 11:42:02 +02:00
lucio.lelii bcbe97f547 - ACLManager Delegate Added 2021-04-07 12:38:18 +02:00
lucio.lelii a2613dc1a7 - possibility to impersonate people added 2021-03-31 14:49:47 +02:00
lucio.lelii 64952442ed unshareAll fixed 2021-03-16 15:37:18 +01:00
lucio.lelii e271e9fe78 removing also ACL on already unshared folder 2021-03-16 13:54:34 +01:00
lucio.lelii 7566a3cf9f issue on home folder removal fixed 2021-03-16 13:03:27 +01:00
lucio.lelii 8c677df64e NodeAdmin resource added 2021-03-16 10:01:07 +01:00
lucio.lelii 61c84fbb11 reverted chenage 2021-03-16 00:04:54 +01:00
lucio.lelii 31751ca11e solved an issue on versioning 2021-03-15 16:52:19 +01:00
lucio.lelii 7591536a69 removing old not versioned node 2021-03-15 16:01:14 +01:00
lucio.lelii 6b690caf56 users list ordering added 2021-03-15 11:57:46 +01:00
lucio.lelii 288e8d4254 smartgear bom version fixed 2021-03-12 11:22:46 +01:00
lucio.lelii b68d30cd53 removed snapshot for release 2021-03-12 10:27:38 +01:00
lucio.lelii 7df7afecd3 use of query (indexes are not working well in jackrabbit) to retrieve
shared folder removed on delete user
2021-03-12 10:24:45 +01:00
lucio.lelii 1e916b21b6 added method to check user existence 2021-02-08 12:30:58 +01:00
lucio.lelii 56e01e91f8 Merge branch 'master' of https://code-repo.d4science.org/gCubeSystem/storagehub.git 2021-01-13 10:48:00 +01:00
lucio.lelii 94cb6e4cd3 added catch of all exception on unshare during delete 2021-01-13 10:46:58 +01:00
Roberto Cirillo 5760a44220 Update 'pom.xml'
removed snapshot from gcube-smartgears-bom version
2021-01-12 09:36:07 +01:00
lucio.lelii cbb77864c5 mimetype set also on non parsable pdf
method add and remove admin on a VREFolder enabled also for admin role

fixed bug on unsharing folder on user removal
2021-01-11 18:07:57 +01:00
user1 effbb513a7 ObjectMapper import changed to thegcube embedded jackson 2020-11-10 15:18:11 +01:00
user1 953cec03ee removed an unused session 2020-10-13 16:27:31 +02:00
user1 0d499d6c88 acl error message changed 2020-10-13 15:53:27 +02:00
user1 79f755dc13 pom cleaned from warnings 2020-10-08 12:02:11 +02:00
user1 8b494440af changelog modified 2020-10-07 18:30:46 +02:00
user1 d57647a714 mimetype set also on non parasble pdf 2020-10-07 18:28:34 +02:00
Fabio Sinibaldi cb57512174 adoption of gcube-smartgears-bom.2.0.0-SNAPSHOT 2020-10-07 16:34:00 +02:00
Lucio Lelii 2732b05426 SNAPSHOT removed from version 2020-09-16 12:28:38 +02:00
Lucio Lelii 432859d9bb descriptor removed 2020-09-16 12:27:20 +02:00
Lucio Lelii dcf1a614b4 commit for release 2020-09-16 12:11:52 +02:00
Lucio Lelii 84cec8aa76 changelog added 2020-05-26 16:31:23 +02:00
Lucio Lelii 52df23f2a9 changelog added 2020-05-26 16:30:50 +02:00
Lucio Lelii ce8a1e744f commit for release 4.23
resolves a bug on Archive upload
2020-05-22 17:31:40 +02:00
Lucio Lelii 70ae49e28d update for test issue 2020-04-23 16:09:13 +02:00
Lucio Lelii f2742ce0e0 solved bug with getAnchestors and public folders 2020-04-17 17:03:06 +02:00
Lucio Lelii 7ed01ecc4e ItemAction for restore set to MOVED 2020-04-15 17:40:02 +02:00
Lucio Lelii 1db74cc4df solved bugs on restore item and authorization 2020-04-15 17:36:11 +02:00
Lucio Lelii aae84a27d6 pom updated for release 4.22 2020-04-15 10:42:02 +02:00
Lucio Lelii b80f1ccb0d changelog updated 2020-04-15 10:31:09 +02:00
Lucio Lelii ea438888c8 added a todo 2020-04-14 19:49:04 +02:00
Lucio Lelii 01b74ae117 added a servlet for administration 2020-04-14 19:48:28 +02:00
Lucio Lelii 94d9307b4c refactoring of some classes 2020-04-14 18:52:59 +02:00
Lucio Lelii e82d695bbf setting owner of an full unshared folder to caller 2020-04-14 18:52:20 +02:00
Lucio Lelii 458b8a72ea allows moving shared item outside the shared folder 2020-04-14 18:46:44 +02:00
Lucio Lelii 487eae33e2 refactoring 2020-04-09 13:31:17 +02:00
Lucio Lelii 08351b2005 public folder check added on Authorization Checker 2020-04-09 09:44:40 +02:00
Lucio Lelii 4c13f4098e moved classes in differen packages 2020-04-08 21:11:43 +02:00
lucio 6e69de91d0 solved an error on authorization for deleted user 2020-04-05 11:37:15 +02:00
lucio 62fe5a77a0 removes duplicate nodes in search 2020-03-17 13:58:37 +01:00
lucio acbd780dff pom updated for release 2020-03-17 13:41:46 +01:00
lucio a7ee9afb76 search excludes not authorized node from the results 2020-03-17 13:40:41 +01:00
lucio 9e3b5f08e0 pom updated for release 2020-03-16 16:56:57 +01:00
lucio 133d71f14f search exludes hidden 2020-03-16 16:55:26 +01:00
Lucio Lelii 9d895f0adf pom updated 2020-03-11 15:14:20 +01:00
lucio 177888e1b4 - openByPath added
- replaced some warning log with debug
2020-03-11 15:00:40 +01:00
lucio 868eadfdaa complete remove of file on user and group deletion 2020-03-05 15:39:34 +01:00
lucio 6c9aaa9489 pom updated 2020-03-05 15:18:47 +01:00
lucio 774e2b4bfb getByPath method added 2020-03-05 15:18:20 +01:00
lucio fae5173b17 diaplyName bug with root scope containing dashes fixed 2020-01-31 15:22:54 +01:00
lucio ddbac93245 VRE ACl can be changed using setAcl method 2020-01-30 17:14:46 +01:00
lucio 8a84c93c18 fixed bug on administrator check 2020-01-30 17:02:13 +01:00
lucio 2033af4572 bug on vre folder displayName on folder containing - in the name solved 2020-01-30 16:13:23 +01:00
lucio 0711d8a702 control on invalid group id and user added on addAdmin 2020-01-30 11:18:35 +01:00
lucio b9d62994f9 bug on group creation fixed 2020-01-29 17:14:44 +01:00
lucio 8f725d46c0 group creation logs added 2020-01-29 15:25:24 +01:00
lucio eb3daa0a26 added vre folder to group creator workspace 2020-01-29 12:24:30 +01:00
lucio e08984af23 On Grup creation the user creator is automatically added to the gruop 2020-01-29 11:37:50 +01:00
lucio 067f487f8b search made case insensitive 2020-01-24 12:30:05 +01:00
lucio df1956c08d accounting on serach method fixed 2020-01-24 11:59:01 +01:00
Lucio Lelii 4ebc3ce222 Update pom.xml 2020-01-23 15:37:30 +01:00
Lucio Lelii abc2e16cde SNAPSHOT removed on dependency ranges 2020-01-23 12:51:05 +01:00
Lucio Lelii 0311d9782d Update pom.xml 2020-01-23 12:26:11 +01:00
lucio 1bcaa47d48 Merge remote-tracking branch 'origin/rolesmanaging'
Conflicts:
	src/main/webapp/WEB-INF/README
	src/main/webapp/WEB-INF/gcube-app.xml
2020-01-22 17:14:22 +01:00
lucio 0f645fdde7 commit for release 2020-01-22 16:41:12 +01:00
lucio 8ac4752ca7 pom committed 2020-01-22 12:45:19 +01:00
lucio a4dc3cff54 My ApplicationListener added 2020-01-22 12:40:35 +01:00
lucio de91f86daf version changed for release 2020-01-22 12:40:01 +01:00
lucio 188d11ff70 Application Listener add to correctly shutdown the jackrabbit repository 2020-01-22 12:32:49 +01:00
lucio c1ab8333b8 solved error on group creation 2020-01-16 18:11:23 +01:00
lucio 67fe556a4f methdo for administrator management added 2020-01-15 19:11:07 +01:00
lucio 2dc02aa194 unshared accounting added 2020-01-07 18:25:52 +01:00
lucio 4802a0542e Corrected a Authorization message error 2020-01-07 17:05:51 +01:00
lucio 0f156c6637 gcube-app file updated 2019-10-25 14:58:09 +02:00
lucio 0508aa0e3a added inner method name to GroupManager 2019-10-10 19:09:30 +02:00
lucio 18cba6c067 added client method for User and Group management 2019-10-10 18:15:38 +02:00
81 changed files with 6975 additions and 2280 deletions

View File

@ -13,15 +13,15 @@
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
@ -35,5 +35,6 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/storagehub-model"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,14 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8

View File

@ -1,16 +1,226 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="storagehub">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="authorization-control-library-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/authorization-control-library/authorization-control-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="storagehub-model-1.0.5.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/storagehub-model/storagehub-model">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="context-root" value="storagehub"/>
<property name="java-output-path" value="/storagehub-webapp_BRANCH/target/classes"/>
</wb-module>
</project-modules>

78
CHANGELOG.md Normal file
View File

@ -0,0 +1,78 @@
# Changelog
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.4.2] - [2023-05-22]
- added enunciate libraries for documentation
## [v1.4.1] - [2022-11-14]
- added libraries to manage different image format
## [v1.4.0] - [2021-10-07]
- slow query removed from VRE retrieving and recents
- incident #22184 solved
## [v1.3.2] - [2021-09-28]
- fix 22087
## [v1.3.1] - [2021-09-08]
- solved bug on attachment rights
## [v1.3.0] - [2021-03-31]
- possibility to impersonate people added
## [v1.2.5] - [2021-03-11]
use of query (indexes are not working well in jackrabbit) to retrieve shared folder removed on delete user
## [v1.2.4] - [2021-01-11]
mimetype set also on non parsable pdf
method add and remove admin on a VREFolder enabled also for admin role
fixed bug on unsharing folder on user removal
added method exist user
## [v1.2.2] - [2020-10-12]
method for description update added
## [v1.2.1] - [2020-06-20]
bug on Archive uploader solved
## [v1.2.0] - [2020-04-15]
trash items changes owner on restore
restore with new destination folder added
move between shared and private or different shared folder enabled
## [v1.0.8] - [2019-09-20]
Bug on ushare owner fixed
## [v1.0.5] - [2019-04-04]
Active wait for lock in case of item creation added
## [v1.0.0] - [2015-07-01]
First commit

26
FUNDING.md Normal file
View File

@ -0,0 +1,26 @@
# Acknowledgments
The projects leading to this software have received funding from a series of European Union programmes including:
- the Sixth Framework Programme for Research and Technological Development
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
- the Seventh Framework Programme for research, technological development and demonstration
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
- the H2020 research and innovation programme
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);

View File

@ -1,4 +1,4 @@
#European Union Public Licence V.1.1
#European Union Public Licence V.1.2
##*EUPL © the European Community 2007*
@ -12,7 +12,7 @@ The Original Work is provided under the terms of this Licence when the Licensor
(as defined below) has placed the following notice immediately following the
copyright notice for the Original Work:
**Licensed under the EUPL V.1.1**
**Licensed under the EUPL V.1.2**
or has expressed by any other mean his willingness to license under the EUPL.

View File

@ -1,14 +0,0 @@
<ReleaseNotes>
<Changeset component="org.gcube.data-access.storagehub-webapp.1.0.8"
date="2019-09-20">
<Change>Bug on ushare owner fixed</Change>
</Changeset>
<Changeset component="org.gcube.data-access.storagehub-webapp.1.0.5"
date="2019-04-04">
<Change>Active wait for lock in case of item creation added</Change>
</Changeset>
<Changeset component="org.gcube.data-access.storagehub-webapp.1.0.0"
date="2015-07-01">
<Change>First commit</Change>
</Changeset>
</ReleaseNotes>

View File

@ -1,32 +0,0 @@
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>servicearchive</id>
<formats>
<format>tar.gz</format>
</formats>
<baseDirectory>/</baseDirectory>
<fileSets>
<fileSet>
<directory>.</directory>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<includes>
<include>README.md</include>
<include>LICENSE.md</include>
<include>changelog.xml</include>
<include>profile.xml</include>
</includes>
<fileMode>755</fileMode>
<filtered>true</filtered>
</fileSet>
</fileSets>
<files>
<file>
<source>target/${build.finalName}.war</source>
<outputDirectory>/${artifactId}</outputDirectory>
</file>
</files>
</assembly>

View File

@ -1,7 +1,8 @@
<application mode='online'>
<name>StorageHub</name>
<group>DataAccess</group>
<version>1.0.0-SNAPSHOT</version>
<version>1.4.2</version>
<description>Storage Hub webapp</description>
<local-persistence location='target' />
<exclude>/workspace/api-docs/*</exclude>
</application>

View File

24
enunciate.xml Normal file
View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<enunciate
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.14.0.xsd">
<api-classes>
<!-- Use patterns to exclude classes... e.g. for URI-Resolver <exclude
pattern="org.gcube.datatransfer.resolver.services.DocsGenerator" /> -->
</api-classes>
<modules>
<gwt-json-overlay disabled="true" />
<php-json-client disabled="true" />
<ruby-json-client disabled="true" />
<java-json-client disabled="true" />
<javascript-client disabled="true" />
<docs docsDir="${project.build.directory}" docsSubdir="api-docs" />
<docs
freemarkerTemplate="${project.basedir}/src/main/resources/META-INF/enunciate/d4science_docs.fmt">
<additional-css
file="css/d4science_enunciate_custom.css" />
</docs>
<swagger basePath="/workspace" />
</modules>
</enunciate>

282
pom.xml
View File

@ -1,53 +1,44 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId>
<version>1.1.0</version>
<relativePath />
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.data.access</groupId>
<artifactId>storagehub</artifactId>
<version>1.0.8</version>
<version>1.4.2</version>
<name>storagehub</name>
<scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/storagehub.git</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/storagehub.git</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/storagehub</url>
</scm>
<packaging>war</packaging>
<properties>
<webappDirectory>${project.basedir}/src/main/webapp/WEB-INF</webappDirectory>
<jackrabbit.version>2.16.0</jackrabbit.version>
<jackrabbit.version>2.20.2</jackrabbit.version>
<jackson.version>2.8.11</jackson.version>
<slf4j.version>1.7.4</slf4j.version>
<tomcat.version>7.0.40</tomcat.version>
<jetty.version>6.1.26</jetty.version>
<tika.version>1.21</tika.version>
<slf4j.api.version>1.6.6</slf4j.api.version>
<slf4j.version>1.7.4</slf4j.version> <!-- sync with logback version -->
<logback.version>1.0.12</logback.version>
<distroDirectory>${project.basedir}/distro</distroDirectory>
<description>REST web service for Jackrabbit</description>
<warname>storagehub</warname>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<enunciate.version>2.14.0</enunciate.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-smartgears-bom</artifactId>
<version>LATEST</version>
<artifactId>gcube-smartgears-bom</artifactId>
<version>2.1.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@ -58,82 +49,85 @@
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-smartgears-app</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>authorization-control-library</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-encryption</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-encryption</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-model</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.data.access</groupId>
<artifactId>storagehub-script-utils</artifactId>
<version>[1.0.0, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.13.1</version>
<version>5.5.13.2</version>
</dependency>
<!-- needed to manage strange image types -->
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-jpeg</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-bmp</artifactId>
<version>3.3.2</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-core</artifactId>
<version>3.3.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.62</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>gxJRS</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<!-- JCR dependencies -->
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
@ -142,7 +136,7 @@
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-api</artifactId>
<version>${jackrabbit.version}</version>
<version>2.19.3</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
@ -154,139 +148,159 @@
<artifactId>jackrabbit-jcr-server</artifactId>
<version>${jackrabbit.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tika/tika-parsers -->
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>1.21</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tika/tika-core -->
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>1.21</version>
</dependency>
<!-- jersey -->
<!-- https://mvnrepository.com/artifact/net.bull.javamelody/javamelody-core -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0</version>
<groupId>net.bull.javamelody</groupId>
<artifactId>javamelody-core</artifactId>
<version>1.82.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers.glassfish</groupId>
<artifactId>jersey-gf-cdi</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>1.2</version>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.2</version>
<scope>provided</scope>
</dependency>
<!-- jersey & weld -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<!-- weld -->
<!-- https://mvnrepository.com/artifact/javax.interceptor/javax.interceptor-api -->
<dependency>
<groupId>javax.interceptor</groupId>
<artifactId>javax.interceptor-api</artifactId>
<version>1.2.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.enterprise/cdi-api -->
<dependency>
<groupId>javax.enterprise</groupId>
<artifactId>cdi-api</artifactId>
<version>1.1</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.inject/jersey-hk2 -->
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<version>2.30.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>jersey-cdi1x</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.ext.cdi</groupId>
<artifactId>jersey-cdi1x-servlet</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet</artifactId>
<version>2.2.10.Final</version>
<artifactId>weld-servlet-core</artifactId>
<version>3.1.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jboss/jandex -->
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jandex</artifactId>
<version>1.2.2.Final</version>
<version>2.2.2.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-common -->
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.3.0</version>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-jackson</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-multipart</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
<scope>runtime</scope>
</dependency>
<!-- Storage dependencies -->
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-core</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-wrapper</artifactId>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.10</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>16.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.17</version>
</dependency>
<dependency>
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-simple</artifactId>
<version>2.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
@ -299,7 +313,6 @@
<version>10.8.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.googlecode.jeeunit</groupId>
<artifactId>jeeunit</artifactId>
@ -312,21 +325,29 @@
<artifactId>gson</artifactId>
<version>2.7</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
<groupId>com.vlkan.rfos</groupId>
<artifactId>rotating-fos</artifactId>
<version>0.9.2</version>
</dependency>
<!-- enunciate deps -->
<dependency>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-core-annotations</artifactId>
<version>${enunciate.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-rt-util</artifactId>
<version>${enunciate.version}</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
<dependency>
<groupId>org.mockito</groupId>
@ -334,14 +355,11 @@
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
@ -354,24 +372,19 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>jersey-test-framework-core</artifactId>
<version>2.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-grizzly2</artifactId>
<version>2.13</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>${artifactId}</finalName>
<finalName>${project.artifactId}</finalName>
<pluginManagement>
<plugins>
<plugin>
@ -385,7 +398,6 @@
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>test-compile</goal>
@ -403,7 +415,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<version>1.14.0</version>
<configuration>
<complianceLevel>1.8</complianceLevel>
<source>1.8</source>
@ -433,7 +445,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
@ -454,32 +465,53 @@
<resources>
<resource>
<directory>${distroDirectory}</directory>
<filtering>true</filtering>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- Enunciate Maven plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>descriptor.xml</descriptor>
</descriptors>
</configuration>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-maven-plugin</artifactId>
<version>${enunciate.version}</version>
<configuration></configuration>
<executions>
<execution>
<id>servicearchive</id>
<phase>install</phase>
<id>assemble</id>
<goals>
<goal>single</goal>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Copy Enunciate Documentation from your-application/docs to your-application.war -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>copy-enunciate-docs</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<resources>
<resource>
<targetPath>${project.build.directory}/${project.artifactId}/api-docs</targetPath>
<directory>${project.build.directory}/api-docs</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID></ID>
<Type>Service</Type>
<Profile>
<Description>Storage Hub Webapp</Description>
<Class>DataAccess</Class>
<Name>${artifactId}</Name>
<Version>1.0.0</Version>
<Packages>
<Software>
<Name>${artifactId}</Name>
<Version>${version}</Version>
<MavenCoordinates>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
</MavenCoordinates>
<Files>
<File>${build.finalName}.jar</File>
</Files>
</Software>
</Packages>
</Profile>
</Resource>

View File

@ -1,112 +1,154 @@
package org.gcube.data.access.storagehub;
import org.apache.jackrabbit.api.security.user.Group;
import java.util.List;
import javax.inject.Inject;
import javax.inject.Singleton;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.security.AccessControlEntry;
import javax.jcr.security.Privilege;
import org.apache.jackrabbit.api.JackrabbitSession;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlList;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
import org.apache.jackrabbit.api.security.user.Group;
import org.apache.jackrabbit.api.security.user.UserManager;
import org.gcube.common.storagehub.model.Excludes;
import org.gcube.common.storagehub.model.acls.ACL;
import org.gcube.common.storagehub.model.acls.AccessType;
import org.gcube.common.storagehub.model.exceptions.BackendGenericError;
import org.gcube.common.storagehub.model.exceptions.InvalidCallParameters;
import org.gcube.common.storagehub.model.exceptions.UserNotAuthorizedException;
import org.gcube.common.storagehub.model.items.FolderItem;
import org.gcube.common.storagehub.model.items.Item;
import org.gcube.common.storagehub.model.items.SharedFolder;
import org.gcube.data.access.storagehub.handlers.Node2ItemConverter;
import org.gcube.common.storagehub.model.items.TrashItem;
import org.gcube.data.access.storagehub.handlers.items.Node2ItemConverter;
import org.gcube.data.access.storagehub.services.interfaces.ACLManagerInterface;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j;
/**
*
*
* the caller must be authorized, so i'm not passing the login also if it works on behalf of an user
*
*
*/
@Singleton
public class AuthorizationChecker {
private static Logger log = LoggerFactory.getLogger(AuthorizationChecker.class);
@Inject
Node2ItemConverter node2Item;
public void checkReadAuthorizationControl(Session session, String id) throws UserNotAuthorizedException , BackendGenericError, RepositoryException{
@Inject
PathUtil pathUtil;
@Inject
ACLManagerInterface aclManager;
public void checkReadAuthorizationControl(Session session, String userToCheck, String id) throws UserNotAuthorizedException , BackendGenericError, RepositoryException{
Node node = session.getNodeByIdentifier(id);
String login = AuthorizationProvider.instance.get().getClient().getId();
Item item = node2Item.getItem(node, Excludes.ALL);
if (item==null) throw new UserNotAuthorizedException("Insufficent Provileges for user "+login+" to read node with id "+id+": it's not a valid StorageHub node");
if (item==null) throw new UserNotAuthorizedException("Insufficent Privileges for user "+userToCheck+" to read node with id "+id+": it's not a valid StorageHub node");
//checking if the item is in the owner trash folder
if(item instanceof TrashItem && item.getParentPath().equals(pathUtil.getTrashPath(userToCheck, session).toPath()))
return;
if (!item.isShared() && item.getOwner()!=null && item.getOwner().equals(userToCheck)) return;
if (hasParentPublicFolder(session, item)) return;
//TODO: remove when messages will be passed to a new system
String parentPath = item.getParentPath();
if (parentPath.endsWith("hl:attachments") && (parentPath.contains("/OutBox/") || parentPath.contains("/InBox/"))) {