summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml32
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java6
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java2
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/SessionContextFilter.java45
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml23
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/spring-mapper-servlet.xml13
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml34
7 files changed, 133 insertions, 22 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
index 84c4eb408a..32975b3ebf 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/pom.xml
@@ -16,13 +16,23 @@
<dependencies>
<dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>item-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.openecomp.sdc.onboarding</groupId>
<artifactId>vendor-license-rest-services</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openecomp.sdc</groupId>
- <artifactId>activity-log-rest-services</artifactId>
+ <artifactId>openecomp-sdc-notification-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>openecomp-sdc-notification-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -42,6 +52,21 @@
</dependency>
<dependency>
<groupId>org.openecomp.sdc</groupId>
+ <artifactId>conflict-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>item-permissions-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
+ <artifactId>notifications-rest-services</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.openecomp.sdc</groupId>
<artifactId>application-config-rest-services</artifactId>
<version>${project.version}</version>
</dependency>
@@ -108,6 +133,11 @@
</dependency>
<dependency>
<groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>${spring.framework.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.framework.version}</version>
</dependency>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
index 18465cd00c..e10f6a57ab 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java
@@ -23,9 +23,6 @@ package org.openecomp.server.filters;
import org.openecomp.sdc.logging.api.Logger;
import org.openecomp.sdc.logging.api.LoggerFactory;
-import java.io.IOException;
-import java.security.Principal;
-import java.util.Base64;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -35,6 +32,9 @@ import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.security.Principal;
+import java.util.Base64;
public class ActionAuthenticationFilter implements Filter {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
index 82e4fa80d9..f54b06d46a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthorizationFilter.java
@@ -20,7 +20,6 @@
package org.openecomp.server.filters;
-import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
@@ -29,6 +28,7 @@ import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
public class ActionAuthorizationFilter implements Filter {
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/SessionContextFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/SessionContextFilter.java
new file mode 100644
index 0000000000..b317fa6bf5
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/SessionContextFilter.java
@@ -0,0 +1,45 @@
+package org.openecomp.server.filters;
+
+import org.openecomp.sdc.common.session.SessionContextProvider;
+import org.openecomp.sdc.common.session.SessionContextProviderFactory;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+
+import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM;
+
+public class SessionContextFilter implements Filter {
+ @Override
+ public void init(FilterConfig filterConfig) throws ServletException {
+
+ }
+
+ @Override
+ public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
+ FilterChain filterChain) throws IOException, ServletException {
+ SessionContextProvider contextProvider =
+ SessionContextProviderFactory.getInstance().createInterface();
+
+ try {
+ if (servletRequest instanceof HttpServletRequest) {
+ String userName = ((HttpServletRequest) servletRequest).getHeader(USER_ID_HEADER_PARAM);
+ contextProvider.create(userName);
+ }
+
+ filterChain.doFilter(servletRequest, servletResponse);
+ } finally {
+ contextProvider.close();
+ }
+ }
+
+ @Override
+ public void destroy() {
+
+ }
+}
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
index 8f4a2db73e..e43fa017d8 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/beans-services.xml
@@ -36,24 +36,14 @@
<!-- aspect beans -->
<bean id = "healthCheck" class="org.openecomp.sdcrests.health.rest.services.HealthCheckImpl"/>
- <!--aop:config>
- < aspect pointcuts>
- <aop:pointcut id="loggingDebugPointcut" expression="execution(* org.openecomp.sdc.*.*.*(..))"/>
-
- <advices>
- <aop:aspect id="logDebugAspect" ref="debugAspect">
- <aop:before pointcut-ref="loggingDebugPointcut" method="debugEnterMethod"/>
- <aop:after-returning pointcut-ref="loggingDebugPointcut" method="debugExitMethod"/>
- </aop:aspect>
- </aop:config-->
-
-
-
-
+ <bean id = "itemPermissions" class="org.openecomp.sdcrests.itempermissions.rest.services.ItemPermissionsImpl"/>
+ <bean id = "notifications" class="org.openecomp.sdcrests.notifications.rest.services.impl.NotificationsImpl"/>
<!-- RESTful Services -->
<jaxrs:server id="restContainer" address="/">
<jaxrs:serviceBeans>
+ <ref bean="versions"/>
+ <ref bean="conflicts"/>
<ref bean="vendorLicenseModels"/>
<ref bean="licenseAgreements"/>
<ref bean="featureGroups"/>
@@ -75,9 +65,10 @@
<ref bean="deploymentFlavors"/>
<ref bean="images"/>
<ref bean="orchestrationTemplateCandidate"/>
- <ref bean="componentDependencyModel"/>
- <ref bean="activityLog"/>
+ <ref bean="componentDependencies"/>
<ref bean="healthCheck"/>
+ <ref bean="itemPermissions"/>
+ <ref bean="notifications"/>
</jaxrs:serviceBeans>
<jaxrs:providers>
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/spring-mapper-servlet.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/spring-mapper-servlet.xml
new file mode 100644
index 0000000000..437df7945f
--- /dev/null
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/spring-mapper-servlet.xml
@@ -0,0 +1,13 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+
+ <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
+ <property name="mappings">
+ <props>
+ </props>
+ </property>
+ </bean>
+
+</beans> \ No newline at end of file
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
index 35865f988e..de88197a8a 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/webapp/WEB-INF/web.xml
@@ -23,6 +23,19 @@
</listener>
<filter>
+ <filter-name>PermissionsFilter</filter-name>
+ <filter-class>org.openecomp.sdc.itempermissions.servlet.PermissionsFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>PermissionsFilter</filter-name>
+ <url-pattern>/v1.0/vendor-license-models/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>PermissionsFilter</filter-name>
+ <url-pattern>/v1.0/vendor-software-products/*</url-pattern>
+ </filter-mapping>
+
+ <filter>
<filter-name>cross-origin</filter-name>
<filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
<init-param>
@@ -68,6 +81,22 @@
<filter-name>LoggingServletFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
+ <filter>
+ <filter-name>SessionContextFilter</filter-name>
+ <filter-class>org.openecomp.server.filters.SessionContextFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>SessionContextFilter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <!-- Spring WS Mapping -->
+ <servlet>
+ <servlet-name>spring-mapper</servlet-name>
+ <servlet-class>
+ org.springframework.web.servlet.DispatcherServlet
+ </servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
<!-- CXF -->
<servlet>
<servlet-name>CXFServlet</servlet-name>
@@ -94,7 +123,10 @@
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
- <!--servlet-name>logger-aspect</servlet-name-->
+ <servlet-name>spring-mapper</servlet-name>
+ <url-pattern>/ws/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>