Skip to content

Commit

Permalink
Disable client editing through MitreID API endpoint (#703)
Browse files Browse the repository at this point in the history
GET endpoint still enabled because it's used by whitelist page
  • Loading branch information
enricovianello authored Jan 29, 2024
1 parent a97a1a0 commit e1cbdb4
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
Expand Down Expand Up @@ -56,7 +57,11 @@ public static class MitreApisEndpointAuthorizationConfig extends WebSecurityConf
public void configure(final HttpSecurity http) throws Exception {

// @formatter:off
http.antMatcher("/api/**")
http.authorizeRequests()
.antMatchers(HttpMethod.POST, "/api/clients").denyAll()
.antMatchers(HttpMethod.PUT, "/api/clients/**").denyAll()
.antMatchers(HttpMethod.DELETE, "/api/clients/**").denyAll();
http.antMatcher("/api/**")
.addFilterAfter(resourceFilter, SecurityContextPersistenceFilter.class)
.exceptionHandling()
.authenticationEntryPoint(authenticationEntryPoint)
Expand Down

0 comments on commit e1cbdb4

Please sign in to comment.