Class ServerHttpRequestSupport
java.lang.Object
com.c4_soft.springaddons.security.oidc.starter.reactive.ServerHttpRequestSupport
Support class to statically access current request.
It is mainly intended at parsing additional headers when authorizing requests.
- Author:
- ch4mp
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic reactor.core.publisher.Flux<String>getNonEmptyHeaderValues(String headerName) static reactor.core.publisher.Mono<org.springframework.http.server.reactive.ServerHttpRequest>static reactor.core.publisher.Mono<org.springframework.web.server.WebSession>static reactor.core.publisher.Mono<String>getUniqueHeader(String headerName)
-
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 headerServerHttpRequestSupport.MultiValuedHeaderException- more than one non-empty value is found for that header
-
getNonEmptyHeaderValues
- 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
-