Skip to content

Micronaut 4 non-documented breaking changes #1541

Closed Answered by sdelamo
loicmathieu asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for reporting these issues @loicmathieu

AuthenticationProvier now having T instead of HttpRequest for the type of the request parameter, can I safely cast them to HttpRequest ?

You can use implements AuthenticationProvider<HttpRequest<?>> safely. We decoupled Micronaut Security from HttpRequest to use it in contexts with no HTTP server running.

SecurityRule.check() missing the RouteMatch<?> routeMatch attribute, how can we access the RouteMatch from a security rule?

You can get a routeMatch in a SecurityRule by doing:

        RouteMatch<?> routeMatch = request.getAttribute(HttpAttributes.ROUTE_MATCH, RouteMatch.class).orElse(null);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by loicmathieu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants