initial Release request #1

Merged
Cedric merged 34 commits from dev into main 2025-01-12 10:46:30 +01:00
3 changed files with 22 additions and 17 deletions
Showing only changes of commit e20be63e5e - Show all commits

View File

@@ -38,6 +38,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

View File

@@ -0,0 +1,13 @@
package de.zendric.app.xpensely_server.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
class HomeController {
@GetMapping("/")
public String getAll() {
return "Welcome";
}
}

View File

@@ -2,31 +2,19 @@ package de.zendric.app.xpensely_server.security;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(authorize -> authorize
.anyRequest().permitAll() // Allow all requests without authentication
)
.csrf().disable(); // Disable CSRF for development purposes
http.authorizeHttpRequests(auth -> auth
.anyRequest().authenticated()).oauth2Login(Customizer.withDefaults());
return http.build();
}
// @Bean
// public SecurityFilterChain securityFilterChain(HttpSecurity http) throws
// Exception {
// return http.authorizeHttpRequests(auth -> {
// auth.requestMatchers("/").permitAll();
// auth.anyRequest().permitAll();
// // auth.anyRequest().authenticated();
// }).oauth2Login(Customizer.withDefaults())
// .build();
// }
}