Skip to content

Commit a3c4059

Browse files
committed
Remove support for H2's web console
Closes gh-28590
1 parent 64bf330 commit a3c4059

File tree

10 files changed

+2
-634
lines changed

10 files changed

+2
-634
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleAutoConfiguration.java

Lines changed: 0 additions & 105 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/H2ConsoleProperties.java

Lines changed: 0 additions & 111 deletions
This file was deleted.

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/h2/package-info.java

Lines changed: 0 additions & 20 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,17 +16,8 @@
1616

1717
package org.springframework.boot.autoconfigure.security.servlet;
1818

19-
import java.util.function.Supplier;
20-
21-
import javax.servlet.http.HttpServletRequest;
22-
23-
import org.springframework.boot.autoconfigure.h2.H2ConsoleProperties;
2419
import org.springframework.boot.autoconfigure.security.StaticResourceLocation;
25-
import org.springframework.boot.security.servlet.ApplicationContextRequestMatcher;
26-
import org.springframework.boot.web.context.WebServerApplicationContext;
27-
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
2820
import org.springframework.security.web.util.matcher.RequestMatcher;
29-
import org.springframework.web.context.WebApplicationContext;
3021

3122
/**
3223
* Factory that can be used to create a {@link RequestMatcher} for commonly used paths.
@@ -49,43 +40,4 @@ public static StaticResourceRequest toStaticResources() {
4940
return StaticResourceRequest.INSTANCE;
5041
}
5142

52-
/**
53-
* Returns a matcher that includes the H2 console location. For example:
54-
* <pre class="code">
55-
* PathRequest.toH2Console()
56-
* </pre>
57-
* @return the configured {@link RequestMatcher}
58-
*/
59-
public static H2ConsoleRequestMatcher toH2Console() {
60-
return new H2ConsoleRequestMatcher();
61-
}
62-
63-
/**
64-
* The request matcher used to match against h2 console path.
65-
*/
66-
public static final class H2ConsoleRequestMatcher extends ApplicationContextRequestMatcher<H2ConsoleProperties> {
67-
68-
private volatile RequestMatcher delegate;
69-
70-
private H2ConsoleRequestMatcher() {
71-
super(H2ConsoleProperties.class);
72-
}
73-
74-
@Override
75-
protected boolean ignoreApplicationContext(WebApplicationContext applicationContext) {
76-
return WebServerApplicationContext.hasServerNamespace(applicationContext, "management");
77-
}
78-
79-
@Override
80-
protected void initialized(Supplier<H2ConsoleProperties> h2ConsoleProperties) {
81-
this.delegate = new AntPathRequestMatcher(h2ConsoleProperties.get().getPath() + "/**");
82-
}
83-
84-
@Override
85-
protected boolean matches(HttpServletRequest request, Supplier<H2ConsoleProperties> context) {
86-
return this.delegate.matches(request);
87-
}
88-
89-
}
90-
9143
}

spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration,\
7070
org.springframework.boot.autoconfigure.freemarker.FreeMarkerAutoConfiguration,\
7171
org.springframework.boot.autoconfigure.groovy.template.GroovyTemplateAutoConfiguration,\
7272
org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration,\
73-
org.springframework.boot.autoconfigure.h2.H2ConsoleAutoConfiguration,\
7473
org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration,\
7574
org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration,\
7675
org.springframework.boot.autoconfigure.hazelcast.HazelcastJpaDependencyAutoConfiguration,\

0 commit comments

Comments
 (0)