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
11 changes: 0 additions & 11 deletions .ebextensions-dev/00-makeFiles.config

This file was deleted.

3 changes: 0 additions & 3 deletions .ebextensions-dev/01-update-timezone.config

This file was deleted.

11 changes: 0 additions & 11 deletions .ebextensions-prod/00-makeFiles.config

This file was deleted.

3 changes: 0 additions & 3 deletions .ebextensions-prod/01-update-timezone.config

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/elasticbeanstalk-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ jobs:
environment_name: Juulabel-backend-dev-env # Elastic Beanstalk 환경 이름
version_label: juulabel-backend-dev-${{steps.current-time.outputs.formattedTime}}
region: ap-northeast-2
deployment_package: docker-compose-dev-deploy.yml
deployment_package: elastic-beanstalk-dev-deploy.yml
wait_for_environment_recovery: 60
1 change: 0 additions & 1 deletion .platform/nginx/conf.d/elasticbeanstalk/s3conf.conf

This file was deleted.

1 change: 0 additions & 1 deletion Procfile

This file was deleted.

6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ dependencies {
implementation 'io.jsonwebtoken:jjwt:0.12.5'

// lombok
implementation 'org.projectlombok:lombok'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// mysql
runtimeOnly 'com.mysql:mysql-connector-j'

// swagger
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.0.3'

// p6spy logging
implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.9.1'

// S3
implementation 'org.springframework.cloud:spring-cloud-starter-aws:2.2.6.RELEASE'

Expand Down
7 changes: 0 additions & 7 deletions docker-compose-dev-deploy.yml

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/java/com/juu/juulabel/EbHealthCheck.java

This file was deleted.

6 changes: 3 additions & 3 deletions src/main/java/com/juu/juulabel/api/config/SecurityConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.juu.juulabel.api.config;

import com.juu.juulabel.api.filter.JwtAuthenticationFilter;
import com.juu.juulabel.api.filter.JwtAuthorizationFilter;
import com.juu.juulabel.api.filter.JwtExceptionFilter;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Bean;
Expand All @@ -25,7 +25,7 @@
@RequiredArgsConstructor
public class SecurityConfig {

private final JwtAuthenticationFilter jwtAuthenticationFilter;
private final JwtAuthorizationFilter jwtAuthenticationFilter;
private final JwtExceptionFilter jwtExceptionFilter;

private static final String[] PERMIT_PATHS = {
Expand Down Expand Up @@ -71,7 +71,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
)

.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(jwtExceptionFilter, JwtAuthenticationFilter.class)
.addFilterBefore(jwtExceptionFilter, JwtAuthorizationFilter.class)

.build();
}
Expand Down
26 changes: 22 additions & 4 deletions src/main/java/com/juu/juulabel/api/config/SwaggerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,15 @@
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.http.HttpHeaders;

@OpenAPIDefinition(
servers = {
@Server(url = "https://juulabel.shop", description = "Server"),
@Server(url = "http://localhost:8084", description = "Local")
@Server(url = "https://dev.juulabel.com", description = "Server"),
@Server(url = "http://localhost:8080", description = "Local")
}
)
@Configuration
@Profile("dev")
public class SwaggerConfig {

@Bean
Expand Down Expand Up @@ -50,4 +48,24 @@ public OpenAPI springShopOpenAPI() {
.components(components);
}

@Bean

public OpenAPI openAPI() {
return new OpenAPI()
.addSecurityItem(new SecurityRequirement().addList("JWTAuth"))
.components(new io.swagger.v3.oas.models.Components()
.addSecuritySchemes("JWTAuth", securityScheme()));
}


private SecurityScheme securityScheme() {
return new SecurityScheme()
.name("JWTAuth")
.scheme("bearer")
.bearerFormat("JWT")
.type(SecurityScheme.Type.HTTP)
.in(SecurityScheme.In.HEADER)
.description("JWT 인증 토큰을 입력하세요.");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.juu.juulabel.api.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(
name = "헬스체크 API",
description = "헬스체크 API"
)
@RestController
public class HeathCheckController {


@Operation(
summary = "헬스체크 API",
description = "AWS ALB에서 헬스체크"
)
@GetMapping("/")
public ResponseEntity<String> healthCheck() {
return ResponseEntity.ok("OK");
}

}
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
package com.juu.juulabel;
package com.juu.juulabel.api.controller;


import io.sentry.Sentry;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(
name = "테스트 API",
description = "테스트 API"
)
@RestController
@RequestMapping("/sentry")
public class SentryTestController {


@Operation(summary = "Sentry 알림 테스트 API")
@GetMapping
public void test() {
try{
try {
throw new RuntimeException("222");
}catch (Exception e){
} catch (Exception e) {
Sentry.captureException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.juu.juulabel.api.controller;


import com.juu.juulabel.api.provider.JwtTokenProvider;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Tag(
name = "테스트 API",
description = "테스트 API"
)
@RestController
@RequiredArgsConstructor
public class TestAccessTokenController {

private final JwtTokenProvider jwtTokenProvider;

@Operation(
summary = "JWT 테스트용 토큰 발급 API",
description = "기본 [email protected] 이메일로 JWT 발급"
)
@GetMapping("/token")
public String testAccessToken(@RequestParam(defaultValue = "[email protected]") String email) {
return jwtTokenProvider.createAccessToken(email);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@Component
@RequiredArgsConstructor
public class JwtAuthenticationFilter extends OncePerRequestFilter {
public class JwtAuthorizationFilter extends OncePerRequestFilter {

private final JwtTokenProvider jwtTokenProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public ResponseEntity<CommonResponse<String>> handle(MalformedJwtException e) {

@ExceptionHandler(NoResourceFoundException.class)
public void handle(NoResourceFoundException e) {
log.warn("NoResourceFoundException :", e);
// 이거 키면 출력이 너무 많이 됨
//log.warn("NoResourceFoundException : {}", e.getMessage());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public BrewerySummary getBreweryById(Long breweryId) {
BrewerySummary.class,
brewery.id,
brewery.name,
brewery.region
brewery.region,
brewery.message
)
)
.from(brewery)
Expand Down
Loading