@Provider public class SignatureValidatorInterceptor extends Object implements javax.ws.rs.container.ContainerRequestFilter
../
It needs to know the webhook id, which must be registered via {#put(String channel, UUID)}Modifier and Type | Field and Description |
---|---|
static String[] |
SIGNATURES |
static Map<String,List<UUID>> |
WEBHOOK_IDS |
Constructor and Description |
---|
SignatureValidatorInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
filter(javax.ws.rs.container.ContainerRequestContext requestContext) |
static boolean |
put(String channel,
UUID webhookId) |
static void |
readyForRequests() |
protected void |
validate(String signature,
byte[] payload,
String channel) |
public static final String[] SIGNATURES
public static void readyForRequests()
public void filter(@Nonnull javax.ws.rs.container.ContainerRequestContext requestContext) throws IOException
filter
in interface javax.ws.rs.container.ContainerRequestFilter
IOException
protected void validate(@Nonnull String signature, @Nonnull byte[] payload, @Nonnull String channel) throws NoSuchAlgorithmException, InvalidKeyException
Copyright © 2018–2019. All rights reserved.