Interface AuthorizationJacksonModuleContributor

All Known Implementing Classes:
FederatedJacksonModuleContributor, WebauthnJacksonModuleContributor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface AuthorizationJacksonModuleContributor
Extension point that adds a Jackson module to the mapper of the stored authorizations (AuthorizationJsonMapperFactory), for a feature whose authentication or attribute types the framework's security modules do not cover (for example the passkeys, whose module Spring Security leaves out of SecurityJacksonModules). Every bean of this type is applied; no shared file is edited.

It is deliberately not a plain JacksonModule bean: Spring Boot adds every such bean to the application-wide JsonMapper, which would widen the polymorphic typing of every JSON answer of the application, while the module only belongs to the mapper of the stored authorizations. It also needs the type validator of that mapper, which only the factory has.

  • Method Summary

    Modifier and Type
    Method
    Description
    tools.jackson.databind.JacksonModule
    module(tools.jackson.databind.jsontype.BasicPolymorphicTypeValidator.Builder validator)
    Creates the module and allows, in the validator, the types it (de)serializes polymorphically.
  • Method Details

    • module

      tools.jackson.databind.JacksonModule module(tools.jackson.databind.jsontype.BasicPolymorphicTypeValidator.Builder validator)
      Creates the module and allows, in the validator, the types it (de)serializes polymorphically. It is called before the framework's modules are created, while the validator can still be configured.
      Parameters:
      validator - builder of the polymorphic type validator of the authorization mapper.
      Returns:
      the module to add.