在Spring安全版3.0.6中修复了CRLF注销漏洞(https://jira.springsource.org/browse/SEC-1790),他们禁用了'spring-security-redirect'参数.
3.0.6中也删除了对注销URL中的重定向参数的默认支持.在3.1中,它已经需要明确启用.
有没有办法重新打开重定向参数,以便我可以在我的Grails Spring Security Logout Controller中动态重定向?
LogoutContoller.groovy
def user = springSecurityService.currentUser
if (params.redirect) {
// this needs to log the user out and then redirect, so don't redirect until we log the user out here
log.info "Redirecting " + springSecurityService.currentUser.username + " to " + params.redirect
// the successHandler.targetUrlParameter is spring-security-redirect, which should redirect after successfully logging the user out
redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl + "?spring-security-redirect="+params.redirect
return;
}
redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl // '/j_spring_security_logout'
Run Code Online (Sandbox Code Playgroud)
以下内容不再适用于spring security 3.0.6+的版本
是否有针对包含副作用的Java / JVM语言方法编写javadocs的标准或最佳实践?
我定义了一个void方法,该方法修改了方法参数之一,但不知道如何记录实际的返回值(因为没有实际的返回值)。
/**
* @param obj - reference object
* @return obj - obj.name is changed to 'hello' //TODO figure out javadoc annotation
*/
void methodName(Object obj) {
if (obj != null) {
obj.name = "hello";
}
}
Run Code Online (Sandbox Code Playgroud)
似乎没有标记对象上副作用的好方法,因为@param和@return批注并不能真正指示正在发生的事情。