org.springframework.security.config.annotation.web.configurers
Class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>

java.lang.Object
  extended by org.springframework.security.config.annotation.SecurityConfigurerAdapter<O,B>
      extended by org.springframework.security.config.annotation.web.AbstractRequestMatcherConfigurer<B,C,O>
          extended by org.springframework.security.config.annotation.web.configurers.AbstractRequestMatcherMappingConfigurer<H,ChannelSecurityConfigurer.RequiresChannelUrl,DefaultSecurityFilterChain>
              extended by org.springframework.security.config.annotation.web.configurers.ChannelSecurityConfigurer<H>
Type Parameters:
H - the type of HttpSecurityBuilder that is being configured
All Implemented Interfaces:
SecurityConfigurer<DefaultSecurityFilterChain,H>

public final class ChannelSecurityConfigurer<H extends HttpSecurityBuilder<H>>
extends AbstractRequestMatcherMappingConfigurer<H,ChannelSecurityConfigurer.RequiresChannelUrl,DefaultSecurityFilterChain>

Adds channel security (i.e. requires HTTPS or HTTP) to an application. In order for ChannelSecurityConfigurer to be useful, at least one RequestMatcher should be mapped to HTTP or HTTPS.

By default an InsecureChannelProcessor and a SecureChannelProcessor will be registered.

Security Filters

The following Filters are populated

Shared Objects Created

No shared objects are created.

Shared Objects Used

The following shared objects are used:

Since:
3.2

Nested Class Summary
 class ChannelSecurityConfigurer.RequiresChannelUrl
           
 
Constructor Summary
ChannelSecurityConfigurer()
          Creates a new instance
 
Method Summary
protected  ChannelSecurityConfigurer.RequiresChannelUrl chainRequestMatchersInternal(List<RequestMatcher> requestMatchers)
          Subclasses should implement this method for returning the object that is chained to the creation of the RequestMatcher instances.
 ChannelSecurityConfigurer<H> channelProcessors(List<ChannelProcessor> channelProcessors)
          Sets the ChannelProcessor instances to use in ChannelDecisionManagerImpl
 void configure(H http)
          Configure the SecurityBuilder by setting the necessary properties on the SecurityBuilder.
 ChannelSecurityConfigurer<H> withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
          Adds an ObjectPostProcessor for this class.
 
Methods inherited from class org.springframework.security.config.annotation.web.configurers.AbstractRequestMatcherMappingConfigurer
chainRequestMatchers
 
Methods inherited from class org.springframework.security.config.annotation.web.AbstractRequestMatcherConfigurer
antMatchers, antMatchers, anyRequest, regexMatchers, regexMatchers, requestMatchers
 
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, getBuilder, init, postProcess, setBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChannelSecurityConfigurer

public ChannelSecurityConfigurer()
Creates a new instance

See Also:
HttpSecurity.requiresChannel()
Method Detail

configure

public void configure(H http)
               throws Exception
Description copied from interface: SecurityConfigurer
Configure the SecurityBuilder by setting the necessary properties on the SecurityBuilder.

Specified by:
configure in interface SecurityConfigurer<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
Overrides:
configure in class SecurityConfigurerAdapter<DefaultSecurityFilterChain,H extends HttpSecurityBuilder<H>>
Throws:
Exception

withObjectPostProcessor

public ChannelSecurityConfigurer<H> withObjectPostProcessor(ObjectPostProcessor<?> objectPostProcessor)
Adds an ObjectPostProcessor for this class.

Parameters:
objectPostProcessor -
Returns:
the ChannelSecurityConfigurer for further customizations

channelProcessors

public ChannelSecurityConfigurer<H> channelProcessors(List<ChannelProcessor> channelProcessors)
Sets the ChannelProcessor instances to use in ChannelDecisionManagerImpl

Parameters:
channelProcessors -
Returns:

chainRequestMatchersInternal

protected ChannelSecurityConfigurer.RequiresChannelUrl chainRequestMatchersInternal(List<RequestMatcher> requestMatchers)
Description copied from class: AbstractRequestMatcherMappingConfigurer
Subclasses should implement this method for returning the object that is chained to the creation of the RequestMatcher instances.

Specified by:
chainRequestMatchersInternal in class AbstractRequestMatcherMappingConfigurer<H extends HttpSecurityBuilder<H>,ChannelSecurityConfigurer.RequiresChannelUrl,DefaultSecurityFilterChain>
Parameters:
requestMatchers - the RequestMatcher instances that were created
Returns:
the chained Object for the subclass which allows association of something else to the RequestMatcher