Browse Source

Fix-typos

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
pull/18064/head
Tran Ngoc Nhan 2 months ago committed by Rob Winch
parent
commit
f5d33457dc
  1. 2
      access/src/main/java/org/springframework/security/acls/AclEntryVoter.java
  2. 9
      acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java
  3. 2
      web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java
  4. 2
      web/src/main/java/org/springframework/security/web/server/csrf/WebSessionServerCsrfTokenRepository.java
  5. 4
      web/src/main/java/org/springframework/security/web/server/header/CacheControlServerHttpHeadersWriter.java
  6. 4
      web/src/main/java/org/springframework/security/web/util/ThrowableAnalyzer.java
  7. 2
      web/src/test/java/org/springframework/security/web/server/header/CacheControlServerHttpHeadersWriterTests.java
  8. 8
      web/src/test/java/org/springframework/security/web/server/header/StaticServerHttpHeadersWriterTests.java
  9. 2
      web/src/test/java/org/springframework/security/web/server/header/XXssProtectionServerHttpHeadersWriterTests.java

2
access/src/main/java/org/springframework/security/acls/AclEntryVoter.java

@ -71,7 +71,7 @@ import org.springframework.util.StringUtils; @@ -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

9
acl/src/main/java/org/springframework/security/acls/jdbc/BasicLookupStrategy.java

@ -65,10 +65,11 @@ import org.springframework.util.Assert; @@ -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

2
web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java

@ -99,7 +99,7 @@ import static org.springframework.security.web.servlet.util.matcher.PathPatternR @@ -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>

2
web/src/main/java/org/springframework/security/web/server/csrf/WebSessionServerCsrfTokenRepository.java

@ -103,7 +103,7 @@ public class WebSessionServerCsrfTokenRepository implements ServerCsrfTokenRepos @@ -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;
}

4
web/src/main/java/org/springframework/security/web/server/header/CacheControlServerHttpHeadersWriter.java

@ -49,13 +49,13 @@ public class CacheControlServerHttpHeadersWriter implements ServerHttpHeadersWri @@ -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();

4
web/src/main/java/org/springframework/security/web/util/ThrowableAnalyzer.java

@ -204,8 +204,8 @@ public class ThrowableAnalyzer { @@ -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}.

2
web/src/test/java/org/springframework/security/web/server/header/CacheControlServerHttpHeadersWriterTests.java

@ -44,7 +44,7 @@ public class CacheControlServerHttpHeadersWriterTests { @@ -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);

8
web/src/test/java/org/springframework/security/web/server/header/StaticServerHttpHeadersWriterTests.java

@ -69,7 +69,7 @@ public class StaticServerHttpHeadersWriterTests { @@ -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 { @@ -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 { @@ -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();

2
web/src/test/java/org/springframework/security/web/server/header/XXssProtectionServerHttpHeadersWriterTests.java

@ -52,7 +52,7 @@ public class XXssProtectionServerHttpHeadersWriterTests { @@ -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);

Loading…
Cancel
Save