Class JwtUserIdKeyResolver

  • All Implemented Interfaces:
    KeyResolver

    public class JwtUserIdKeyResolver
    extends Object
    implements 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 Detail

      • JwtUserIdKeyResolver

        public JwtUserIdKeyResolver()
    • Method Detail

      • resolve

        public String resolve​(LightLambdaExchange exchange)
        Description copied from interface: KeyResolver
        Resolve a unique key from the exchange
        Specified by:
        resolve in interface KeyResolver
        Parameters:
        exchange - lambda exchange
        Returns:
        A string for the key