jdaugherty commented on code in PR #1205:
URL:
https://github.com/apache/grails-spring-security/pull/1205#discussion_r2828826157
##########
plugin-core/plugin/src/main/groovy/grails/plugin/springsecurity/SecurityAutoConfigurationExcluder.groovy:
##########
@@ -38,6 +40,16 @@ import
org.springframework.boot.autoconfigure.AutoConfigurationMetadata
* automatically filtering them out during Spring Boot's auto-configuration
* discovery phase.</p>
*
+ * <p>To disable this filter and allow Spring Boot's security
auto-configurations
Review Comment:
I believe we need to put this in the actual spring docs as well as the
groovydoc.
##########
plugin-core/plugin/src/test/groovy/grails/plugin/springsecurity/SecurityAutoConfigurationExcluderSpec.groovy:
##########
@@ -147,6 +148,59 @@ class SecurityAutoConfigurationExcluderSpec extends
Specification {
thrown(UnsupportedOperationException)
}
+ def "match allows all auto-configurations when disabled via environment
property"() {
Review Comment:
I think you should an actual functional test for this. I'm pretty sure this
coudl be broken, but it may only be in edge cases with plugin's having
configuration instead of the end app.
##########
plugin-core/plugin/src/main/groovy/grails/plugin/springsecurity/SecurityAutoConfigurationExcluder.groovy:
##########
@@ -46,7 +58,16 @@ import
org.springframework.boot.autoconfigure.AutoConfigurationMetadata
* @see AutoConfigurationImportFilter
*/
@CompileStatic
-class SecurityAutoConfigurationExcluder implements
AutoConfigurationImportFilter {
+class SecurityAutoConfigurationExcluder implements
AutoConfigurationImportFilter, EnvironmentAware {
+
+ static final String ENABLED_PROPERTY =
'grails.plugin.springsecurity.excludeSpringSecurityAutoConfiguration'
+
+ private boolean enabled = true
+
+ @Override
+ void setEnvironment(Environment environment) {
+ this.enabled = environment.getProperty(ENABLED_PROPERTY, Boolean, true)
Review Comment:
I don't think this will work without my plugin fix. Maybe if it's specified
in the end app it will, but I don't see any ordering on this excluder.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]