Class DefaultCsrfOutboundRequestDecorator
java.lang.Object
de.hybris.platform.outboundservices.decorator.impl.csrf.DefaultCsrfOutboundRequestDecorator
- All Implemented Interfaces:
OutboundRequestDecorator
Decorates SAP CPI outbound requests with CSRF tokens.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecorate(org.springframework.http.HttpHeaders httpHeaders, Map<String, Object> payload, DecoratorContext context, DecoratorExecution execution) Decorates an Outbound requestprotected de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParametersfetchCsrfTokenFromSCPI(ConsumedDestinationModel destinationModel) protected IntegrationCache<CsrfParametersCacheKey,de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters> getCache()protected static org.springframework.http.HttpHeadersprotected IntegrationRestTemplateFactorybooleanisApplicable(DecoratorContext decoratorContext) Determines if the decorator is applicable.voidsetCache(IntegrationCache<CsrfParametersCacheKey, de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters> cache) voidsetIntegrationRestTemplateFactory(IntegrationRestTemplateFactory integrationRestTemplateFactory) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.hybris.platform.outboundservices.decorator.OutboundRequestDecorator
isEnabled
-
Constructor Details
-
DefaultCsrfOutboundRequestDecorator
public DefaultCsrfOutboundRequestDecorator()
-
-
Method Details
-
isApplicable
Description copied from interface:OutboundRequestDecoratorDetermines if the decorator is applicable.- Specified by:
isApplicablein interfaceOutboundRequestDecorator- Parameters:
decoratorContext- with the information about the request being decorated.- Returns:
trueif the decorator is applicable;falseif not
-
getHeadersForTokenFetching
protected static org.springframework.http.HttpHeaders getHeadersForTokenFetching() -
decorate
public org.springframework.http.HttpEntity<Map<String,Object>> decorate(org.springframework.http.HttpHeaders httpHeaders, Map<String, Object> payload, DecoratorContext context, DecoratorExecution execution) Description copied from interface:OutboundRequestDecoratorDecorates an Outbound request- Specified by:
decoratein interfaceOutboundRequestDecorator- Parameters:
httpHeaders- The headers to be used for the outgoing request.payload- The payload used for the requestcontext- Some extra information that can be used by decorators.execution- The execution chain.- Returns:
- An
HttpEntitycontaining the result of the decoration. Normally by callingexecution.createHttpEntity()
-
fetchCsrfTokenFromSCPI
protected de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters fetchCsrfTokenFromSCPI(ConsumedDestinationModel destinationModel) -
getIntegrationRestTemplateFactory
-
setIntegrationRestTemplateFactory
public void setIntegrationRestTemplateFactory(IntegrationRestTemplateFactory integrationRestTemplateFactory) -
getCache
protected IntegrationCache<CsrfParametersCacheKey,de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters> getCache() -
setCache
public void setCache(IntegrationCache<CsrfParametersCacheKey, de.hybris.platform.outboundservices.decorator.impl.csrf.CsrfParameters> cache)
-