Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/adobe/css-tools-4.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielFran authored Sep 24, 2023
2 parents 186c2e1 + 60dec22 commit 7d684cc
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 30 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>6.4.0.202211300538-r</version>
<version>6.6.1.202309021850-r</version>
</dependency>
<dependency>
<groupId>tech.jhipster</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
import org.springframework.http.HttpMethod;
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.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
import org.springframework.security.config.http.SessionCreationPolicy;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter;
import org.springframework.web.filter.CorsFilter;
Expand All @@ -40,7 +40,7 @@
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
@Import(SecurityProblemSupport.class)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
public class SecurityConfiguration {

private final TokenProvider tokenProvider;

Expand All @@ -58,21 +58,22 @@ public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}

@Override
public void configure(WebSecurity web) {
web
.ignoring()
.antMatchers(HttpMethod.OPTIONS, "/**")
.antMatchers("/app/**/*.{js,html}")
.antMatchers("/i18n/**")
.antMatchers("/content/**")
.antMatchers("/swagger-ui/index.html")
.antMatchers("/test/**")
.antMatchers("/h2-console/**");
@Bean
public WebSecurityCustomizer webSecurityCustomizer() {
return web ->
web
.ignoring()
.antMatchers(HttpMethod.OPTIONS, "/**")
.antMatchers("/app/**/*.{js,html}")
.antMatchers("/i18n/**")
.antMatchers("/content/**")
.antMatchers("/swagger-ui/index.html")
.antMatchers("/test/**")
.antMatchers("/h2-console/**");
}

@Override
public void configure(HttpSecurity http) throws Exception {
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
// @formatter:off
http
.csrf()
Expand All @@ -87,7 +88,9 @@ public void configure(HttpSecurity http) throws Exception {
.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'")
.permissionsPolicy(permissions -> permissions
.policy("geolocation=(none), midi=(none), sync-xhr=(none), microphone=(none), camera=(none), magnetometer=(none), gyroscope=(none), speaker=(none), fullscreen=(none), speaker=(none), payment=(none)")
)
.and()
.frameOptions()
.deny()
Expand Down Expand Up @@ -122,6 +125,7 @@ public void configure(HttpSecurity http) throws Exception {
.httpBasic()
.and()
.apply(securityConfigurerAdapter());
return http.build();
// @formatter:on
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class JHipsterService {

private static final String SKIP_INSTALL = "--skip-install";

private static final String FORCE = "--force";

private final LogsService logsService;

private final Executor taskExecutor;
Expand Down Expand Up @@ -79,7 +81,7 @@ public void generateApplication(String generationId, File workingDir) throws IOE
SKIP_INSTALL,
"--skip-cache",
"--skip-git",
"--force"
FORCE
);
}

Expand All @@ -94,7 +96,7 @@ public void runImportJdl(String generationId, File workingDir, String jdlFileNam
FORCE_INSIGHT,
SKIP_CHECKS,
SKIP_INSTALL,
"--force"
FORCE
);
}

Expand All @@ -113,7 +115,7 @@ public void addCiCd(String generationId, File workingDir, CiCdTool ciCdTool) thr
FORCE_INSIGHT,
SKIP_CHECKS,
SKIP_INSTALL,
"--force"
FORCE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.net.http.HttpResponse;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -326,7 +327,10 @@ public void setAccess_token(String access_token) {
*/
@GetMapping("/{gitProvider}/companies/{companyName}/projects")
@Secured(AuthoritiesConstants.USER)
public @ResponseBody ResponseEntity getOrganizationProjects(@PathVariable String gitProvider, @PathVariable String companyName) {
public @ResponseBody ResponseEntity<List<String>> getOrganizationProjects(
@PathVariable String gitProvider,
@PathVariable String companyName
) {
Optional<GitProvider> maybeGitProvider = GitProvider.getGitProviderByValue(gitProvider);
return maybeGitProvider
.<ResponseEntity>map(
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import { fontAwesomeIcons } from './icons/font-awesome-icons';
@NgModule({
imports: [
HttpClientModule,
CookieModule.forRoot(),
CookieModule.withOptions(),
NgxWebstorageModule.forRoot({ prefix: 'jhi', separator: '-' }),
NgJhipsterModule.forRoot({
// set below to true to make alerts look like toast
Expand Down
14 changes: 8 additions & 6 deletions src/main/webapp/app/home/jdl-metadata/jdl-studio.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ export class DeleteJdlStudioComponent implements OnInit, OnDestroy {
}

ngOnDestroy(): void {
if (this.subscription) {
this.subscription.unsubscribe();
}
unsubscribe(this.subscription);
}
}

Expand Down Expand Up @@ -164,12 +162,16 @@ export class ApplyJdlStudioComponent implements OnInit, OnDestroy {
}

ngOnDestroy(): void {
if (this.subscription) {
this.subscription.unsubscribe();
}
unsubscribe(this.subscription);
}

isAtLeastOneGitProviderAvailableAndConfigured(): boolean {
return (this.gitConfig.githubAvailable && this.githubConfigured) || (this.gitConfig.gitlabAvailable && this.gitlabConfigured) || false;
}
}

const unsubscribe = (subscription: Subscription | undefined) => {
if (subscription) {
subscription.unsubscribe();
}
};
5 changes: 4 additions & 1 deletion src/main/webapp/swagger-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@

urls.sort(function (a, b) {
var x = a.name.toLowerCase(), y = b.name.toLowerCase();
return x < y ? -1 : x > y ? 1 : 0;
if (x === y) {
return 0;
}
return x < y ? -1 : 1;
});

// Build a system
Expand Down

0 comments on commit 7d684cc

Please sign in to comment.