Fix typos in Kotlin DSL docs

Issue gh-10481
This commit is contained in:
Yuriy Savchenko 2022-03-11 13:42:00 +03:00 committed by Josh Cummings
parent e6673c2816
commit 932ff4f5c4
2 changed files with 12 additions and 12 deletions

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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 * Adds a request authorization rule for an endpoint matching the provided
* pattern. * pattern.
* If Spring MVC is on the classpath, it will use an MVC matcher. * 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. * 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 * For example, often times a mapping of the path "/path" will match on
* "/path", "/path/", "/path.html", etc. * "/path", "/path/", "/path.html", etc.
@ -75,7 +75,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
* Adds a request authorization rule for an endpoint matching the provided * Adds a request authorization rule for an endpoint matching the provided
* pattern. * pattern.
* If Spring MVC is on the classpath, it will use an MVC matcher. * 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. * 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 * For example, often times a mapping of the path "/path" will match on
* "/path", "/path/", "/path.html", etc. * "/path", "/path/", "/path.html", etc.
@ -98,7 +98,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
* Adds a request authorization rule for an endpoint matching the provided * Adds a request authorization rule for an endpoint matching the provided
* pattern. * pattern.
* If Spring MVC is on the classpath, it will use an MVC matcher. * 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. * 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 * For example, often times a mapping of the path "/path" will match on
* "/path", "/path/", "/path.html", etc. * "/path", "/path/", "/path.html", etc.
@ -122,7 +122,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
* Adds a request authorization rule for an endpoint matching the provided * Adds a request authorization rule for an endpoint matching the provided
* pattern. * pattern.
* If Spring MVC is on the classpath, it will use an MVC matcher. * 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. * 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 * For example, often times a mapping of the path "/path" will match on
* "/path", "/path/", "/path.html", etc. * "/path", "/path/", "/path.html", etc.
@ -154,7 +154,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
fun hasAuthority(authority: String) = "hasAuthority('$authority')" 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). * @param authorities the authorities to require (i.e. ROLE_USER, ROLE_ADMIN, etc).
* @return the SpEL expression "hasAnyAuthority" with the given authorities as a * @return the SpEL expression "hasAnyAuthority" with the given authorities as a
@ -175,7 +175,7 @@ class AuthorizeRequestsDsl : AbstractRequestMatcherDsl() {
fun hasRole(role: String) = "hasRole('$role')" 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). * @param roles the roles to require (i.e. USER, ADMIN, etc).
* @return the SpEL expression "hasAnyRole" with the given roles as a * @return the SpEL expression "hasAnyRole" with the given roles as a

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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) { * override fun configure(http: HttpSecurity) {
* http { * http {
* authorizeRequests { * authorizeRequests {
* request("/public", permitAll) * authorize("/public", permitAll)
* request(anyRequest, authenticated) * authorize(anyRequest, authenticated)
* } * }
* formLogin { * formLogin {
* loginPage = "/log-in" * loginPage = "/log-in"
@ -181,8 +181,8 @@ class HttpSecurityDsl(private val http: HttpSecurity, private val init: HttpSecu
* override fun configure(http: HttpSecurity) { * override fun configure(http: HttpSecurity) {
* http { * http {
* authorizeRequests { * authorizeRequests {
* request("/public", permitAll) * authorize("/public", permitAll)
* request(anyRequest, authenticated) * authorize(anyRequest, authenticated)
* } * }
* } * }
* } * }