java.lang.Object
es.kukenan.smartfi.microservice.security.gateway.configuration.GatewayRoutesConfig

@Configuration public class GatewayRoutesConfig extends Object
Configuration class for security gateway using spring cloud gateway.
  • Field Details

    • MASK

      private static final String MASK
      Mask to find in origin path.
      See Also:
    • MASK_VALUE

      private static final String MASK_VALUE
      Value of mask to replace in destination path.
      See Also:
    • responseHandler

      @Autowired ResponseHandler responseHandler
      Component for response operations.
    • webExchangeSessionHandler

      @Autowired WebExchangeSessionHandler webExchangeSessionHandler
      Component for request operations.
    • securityGatewayPreFilter

      @Autowired SecurityGatewayPreFilter securityGatewayPreFilter
      Pre filter for api endpoints which includes authentication bearer header.
    • log

      private es.kukenan.smartfi.logger.WalletLogger log
      Logger.
    • properties

      @Autowired private GatewayRoutesProperties properties
      Security gateway properties.
    • requestContextManager

      @Autowired private es.kukenan.smartfi.common.context.RequestContextManager requestContextManager
      The RequestContextManager used to update the server request context.
    • addContextHeaderFilter

      @Autowired private AddContextHeaderFilter addContextHeaderFilter
      Add Context Header Filter.
    • transformExternalHeadersFilter

      @Autowired private TransformExternalHeadersFilter transformExternalHeadersFilter
      Transform external header names to internal header names.
  • Constructor Details

    • GatewayRoutesConfig

      public GatewayRoutesConfig()
  • Method Details

    • setFilters

      private org.springframework.cloud.gateway.route.builder.UriSpec setFilters(org.springframework.cloud.gateway.route.builder.GatewayFilterSpec f, String serviceUri, String originPath, String destinationPath, boolean modifyRequest, boolean modifyResponse)
      Build the UriSpec given the endpoint information.
      Parameters:
      f - Started GatewayFilterSpec
      serviceUri - Service Uri to send
      originPath - Origin path used
      destinationPath - Destination path to send
      modifyRequest - flag to add request body modification (decryption)
      modifyResponse - flag to add response body modification (encryption)
      Returns:
      UriSpec generated with filters
    • customRouteLocator

      @Bean public org.springframework.cloud.gateway.route.RouteLocator customRouteLocator(org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder builder)
      Build the gateway configuration for every endpoint.
      Parameters:
      builder - Builder for build specific routes in the gateway.
      Returns:
      RouteLocator with all configuration for every endpoint needed.
    • loadServiceInfo

      private GatewayRoutesProperties.Service loadServiceInfo(String serviceName)