diff --git a/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt index 693966ace7..53fa7b7a01 100644 --- a/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt +++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/AuthorizeRequestsDsl.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,7 +54,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * Adds a request authorization rule for an endpoint matching the provided * pattern. * If Spring MVC is on the classpath, it will use an MVC matcher. - * If Spring MVC is not an the classpath, it will use an ant matcher. + * If Spring MVC is not on the classpath, it will use an ant matcher. * The MVC will use the same rules that Spring MVC uses for matching. * For example, often times a mapping of the path "/path" will match on * "/path", "/path/", "/path.html", etc. @@ -75,7 +75,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * Adds a request authorization rule for an endpoint matching the provided * pattern. * If Spring MVC is on the classpath, it will use an MVC matcher. - * If Spring MVC is not an the classpath, it will use an ant matcher. + * If Spring MVC is not on the classpath, it will use an ant matcher. * The MVC will use the same rules that Spring MVC uses for matching. * For example, often times a mapping of the path "/path" will match on * "/path", "/path/", "/path.html", etc. @@ -98,7 +98,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * Adds a request authorization rule for an endpoint matching the provided * pattern. * If Spring MVC is on the classpath, it will use an MVC matcher. - * If Spring MVC is not an the classpath, it will use an ant matcher. + * If Spring MVC is not on the classpath, it will use an ant matcher. * The MVC will use the same rules that Spring MVC uses for matching. * For example, often times a mapping of the path "/path" will match on * "/path", "/path/", "/path.html", etc. @@ -122,7 +122,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { * Adds a request authorization rule for an endpoint matching the provided * pattern. * If Spring MVC is on the classpath, it will use an MVC matcher. - * If Spring MVC is not an the classpath, it will use an ant matcher. + * If Spring MVC is not on the classpath, it will use an ant matcher. * The MVC will use the same rules that Spring MVC uses for matching. * For example, often times a mapping of the path "/path" will match on * "/path", "/path/", "/path.html", etc. @@ -154,7 +154,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { fun hasAuthority(authority: String) = "hasAuthority('$authority')" /** - * Specify that URLs requires any of a number authorities. + * Specify that URLs require any number of authorities. * * @param authorities the authorities to require (i.e. ROLE_USER, ROLE_ADMIN, etc). * @return the SpEL expression "hasAnyAuthority" with the given authorities as a @@ -175,7 +175,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() { fun hasRole(role: String) = "hasRole('$role')" /** - * Specify that URLs requires any of a number roles. + * Specify that URLs require any number of roles. * * @param roles the roles to require (i.e. USER, ADMIN, etc). * @return the SpEL expression "hasAnyRole" with the given roles as a diff --git a/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt b/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt index ef35967ffd..c9ffcd836f 100644 --- a/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt +++ b/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,8 @@ import jakarta.servlet.http.HttpServletRequest * override fun configure(http: HttpSecurity) { * http { * authorizeRequests { - * request("/public", permitAll) - * request(anyRequest, authenticated) + * authorize("/public", permitAll) + * authorize(anyRequest, authenticated) * } * formLogin { * loginPage = "/log-in" @@ -181,8 +181,8 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu * override fun configure(http: HttpSecurity) { * http { * authorizeRequests { - * request("/public", permitAll) - * request(anyRequest, authenticated) + * authorize("/public", permitAll) + * authorize(anyRequest, authenticated) * } * } * }