217 Commits

Author SHA1 Message Date
Rob Winch
fc516b55a6 Fix Build Against Spring 5.0.0.BUILD-SNAPSHOT
Change Bean definition to static to avoid SPR-12646

Fixes gh-4150
2016-12-08 15:54:46 -06:00
Eddú Meléndez
23294c4c57 Add Referrer-Policy header support
Fixes gh-4110
2016-11-08 13:21:35 -06:00
Rob Winch
df3b8bc284 Add Spring MVC test for override cache control
Issue gh-3975
2016-10-24 15:57:32 -05:00
Rob Winch
94e580fe64 Add Support for Custom Default Configuration in Web Security
Fixes gh-4102
2016-10-19 16:15:56 -05:00
Rob Winch
af9139b613 Add intercept-url@request-matcher-ref
Fixes gh-4097
2016-10-18 22:27:31 -05:00
Rob Winch
aaa9708b95 Add BeanResolver to AuthenticationPrincipalArgumentResolver
Previously @AuthenticationPrincipal's expression attribute didn't support
bean references because the BeanResolver was not set on the SpEL context.

This commit adds a BeanResolver and ensures that the configuration
sets a BeanResolver.

Fixes gh-3949
2016-10-18 19:45:54 -05:00
Rob Winch
badb466cc5 AuthenticationConfiguration imports ObjectPostProcessor
Fixes gh-4086
2016-10-17 20:00:27 -05:00
Rob Winch
b443baef04 Polish GrantedAuthorityDefaults
* Move GrantedAuthorityDefaults to config module
* Move setting of default role into config module vs
  ApplicationContextAware

Issue gh-3701
2016-09-22 15:13:05 -05:00
Rob Winch
c6366baee2 Remove MvcRequestMatcher.afterPropertiesSet()
The validation does not work due to restrictions within the servlet
container. Specifically we cannot access the servlets that are registered.

This commit reverts the validation logic for MvcRequestMatcher to determine
if servletPath is required.

Fixes gh-4027
2016-08-19 14:18:07 -04:00
Rob Winch
bb997eecde Fix defaultMethodExpressionHandler autowiring
Previously if a Bean for GlobalMethodSecurityConfiguration's
defaultMethodExpressionHandler was found on a Configuration that also
@Autowired a Bean that enabled method security, the Bean that was
@Autowired would not have security enabled.

This fixes the issue by delaying the lookup of Beans populated on
GlobalMethodSecurityConfiguration's defaultMethodExpressionHandler.

Fixes gh-4020
2016-08-10 23:48:07 -05:00
Joe Grandja
e080905a79 MvcRequestMatcher servletPath Polish / XML Config
Fixes gh-4014
2016-08-09 16:29:30 -05:00
Rob Winch
3befb1c8a6 MvcRequestMatcher servletPath / JavaConfig
Issue: gh-3987
2016-08-09 16:29:30 -05:00
Rob Winch
ca170f8479 DummyRequest supports methods for MvcRequestMatcher
To support MvcRequestMatcher DummyRequest needs to support
getCharacterEncoding() and getAttribute(String)
2016-07-14 14:18:31 -05:00
Rob Winch
ada146244e Add HttpSecurity.mvcMatcher
Fixes gh-3970
2016-07-14 10:50:49 -04:00
Rob Winch
945e2e2ad4 Fix NPE requestMatchers().mvcMatchers
Fixes gh-3969
2016-07-14 10:50:49 -04:00
Eddú Meléndez
13b0ddb7e6 Fix test assertions 2016-07-07 13:29:00 -05:00
Rob Winch
e4c13e3c0e Add MvcRequestMatcher
Fixes gh-3964
2016-07-06 15:47:23 -05:00
Rob Winch
c935d857eb Add mvc namespace to XmlApplicationContext 2016-07-01 22:04:55 -05:00
Rob Winch
bd5f71bb0d Polish
Fix checkstyle for LDAP JavaConfig Authority mapping

Issue gh-2768
2016-06-21 17:08:37 -05:00
Tony Dalbrekt
b76e3be822 LDAP Java Config supports GrantedAuthoritiesMapper
Fixes gh-2768
2016-06-21 16:43:13 -05:00
Eddú Meléndez
a2ead4cf7a Polish
Fixes gh-3892
2016-06-20 12:35:43 -05:00
Rob Winch
fa1c484587 AuthenticationConfiguration.getAuthenticationManager() supports recursion
AuthenticationConfiguration.getAuthenticationManager() now supports
recursion. This is necessary in instances where something using
@EnableGlobalAuthentication requires an object using method level security.

Fixes gh-3935
2016-06-17 14:02:36 -05:00
Rob Winch
7fe0a135ec Default AntPathRequestMatcher to be case sensitive
Issue gh-3831
2016-04-20 13:29:18 -05:00
Rob Winch
a5a8aeb550 Message SecurityExpressionHandler is post processed (#3820)
Previously the SecurityExpressionHandler for message based configuration
did not have a beanResolver set.

This commit post processes the default message SecurityExpressionHandler
to ensure the beanResolver is set.

Fixes gh-3797
2016-04-19 13:21:58 -04:00
Rob Winch
c872a77ad1 RoleHiearchy Bean used in GlobalMethodSecurity (#3394)
Previously it required quite a bit of extra work to use RoleHiearchy
within Java Based Spring Security configuration.

Now if a single RoleHiearchy Bean is defined it will automatically
be picked up and used by method security.

Fixes gh-3394
2016-04-19 12:47:38 -04:00
Rob Winch
fb5776cb5c Support Camel case URI variables (#3814)
Perviously there were issues with case insenstive patterns and URI
variables that contained upper case characters. For example, the pattern
"/user/{userId}" could not resolve the variable #userId Instead it was
forced to lowercase and #userid was used.

Now if the pattern is case insensitive then so is the variable. This means
that #userId will work as will #userid.

Fixes gh-3786
2016-04-18 17:54:48 -04:00
Rob Winch
533a5f0905 Fix <password-encoder> when authentication-manager@id specified
When <authentication-manager> specifies an id, the <password-encoder> is
not used because the parser changes the bean id without aliasing it to
BeanIds.AUTHENTICATION_MANAGER which is used by
AuthenticationManagerBeanDefinitionParser to look up the
AuthenticationManager bean.

This commit updates AuthenticationManagerBeanDefinitionParser to ensure
there is an alias to BeanIds.AUTHENTICATION_MANAGER when the id is
specified.

Fixes gh-3296
2016-03-21 22:48:49 -05:00
Rob Winch
7bf014f678 Path Variables fail with different case
Fixes gh-3329
2016-03-21 10:09:50 -05:00
Rob Winch
cf66487d3a Add Java Configuration Test
Issue SEC-2256
2016-03-18 14:03:47 -05:00
Rob Winch
f221920a19 Clean up code to conform to basic checkstyle
Issue gh-3746
2016-03-14 00:15:12 -05:00
Billy Korando
71d4ce96ad Convert to assertj
Fixes gh-3175
2016-03-09 14:30:17 -06:00
Rob Winch
bb600a473e Start AssertJ Migration
Issue gh-3175
2016-03-09 14:26:30 -06:00
Rob Winch
3164bd6f8d Polish Sorting ObjectPostProcessor
* Add Test
* Only sort on adding new entry

Issue gh-3572
2016-03-08 15:51:13 -06:00
Tim Ysewyn
331c7e91b7 HTTP Public Key Pinning
HTTP Public Key Pinning (HPKP) is a security mechanism which allows HTTPS websites
to resist impersonation by attackers using mis-issued or otherwise fraudulent certificates.
(For example, sometimes attackers can compromise certificate authorities,
 and then can mis-issue certificates for a web origin.)
The HTTPS web server serves a list of public key hashes, and on subsequent connections
clients expect that server to use 1 or more of those public keys in its certificate chain.

This commit will add this new functionality.

Fixes gh-3706
2016-03-03 14:21:46 -06:00
Rob Winch
53f85e2151 SEC-2848: LogoutConfigurer allows setting clearAuthentication 2015-10-30 13:54:01 -05:00
Rob Winch
15b4406015 SEC-3135: antMatchers(<method>,new String[0]) now passive 2015-10-30 10:08:42 -05:00
Rob Winch
6f1bb705ac SEC-3135: antMatchers now allows method and no pattern
Previously, antMatchers(POST).authenticated() was not allowed. Instead
users had to use antMatchers(POST, "/**").authenticated().

Now we default the patterns to be "/**" if it is null or empty.
2015-10-29 12:48:29 -05:00
Rob Winch
f76bf96e14 SEC-3132: securityBuilder cannot be null
If a custom SecurityConfiguererAdapter applies another
SecurityConfigurerAdapter it caused an error securityBuilder cannot be null.

This commit fixes this.
2015-10-23 10:27:09 -05:00
Rob Winch
b9f8af3096 SEC-3063: rm ConditionalOnMissingBean for @Primary
ConditionalOnMissingBean can only work in a Spring Boot environment. This
means this approach is flawed.

Instead users that wish to override requestDataValueProcessor can use
@Primary.
2015-10-21 15:40:43 -05:00
Rob Winch
cbed1d75ee SEC-3076: Add Method Level Security Meta Annotations 2015-08-19 16:07:03 -05:00
Rob Winch
64938ebcfc SEC-2996: Suport configuring SecurityExpressionHandler<Message<Object>> 2015-07-13 22:45:35 -05:00
Rob Winch
57b06fb0b5 SEC-2864: Default Spring Security WebSocket PathMatcher 2015-03-25 13:14:15 -05:00
Rob Winch
ae6af5d73c SEC-2915: Updated Java Code Formatting 2015-03-25 13:09:18 -05:00
Rob Winch
bed20db905 Remove Unnecessary @Override 2015-02-27 16:18:31 -06:00
Rob Winch
37740cd020 SEC-2861: Add WebSocket Documentation & Sample 2015-02-24 10:29:47 -06:00
Rob Winch
b9563f6102 SEC-2830: Cleanup disabling Same Origin SockJS
- Defaults for properties false
- Add XML Namespace support
2015-02-24 10:28:33 -06:00
Rob Winch
fea03536d6 SEC-2853: Rename WebSocket XML Namespace elements 2015-02-20 11:43:15 -06:00
Rob Winch
6a8475adbb SEC-2830: Provide Same Origin support for SockJS 2015-02-18 11:21:02 -06:00
Rob Winch
a27c33754c SEC-2859: Add CsrfTokenArgumentResolver 2015-02-18 10:51:30 -06:00
Rob Winch
36fe0d0357 SEC-2845: SecurityContextChannelInterceptor support anonymous 2015-02-18 10:00:22 -06:00