refactor: moved MapUtil implemented by reflect API to another package

This commit is contained in:
zihluwang
2024-08-05 19:04:51 +08:00
parent 7e4fdd5404
commit 62b8cb8118
16 changed files with 204 additions and 130 deletions
@@ -20,6 +20,8 @@ package com.onixbyte.simplejwt.config;
import com.onixbyte.simplejwt.TokenResolver;
import com.onixbyte.simplejwt.constants.TokenAlgorithm;
import java.util.List;
/**
* The {@code TokenResolverConfig} provides a mechanism to configure an
* implementation of {@link TokenResolver} with algorithm functions.
@@ -49,11 +51,15 @@ public interface TokenResolverConfig<Algo> {
* implementation that can be used by the {@link TokenResolver} to handle
* the specific algorithm.
*
* @param algorithm the {@link TokenAlgorithm} for which the algorithm
* function is required
* @return the algorithm function associated with the given {@link
* TokenAlgorithm}
* @param algorithm the {@link TokenAlgorithm} for which the algorithm function is required
* @return the algorithm function associated with the given {@link TokenAlgorithm}
*/
Algo getAlgorithm(TokenAlgorithm algorithm);
List<TokenAlgorithm> ECDSA_ALGORITHMS =
List.of(TokenAlgorithm.ES256, TokenAlgorithm.ES384, TokenAlgorithm.ES512);
List<TokenAlgorithm> HMAC_ALGORITHMS =
List.of(TokenAlgorithm.HS256, TokenAlgorithm.HS384, TokenAlgorithm.HS512);
}
@@ -35,13 +35,14 @@ import java.util.List;
* <li>{@link #JWT_ID}: Represents the "jti" (JWT ID) claim.</li>
* </ul>
* <p>
* The class also contains a list of all the standard claim constants, accessible via the {@link #KEYS} field. This
* list can be useful for iterating through all the standard claims or checking for the presence of specific claims.
* The class also contains a list of all the standard claim constants, accessible via the {@link
* #KEYS} field. This list can be useful for iterating through all the standard claims or checking
* for the presence of specific claims.
* <p>
* Note: This class is final and cannot be instantiated. It only serves as a utility class to hold the standard JWT
* claim constants.
* Note: This class is final and cannot be instantiated. It only serves as a utility class to hold
* the standard JWT claim constants.
*
* @author Zihlu Wang
* @author zihluwang
* @version 1.1.0
* @since 1.0.0
*/
@@ -85,7 +86,8 @@ public final class PredefinedKeys {
/**
* List containing all the standard JWT claim constants.
*/
public static final List<String> KEYS = List.of(ISSUER, SUBJECT, AUDIENCE, EXPIRATION_TIME, NOT_BEFORE, ISSUED_AT, JWT_ID);
public static final List<String> KEYS =
List.of(ISSUER, SUBJECT, AUDIENCE, EXPIRATION_TIME, NOT_BEFORE, ISSUED_AT, JWT_ID);
/**
* Private constructor will protect this class from being instantiated.