Class AuthenticatedContentVerifier
- java.lang.Object
-
- io.mosip.kernel.websub.api.verifier.AuthenticatedContentVerifier
-
@Component public class AuthenticatedContentVerifier extends Object
This is a helper class to authenticate content when payload is pushed by hub after update from publisher according to WebSub Specs Note that content only needed to be authenticated if we have passed secret in subscribe request.- Author:
- Urvil Joshi
-
-
Constructor Summary
Constructors Constructor Description AuthenticatedContentVerifier()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisContentVerified(String secret, String body, String hubSignature)This method authenticates the content.booleanverifyAuthorizedContentVerified(javax.servlet.http.HttpServletRequest httpServletRequest, String secret)This method retrive body and signature header from request and usedisContentVerified(String, String, String)to authenticate the content.
-
-
-
Method Detail
-
verifyAuthorizedContentVerified
public boolean verifyAuthorizedContentVerified(javax.servlet.http.HttpServletRequest httpServletRequest, String secret)This method retrive body and signature header from request and usedisContentVerified(String, String, String)to authenticate the content.- Parameters:
httpServletRequest- request for delivery of payload.secret- secret send while subscribe operation.- Returns:
- authentication result in boolean.
-
isContentVerified
public boolean isContentVerified(String secret, String body, String hubSignature)
This method authenticates the content.- Parameters:
secret- secret used while subscribe operation.body- payload sent by hub.hubSignature- signature header sent by hub.- Returns:
- authentication result in boolean.
-
-