Interface TokenPropagator
- All Superinterfaces:
io.micronaut.core.order.Ordered
- All Known Implementing Classes:
HttpHeaderTokenPropagator
public interface TokenPropagator
extends io.micronaut.core.order.Ordered
Responsible for retrieving and writing tokens for the purpose
of propagation between services.
- Since:
- 1.4.0
- Author:
- James Kleeh
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescriptionfindToken
(io.micronaut.http.HttpRequest<?> request) Attempts to retrieve a token in a request.void
writeToken
(io.micronaut.http.MutableHttpRequest<?> request, String token) Writes the token to the request.Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Method Details
-
writeToken
Writes the token to the request.- Parameters:
request
- TheMutableHttpRequest
instancetoken
- A token ( e.g. JWT token, basic auth token...)
-
findToken
Attempts to retrieve a token in a request.- Parameters:
request
- The request to look for the token in- Returns:
- An optional token string
-