Expected Behavior
HttpSecurityDsl should expose underlying HttpSecurity through public HttpSecurityDsl.http field.
https://github.com/spring-projects/spring-security/blob/7.1.1/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt#L82
Current Behavior
HttpSecurityDsl.http is private, but it is implicitly exposed through HttpSecurityDsl.with().
Context
Let some library provide a utility function that configures HttpSecurity using its built-in features (csrf, authorizeHttpRequests, etc.).
There is currently no stable way to provide the same utility in Kotlin DSL without code duplication.
HttpSecurityDsl already exposes underlying HttpSecurity through HttpSecurityDsl.with().
https://github.com/spring-projects/spring-security/blob/7.1.1/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt#L260
So the desired functionality can be implemented in this way:
fun HttpSecurityDsl.someUtilityDsl() {
class NoOp : AbstractHttpConfigurer<NoOp, HttpSecurity>()
someUtility(with(NoOp())!!)
}
This is definitely not the expected use of HttpSecurityDsl.
Is it possible to make the HttpSecurityDsl.http property explicitly public instead?
Expected Behavior
HttpSecurityDslshould expose underlyingHttpSecuritythrough publicHttpSecurityDsl.httpfield.https://github.com/spring-projects/spring-security/blob/7.1.1/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt#L82
Current Behavior
HttpSecurityDsl.httpis private, but it is implicitly exposed throughHttpSecurityDsl.with().Context
Let some library provide a utility function that configures
HttpSecurityusing its built-in features (csrf, authorizeHttpRequests, etc.).There is currently no stable way to provide the same utility in Kotlin DSL without code duplication.
HttpSecurityDslalready exposes underlyingHttpSecuritythroughHttpSecurityDsl.with().https://github.com/spring-projects/spring-security/blob/7.1.1/config/src/main/kotlin/org/springframework/security/config/annotation/web/HttpSecurityDsl.kt#L260
So the desired functionality can be implemented in this way:
This is definitely not the expected use of
HttpSecurityDsl.Is it possible to make the
HttpSecurityDsl.httpproperty explicitly public instead?