Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring WebFlux doesn't mix when Jackson mixins are applied #5623

Closed
gregturn opened this issue Aug 1, 2018 · 5 comments
Closed

Spring WebFlux doesn't mix when Jackson mixins are applied #5623

gregturn opened this issue Aug 1, 2018 · 5 comments
Assignees
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug

Comments

@gregturn
Copy link
Contributor

gregturn commented Aug 1, 2018

Origin: spring-projects/spring-session-data-mongodb#33

Problem: Spring WebFlux + Spring Security + Spring Session MongoDB + JacksonMongoSessionConverter.

WebJackson2Module registers multiple mixins including CookieMixin. This fails because Cookie is not on the classpath.

Possible solution: Conditionalize some of these registrations so they are only done when Spring MVC on the classpath.

    public void setupModule(SetupContext context) {
        SecurityJackson2Modules.enableDefaultTyping((ObjectMapper)context.getOwner());
        context.setMixInAnnotations(Cookie.class, CookieMixin.class);
        context.setMixInAnnotations(SavedCookie.class, SavedCookieMixin.class);
        context.setMixInAnnotations(DefaultCsrfToken.class, DefaultCsrfTokenMixin.class);
        context.setMixInAnnotations(DefaultSavedRequest.class, DefaultSavedRequestMixin.class);
        context.setMixInAnnotations(WebAuthenticationDetails.class, WebAuthenticationDetailsMixin.class);
        context.setMixInAnnotations(PreAuthenticatedAuthenticationToken.class, PreAuthenticatedAuthenticationTokenMixin.class);
    }
@gregturn gregturn changed the title Spring WebFlux doesn't mix when Jackson whitelisting is applied Spring WebFlux doesn't mix when Jackson mixins are applied Aug 1, 2018
@rwinch rwinch added this to the 5.1.0.RC1 milestone Aug 7, 2018
@rwinch rwinch self-assigned this Aug 7, 2018
@rwinch rwinch added in: web An issue in web modules (web, webmvc) type: bug A general bug Reactive labels Aug 7, 2018
@finke-ba
Copy link
Contributor

@rwinch Hello! Any updates regarding this issue?

@rwinch
Copy link
Member

rwinch commented Dec 11, 2018

@finke-ba Thanks for the ping. We haven't had a chance to work on this due to other issues. If you have a chance to provide a PR I'd be happy to work with you on getting it merged.

@rwinch rwinch added the status: ideal-for-contribution An issue that we actively are looking for someone to help us with label Dec 11, 2018
@finke-ba
Copy link
Contributor

@rwinch Thanks for the reply and such a welcome invitation to collaboration. I will certainly make a pull request as soon as I can in the near future.

@finke-ba
Copy link
Contributor

finke-ba commented Dec 17, 2018

@rwinch Hello! I created a pull request #6293, could you please check and review it?

@finke-ba
Copy link
Contributor

@rwinch just friendly remind you that we can close this issue as it fixed in #6302 and in #6303.

@rwinch rwinch closed this as completed Dec 19, 2018
@rwinch rwinch removed status: ideal-for-contribution An issue that we actively are looking for someone to help us with labels Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web An issue in web modules (web, webmvc) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants