Add OpenAPI documentation generation and update security configuration
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
This commit is contained in:
@@ -88,13 +88,13 @@ public class SecurityConfiguration {
|
||||
.cors(withDefaults())
|
||||
//.authorizeHttpRequests(auth -> auth.anyRequest().permitAll()) //allows Access To ALL APIs, Security is off
|
||||
.authorizeHttpRequests(auth -> {
|
||||
auth.requestMatchers(AUTH_WHITELIST).permitAll();
|
||||
auth.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll();
|
||||
auth.requestMatchers("/auth/user/**").permitAll();
|
||||
auth.requestMatchers("/admin/**").hasRole("ADMIN"); //looks for "ROLE_ADMIN" //alternative: hasAuthoritiy("ADMIN")
|
||||
auth.requestMatchers("/user/**").hasAnyRole("ADMIN", "USER");
|
||||
auth.requestMatchers("/friendship/**").hasAnyRole("ADMIN", "USER");
|
||||
auth.requestMatchers("/trip/**").hasAnyRole("USER", "ADMIN");
|
||||
auth.requestMatchers(AUTH_WHITELIST).permitAll();
|
||||
//auth.requestMatchers("/error").permitAll();
|
||||
auth.anyRequest().authenticated();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user