Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions .env.example

This file was deleted.

103 changes: 0 additions & 103 deletions .github/workflows/ci.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/publish-images.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@
.vscode/
.gradle/
bin
build
.env
.env.prod
secrets/
.gradle-home/
build
9 changes: 0 additions & 9 deletions backend/.dockerignore

This file was deleted.

17 changes: 0 additions & 17 deletions backend/Dockerfile

This file was deleted.

44 changes: 0 additions & 44 deletions backend/Dockerfile.prod

This file was deleted.

5 changes: 0 additions & 5 deletions backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ dependencies {
implementation 'org.hibernate.validator:hibernate-validator:8.0.1.Final'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

// Database migrations
implementation 'org.springframework.boot:spring-boot-flyway'
implementation 'org.flywaydb:flyway-core'
runtimeOnly 'org.flywaydb:flyway-database-postgresql'

// PostgreSQL
runtimeOnly 'org.postgresql:postgresql'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
package com.casey.applyflow.config;

import java.util.Arrays;
import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfigurationSource;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;

@Configuration
public class CorsConfiguration {

@Value("${app.cors.allowed-origins:http://localhost:3000,http://localhost:5173}")
private String allowedOrigins;

@Bean
public CorsConfigurationSource corsConfigurationSource() {
org.springframework.web.cors.CorsConfiguration config = new org.springframework.web.cors.CorsConfiguration();
config.setAllowedOrigins(Arrays.stream(allowedOrigins.split(","))
.map(String::trim)
.filter(origin -> !origin.isBlank())
.toList());
config.setAllowedOrigins(List.of("http://localhost:3000", "http://localhost:5173"));
config.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
config.setAllowedHeaders(List.of("*"));
config.setAllowCredentials(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.Customizer;
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
Expand Down Expand Up @@ -35,9 +34,6 @@ public class SecurityConfiguration {

private final RsaKeyProperties rsaKeys;

@Value("${app.security.allow-h2-console:false}")
private boolean allowH2Console;

public SecurityConfiguration(RsaKeyProperties rsaKeys) {
this.rsaKeys = rsaKeys;
}
Expand All @@ -49,9 +45,7 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
.csrf(AbstractHttpConfigurer::disable) // Disable CSRF for stateless API
.authorizeHttpRequests(auth -> {
auth.requestMatchers("/api/auth/**").permitAll(); // Public auth endpoints
if (allowH2Console) {
auth.requestMatchers("/h2-console/**").permitAll();
}
auth.requestMatchers("/h2-console/**").permitAll(); // H2 console (dev only)
auth.anyRequest().authenticated(); // Everything else requires auth
})
.sessionManagement(session ->
Expand All @@ -60,11 +54,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
oauth2
.bearerTokenResolver(bearerTokenResolver())
.jwt(Customizer.withDefaults())) // Enable JWT validation
.headers(headers -> {
if (allowH2Console) {
headers.frameOptions(frame -> frame.sameOrigin());
}
})
.headers(headers ->
headers.frameOptions(frame -> frame.sameOrigin())) // For H2 console
.build();
}

Expand Down
Loading