committed by
Rob Winch
parent
938a5a7c77
commit
f5d33457dc
@@ -71,7 +71,7 @@ import org.springframework.util.StringUtils;
|
||||
* <tt>AclEntryVoter</tt>:
|
||||
* <ul>
|
||||
* <li>Process domain object class <code>BankAccount</code>, configuration attribute
|
||||
* <code>VOTE_ACL_BANK_ACCONT_READ</code>, require permission
|
||||
* <code>VOTE_ACL_BANK_ACCOUNT_READ</code>, require permission
|
||||
* <code>BasePermission.READ</code></li>
|
||||
* <li>Process domain object class <code>BankAccount</code>, configuration attribute
|
||||
* <code>VOTE_ACL_BANK_ACCOUNT_WRITE</code>, require permission list
|
||||
|
||||
@@ -65,10 +65,11 @@ import org.springframework.util.Assert;
|
||||
* NB: This implementation does attempt to provide reasonably optimised lookups - within
|
||||
* the constraints of a normalised database and standard ANSI SQL features. If you are
|
||||
* willing to sacrifice either of these constraints (e.g. use a particular database
|
||||
* feature such as hierarchical queries or materalized views, or reduce normalisation) you
|
||||
* are likely to achieve better performance. In such situations you will need to provide
|
||||
* your own custom <code>LookupStrategy</code>. This class does not support subclassing,
|
||||
* as it is likely to change in future releases and therefore subclassing is unsupported.
|
||||
* feature such as hierarchical queries or materialized views, or reduce normalisation)
|
||||
* you are likely to achieve better performance. In such situations you will need to
|
||||
* provide your own custom <code>LookupStrategy</code>. This class does not support
|
||||
* subclassing, as it is likely to change in future releases and therefore subclassing is
|
||||
* unsupported.
|
||||
* <p>
|
||||
* There are two SQL queries executed, one in the <tt>lookupPrimaryKeys</tt> method and
|
||||
* one in <tt>lookupObjectIdentities</tt>. These are built from the same select and "order
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ import static org.springframework.security.web.servlet.util.matcher.PathPatternR
|
||||
* <p>
|
||||
* To configure the Switch User Processing Filter, create a bean definition for the Switch
|
||||
* User processing filter and add to the filterChainProxy. Note that the filter must come
|
||||
* <b>after</b> the <tt>FilterSecurityInteceptor</tt> in the chain, in order to apply the
|
||||
* <b>after</b> the <tt>FilterSecurityInterceptor</tt> in the chain, in order to apply the
|
||||
* correct constraints to the <tt>switchUserUrl</tt>. Example:
|
||||
*
|
||||
* <pre>
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ public class WebSessionServerCsrfTokenRepository implements ServerCsrfTokenRepos
|
||||
* @param sessionAttributeName the new attribute name to use
|
||||
*/
|
||||
public void setSessionAttributeName(String sessionAttributeName) {
|
||||
Assert.hasLength(sessionAttributeName, "sessionAttributename cannot be null or empty");
|
||||
Assert.hasLength(sessionAttributeName, "sessionAttributeName cannot be null or empty");
|
||||
this.sessionAttributeName = sessionAttributeName;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -49,13 +49,13 @@ public class CacheControlServerHttpHeadersWriter implements ServerHttpHeadersWri
|
||||
/**
|
||||
* The value for cache control value
|
||||
*/
|
||||
public static final String CACHE_CONTRTOL_VALUE = "no-cache, no-store, max-age=0, must-revalidate";
|
||||
public static final String CACHE_CONTROL_VALUE = "no-cache, no-store, max-age=0, must-revalidate";
|
||||
|
||||
/**
|
||||
* The delegate to write all the cache control related headers
|
||||
*/
|
||||
private static final ServerHttpHeadersWriter CACHE_HEADERS = StaticServerHttpHeadersWriter.builder()
|
||||
.header(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTRTOL_VALUE)
|
||||
.header(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTROL_VALUE)
|
||||
.header(HttpHeaders.PRAGMA, CacheControlServerHttpHeadersWriter.PRAGMA_VALUE)
|
||||
.header(HttpHeaders.EXPIRES, CacheControlServerHttpHeadersWriter.EXPIRES_VALUE)
|
||||
.build();
|
||||
|
||||
@@ -204,8 +204,8 @@ public class ThrowableAnalyzer {
|
||||
|
||||
/**
|
||||
* Verifies that the provided throwable is a valid subclass of the provided type (or
|
||||
* of the type itself). If <code>expectdBaseType</code> is <code>null</code>, no check
|
||||
* will be performed.
|
||||
* of the type itself). If <code>expectedBaseType</code> is <code>null</code>, no
|
||||
* check will be performed.
|
||||
* <p>
|
||||
* Can be used for verification purposes in implementations of
|
||||
* {@link ThrowableCauseExtractor extractors}.
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public class CacheControlServerHttpHeadersWriterTests {
|
||||
this.writer.writeHttpHeaders(this.exchange);
|
||||
assertThat(this.headers.headerNames()).hasSize(3);
|
||||
assertThat(this.headers.get(HttpHeaders.CACHE_CONTROL))
|
||||
.containsOnly(CacheControlServerHttpHeadersWriter.CACHE_CONTRTOL_VALUE);
|
||||
.containsOnly(CacheControlServerHttpHeadersWriter.CACHE_CONTROL_VALUE);
|
||||
assertThat(this.headers.get(HttpHeaders.EXPIRES))
|
||||
.containsOnly(CacheControlServerHttpHeadersWriter.EXPIRES_VALUE);
|
||||
assertThat(this.headers.get(HttpHeaders.PRAGMA)).containsOnly(CacheControlServerHttpHeadersWriter.PRAGMA_VALUE);
|
||||
|
||||
+4
-4
@@ -69,7 +69,7 @@ public class StaticServerHttpHeadersWriterTests {
|
||||
// due to the fact that gh-10557 reports NettyHeadersAdapter as the
|
||||
// response headers implementation, which is not accessible here.
|
||||
HttpHeaders caseSensitiveHeaders = new HttpHeaders(new LinkedMultiValueMap<>());
|
||||
caseSensitiveHeaders.set(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTRTOL_VALUE);
|
||||
caseSensitiveHeaders.set(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTROL_VALUE);
|
||||
caseSensitiveHeaders.set(HttpHeaders.PRAGMA, CacheControlServerHttpHeadersWriter.PRAGMA_VALUE);
|
||||
caseSensitiveHeaders.set(HttpHeaders.EXPIRES, CacheControlServerHttpHeadersWriter.EXPIRES_VALUE);
|
||||
this.writer = new StaticServerHttpHeadersWriter(caseSensitiveHeaders);
|
||||
@@ -80,13 +80,13 @@ public class StaticServerHttpHeadersWriterTests {
|
||||
@Test
|
||||
public void writeHeadersWhenMultiHeaderThenWritesAllHeaders() {
|
||||
this.writer = StaticServerHttpHeadersWriter.builder()
|
||||
.header(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTRTOL_VALUE)
|
||||
.header(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTROL_VALUE)
|
||||
.header(HttpHeaders.PRAGMA, CacheControlServerHttpHeadersWriter.PRAGMA_VALUE)
|
||||
.header(HttpHeaders.EXPIRES, CacheControlServerHttpHeadersWriter.EXPIRES_VALUE)
|
||||
.build();
|
||||
this.writer.writeHttpHeaders(this.exchange);
|
||||
assertThat(this.headers.get(HttpHeaders.CACHE_CONTROL))
|
||||
.containsOnly(CacheControlServerHttpHeadersWriter.CACHE_CONTRTOL_VALUE);
|
||||
.containsOnly(CacheControlServerHttpHeadersWriter.CACHE_CONTROL_VALUE);
|
||||
assertThat(this.headers.get(HttpHeaders.PRAGMA)).containsOnly(CacheControlServerHttpHeadersWriter.PRAGMA_VALUE);
|
||||
assertThat(this.headers.get(HttpHeaders.EXPIRES))
|
||||
.containsOnly(CacheControlServerHttpHeadersWriter.EXPIRES_VALUE);
|
||||
@@ -97,7 +97,7 @@ public class StaticServerHttpHeadersWriterTests {
|
||||
String headerValue = "other";
|
||||
this.headers.set(HttpHeaders.CACHE_CONTROL, headerValue);
|
||||
this.writer = StaticServerHttpHeadersWriter.builder()
|
||||
.header(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTRTOL_VALUE)
|
||||
.header(HttpHeaders.CACHE_CONTROL, CacheControlServerHttpHeadersWriter.CACHE_CONTROL_VALUE)
|
||||
.header(HttpHeaders.PRAGMA, CacheControlServerHttpHeadersWriter.PRAGMA_VALUE)
|
||||
.header(HttpHeaders.EXPIRES, CacheControlServerHttpHeadersWriter.EXPIRES_VALUE)
|
||||
.build();
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@ public class XXssProtectionServerHttpHeadersWriterTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void writeHeadersWhenHeaderWrittenThenDoesNotOverrride() {
|
||||
public void writeHeadersWhenHeaderWrittenThenDoesNotOverride() {
|
||||
String headerValue = "value";
|
||||
this.headers.set(XXssProtectionServerHttpHeadersWriter.X_XSS_PROTECTION, headerValue);
|
||||
this.writer.writeHttpHeaders(this.exchange);
|
||||
|
||||
Reference in New Issue
Block a user