Skip to content

Commit

Permalink
MOSIP-35176 Added debug log (#1576)
Browse files Browse the repository at this point in the history
* MOSIP-35176 Added debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug log

Signed-off-by: kameshsr <[email protected]>

* MOSIP-35176 Added debug log

Signed-off-by: kameshsr <[email protected]>

---------

Signed-off-by: kameshsr <[email protected]>
  • Loading branch information
kameshsr authored Oct 1, 2024
1 parent 105eda8 commit faee00d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class SubscriberClientImpl
public SubscriptionChangeResponse subscribe(SubscriptionChangeRequest subscriptionRequest) {
// TODO code duplicacy remove
// TODO retries on redirect
LOGGER.info("i am subscribe method");
verifySubscribeModel(subscriptionRequest);
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import jakarta.servlet.Filter;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -32,6 +34,8 @@
@EnableAspectJAutoProxy
public class WebSubClientConfig {

private static final Logger logger = LoggerFactory.getLogger(WebSubClientConfig.class);

@Bean
public IntentVerifier intentVerifier() {
return new IntentVerifier();
Expand All @@ -51,6 +55,7 @@ public FilterRegistrationBean<Filter> registerIntentVerificationFilterFilterBean

@Bean
public IntentVerificationFilter registerIntentVerificationFilter(IntentVerifier intentVerifier) {
logger.info("inside intentVerification filter");
return new IntentVerificationFilter(intentVerifier);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ public class IntentVerificationFilter extends OncePerRequestFilter {
private Map<String, String> mappings = null;

public IntentVerificationFilter(IntentVerifier intentVerifier) {
logger.info("inside intentVerification filter intentverifier");
logger.info("intentVerifier"+ intentVerifier);
this.intentVerifier = intentVerifier;
}

@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
logger.debug("inside doFilterInternal");
logger.debug("HttpServletRequest request- "+request);
logger.info("inside doFilterInternal");
logger.info("HttpServletRequest request- "+request);
String topic=matchCallbackURL(request.getRequestURI());
if (request.getMethod().equals(HttpMethod.GET.name()) && topic!=null) {
String topicReq = request.getParameter(WebSubClientConstants.HUB_TOPIC);
Expand Down Expand Up @@ -93,6 +95,8 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
}

private String matchCallbackURL(String requestURI) {
logger.info("mappings"+ mappings);
logger.info("requestURI-"+requestURI);
if(mappings.containsKey(requestURI)) {
return mappings.get(requestURI);
}else {
Expand Down

0 comments on commit faee00d

Please sign in to comment.