BAIS 권한 서비스를 Spring Java로 전환 #3
4 changed files with 73 additions and 0 deletions
3
.forge/BAIS-E2E-MIG-001-attempt-2.md
Normal file
3
.forge/BAIS-E2E-MIG-001-attempt-2.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# BAIS-E2E-MIG-001-attempt-2
|
||||
|
||||
Forge 이슈 작업 브랜치 `forge/BAIS-E2E-MIG-001-attempt-2`.
|
||||
46
pom.xml
Normal file
46
pom.xml
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>bais-authorization-service</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
11
src/main/java/com/example/AuthorizationService.java
Normal file
11
src/main/java/com/example/AuthorizationService.java
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package com.example;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class AuthorizationService {
|
||||
public boolean hasAccess(String userId, String resource) {
|
||||
// 권한 로직을 여기에 구현합니다.
|
||||
return true; // 예시로 항상 true를 반환
|
||||
}
|
||||
}
|
||||
13
src/test/java/com/example/AuthorizationServiceTest.java
Normal file
13
src/test/java/com/example/AuthorizationServiceTest.java
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package com.example;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
class AuthorizationServiceTest {
|
||||
|
||||
@Test
|
||||
void testHasAccess() {
|
||||
AuthorizationService service = new AuthorizationService();
|
||||
assertTrue(service.hasAccess("user1", "resource1"));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue