summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config
diff options
context:
space:
mode:
authorsa282w <sa282w@att.com>2018-06-15 12:45:37 -0400
committersa282w <sa282w@att.com>2018-06-21 10:59:42 -0400
commita68c7de8ca9d38fbdf0801252a4185c8fd94cea6 (patch)
treee44fd8286a51a684c6bfd6540c0c380014c2bc03 /ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config
parent4072269d9f6b452aaff41fc02b09bfca40356dd5 (diff)
Music health check apis
Issue-ID: PORTAL-291, PORTAL-307 Included the music changes, other changes from 2.3 branch to be included in master, added JUnits to the new classes and updated the document with the API version changes. Change-Id: I7b4c54be49317264afbdcb8d8ae3f20395bf0e1f Signed-off-by: sa282w <sa282w@att.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java
index 5354fa39..9f125b75 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/ExternalSecurityConfig.java
@@ -41,11 +41,13 @@ import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
+import org.onap.portalapp.music.util.MusicUtil;
import org.onap.portalapp.portal.utils.MusicCookieCsrfTokenRepository;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.web.csrf.CookieCsrfTokenRepository;
import org.springframework.security.web.util.matcher.RegexRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher;
@@ -67,6 +69,9 @@ public class ExternalSecurityConfig extends WebSecurityConfigurerAdapter {
return false;
}
};
- http.csrf().csrfTokenRepository(MusicCookieCsrfTokenRepository.withHttpOnlyFalse()).requireCsrfProtectionMatcher(csrfRequestMatcher);
+ if(MusicUtil.isMusicEnable())
+ http.csrf().csrfTokenRepository(MusicCookieCsrfTokenRepository.withHttpOnlyFalse()).requireCsrfProtectionMatcher(csrfRequestMatcher);
+ else
+ http.csrf().csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()).requireCsrfProtectionMatcher(csrfRequestMatcher);
}
}