Class ServerHttpRequestSupport

java.lang.Object
com.c4_soft.springaddons.security.oidc.starter.reactive.ServerHttpRequestSupport

public class ServerHttpRequestSupport extends Object

Support class to statically access current request.

It is mainly intended at parsing additional headers when authorizing requests.

Author:
ch4mp
  • Constructor Details

    • ServerHttpRequestSupport

      public ServerHttpRequestSupport()
  • Method Details

    • getRequest

      public static reactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest> getRequest()
      Returns:
      the request in current context
    • getSession

      public static reactor.core.publisher.Mono<org.springframework.web.server.WebSession> getSession()
    • getUniqueHeader

      public static reactor.core.publisher.Mono<String> getUniqueHeader(String headerName) throws ServerHttpRequestSupport.MissingHeaderException, ServerHttpRequestSupport.MultiValuedHeaderException
      Parameters:
      headerName - name of the header to retrieve
      Returns:
      the unique value for the given header in current request
      Throws:
      ServerHttpRequestSupport.MissingHeaderException - if no non-empty value is found for that header
      ServerHttpRequestSupport.MultiValuedHeaderException - more than one non-empty value is found for that header
    • getNonEmptyHeaderValues

      public static reactor.core.publisher.Flux<String> getNonEmptyHeaderValues(String headerName)
      Parameters:
      headerName - the name of the header to retrieve
      Returns:
      a stream of non empty values for a given header from the request in current context