Add RuntimeHints for webauthn Javascript resource
This commit is contained in:
parent
409d552ae0
commit
46fe0124ba
|
@ -27,6 +27,7 @@ import org.springframework.security.web.access.expression.WebSecurityExpressionR
|
||||||
* {@link RuntimeHintsRegistrar} for WebMVC classes
|
* {@link RuntimeHintsRegistrar} for WebMVC classes
|
||||||
*
|
*
|
||||||
* @author Marcus Da Coregio
|
* @author Marcus Da Coregio
|
||||||
|
* @author Daniel Garnier-Moiroux
|
||||||
* @since 6.0
|
* @since 6.0
|
||||||
*/
|
*/
|
||||||
class WebMvcSecurityRuntimeHints implements RuntimeHintsRegistrar {
|
class WebMvcSecurityRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
|
@ -47,6 +48,12 @@ class WebMvcSecurityRuntimeHints implements RuntimeHintsRegistrar {
|
||||||
hints.resources().registerResource(css);
|
hints.resources().registerResource(css);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ClassPathResource webauthnJavascript = new ClassPathResource(
|
||||||
|
"org/springframework/security/spring-security-webauthn.js");
|
||||||
|
if (webauthnJavascript.exists()) {
|
||||||
|
hints.resources().registerResource(webauthnJavascript);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,4 +68,10 @@ class WebMvcSecurityRuntimeHintsTests {
|
||||||
.accepts(this.hints);
|
.accepts(this.hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void webauthnJavascriptHasHints() {
|
||||||
|
assertThat(RuntimeHintsPredicates.resource()
|
||||||
|
.forResource("org/springframework/security/spring-security-webauthn.js")).accepts(this.hints);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue