Skip to content

Commit 6f48357

Browse files
authored
Merge pull request #80 from sdeleuze/thymeleaf-extras-springsecurity6
Add thymeleaf-extras-springsecurity6 metadata
2 parents 47d39d4 + f23e84d commit 6f48357

File tree

9 files changed

+290
-0
lines changed

9 files changed

+290
-0
lines changed

metadata/index.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,9 @@
110110
{
111111
"directory": "io.undertow/undertow-core",
112112
"module": "io.undertow:undertow-core"
113+
},
114+
{
115+
"directory": "org.thymeleaf.extras/thymeleaf-extras-springsecurity6",
116+
"module": "org.thymeleaf.extras:thymeleaf-extras-springsecurity6"
113117
}
114118
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
"reflect-config.json"
3+
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[
2+
{
3+
"name": "org.thymeleaf.extras.springsecurity6.util.Spring6VersionSpecificUtility",
4+
"allDeclaredConstructors": true,
5+
"condition": {
6+
"typeReachable": "org.thymeleaf.extras.springsecurity6.util.SpringVersionSpecificUtils"
7+
}
8+
},
9+
{
10+
"name": "org.springframework.web.servlet.View",
11+
"condition": {
12+
"typeReachable": "org.springframework.web.servlet.View"
13+
}
14+
},
15+
{
16+
"name": "org.springframework.web.reactive.result.view.View",
17+
"condition": {
18+
"typeReachable": "org.springframework.web.reactive.result.view.View"
19+
}
20+
}
21+
]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"latest": true,
4+
"metadata-version": "3.1.0.M1",
5+
"module": "org.thymeleaf.extras:thymeleaf-extras-springsecurity6",
6+
"tested-versions": [
7+
"3.1.0.M1"
8+
]
9+
}
10+
]

tests/src/index.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,17 @@
252252
}
253253
]
254254
},
255+
{
256+
"test-project-path": "org.thymeleaf.extras/thymeleaf-extras-springsecurity6/3.1.0.M1",
257+
"libraries": [
258+
{
259+
"name": "org.thymeleaf.extras:thymeleaf-extras-springsecurity6",
260+
"versions": [
261+
"3.1.0.M1"
262+
]
263+
}
264+
]
265+
},
255266
{
256267
"test-project-path": "org.freemarker/freemarker/2.3.31",
257268
"libraries": [
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
* Copyright and related rights waived via CC0
3+
*
4+
* You should have received a copy of the CC0 legalcode along with this
5+
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
6+
*/
7+
8+
import org.graalvm.internal.tck.TestUtils
9+
10+
plugins {
11+
id "org.graalvm.internal.tck"
12+
}
13+
14+
String libraryVersion = TestUtils.testedLibraryVersion
15+
16+
tasks.withType(JavaCompile) {
17+
options.release = 17
18+
}
19+
20+
dependencies {
21+
testImplementation("org.slf4j:slf4j-api:1.7.36")
22+
testImplementation("org.slf4j:slf4j-simple:1.7.36")
23+
testImplementation("org.thymeleaf:thymeleaf-spring6:3.1.0.M2")
24+
testImplementation("org.thymeleaf.extras:thymeleaf-extras-springsecurity6:$libraryVersion")
25+
testImplementation("org.springframework:spring-web:6.0.0-M6")
26+
testImplementation("org.springframework:spring-webflux:6.0.0-M6")
27+
testImplementation("org.springframework:spring-context:6.0.0-M6")
28+
testImplementation('org.assertj:assertj-core:3.22.0')
29+
}
30+
31+
repositories {
32+
mavenCentral()
33+
maven { url 'https://repo.spring.io/milestone' }
34+
}
35+
36+
graalvmNative {
37+
binaries {
38+
test {
39+
buildArgs.add('--no-fallback')
40+
}
41+
}
42+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
library.version = 3.1.0.M1
2+
metadata.dir = org.thymeleaf.extras/thymeleaf-extras-springsecurity6/3.1.0.M1/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright and related rights waived via CC0
3+
*
4+
* You should have received a copy of the CC0 legalcode along with this
5+
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
6+
*/
7+
8+
pluginManagement {
9+
def tckPath = Objects.requireNonNullElse(
10+
System.getenv("GVM_TCK_TCKDIR"),
11+
"../../../../tck-build-logic"
12+
)
13+
includeBuild(tckPath)
14+
}
15+
16+
plugins {
17+
id "org.graalvm.internal.tck-settings" version "1.0.0-SNAPSHOT"
18+
}
19+
20+
rootProject.name = 'thymeleaf-springsecurity6-tests'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
/*
2+
* Copyright and related rights waived via CC0
3+
*
4+
* You should have received a copy of the CC0 legalcode along with this
5+
* work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
6+
*/
7+
package org.thymeleaf.extras;
8+
9+
import java.security.Principal;
10+
import java.util.Enumeration;
11+
import java.util.Locale;
12+
import java.util.Map;
13+
14+
import org.assertj.core.api.Assertions;
15+
import org.junit.jupiter.api.Test;
16+
import org.thymeleaf.context.WebContext;
17+
import org.thymeleaf.extras.springsecurity6.util.SpringVersionSpecificUtils;
18+
import org.thymeleaf.extras.springsecurity6.util.SpringVersionUtils;
19+
import org.thymeleaf.spring6.web.webflux.ISpringWebFluxWebApplication;
20+
import org.thymeleaf.spring6.web.webflux.ISpringWebFluxWebExchange;
21+
import org.thymeleaf.spring6.web.webflux.ISpringWebFluxWebRequest;
22+
import org.thymeleaf.spring6.web.webflux.ISpringWebFluxWebSession;
23+
import org.thymeleaf.web.servlet.IServletWebApplication;
24+
import org.thymeleaf.web.servlet.IServletWebExchange;
25+
import org.thymeleaf.web.servlet.IServletWebRequest;
26+
import org.thymeleaf.web.servlet.IServletWebSession;
27+
28+
import org.springframework.core.SpringVersion;
29+
30+
public class ThymeleafSpringSecurityTest {
31+
32+
@Test
33+
void springVersion() {
34+
Assertions.assertThat(SpringVersion.getVersion()).isNotNull();
35+
Assertions.assertThat(SpringVersionUtils.isSpring60AtLeast()).isTrue();
36+
}
37+
38+
@Test
39+
void springVersionSpecificUtilsWebMvc() {
40+
WebContext webContext = new WebContext(new IServletWebExchange() {
41+
42+
@Override
43+
public IServletWebRequest getRequest() {
44+
return null;
45+
}
46+
47+
@Override
48+
public IServletWebSession getSession() {
49+
return null;
50+
}
51+
52+
@Override
53+
public IServletWebApplication getApplication() {
54+
return null;
55+
}
56+
57+
@Override
58+
public Principal getPrincipal() {
59+
return null;
60+
}
61+
62+
@Override
63+
public Locale getLocale() {
64+
return null;
65+
}
66+
67+
@Override
68+
public String getContentType() {
69+
return null;
70+
}
71+
72+
@Override
73+
public String getCharacterEncoding() {
74+
return null;
75+
}
76+
77+
@Override
78+
public Object getAttributeValue(String name) {
79+
return null;
80+
}
81+
82+
@Override
83+
public void setAttributeValue(String name, Object value) {
84+
85+
}
86+
87+
@Override
88+
public String transformURL(String url) {
89+
return null;
90+
}
91+
92+
@Override
93+
public Enumeration<String> getAttributeNames() {
94+
return null;
95+
}
96+
97+
@Override
98+
public Object getNativeRequestObject() {
99+
return null;
100+
}
101+
102+
@Override
103+
public Object getNativeResponseObject() {
104+
return null;
105+
}
106+
});
107+
Assertions.assertThat(SpringVersionSpecificUtils.isWebMvcContext(webContext)).isTrue();
108+
Assertions.assertThat(SpringVersionSpecificUtils.isWebContext(webContext)).isTrue();
109+
}
110+
111+
@Test
112+
void springVersionSpecificUtilsWebFlux() {
113+
WebContext webContext = new WebContext(new ISpringWebFluxWebExchange() {
114+
@Override
115+
public ISpringWebFluxWebRequest getRequest() {
116+
return null;
117+
}
118+
119+
@Override
120+
public ISpringWebFluxWebSession getSession() {
121+
return null;
122+
}
123+
124+
@Override
125+
public ISpringWebFluxWebApplication getApplication() {
126+
return null;
127+
}
128+
129+
@Override
130+
public Map<String, Object> getAttributes() {
131+
return null;
132+
}
133+
134+
@Override
135+
public Object getNativeExchangeObject() {
136+
return null;
137+
}
138+
139+
@Override
140+
public Principal getPrincipal() {
141+
return null;
142+
}
143+
144+
@Override
145+
public Locale getLocale() {
146+
return null;
147+
}
148+
149+
@Override
150+
public String getContentType() {
151+
return null;
152+
}
153+
154+
@Override
155+
public String getCharacterEncoding() {
156+
return null;
157+
}
158+
159+
@Override
160+
public void setAttributeValue(String name, Object value) {
161+
162+
}
163+
164+
@Override
165+
public void removeAttribute(String name) {
166+
167+
}
168+
169+
@Override
170+
public String transformURL(String url) {
171+
return null;
172+
}
173+
});
174+
Assertions.assertThat(SpringVersionSpecificUtils.isWebFluxContext(webContext)).isTrue();
175+
Assertions.assertThat(SpringVersionSpecificUtils.isWebContext(webContext)).isTrue();
176+
}
177+
}

0 commit comments

Comments
 (0)