-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates for #6911 and #6918 #1131
base: master
Are you sure you want to change the base?
Changes from 1 commit
fef018e
08ec1ef
026ad25
df29277
683d0fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
import com.netflix.spinnaker.kork.web.exceptions.ExceptionMessageDecorator; | ||
import com.netflix.spinnaker.okhttp.SpinnakerRequestInterceptor; | ||
import com.netflix.spinnaker.retrofit.Slf4jRetrofitLogger; | ||
import com.netflix.spinnaker.security.SpinnakerUsers; | ||
import lombok.Setter; | ||
import lombok.val; | ||
import okhttp3.OkHttpClient; | ||
|
@@ -143,6 +144,8 @@ protected void configure(HttpSecurity http) throws Exception { | |
.exceptionHandling() | ||
.and() | ||
.anonymous() | ||
// match the same anonymous userid as expected elsewhere | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How is this different from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default settings in this DSL set the principal to the string There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So using the updated Spring Security DSL, this whole method would look more like the following: http.servletApi(Customizer.withDefaults())
.exceptionHandling(Customizer.withDefaults())
.anonymous(anonymous -> anonymous.principal(SpinnakerUsers.ANONYMOUS))
.addFilterBefore(
new FiatAuthenticationFilter(fiatStatus, authenticationConverter),
AnonymousAuthenticationFilter.class); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't see before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll figure out some sort of test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Turns out testing this is futile. I've extracted some constants to make this more consistent. |
||
.principal(SpinnakerUsers.ANONYMOUS) | ||
.and() | ||
.addFilterBefore( | ||
new FiatAuthenticationFilter(fiatStatus, authenticationConverter), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
notes for reviewers -- the new code looks like it does exactly the same thing as the old code, so this is "just" a refactor.