Class SearchCatalogAccessPolicyUtils
java.lang.Object
com.broadleafcommerce.search.core.utils.SearchCatalogAccessPolicyUtils
-
Constructor Summary
ConstructorsConstructorDescriptionSearchCatalogAccessPolicyUtils
(com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.search.autoconfigure.SearchCatalogAccessPolicyProperties searchCatalogAccessPolicyProperties, com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) -
Method Summary
Modifier and TypeMethodDescriptioncom.broadleafcommerce.search.api.domain.accesspolicy.SearchCatalogAccessPolicyContext
buildSearchCatalogAccessPolicyContext
(jakarta.servlet.http.HttpServletRequest webRequest) Retrieves the additional auth claims that should be placed on theSearchCatalogAccessPolicyContext
that theCatalogAccessPolicies
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 theSearchCatalogAccessPolicyContext
that theSearchCatalogAccessPolicies
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.
-
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 theSearchCatalogAccessPolicyContext
that theSearchCatalogAccessPolicies
are evaluated against.- Parameters:
webRequest
- The incoming web request.- Returns:
- The request attributes that should be placed on the
SearchCatalogAccessPolicyContext
that theSearchCatalogAccessPolicies
are evaluated against.
-
getAdditionalClaims
Retrieves the additional auth claims that should be placed on theSearchCatalogAccessPolicyContext
that theCatalogAccessPolicies
are evaluated against.- Returns:
- The additional auth claims that should be placed on the
SearchCatalogAccessPolicyContext
that theCatalogAccessPolicies
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()
-