diff options
Diffstat (limited to 'ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsApp.java')
-rw-r--r-- | ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsApp.java | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsApp.java b/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsApp.java index a0e9595..d436d21 100644 --- a/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsApp.java +++ b/ms/generic-resource-api/src/main/java/org/onap/sdnc/apps/ms/gra/GenericResourceMsApp.java @@ -20,25 +20,19 @@ package org.onap.sdnc.apps.ms.gra; -import org.apache.shiro.realm.Realm; -import org.apache.shiro.realm.text.PropertiesRealm; -import org.apache.shiro.spring.web.config.DefaultShiroFilterChainDefinition; -import org.apache.shiro.spring.web.config.ShiroFilterChainDefinition; -import org.onap.aaf.cadi.shiro.AAFRealm; import org.onap.ccsdk.apps.ms.sliboot.controllers.RestconfApiController; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.domain.EntityScan; -import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.transaction.annotation.EnableTransactionManagement; import springfox.documentation.swagger2.annotations.EnableSwagger2; -@SpringBootApplication(scanBasePackages = { "org.onap.sdnc.apps.ms.gra", "org.onap.ccsdk.apps.services", "org.onap.ccsdk.apps.filters" }) +@SpringBootApplication(scanBasePackages = { "org.onap.sdnc.apps.ms.gra", "org.onap.ccsdk.apps.services" }) @EnableJpaRepositories(basePackages = { "org.onap.sdnc.apps.ms.gra", "org.onap.ccsdk.apps.ms.sliboot" }) @EntityScan(basePackages = { "org.onap.sdnc.apps.ms.gra", "org.onap.ccsdk.apps.ms.sliboot" }) @EnableTransactionManagement @@ -52,36 +46,4 @@ public class GenericResourceMsApp { public static void main(String[] args) throws Exception { SpringApplication.run(GenericResourceMsApp.class, args); } - - @Bean - public Realm realm() { - - // If cadi prop files is not defined use local properties realm - // src/main/resources/shiro-users.properties - if ("none".equals(System.getProperty("cadi_prop_files", "none"))) { - log.info("cadi_prop_files undefined, AAF Realm will not be set"); - PropertiesRealm realm = new PropertiesRealm(); - return realm; - } else { - AAFRealm realm = new AAFRealm(); - return realm; - } - - } - - @Bean - public ShiroFilterChainDefinition shiroFilterChainDefinition() { - DefaultShiroFilterChainDefinition chainDefinition = new DefaultShiroFilterChainDefinition(); - - // if cadi prop files is not set disable authentication - if ("none".equals(System.getProperty("cadi_prop_files", "none"))) { - chainDefinition.addPathDefinition("/**", "anon"); - } else { - log.info("Loaded property cadi_prop_files, AAF REALM set"); - chainDefinition.addPathDefinition("/**", "authcBasic, rest[org.onap.sdnc.odl:odl-api]"); - } - - return chainDefinition; - } - } |