Commit Graph

26 Commits

Author SHA1 Message Date
mac 699eaa5225 feat(delivery): add HTTP handlers and route registration
Add DeliveryHandler (7 endpoints under /auth/api/v1/delivery/*):
CreateMySQL, List, Get, Cancel, Targets, CreateTarget, UpsertQuota.
Add ExecutionHandler for internal service callback. Register routes
with JWT auth middleware and start scheduler goroutine when enabled.

Relates-to: #97
2026-07-23 12:04:51 +08:00
mac e11bc6f3d6 feat(delivery): implement delivery scheduler and state machine
Core delivery service with: task creation (idempotent, validated),
background scheduler (claimAndReserve with SELECT FOR UPDATE SKIP
LOCKED), 4-level concurrency control, resource quota enforcement,
host allocation from candidate pool, AWX job dispatch, polling,
TCP health check, instance registration, CloudDM integration
(optional), and cancel support. 11-state machine with optimistic
locking and full event audit trail.

Relates-to: #97
2026-07-23 12:04:37 +08:00
mac 81a94322f7 feat(delivery): add AWX API client
Implement AWXClient with Launch, GetJob, and Cancel methods for
orchestrating Ansible job templates via AWX REST API. Uses Bearer
token auth with 30s timeout. Includes unit tests with mock transport.

Relates-to: #97
2026-07-23 12:04:15 +08:00
mac 76583c6766 feat(delivery): add delivery configuration and environment variables
Add 10 config fields: AWX connection (AWX_BASE_URL, AWX_TOKEN),
scheduler controls (DELIVERY_SCHEDULER_ENABLED, DELIVERY_POLL_SECONDS,
DELIVERY_RESERVATION_TTL_MINUTES), concurrency limits (GLOBAL/TARGET/
BUSINESS), service token, and CloudDM registration (CLOUDDM_REGISTER_URL,
CLOUDDM_API_TOKEN). Update .env.example with new variables.

Relates-to: #97
2026-07-23 12:04:02 +08:00
mac 8676963bac feat(delivery): add delivery data models and auto-migration
Add 8 GORM models for MySQL one-click delivery: DeploymentTarget,
ResourceQuota, DeliveryTask, ResourceReservation, ResourceUsage,
MySQLInstance, ExecutionJob, TaskEvent. Register them in AutoMigrate.

Relates-to: #97
2026-07-23 12:03:47 +08:00
ztkkOip 89a23ef60d Merge pull request #95 from ztkkOip/feat/base-service-delivery
Feat(base service delivery)基础服务部署在主系统的初始化
2026-07-22 14:55:44 +08:00
wonder 5e47dee022 fix: upgrade golang.org/x/crypto to fix critical security vulnerabilities
- 升级 golang.org/x/crypto 从 v0.40.0 到 v0.54.0
- 修复 FIDO/U2F 安全密钥物理存在检查绕过漏洞
- 修复服务器意外响应导致的死锁问题
- 修复未强制执行 @revoked 状态导致的认证绕过漏洞
- 修复大通道写入导致的无限循环漏洞
- 修复未强制执行调用密钥约束问题
- 修复未删除调用代理约束转发密钥问题
- 修复 VerifiedPublicKeyCallback 权限跳过强制执行问题
- 同步升级相关依赖: x/net v0.56.0, x/sys v0.47.0, x/text v0.40.0, x/sync v0.22.0, x/mod v0.37.0, x/tools v0.47.0
2026-07-22 10:23:33 +08:00
mac 2db8264c8e feat(service): add deployment task integration 2026-07-21 18:26:50 +08:00
mac c324e2ec59 feat(auth): use Wayne native role APIs 2026-07-21 17:05:48 +08:00
mac 8d49230247 feat(server): add Wayne subsystem authorization APIs 2026-07-17 19:26:40 +08:00
mac a10d4a5921 fix: require Wayne user ID for role binding 2026-07-17 15:47:32 +08:00
mac d264924d1e feat: add business line permissions and Wayne namespace mapping 2026-07-17 15:02:18 +08:00
mac b151356045 fix(auth): handle saml logout and xml encryption padding 2026-07-17 09:43:42 +08:00
mac 487de70250 fix(auth): populate email for local login users 2026-07-16 17:08:23 +08:00
mac 2835cf2576 fix(auth): keep subsystem oauth working without sso 2026-07-16 16:43:01 +08:00
mac cafa8bc840 feat(auth): support local username login mode 2026-07-16 16:19:25 +08:00
mac eb2621d914 feat(auth): complete sso subsystem integration 2026-07-16 15:52:56 +08:00
mac da38acfcb5 merge: sync origin main into auth-login 2026-07-15 15:12:54 +08:00
mac 81d2a8a60b refactor(frontend): merge authserver web login 2026-07-15 14:47:42 +08:00
mac 6af511ed0b refactor(server): merge authserver implementation 2026-07-15 14:05:22 +08:00
wonder 509503a9a0 feat(server): 重构路由模块,优化开发体验
- 提取路由配置到独立的 router 包
- 优化 Makefile 并行启动前后端开发服务器
- 修复 Swagger 文档生成命令
2026-07-15 13:43:21 +08:00
wonder 1d799ac0e7 feat(server): 优化 Swagger 配置,支持动态 host
- 移除 swagger.json/yaml 中硬编码的 host 字段
- 在 docs.go 中将 Host 设置为空字符串以支持动态检测
- 添加前端 /swagger 代理配置,支持开发环境访问 Swagger UI
- 在 main.go 中导入 docs 包注册 Swagger 文档
2026-07-15 13:30:59 +08:00
wonder 8898437e9e feat(server): 集成 Swagger API 文档
- 引入 swaggo/gin-swagger 和 swaggo/files 依赖
- 配置 Swagger UI 路由 /swagger/*
- 为测试 handler 函数添加 Swagger 注解
- 将 main.go 中的内联 handler 重构到 handler/test.go 以支持注解
- 生成 Swagger 文档 (docs.go, swagger.json, swagger.yaml)
- Makefile 新增 make swagger 命令
- .gitignore 添加 server/docs/ 以跟踪生成的文档
- 添加 API 元信息(标题、版本、联系方式、许可证、安全定义)
2026-07-15 11:33:00 +08:00
wonder 3cbb1683a6 feat(server): 添加后端入口和统一响应格式测试路由
- 新增 server/cmd/server/main.go 作为服务入口
- 注册 /api/v1/test/* 测试端点,覆盖成功、业务错误、HTTP 错误、超时等场景
- 加载 Logger 和 Recovery 中间件
- 修复 recovery.go 未使用的 net/http 导入
- 更新 go.mod/go.sum 依赖
2026-07-15 11:03:28 +08:00
wonder 4f1df02f53 feat(server): 实现统一响应格式和错误码
- 添加 server/go.mod,模块路径为 github.com/1024XEngineer/xinfra/server
- 实现 response.go 统一 JSON 响应结构:
  - 响应信封:{ code, message, data, details }
  - 业务错误码 (10001-20002) 与 MVP 规范一致
  - 便捷函数:Success, Error, BadRequest, Unauthorized 等
  - 分页响应支持,包含 total 和 items
- 添加 recovery 中间件捕获 panic 并返回 500 错误
- 添加 logger 中间件记录请求日志

为所有后端处理器建立统一的 API 响应基础,与前端期望的格式保持一致。
2026-07-15 10:44:32 +08:00
wonder 1bd5921fd4 chore: 初始化项目骨架结构
- 创建前端 Vue3 项目目录结构(components、views、router、stores 等)
- 创建后端 Go 项目目录结构(cmd、internal、pkg 等分层架构)
- 创建部署配置目录(docker、k8s)
- 创建文档目录
- 添加 .gitignore 忽略规则
- 添加 Makefile 构建脚本
- 更新 README.md 项目说明文档
- 每个目录添加 .gitkeep 文件说明目录用途
2026-07-14 14:34:10 +08:00