升级到最新版本的JHipster时遇到的问题

时间:2020-02-20 10:14:29

标签: jhipster

在阅读了有关使用Jhipster从Full Stack Develpment升级到最新版本的JHipster的章节之后,我执行了升级以及一切正常的操作,但是在升级完成后,文件中的所有更改都如src \ main \ java \ es \ mibar \ web \ config \ SecurityConfiguration.java不见了。

这包括升级后需要的更改,所以问题是:

有没有保留我的文件并同时升级版本的标志?因为经历所有更改都需要很长时间。

https://www.jhipster.tech/upgrading-an-application/此处详细介绍的内容在这方面似乎没有帮助

@Override
public void configure(HttpSecurity http) throws Exception {
    // @formatter:off
    http
        .csrf()
        .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
    .and()
        .addFilterBefore(corsFilter, CsrfFilter.class)
        .exceptionHandling()
            .authenticationEntryPoint(problemSupport)
            .accessDeniedHandler(problemSupport)
    .and()
        .rememberMe()
        .rememberMeServices(rememberMeServices)
        .rememberMeParameter("remember-me")
        .key(jHipsterProperties.getSecurity().getRememberMe().getKey())
    .and()
        .formLogin()
        .loginProcessingUrl("/api/authentication")
        .successHandler(ajaxAuthenticationSuccessHandler())
        .failureHandler(ajaxAuthenticationFailureHandler())
        .permitAll()
    .and()
        .logout()
        .logoutUrl("/api/logout")
        .logoutSuccessHandler(ajaxLogoutSuccessHandler())
        .permitAll()
    // .and()
    //     .headers()
    //     .contentSecurityPolicy("default-src 'self'; frame-src 'self' data:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://storage.googleapis.com; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:")
    // .and()
    //     .referrerPolicy(ReferrerPolicyHeaderWriter.ReferrerPolicy.STRICT_ORIGIN_WHEN_CROSS_ORIGIN)
    // .and()
    //     .featurePolicy("geolocation 'none'; midi 'none'; sync-xhr 'none'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; speaker 'none'; fullscreen 'self'; payment 'none'")
    // .and()
    //     .frameOptions()
    //     .deny()
    .and()
        .authorizeRequests()
        .antMatchers("/api/authenticate").permitAll()
        .antMatchers("/api/register").permitAll()
        .antMatchers("/api/activate").permitAll()
        .antMatchers("/api/account/reset-password/init").permitAll()
        .antMatchers("/api/account/reset-password/finish").permitAll()
        .antMatchers("/api/feedbacks").permitAll()
        .antMatchers("/api/menudailyfollowers").permitAll()
        .antMatchers("/api/config-variables").permitAll()
        .antMatchers("/api/locals").permitAll()
        .antMatchers("/api/locations").permitAll()
        .antMatchers("/api/degustation-menus").permitAll()
        .antMatchers("/api/daily-menus").permitAll()
        .antMatchers("/api/courses").permitAll()
        .antMatchers("/api/tags").permitAll()
        .antMatchers("/api/payments").permitAll()
        .antMatchers("/api/photos").permitAll()
        .antMatchers("/api/spectacles").permitAll()
        .antMatchers("/api/comments").permitAll()
        .antMatchers("/api/feedbacks").permitAll()
        .antMatchers("/api/menudailyfollowers").permitAll()
        .antMatchers(HttpMethod.GET, "/api/locals/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/locals/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/locations/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/locations/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/degustation-menus/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/degustation-menus/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/daily-menus/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/daily-menus/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/courses/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/courses/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/tags/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/payments/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/photos/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/photos/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/spectacles/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/spectacles/*").permitAll()
        .antMatchers(HttpMethod.GET, "/api/comments/*/view").permitAll()
        .antMatchers(HttpMethod.GET, "/api/comments/*").permitAll()
        .antMatchers(HttpMethod.GET, "/feedbacks/new").permitAll()
        .antMatchers(HttpMethod.GET, "/menudailyfollowers/new").permitAll()
        .antMatchers("/api/**").authenticated()
        .antMatchers("/management/health").permitAll()
        .antMatchers("/management/info").permitAll()
        .antMatchers("/management/prometheus").permitAll()
        .antMatchers("/management/**").hasAuthority(AuthoritiesConstants.ADMIN);
    // @formatter:on
}

}

//注释中的部分和所有添加的.antMatchers(“ / api / locations”)。permitAll()都消失了。

谢谢

1 个答案:

答案 0 :(得分:0)

除了可以通过git控制更改外,您可能还需要遵循以下提示:https://stackoverflow.com/a/60258520/7773582