Skip to content

Kotlin security configuration examples call AuthorizeHttpRequestsDsl::authorize with an array of patterns, but this signature doesn't exist #17174

@sh-at-cs

Description

@sh-at-cs

Describe the bug
The "Real World Example" for a Kotlin Spring Security configuration contains a call to (AuthorizeHttpRequestsDsl::)authorize which is given an array of strings, but this signature doesn't exist, so it won't compile.

To Reproduce
Set up a Kotlin + Spring project with a security configuration and copy the "Real World Example" from the docs:

@Bean                                                              
open fun defaultSecurityFilterChain(http: HttpSecurity): SecurityFilterChain {
    val allowedPaths = arrayOf("/", "/user-login", "/user-logout", "/notices", "/contact", "/register")
    http {
        authorizeHttpRequests {
            authorize(allowedPaths, permitAll)
            authorize(anyRequest, authenticated)
        }
       ...

Expected behavior
Either the signature exists or the documentation doesn't mention it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions