Class ContentSecurityPolicyConfigurer
- java.lang.Object
-
- com.broadleafcommerce.auth.user.autoconfigure.ContentSecurityPolicyConfigurer
-
public class ContentSecurityPolicyConfigurer extends Object
Responsible for configuring Content Security Policy (CSP) forAuthorizationServerWebSecurityConfiguration
.
-
-
Constructor Summary
Constructors Constructor Description ContentSecurityPolicyConfigurer(AuthorizationServerProperties authorizationServerProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(org.springframework.security.config.annotation.web.configurers.HeadersConfigurer.ContentSecurityPolicyConfig config)
IfisContentSecurityPolicyEnabled()
, this method will be invoked to configure the content security policy.protected AuthorizationServerProperties
getAuthorizationServerProperties()
protected String
getBaseUriDirective(AuthorizationServerProperties.ContentSecurityPolicyProperties properties)
protected String
getCombinedDirectivesValue()
protected String
getDefaultSrcDirective(AuthorizationServerProperties.ContentSecurityPolicyProperties properties)
boolean
isContentSecurityPolicyEnabled()
Whether or not content security policy behavior should be enabled.
-
-
-
Constructor Detail
-
ContentSecurityPolicyConfigurer
public ContentSecurityPolicyConfigurer(AuthorizationServerProperties authorizationServerProperties)
-
-
Method Detail
-
isContentSecurityPolicyEnabled
public boolean isContentSecurityPolicyEnabled()
Whether or not content security policy behavior should be enabled.- Returns:
- true if the behavior should be enabled, false otherwise
-
configure
public void configure(org.springframework.security.config.annotation.web.configurers.HeadersConfigurer.ContentSecurityPolicyConfig config)
IfisContentSecurityPolicyEnabled()
, this method will be invoked to configure the content security policy. This is typically invoked viaHeadersConfigurer.contentSecurityPolicy(Customizer)
.- Parameters:
config
- the content security policy configuration to customize
-
getCombinedDirectivesValue
@Nullable protected String getCombinedDirectivesValue()
-
getDefaultSrcDirective
@Nullable protected String getDefaultSrcDirective(AuthorizationServerProperties.ContentSecurityPolicyProperties properties)
-
getBaseUriDirective
@Nullable protected String getBaseUriDirective(AuthorizationServerProperties.ContentSecurityPolicyProperties properties)
-
getAuthorizationServerProperties
protected AuthorizationServerProperties getAuthorizationServerProperties()
-
-