forked from gCubeSystem/gx-rest
Compare commits
11 Commits
Author | SHA1 | Date |
---|---|---|
Luca Frosini | eec32da4d7 | |
Mauro Mugnaini | b3af1e29f8 | |
Luca Frosini | 74cb5bdaa5 | |
luca.frosini | 0d7b341f8e | |
Mauro Mugnaini | 88d588b29c | |
Luca Frosini | 4bd280b1c5 | |
Luca Frosini | d615a454bb | |
Luca Frosini | 1da0e27c42 | |
Luca Frosini | 2be6f3b7fd | |
Luca Frosini | 8573d2c6e3 | |
Lucio Lelii | 66ce9b8a23 |
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
|
||||||
</classpath>
|
|
|
@ -1,3 +1,7 @@
|
||||||
token.*
|
token.*
|
||||||
.svn
|
.svn
|
||||||
target
|
target
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
/.DS_Store
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<annotationProcessing>
|
|
||||||
<profile name="Maven default annotation processors profile" enabled="true">
|
|
||||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
|
||||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
|
||||||
<outputRelativeToContentRoot value="true" />
|
|
||||||
<module name="gxHTTP" />
|
|
||||||
<module name="gxJRS" />
|
|
||||||
</profile>
|
|
||||||
</annotationProcessing>
|
|
||||||
<bytecodeTargetLevel>
|
|
||||||
<module name="gx-rest" target="1.8" />
|
|
||||||
<module name="gxHTTP" target="1.8" />
|
|
||||||
<module name="gxJRS" target="1.8" />
|
|
||||||
</bytecodeTargetLevel>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Encoding">
|
|
||||||
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/gxHTTP" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/gxJRS" charset="UTF-8" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: ch.qos.logback:logback-classic:1.0.13">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-classic/1.0.13/logback-classic-1.0.13-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: ch.qos.logback:logback-core:1.0.13">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.0.13/logback-core-1.0.13.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.0.13/logback-core-1.0.13-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/ch/qos/logback/logback-core/1.0.13/logback-core-1.0.13-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.6.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: com.fasterxml.jackson.core:jackson-core:2.6.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.6.0/jackson-core-2.6.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.6.0/jackson-core-2.6.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.6.0/jackson-core-2.6.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: com.fasterxml.jackson.core:jackson-databind:2.6.0">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.6.0/jackson-databind-2.6.0.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.6.0/jackson-databind-2.6.0-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.6.0/jackson-databind-2.6.0-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: javax.annotation:javax.annotation-api:1.2">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: javax.ws.rs:javax.ws.rs-api:2.0.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/javax/ws/rs/javax.ws.rs-api/2.0.1/javax.ws.rs-api-2.0.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/javax/ws/rs/javax.ws.rs-api/2.0.1/javax.ws.rs-api-2.0.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/javax/ws/rs/javax.ws.rs-api/2.0.1/javax.ws.rs-api-2.0.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: junit:junit:4.12">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/junit/junit/4.12/junit-4.12-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.gcube.common:authorization-client:2.0.7">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/common/authorization-client/2.0.7/authorization-client-2.0.7.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/common/authorization-client/2.0.7/authorization-client-2.0.7-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/common/authorization-client/2.0.7/authorization-client-2.0.7-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.gcube.common:common-authorization:2.3.0-SNAPSHOT">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/common/common-authorization/2.3.0-SNAPSHOT/common-authorization-2.3.0-20200529.152306-2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/common/common-authorization/2.3.0-SNAPSHOT/common-authorization-2.3.0-20200529.152306-2-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/common/common-authorization/2.3.0-SNAPSHOT/common-authorization-2.3.0-20200529.152306-2-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.gcube.core:common-configuration-scanner:1.1.0-SNAPSHOT">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-configuration-scanner/1.1.0-SNAPSHOT/common-configuration-scanner-1.1.0-20191018.142430-3176.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-configuration-scanner/1.1.0-SNAPSHOT/common-configuration-scanner-1.1.0-20191018.142430-3176-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-configuration-scanner/1.1.0-SNAPSHOT/common-configuration-scanner-1.1.0-20191018.142430-3176-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.gcube.core:common-scope:1.3.0-SNAPSHOT">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-scope/1.3.0-SNAPSHOT/common-scope-1.3.0-20200408.084938-5.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-scope/1.3.0-SNAPSHOT/common-scope-1.3.0-20200408.084938-5-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-scope/1.3.0-SNAPSHOT/common-scope-1.3.0-20200408.084938-5-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.gcube.core:common-scope-maps:1.2.2-SNAPSHOT">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-scope-maps/1.2.2-SNAPSHOT/common-scope-maps-1.2.2-20200402.091534-2.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-scope-maps/1.2.2-SNAPSHOT/common-scope-maps-1.2.2-20200402.091534-2-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/gcube/core/common-scope-maps/1.2.2-SNAPSHOT/common-scope-maps-1.2.2-20200402.091534-2-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.hk2.external:aopalliance-repackaged:2.5.0-b32">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/external/aopalliance-repackaged/2.5.0-b32/aopalliance-repackaged-2.5.0-b32.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/external/aopalliance-repackaged/2.5.0-b32/aopalliance-repackaged-2.5.0-b32-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/external/aopalliance-repackaged/2.5.0-b32/aopalliance-repackaged-2.5.0-b32-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.hk2.external:javax.inject:2.5.0-b32">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/external/javax.inject/2.5.0-b32/javax.inject-2.5.0-b32.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/external/javax.inject/2.5.0-b32/javax.inject-2.5.0-b32-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/external/javax.inject/2.5.0-b32/javax.inject-2.5.0-b32-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.hk2:hk2-api:2.5.0-b32">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-api/2.5.0-b32/hk2-api-2.5.0-b32.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-api/2.5.0-b32/hk2-api-2.5.0-b32-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-api/2.5.0-b32/hk2-api-2.5.0-b32-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.hk2:hk2-locator:2.5.0-b32">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-locator/2.5.0-b32/hk2-locator-2.5.0-b32.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-locator/2.5.0-b32/hk2-locator-2.5.0-b32-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-locator/2.5.0-b32/hk2-locator-2.5.0-b32-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.hk2:hk2-utils:2.5.0-b32">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-utils/2.5.0-b32/hk2-utils-2.5.0-b32.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-utils/2.5.0-b32/hk2-utils-2.5.0-b32-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/hk2-utils/2.5.0-b32/hk2-utils-2.5.0-b32-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.hk2:osgi-resource-locator:1.0.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/hk2/osgi-resource-locator/1.0.1/osgi-resource-locator-1.0.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.jersey.bundles.repackaged:jersey-guava:2.25.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.25.1/jersey-guava-2.25.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.25.1/jersey-guava-2.25.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/bundles/repackaged/jersey-guava/2.25.1/jersey-guava-2.25.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.jersey.core:jersey-client:2.25.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/core/jersey-client/2.25.1/jersey-client-2.25.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/core/jersey-client/2.25.1/jersey-client-2.25.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/core/jersey-client/2.25.1/jersey-client-2.25.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.jersey.core:jersey-common:2.25.1">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/core/jersey-common/2.25.1/jersey-common-2.25.1.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/core/jersey-common/2.25.1/jersey-common-2.25.1-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/core/jersey-common/2.25.1/jersey-common-2.25.1-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.glassfish.jersey.inject:jersey-hk2:2.27">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/inject/jersey-hk2/2.27/jersey-hk2-2.27.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/inject/jersey-hk2/2.27/jersey-hk2-2.27-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/glassfish/jersey/inject/jersey-hk2/2.27/jersey-hk2-2.27-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.hamcrest:hamcrest-core:1.3">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.javassist:javassist:3.20.0-GA">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/javassist/javassist/3.20.0-GA/javassist-3.20.0-GA-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<component name="libraryTable">
|
|
||||||
<library name="Maven: org.slf4j:slf4j-api:1.7.25">
|
|
||||||
<CLASSES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar!/" />
|
|
||||||
</CLASSES>
|
|
||||||
<JAVADOC>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-javadoc.jar!/" />
|
|
||||||
</JAVADOC>
|
|
||||||
<SOURCES>
|
|
||||||
<root url="jar://$MAVEN_REPOSITORY$/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25-sources.jar!/" />
|
|
||||||
</SOURCES>
|
|
||||||
</library>
|
|
||||||
</component>
|
|
23
.project
23
.project
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>gxREST</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -1,2 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
encoding/<project>=UTF-8
|
|
|
@ -2,6 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for gxREST
|
# Changelog for gxREST
|
||||||
|
|
||||||
|
## [v2.0.0-SNAPSHOT]
|
||||||
|
|
||||||
|
- removed all the old providers
|
||||||
|
- removed set of gcube headers
|
||||||
|
- removed isExtCall because authorization headers are not added automatically anymore
|
||||||
|
|
||||||
## [v1.2.0]
|
## [v1.2.0]
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
/.classpath
|
/.classpath
|
||||||
/bin/
|
/bin/
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
target/
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>gxHTTP</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -1,6 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
encoding//src/main/java=UTF-8
|
|
||||||
encoding//src/main/resources=UTF-8
|
|
||||||
encoding//src/test/java=UTF-8
|
|
||||||
encoding//src/test/resources=UTF-8
|
|
||||||
encoding/<project>=UTF-8
|
|
|
@ -1,8 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
|
||||||
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
|
|
|
@ -2,6 +2,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for gxHTTP
|
# Changelog for gxHTTP
|
||||||
|
|
||||||
|
## [v2.0.0-SNAPSHOT]
|
||||||
|
|
||||||
|
- removed all the old providers
|
||||||
|
- removed set of gcube headers
|
||||||
|
- removed isExtCall because authorization headers are not added automatically anymore
|
||||||
|
|
||||||
|
|
||||||
## [v1.2.0]
|
## [v1.2.0]
|
||||||
|
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
|
|
||||||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
|
|
||||||
<output url="file://$MODULE_DIR$/target/classes" />
|
|
||||||
<output-test url="file://$MODULE_DIR$/target/test-classes" />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="library" name="Maven: org.gcube.common:authorization-client:2.0.7" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.gcube.common:common-authorization:2.3.0-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.gcube.core:common-scope:1.3.0-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.gcube.core:common-configuration-scanner:1.1.0-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" name="Maven: org.gcube.core:common-scope-maps:1.2.2-SNAPSHOT" level="project" />
|
|
||||||
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.7.25" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
|
|
||||||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
|
@ -7,7 +7,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gxREST</artifactId>
|
<artifactId>gxREST</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>gxHTTP</artifactId>
|
<artifactId>gxHTTP</artifactId>
|
||||||
|
@ -28,15 +28,9 @@
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.common</groupId>
|
|
||||||
<artifactId>authorization-client</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<scope>provided</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
|
@ -45,6 +39,5 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -14,8 +14,6 @@ import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
||||||
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
|
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -53,8 +51,7 @@ public class GXConnection {
|
||||||
private String body;
|
private String body;
|
||||||
private InputStream bodyAsStream;
|
private InputStream bodyAsStream;
|
||||||
private Map<String, String> properties = new HashMap<>();
|
private Map<String, String> properties = new HashMap<>();
|
||||||
private boolean extCall = false;
|
|
||||||
|
|
||||||
public GXConnection(String address) {
|
public GXConnection(String address) {
|
||||||
this.address = address;
|
this.address = address;
|
||||||
}
|
}
|
||||||
|
@ -119,28 +116,11 @@ public class GXConnection {
|
||||||
public HttpURLConnection send(HTTPMETHOD method) throws Exception {
|
public HttpURLConnection send(HTTPMETHOD method) throws Exception {
|
||||||
return send(this.buildURL(), method);
|
return send(this.buildURL(), method);
|
||||||
}
|
}
|
||||||
|
|
||||||
private HttpURLConnection addGCubeAuthorizationToken(HttpURLConnection uConn) throws Exception {
|
|
||||||
if (!this.extCall) {
|
|
||||||
String oldGcubeAuthToken = SecurityTokenProvider.instance.get();
|
|
||||||
if (Objects.isNull(oldGcubeAuthToken) || oldGcubeAuthToken.isEmpty()) {
|
|
||||||
String umaToken = AccessTokenProvider.instance.get();
|
|
||||||
if(Objects.isNull(umaToken) || umaToken.isEmpty()) {
|
|
||||||
throw new IllegalStateException("The security token in the current environment is null.");
|
|
||||||
}else {
|
|
||||||
uConn.setRequestProperty("Authorization", "Bearer " + umaToken);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
uConn.setRequestProperty(org.gcube.common.authorization.client.Constants.TOKEN_HEADER_ENTRY, oldGcubeAuthToken);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return uConn;
|
|
||||||
}
|
|
||||||
|
|
||||||
private HttpURLConnection send(URL url, HTTPMETHOD method) throws Exception {
|
private HttpURLConnection send(URL url, HTTPMETHOD method) throws Exception {
|
||||||
HttpURLConnection uConn = (HttpURLConnection) url.openConnection();
|
HttpURLConnection uConn = (HttpURLConnection) url.openConnection();
|
||||||
|
|
||||||
uConn = addGCubeAuthorizationToken(uConn);
|
//uConn = addGCubeAuthorizationToken(uConn);
|
||||||
|
|
||||||
uConn.setDoOutput(true);
|
uConn.setDoOutput(true);
|
||||||
// uConn.setRequestProperty("Content-type", APPLICATION_JSON_CHARSET_UTF_8);
|
// uConn.setRequestProperty("Content-type", APPLICATION_JSON_CHARSET_UTF_8);
|
||||||
|
@ -258,19 +238,5 @@ public class GXConnection {
|
||||||
public void setProperty(String name, String value) {
|
public void setProperty(String name, String value) {
|
||||||
this.properties.put(name, value);
|
this.properties.put(name, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param extCall the extCall to set
|
|
||||||
*/
|
|
||||||
public void setExtCall(boolean extCall) {
|
|
||||||
this.extCall = extCall;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the extCall
|
|
||||||
*/
|
|
||||||
public boolean isExtCall() {
|
|
||||||
return extCall;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,17 +85,6 @@ public interface GXHTTP<BODY,RESPONSE> {
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
RESPONSE connect() throws Exception;
|
RESPONSE connect() throws Exception;
|
||||||
|
|
||||||
/**
|
|
||||||
* Overrides the default security token.
|
|
||||||
* @param token the new token
|
|
||||||
*/
|
|
||||||
void setSecurityToken(String token);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* States if the service being called in an external service (not gCube).
|
|
||||||
* @param ext true if external, false otherwise
|
|
||||||
*/
|
|
||||||
void isExternalCall(boolean ext);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,8 @@ import java.io.UnsupportedEncodingException;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import org.gcube.common.gxhttp.reference.GXConnection.HTTPMETHOD;
|
import org.gcube.common.gxhttp.reference.GXConnection.HTTPMETHOD;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -78,24 +77,7 @@ public class GXHTTPRequestBuilder {
|
||||||
|
|
||||||
public static final String UUID_REGEX = "^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}-[a-fA-F0-9]{8,9}){1}$";
|
public static final String UUID_REGEX = "^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}-[a-fA-F0-9]{8,9}){1}$";
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overrides the default security token.
|
|
||||||
*
|
|
||||||
* @param token
|
|
||||||
*/
|
|
||||||
public void setSecurityToken(String token) {
|
|
||||||
if (!this.connection.isExtCall()) {
|
|
||||||
if(Pattern.matches(UUID_REGEX, token)) {
|
|
||||||
this.connection.setProperty(org.gcube.common.authorization.client.Constants.TOKEN_HEADER_ENTRY, token);
|
|
||||||
}else {
|
|
||||||
this.connection.setProperty("Authorization", "Bearer " + token);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
throw new UnsupportedOperationException("Cannot set the security token on an external call");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add headers to the request.
|
* Add headers to the request.
|
||||||
*
|
*
|
||||||
|
@ -205,12 +187,4 @@ public class GXHTTPRequestBuilder {
|
||||||
return this.connection.send(HTTPMETHOD.CONNECT);
|
return this.connection.send(HTTPMETHOD.CONNECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.gcube.common.gxrest.request.GXHTTP#isExternalCall(boolean)
|
|
||||||
*/
|
|
||||||
public void isExternalCall(boolean ext) {
|
|
||||||
this.connection.setExtCall(ext);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,20 +83,6 @@ class GXHTTPCommonRequest {
|
||||||
public HttpURLConnection connect() throws Exception {
|
public HttpURLConnection connect() throws Exception {
|
||||||
return builder.connect();
|
return builder.connect();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.gcube.common.gxhttp.reference.GXHTTP#setSecurityToken(java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setSecurityToken(String token) {
|
|
||||||
builder.setSecurityToken(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.gcube.common.gxhttp.reference.GXHTTP#isExternalCall(boolean)
|
|
||||||
*/
|
|
||||||
public void isExternalCall(boolean ext) {
|
|
||||||
builder.isExternalCall(ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear up the request.
|
* Clear up the request.
|
||||||
|
|
|
@ -10,15 +10,9 @@ import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
import org.gcube.common.authorization.client.Constants;
|
|
||||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
|
||||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
||||||
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
|
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
|
||||||
import org.gcube.common.gxhttp.util.ContentUtils;
|
import org.gcube.common.gxhttp.util.ContentUtils;
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,30 +50,6 @@ public class GXHTTPStringRequestTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@BeforeClass
|
|
||||||
public static void beforeClass() throws Exception {
|
|
||||||
setContext(DEFAULT_TEST_SCOPE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setContext(String token) throws ObjectNotFound, Exception {
|
|
||||||
if (DEFAULT_TEST_SCOPE.isEmpty()) {
|
|
||||||
skipTest = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
SecurityTokenProvider.instance.set(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
|
||||||
AuthorizationEntry authorizationEntry = Constants.authorizationService().get(token);
|
|
||||||
String context = authorizationEntry.getContext();
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
|
||||||
public static void afterClass() throws Exception {
|
|
||||||
SecurityTokenProvider.instance.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test method for {@link org.gcube.common.gxhttp.request.GXHTTPStringRequest#newRequest(java.lang.String)}.
|
* Test method for {@link org.gcube.common.gxhttp.request.GXHTTPStringRequest#newRequest(java.lang.String)}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,2 +1,5 @@
|
||||||
/.classpath
|
/.classpath
|
||||||
/bin/
|
/bin/
|
||||||
|
.project
|
||||||
|
.settings/
|
||||||
|
target/
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>gxRest</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -1,6 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
encoding//src/main/java=UTF-8
|
|
||||||
encoding//src/main/resources=UTF-8
|
|
||||||
encoding//src/test/java=UTF-8
|
|
||||||
encoding//src/test/resources=UTF-8
|
|
||||||
encoding/<project>=UTF-8
|
|
|
@ -1,8 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
|
||||||
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
|
|
|
@ -2,6 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for gxJRS
|
# Changelog for gxJRS
|
||||||
|
|
||||||
|
## [v2.0.0-SNAPSHOT]
|
||||||
|
|
||||||
|
- removed all the old providers
|
||||||
|
- removed set of gcube headers
|
||||||
|
- removed isExtCall because authorization headers are not added automatically anymore
|
||||||
|
|
||||||
## [v1.2.0]
|
## [v1.2.0]
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gxREST</artifactId>
|
<artifactId>gxREST</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>gxJRS</artifactId>
|
<artifactId>gxJRS</artifactId>
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>gcube-bom</artifactId>
|
<artifactId>gcube-bom</artifactId>
|
||||||
<version>2.0.1</version>
|
<version>3.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -54,11 +54,6 @@
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gxHTTP</artifactId>
|
<artifactId>gxHTTP</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.common</groupId>
|
|
||||||
<artifactId>authorization-client</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gcube-jackson-databind</artifactId>
|
<artifactId>gcube-jackson-databind</artifactId>
|
||||||
|
@ -67,15 +62,10 @@
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gcube-jackson-core</artifactId>
|
<artifactId>gcube-jackson-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
<!-- <dependency> -->
|
<groupId>org.slf4j</groupId>
|
||||||
<!-- <groupId>com.fasterxml.jackson.core</groupId> -->
|
<artifactId>slf4j-api</artifactId>
|
||||||
<!-- <artifactId>jackson-core</artifactId> -->
|
</dependency>
|
||||||
<!-- </dependency> -->
|
|
||||||
<!-- <dependency> -->
|
|
||||||
<!-- <groupId>com.fasterxml.jackson.core</groupId> -->
|
|
||||||
<!-- <artifactId>jackson-databind</artifactId> -->
|
|
||||||
<!-- </dependency> -->
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Test Dependency -->
|
<!-- Test Dependency -->
|
||||||
|
@ -104,19 +94,4 @@
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-servicearchive</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -137,22 +137,6 @@ public class GXHTTPStreamRequest implements GXHTTP<InputStream,GXInboundResponse
|
||||||
return new GXInboundResponse(builder.connect());
|
return new GXInboundResponse(builder.connect());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.gcube.common.gxrest.request.GXHTTP#setSecurityToken(java.lang.String)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setSecurityToken(String token) {
|
|
||||||
builder.setSecurityToken(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.gcube.common.gxrest.request.GXHTTP#isExternalCall(boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void isExternalCall(boolean ext) {
|
|
||||||
builder.isExternalCall(ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string
|
* @param string
|
||||||
* @return the request
|
* @return the request
|
||||||
|
|
|
@ -155,22 +155,6 @@ public class GXHTTPStringRequest implements GXHTTP<String,GXInboundResponse> {
|
||||||
return new GXInboundResponse(builder.connect());
|
return new GXInboundResponse(builder.connect());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.gcube.common.gxrest.request.GXHTTP#setSecurityToken(java.lang.String)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setSecurityToken(String token) {
|
|
||||||
builder.setSecurityToken(token);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.gcube.common.gxrest.request.GXHTTP#isExternalCall(boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void isExternalCall(boolean ext) {
|
|
||||||
builder.isExternalCall(ext);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string
|
* @param string
|
||||||
|
|
|
@ -7,8 +7,8 @@ import java.security.NoSuchAlgorithmException;
|
||||||
import java.security.cert.CertificateException;
|
import java.security.cert.CertificateException;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.net.ssl.HostnameVerifier;
|
import javax.net.ssl.HostnameVerifier;
|
||||||
import javax.net.ssl.SSLContext;
|
import javax.net.ssl.SSLContext;
|
||||||
|
@ -25,7 +25,6 @@ import javax.ws.rs.core.MultivaluedHashMap;
|
||||||
import javax.ws.rs.core.MultivaluedMap;
|
import javax.ws.rs.core.MultivaluedMap;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
||||||
import org.gcube.common.gxhttp.reference.GXConnection;
|
import org.gcube.common.gxhttp.reference.GXConnection;
|
||||||
import org.gcube.common.gxhttp.reference.GXHTTP;
|
import org.gcube.common.gxhttp.reference.GXHTTP;
|
||||||
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
||||||
|
@ -45,7 +44,6 @@ public class GXWebTargetAdapterRequest implements GXHTTP<Entity<?>,GXInboundResp
|
||||||
private static final Logger logger = LoggerFactory.getLogger(GXWebTargetAdapterRequest.class);
|
private static final Logger logger = LoggerFactory.getLogger(GXWebTargetAdapterRequest.class);
|
||||||
private MediaType[] mediaType;
|
private MediaType[] mediaType;
|
||||||
MultivaluedMap<String, Object> headers = new MultivaluedHashMap<String, Object>();
|
MultivaluedMap<String, Object> headers = new MultivaluedHashMap<String, Object>();
|
||||||
private boolean extCall = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new request.
|
* Creates a new request.
|
||||||
|
@ -121,26 +119,9 @@ public class GXWebTargetAdapterRequest implements GXHTTP<Entity<?>,GXInboundResp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.adaptee = client.target(address);
|
this.adaptee = client.target(address);
|
||||||
this.headers.add(org.gcube.common.authorization.client.Constants.TOKEN_HEADER_ENTRY,
|
|
||||||
SecurityTokenProvider.instance.get());
|
|
||||||
this.headers.add("User-Agent", this.getClass().getSimpleName());
|
this.headers.add("User-Agent", this.getClass().getSimpleName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Overrides the default security token.
|
|
||||||
*
|
|
||||||
* @param token
|
|
||||||
* the new token
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void setSecurityToken(String token) {
|
|
||||||
if (!this.extCall)
|
|
||||||
this.headers.add(org.gcube.common.authorization.client.Constants.TOKEN_HEADER_ENTRY, token);
|
|
||||||
|
|
||||||
else
|
|
||||||
throw new UnsupportedOperationException("Cannot set the security token on an external call");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the identity user agent associated to the request.
|
* Sets the identity user agent associated to the request.
|
||||||
*
|
*
|
||||||
|
@ -405,13 +386,4 @@ public class GXWebTargetAdapterRequest implements GXHTTP<Entity<?>,GXInboundResp
|
||||||
throw new UnsupportedOperationException("WebTarget does not support CONNECT");
|
throw new UnsupportedOperationException("WebTarget does not support CONNECT");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see org.gcube.common.gxrest.request.GXHTTP#isExternalCall(boolean)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void isExternalCall(boolean ext) {
|
|
||||||
this.extCall = ext;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class GXInboundResponse {
|
||||||
// ContentUtils.toByteArray(connection.getInputStream());
|
// ContentUtils.toByteArray(connection.getInputStream());
|
||||||
if (this.contentType.equals(MediaType.TEXT_PLAIN)
|
if (this.contentType.equals(MediaType.TEXT_PLAIN)
|
||||||
|| this.contentType.equals(MediaType.APPLICATION_JSON)) {
|
|| this.contentType.equals(MediaType.APPLICATION_JSON)) {
|
||||||
this.body = ContentUtils.toString(ContentUtils.toByteArray(connection.getInputStream()));
|
this.body = ContentUtils.toString(ContentUtils.toByteArray(getInputStream()));
|
||||||
logger.trace("Response's content: " + this.body);
|
logger.trace("Response's content: " + this.body);
|
||||||
this.contentAlreadyConsumed = true;
|
this.contentAlreadyConsumed = true;
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ public class GXInboundResponse {
|
||||||
if(!this.contentAlreadyConsumed) {
|
if(!this.contentAlreadyConsumed) {
|
||||||
if (this.fromConnection) {
|
if (this.fromConnection) {
|
||||||
contentAlreadyConsumed = true;
|
contentAlreadyConsumed = true;
|
||||||
return connection.getInputStream();
|
return isSuccessResponse() ? connection.getInputStream() : connection.getErrorStream();
|
||||||
} else if (this.fromResponse) {
|
} else if (this.fromResponse) {
|
||||||
contentAlreadyConsumed = true;
|
contentAlreadyConsumed = true;
|
||||||
return (InputStream) source.getEntity();
|
return (InputStream) source.getEntity();
|
||||||
|
|
|
@ -10,10 +10,6 @@ import java.util.Properties;
|
||||||
import java.util.WeakHashMap;
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
import org.gcube.com.fasterxml.jackson.databind.JsonMappingException;
|
import org.gcube.com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import org.gcube.common.authorization.client.Constants;
|
|
||||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
|
||||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
||||||
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -62,23 +58,17 @@ public class GXHTTPStringRequestTest {
|
||||||
setContext(DEFAULT_TEST_SCOPE);
|
setContext(DEFAULT_TEST_SCOPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setContext(String token) throws ObjectNotFound, Exception {
|
public static void setContext(String token) throws Exception {
|
||||||
if (DEFAULT_TEST_SCOPE.isEmpty()) {
|
if (DEFAULT_TEST_SCOPE.isEmpty()) {
|
||||||
skipTest = true;
|
skipTest = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SecurityTokenProvider.instance.set(token);
|
//SecurityTokenProvider.instance.set(token);
|
||||||
}
|
|
||||||
|
|
||||||
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
|
||||||
AuthorizationEntry authorizationEntry = Constants.authorizationService().get(token);
|
|
||||||
String context = authorizationEntry.getContext();
|
|
||||||
return context;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void afterClass() throws Exception {
|
public static void afterClass() throws Exception {
|
||||||
SecurityTokenProvider.instance.reset();
|
//SecurityTokenProvider.instance.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,9 +1,17 @@
|
||||||
package org.gcube.common.gxrest.request;
|
package org.gcube.common.gxrest.request;
|
||||||
|
|
||||||
import org.gcube.common.authorization.client.Constants;
|
import static org.junit.Assert.assertTrue;
|
||||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
import static org.junit.Assert.fail;
|
||||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
|
import javax.ws.rs.client.Entity;
|
||||||
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -12,17 +20,6 @@ import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.junit.runners.BlockJUnit4ClassRunner;
|
import org.junit.runners.BlockJUnit4ClassRunner;
|
||||||
|
|
||||||
import javax.ws.rs.client.Entity;
|
|
||||||
import javax.ws.rs.core.MediaType;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.WeakHashMap;
|
|
||||||
|
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
import static org.junit.Assert.fail;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test cases for {@link GXWebTargetAdapterRequest#newHTTPSRequest(String)}
|
* Test cases for {@link GXWebTargetAdapterRequest#newHTTPSRequest(String)}
|
||||||
*
|
*
|
||||||
|
@ -65,24 +62,18 @@ public class GXWebTargetAdapterHTTPSRequestTest {
|
||||||
setContext(DEFAULT_TEST_SCOPE);
|
setContext(DEFAULT_TEST_SCOPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setContext(String token) throws ObjectNotFound, Exception {
|
public static void setContext(String token) throws Exception {
|
||||||
if (skipTest || DEFAULT_TEST_SCOPE.isEmpty()) {
|
if (skipTest || DEFAULT_TEST_SCOPE.isEmpty()) {
|
||||||
skipTest = true;
|
skipTest = true;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
SecurityTokenProvider.instance.set(token);
|
//SecurityTokenProvider.instance.set(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
|
||||||
AuthorizationEntry authorizationEntry = Constants.authorizationService().get(token);
|
|
||||||
String context = authorizationEntry.getContext();
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void afterClass() throws Exception {
|
public static void afterClass() throws Exception {
|
||||||
SecurityTokenProvider.instance.reset();
|
//SecurityTokenProvider.instance.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.common.gxrest.request;
|
package org.gcube.common.gxrest.request;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.assertTrue;
|
||||||
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
@ -11,10 +12,6 @@ import java.util.WeakHashMap;
|
||||||
import javax.ws.rs.client.Entity;
|
import javax.ws.rs.client.Entity;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
|
|
||||||
import org.gcube.common.authorization.client.Constants;
|
|
||||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
|
||||||
import org.gcube.common.authorization.library.AuthorizationEntry;
|
|
||||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
||||||
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
import org.gcube.common.gxrest.response.inbound.GXInboundResponse;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
|
@ -62,24 +59,19 @@ public class GXWebTargetAdapterRequestTest {
|
||||||
setContext(DEFAULT_TEST_SCOPE);
|
setContext(DEFAULT_TEST_SCOPE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setContext(String token) throws ObjectNotFound, Exception {
|
public static void setContext(String token) throws Exception {
|
||||||
if (skipTest || DEFAULT_TEST_SCOPE.isEmpty()) {
|
if (skipTest || DEFAULT_TEST_SCOPE.isEmpty()) {
|
||||||
skipTest = true;
|
skipTest = true;
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
SecurityTokenProvider.instance.set(token);
|
//SecurityTokenProvider.instance.set(token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCurrentScope(String token) throws ObjectNotFound, Exception {
|
|
||||||
AuthorizationEntry authorizationEntry = Constants.authorizationService().get(token);
|
|
||||||
String context = authorizationEntry.getContext();
|
|
||||||
return context;
|
|
||||||
}
|
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void afterClass() throws Exception {
|
public static void afterClass() throws Exception {
|
||||||
SecurityTokenProvider.instance.reset();
|
//SecurityTokenProvider.instance.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
gxREST
|
|
|
@ -1,14 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerConfiguration">
|
|
||||||
<annotationProcessing>
|
|
||||||
<profile name="Maven default annotation processors profile" enabled="true">
|
|
||||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
|
||||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
|
||||||
<outputRelativeToContentRoot value="true" />
|
|
||||||
<module name="gxHTTP" />
|
|
||||||
<module name="gxJRS" />
|
|
||||||
</profile>
|
|
||||||
</annotationProcessing>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="Encoding">
|
|
||||||
<file url="file://$PROJECT_DIR$/.." charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/../gxHTTP" charset="UTF-8" />
|
|
||||||
<file url="file://$PROJECT_DIR$/../gxJRS" charset="UTF-8" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,35 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
|
||||||
<component name="MavenProjectsManager">
|
|
||||||
<option name="originalFiles">
|
|
||||||
<list>
|
|
||||||
<option value="$PROJECT_DIR$/../pom.xml" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
<component name="SvnBranchConfigurationManager">
|
|
||||||
<option name="myConfigurationMap">
|
|
||||||
<map>
|
|
||||||
<entry key="$PROJECT_DIR$/..">
|
|
||||||
<value>
|
|
||||||
<SvnBranchConfiguration>
|
|
||||||
<option name="branchUrls">
|
|
||||||
<list>
|
|
||||||
<option value="https://svn.d4science.research-infrastructures.eu/gcube/branches" />
|
|
||||||
<option value="https://svn.d4science.research-infrastructures.eu/gcube/misc" />
|
|
||||||
<option value="https://svn.d4science.research-infrastructures.eu/gcube/private" />
|
|
||||||
<option value="https://svn.d4science.research-infrastructures.eu/gcube/tags" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
<option name="trunkUrl" value="https://svn.d4science.research-infrastructures.eu/gcube/trunk" />
|
|
||||||
</SvnBranchConfiguration>
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
|
||||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
6
pom.xml
6
pom.xml
|
@ -5,12 +5,12 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.gcube.tools</groupId>
|
<groupId>org.gcube.tools</groupId>
|
||||||
<artifactId>maven-parent</artifactId>
|
<artifactId>maven-parent</artifactId>
|
||||||
<version>1.1.0</version>
|
<version>1.2.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>gxREST</artifactId>
|
<artifactId>gxREST</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>2.0.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>gCube eXtensions to REST</name>
|
<name>gCube eXtensions to REST</name>
|
||||||
<description>gCube eXtensions to REST</description>
|
<description>gCube eXtensions to REST</description>
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>gcube-bom</artifactId>
|
<artifactId>gcube-bom</artifactId>
|
||||||
<version>2.0.1</version>
|
<version>3.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
Loading…
Reference in New Issue