Class JwtUserIdKeyResolver
java.lang.Object
com.networknt.aws.lambda.handler.middleware.limit.key.JwtUserIdKeyResolver
- All Implemented Interfaces:
KeyResolver
When user is selected as the key, we can get the user_id from the JWT claim. In this way, we
can limit a number of requests for a user to prevent abuse from a single page application that
is using the backend APIs.
- Author:
- Steve Hu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresolve(LightLambdaExchange exchange) Resolve a unique key from the exchange
-
Constructor Details
-
JwtUserIdKeyResolver
public JwtUserIdKeyResolver()
-
-
Method Details
-
resolve
Description copied from interface:KeyResolverResolve a unique key from the exchange- Specified by:
resolvein interfaceKeyResolver- Parameters:
exchange- lambda exchange- Returns:
- A string for the key
-