An error occurred while loading the file. Please try again.
-
Keshav Prasad authored
* Update artifacts-download.yml * Update artifacts-upload.yml * Update all.yml * Update common.yml * Update common.yml * Update common.yml * Update all.yml * Issue #000: change keycloak provision playbook * Issue #000: change keycloak role to import * Issue #000: change hosts to keycloak * Issue #000: typo in items * Issue #000: change from import to include * Issue #000: change back to include * Issue #000: Removed tags * Update keycloak provision * Update keycloak provision playbook * Update keycloak provision playbook * Update keycloak provision * Update keycloak provision * Update keycloak provision * Update keycloak provision * Update keycloak deploy * Revert changes to Jenkinsfile * Revert changes to provision keycloak * Issue #000 keycloak: deploy build package to keyclok server with custom changes * Issue #000 keycloak: installing unzip to extract keycloak * Issue #000: updated jobs setup for env order * Issue #000 feat: Moving cassandra repo url and key (#361) * Issue #000 feat: Moving cassandra repo url and key * Updated jenkins config, variables, templates, setup scripts (#367) * feat #000: Updated jenkins config files * feat #000: Removed test file * Revert adminutils config * Revert "Revert adminutils config" This reverts commit b055da7383d14cbc6fc0ebb98a180eabde07d410. * Revert "Revert "Revert adminutils config"" This reverts commit 46c72250d556bd51087dff8fa63ca33f74377fb9. * Revert "Revert adminutils config" This reverts commit b055da7383d14cbc6fc0ebb98a180eabde07d410. * Revert "feat #000: Removed test file" This reverts commit 49936eb13c39fef129ef9552e9f6a4313e3c9838. * Revert "feat #000: Updated jenkins config files" This reverts commit 69af673dfd771ef14dbb37fef81403664492bd21. * Revert "Issue #000: updated jobs setup for env order" This reverts commit 9573bdd9. * Revert "Revert "Issue #000: updated jobs setup for env order"" This reverts commit 2965328f592513517aa8c1d9ede741c2e63fdba8. * feat: Added updated jenkins config files * Issue #00: Changed incorrect update for neo4j branch * Removed auto trigger for deploy jobs * feat: Remove all downstream trigger for deploy * fix: Typo names in variable reference * fix: Updated jenkins secrets path * fix: Adding kafka topic, empty quotes for not mandatory vars * fix: Adding neo4j home, this value will be removed from all.yml * fix: Adding core cassandra group and dummy IP's * chore: uniformity - without quotes for deployer * feat: Removed meta, adding azcli to jenkins setup * fix: remove unused variable (#380)
da862fa9
package com.tarento.retail.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
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.config.http.SessionCreationPolicy;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import com.tarento.retail.util.PathRoutes;
import javax.annotation.Resource;
@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Resource(name = "userService")
private UserDetailsService userDetailsService;
@Autowired
private JwtAuthenticationEntryPoint unauthorizedHandler;
@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Autowired
public void globalUserDetails(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(userDetailsService).passwordEncoder(encoder());
}
@Bean
public JwtAuthenticationFilter authenticationTokenFilterBean() throws Exception {
return new JwtAuthenticationFilter();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable().authorizeRequests()
.antMatchers("/login", "/signup", "/user/role/mapping/delete", "/user/org/getCountryList",
"/user/getCountryList", "/token/validate", "/user/role/mapping", "/user/tokenValidate",
"/user/createOrUpdateCountry", "/user/createOrUpdate", "/user", "/user/getAllUser",
"/user/add/role", "/user/roles/{orgId}", "/user/user/{id}", "/images", "/user/actions/_get",
"/getUserDetails", "/getNumberOfUsers", "/upload", "/user/deleteCountry", "/user/deleteRole",
"/user/deleteUser", "/user/getMapActionToRole", "/user/getUnmapActionToRole",
"/user/mapActionToRole", "/user/unmapActionToRole", "/user/getUsersByMasterRole",
"/user/mapUserMasterRoleCountryOrg", "/user/getMasterRoleByOrgDomain", "/user/domainRole",
"/user/getUsersByRole", "/user/addOrgDomainRoles","/user/createBulkInstitute",
PathRoutes.USER_ACTIONS_URL + PathRoutes.UserRoutes.REQUEST_OTP,
PathRoutes.AuthenticationRoutes.SIGN_IN,
PathRoutes.USER_ACTIONS_URL + PathRoutes.UserRoutes.GENERATE_PIN)
.permitAll().anyRequest().authenticated().and().exceptionHandling()
.authenticationEntryPoint(unauthorizedHandler).and().sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http.addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class);
}
@Bean
public BCryptPasswordEncoder encoder() {
7172737475
return new BCryptPasswordEncoder();
}
}