ab0265c17b
- 新增 docker-compose.yml、两服务 Dockerfile(eclipse-temurin:17-jre、非 root、仅装 exec jar)与 deploy/init-secrets.sh(幂等生成 RS256 密钥对与 .env 随机机密,产物入 .gitignore) - 容器配置复用 application.yml.sample(SPRING_CONFIG_LOCATION 挂载)+ PATBOND_* 环境变量,与本机运行同一套约定;DB 端口不对宿主机发布 - spring-boot-maven-plugin 显式绑定 repackage(本工程无 starter-parent,此前 package 产物不可执行),exec classifier 保留普通 jar 供 auth 模块 E2E 依赖 - 验收:docker compose up -d --build 后完整冒烟通过(register→me→refresh→旧 token 重用 40102→/internal 无凭证 401→logout),down -v 无残留;./mvnw clean test 全绿 74 测试 - README 新增 Docker Compose 一节 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
111 lines
4.4 KiB
XML
111 lines
4.4 KiB
XML
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<parent>
|
|
<groupId>com.patbond.patbond</groupId>
|
|
<artifactId>patbond-api</artifactId>
|
|
<version>1.0.0-SNAPSHOT</version>
|
|
<relativePath>../pom.xml</relativePath>
|
|
</parent>
|
|
|
|
<artifactId>patbond-auth</artifactId>
|
|
<packaging>jar</packaging>
|
|
|
|
<name>patbond-auth</name>
|
|
<description>Authentication service for Patbond</description>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>com.patbond.patbond</groupId>
|
|
<artifactId>patbond-common</artifactId>
|
|
<version>${project.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-web</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-validation</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.cloud</groupId>
|
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
|
</dependency>
|
|
<!-- Real HTTP client for Feign: the JDK HttpURLConnection default
|
|
returns a null error stream on 401 replies to streamed POSTs, so
|
|
downstream error envelopes (40100/40102…) were unreadable and
|
|
collapsed to 503 (found by AuthE2eIntegrationTest). -->
|
|
<dependency>
|
|
<groupId>io.github.openfeign</groupId>
|
|
<artifactId>feign-hc5</artifactId>
|
|
</dependency>
|
|
<!-- Access token issuing (RS256): jjwt is not in the Boot BOM, version
|
|
pinned here and in patbond-user in step. -->
|
|
<dependency>
|
|
<groupId>io.jsonwebtoken</groupId>
|
|
<artifactId>jjwt-api</artifactId>
|
|
<version>0.12.6</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.jsonwebtoken</groupId>
|
|
<artifactId>jjwt-impl</artifactId>
|
|
<version>0.12.6</version>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.jsonwebtoken</groupId>
|
|
<artifactId>jjwt-jackson</artifactId>
|
|
<version>0.12.6</version>
|
|
<scope>runtime</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-starter-test</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<!-- End-to-end vertical test: boots the real user service (against a
|
|
Testcontainers postgres:18) in the same JVM and drives the full
|
|
register → login → me → refresh → logout flow over HTTP. -->
|
|
<dependency>
|
|
<groupId>com.patbond.patbond</groupId>
|
|
<artifactId>patbond-user</artifactId>
|
|
<version>${project.version}</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.testcontainers</groupId>
|
|
<artifactId>postgresql</artifactId>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.springframework.boot</groupId>
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
<!-- No spring-boot-starter-parent in this build, so the
|
|
executable-jar repackaging must be bound explicitly. -->
|
|
<executions>
|
|
<execution>
|
|
<goals>
|
|
<goal>repackage</goal>
|
|
</goals>
|
|
<configuration>
|
|
<!-- Keep the plain jar as the main artifact so other
|
|
modules can depend on this one (patbond-auth's
|
|
E2E test does); the runnable fat jar gets the
|
|
-exec classifier and is what the Dockerfile ships. -->
|
|
<classifier>exec</classifier>
|
|
</configuration>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|