Skip to content

Commit

Permalink
add enpoint to whitelist
Browse files Browse the repository at this point in the history
  • Loading branch information
a-lor-cab committed Nov 17, 2023
1 parent a37c65e commit 00a15eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
"/webjars/**")
.permitAll()
// TODO list all the endpoint for the spotlightPublisherLambda
.antMatchers("/spotlight-batch/**").permitAll().anyRequest().authenticated())
.antMatchers("/spotlight-batch/**", "/spotlight-submissions/**").permitAll().anyRequest()
.authenticated())

.formLogin().disable().httpBasic().disable().logout().disable().csrf().disable().exceptionHandling()
.authenticationEntryPoint(new HttpStatusEntryPoint(HttpStatus.UNAUTHORIZED));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ public AuthorizationHeaderInterceptor(String expectedAuthorizationValue) {

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
log.info("Intercepting request: " + request.getRequestURI());
if (handler instanceof HandlerMethod) {
final HandlerMethod handlerMethod = (HandlerMethod) handler;
final Method method = handlerMethod.getMethod();

SpotlightPublisherHeaderValidator annotation = method
.getAnnotation(SpotlightPublisherHeaderValidator.class);
log.info("SpotlightPublisherHeaderValidator: " + annotation);

if (annotation != null) {
final String authorizationHeader = request.getHeader(HttpHeaders.AUTHORIZATION);
Expand Down

0 comments on commit 00a15eb

Please sign in to comment.