Class SearchCatalogAccessPolicyUtils

java.lang.Object
com.broadleafcommerce.search.core.utils.SearchCatalogAccessPolicyUtils

public class SearchCatalogAccessPolicyUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    SearchCatalogAccessPolicyUtils(com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.search.autoconfigure.SearchCatalogAccessPolicyProperties searchCatalogAccessPolicyProperties, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.broadleafcommerce.search.api.domain.accesspolicy.SearchCatalogAccessPolicyContext
    buildSearchCatalogAccessPolicyContext(jakarta.servlet.http.HttpServletRequest webRequest)
     
    protected Map<String,Object>
    Retrieves the additional auth claims that should be placed on the SearchCatalogAccessPolicyContext that the CatalogAccessPolicies are evaluated against.
    protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
     
    jakarta.servlet.http.HttpServletRequest
     
    getRequestAttributes(jakarta.servlet.http.HttpServletRequest webRequest)
    Retrieves the request attributes that should be placed on the SearchCatalogAccessPolicyContext that the SearchCatalogAccessPolicies are evaluated against.
    protected com.broadleafcommerce.search.autoconfigure.SearchCatalogAccessPolicyProperties
     
    protected com.broadleafcommerce.common.extension.TypeFactory
     
    boolean
    Checks if the authenticated caller is one of the whitelisted microservices allowed to bypass Catalog Access Policy restrictions due to not being commerce-facing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SearchCatalogAccessPolicyUtils

      public SearchCatalogAccessPolicyUtils(com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.search.autoconfigure.SearchCatalogAccessPolicyProperties searchCatalogAccessPolicyProperties, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils)
  • Method Details

    • buildSearchCatalogAccessPolicyContext

      public com.broadleafcommerce.search.api.domain.accesspolicy.SearchCatalogAccessPolicyContext buildSearchCatalogAccessPolicyContext(@Nullable jakarta.servlet.http.HttpServletRequest webRequest)
    • getRequestAttributes

      public Map<String,Object> getRequestAttributes(@Nullable jakarta.servlet.http.HttpServletRequest webRequest)
      Retrieves the request attributes that should be placed on the SearchCatalogAccessPolicyContext that the SearchCatalogAccessPolicies are evaluated against.
      Parameters:
      webRequest - The incoming web request.
      Returns:
      The request attributes that should be placed on the SearchCatalogAccessPolicyContext that the SearchCatalogAccessPolicies are evaluated against.
    • getAdditionalClaims

      protected Map<String,Object> getAdditionalClaims()
      Retrieves the additional auth claims that should be placed on the SearchCatalogAccessPolicyContext that the CatalogAccessPolicies are evaluated against.
      Returns:
      The additional auth claims that should be placed on the SearchCatalogAccessPolicyContext that the CatalogAccessPolicies are evaluated against.
    • getCurrentHttpRequest

      @Nullable public jakarta.servlet.http.HttpServletRequest getCurrentHttpRequest()
    • isCallerWhitelistedService

      public boolean isCallerWhitelistedService()
      Checks if the authenticated caller is one of the whitelisted microservices allowed to bypass Catalog Access Policy restrictions due to not being commerce-facing. This is used for bulk operations by default since those are triggered by admins.
      Returns:
      Whether the authenticated caller is whitelisted to bypass Catalog Access Policies.
      See Also:
      • SearchCatalogAccessPolicyProperties.getWhitelistedServiceCallers()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getSearchCatalogAccessPolicyProperties

      protected com.broadleafcommerce.search.autoconfigure.SearchCatalogAccessPolicyProperties getSearchCatalogAccessPolicyProperties()
    • getAuthenticationUtils

      protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils()