Commit graph

276 commits

Author SHA1 Message Date
vsxd
3706e920df fix(api): 统一所有分页接口为1-based page
前端传 page=1 表示第一页,后端原来是 0-based 导致首页数据丢失。
涉及: SkillSearch, SkillController, ReviewController,
PromotionController, UserManagement, AuditLog
2026-03-13 12:56:23 +08:00
yun-zhi-ztl
447a34a1d1 merge(main): sync latest origin/main into feature/project-review 2026-03-13 12:49:12 +08:00
vsxd
a85a9c3177 fix(publish): 放宽技能包上传校验
- application.yml 补齐缺失的文件扩展名白名单(.js,.ts,.png,.jpg,.svg)
- version 为空时自动生成时间戳版本号,不再强制报错
2026-03-13 12:47:34 +08:00
vsxd
ac32fce08f fix(auth): preserve return target across oauth login 2026-03-13 11:59:17 +08:00
yun-zhi-ztl
556d556724 fix(token): align revoke endpoint with 204 contract
Change DELETE /api/v1/tokens/{id} to return HTTP 204 No Content so the backend matches the existing OpenAPI contract and the frontend delete flow no longer rejects successful revocations.

Add a controller regression test that verifies the endpoint returns 204 with an empty body and still delegates the revoke call to ApiTokenService. Verified with the targeted TokenControllerTest plus full server mvn test.
2026-03-13 11:49:57 +08:00
yun-zhi-ztl
383bc1edae fix(admin): replace compat and admin placeholders with real queries
Implement compat search through SkillSearchAppService instead of returning an empty placeholder list, and map search results back to canonical slugs for the compatibility API.

Replace hard-coded admin user and audit-log payloads with repository-backed application services. User management now supports paged search and status filters, validates managed statuses and role codes, prevents USER_ADMIN from assigning SUPER_ADMIN, and persists role/status changes against the real repositories. Audit logs now read from the audit_log table through a dedicated query repository/service with filterable pagination.

Align admin response DTOs with the frontend contract, add domain not-found handling for localized 404 responses, and cover the new behavior with controller and service regression tests. Verified with targeted skillhub-app tests plus full server mvn test.
2026-03-13 11:46:21 +08:00
vsxd
84dd08503d merge: bring feature/project-init into main for beta3
# Conflicts:
#	scripts/smoke-test.sh
2026-03-13 11:45:56 +08:00
vsxd
6a9e0845d4 Complete phase 3 and 4 backend workflows 2026-03-13 11:36:34 +08:00
vsxd
76808ca794 test(auth): align auth module tests with current flows 2026-03-13 11:32:50 +08:00
vsxd
5bb2eb0d98 fix(auth): grant global membership to new users 2026-03-13 11:29:01 +08:00
vsxd
0c5e4200cb fix(dev): provide explicit skill repository bean 2026-03-13 11:21:32 +08:00
yun-zhi-ztl
ad8bb9c6fd fix(security): whitelist only public skill GET routes
- require authentication for skill star and rating GET endpoints before the public skill-read rules

- keep documented public skill detail, version, download, resolve, and tag listing endpoints readable anonymously

- add regression coverage for anonymous star and rating access denial plus public tag listing
2026-03-13 11:12:18 +08:00
yun-zhi-ztl
ec8f7ec838 fix(auth): enforce api token scopes and active-user checks
- parse stored api token scopes and attach SCOPE authorities during authentication

- reject disabled users from establishing api token sessions and stop touching last-used for inactive accounts

- add an api-token-only scope filter that limits tokens to documented publish and token-management endpoints
2026-03-13 11:04:52 +08:00
vsxd
3cee8fbb5a fix(phase4): harden smoke checks and metrics access 2026-03-13 10:56:28 +08:00
vsxd
0ca38e73ba merge: bring phase4 worktree implementation into feature/project-init
# Conflicts:
#	server/skillhub-app/src/main/java/com/iflytek/skillhub/controller/cli/CliPublishController.java
#	server/skillhub-app/src/main/java/com/iflytek/skillhub/controller/portal/SkillPublishController.java
#	server/skillhub-storage/src/main/java/com/iflytek/skillhub/storage/LocalFileStorageService.java
#	web/src/app/router.tsx
2026-03-13 10:35:42 +08:00
vsxd
b982011614 fix(ops): align smoke test with csrf and metrics access 2026-03-13 10:23:46 +08:00
yun-zhi-ztl
ddbf92435f fix(upload): harden package extraction and storage boundaries
- add shared package safety policy for path normalization and size limits

- stream zip extraction for cli check and publish flows to reject traversal and oversized entries

- confine local storage keys to the configured base path and add regression coverage
2026-03-13 10:20:34 +08:00
vsxd
07ea0fa822 merge: bring phase4 worktree implementation into main
# Conflicts:
#	server/skillhub-app/src/main/java/com/iflytek/skillhub/controller/cli/CliPublishController.java
#	server/skillhub-app/src/main/java/com/iflytek/skillhub/controller/portal/SkillPublishController.java
#	server/skillhub-storage/src/main/java/com/iflytek/skillhub/storage/LocalFileStorageService.java
#	web/src/app/router.tsx
2026-03-13 10:20:19 +08:00
vsxd
33c44fb9cc feat(phase4): complete auth, governance, observability, and ops polish 2026-03-13 10:17:48 +08:00
vsxd
62d9d88546 chore(release): cut v0.1.0-beta.2 2026-03-13 10:13:50 +08:00
vsxd
d4deb2fb74 fix: address review-reported auth and publish issues 2026-03-13 10:06:25 +08:00
vsxd
f7798dddc5 Revert "merge: bring review fixes into feature/project-init"
This reverts commit 92f63f8b89, reversing
changes made to 78e16f0fe7.
2026-03-13 10:06:14 +08:00
yun-zhi-ztl
7bc152a744 fix(publish): keep latest pointer aligned with published versions
- stop publish submission from advancing skill.latestVersionId or overwriting published-facing skill metadata while a version is still pending review\n- move latest pointer and display metadata promotion into review approval so the public skill record changes only when a version becomes PUBLISHED\n- keep SkillPublishedEvent emission on review approval only, preserving search rebuild semantics for published versions\n- add regression coverage for pending review submissions retaining published metadata and for approval promoting latest pointer plus display fields
2026-03-13 10:01:01 +08:00
vsxd
5bb887b292 fix: address review-reported auth and publish issues 2026-03-12 22:29:51 +08:00
tlzhu3
f99ffbd7ec fix(review): tighten review and promotion access boundaries
- derive review namespace from skill ownership instead of trusting request input\n- require namespace membership for review submission and owner or namespace admin rights for promotion submission\n- forbid unauthorized pending-list and detail reads in review and promotion portal endpoints\n- add domain and controller regression tests for submit and read permission boundaries
2026-03-12 22:26:44 +08:00
vsxd
8c5b4d176a feat(auth): add local username-password login 2026-03-12 21:59:28 +08:00
tlzhu3
444a52f802 fix(auth): complete device flow token exchange 2026-03-12 21:42:15 +08:00
vsxd
3c9b95fd98 refactor(auth): remove local auth flow 2026-03-12 21:36:49 +08:00
vsxd
e63531ca3d feat(dev): stabilize local env and phase3 flows 2026-03-12 21:33:25 +08:00
vsxd
05ec9bfbc2 feat(auth): add local username-password login 2026-03-12 21:27:01 +08:00
vsxd
559a9133ab fix(backend): use DomainBadRequestException and ApiResponse envelope
- IdempotencyInterceptor: restructure Redis check to avoid swallowing
  exceptions inside try-catch, use ApiResponse envelope for 409 response
- IdempotencyInterceptorTest: register JavaTimeModule for Instant
  serialization, align mocks with actual implementation
- SkillRatingServiceTest: update expected exception type to match
  DomainBadRequestException used in entity and service
2026-03-12 20:21:59 +08:00
vsxd
b028937abb refactor(api): improve controllers with dedicated DTOs and better tests
- Extract admin DTOs (AdminUserSummary, AdminUserMutation, etc.)
- Add SkillRating request/response DTOs
- Improve controller input validation and error responses
- Strengthen controller test assertions
2026-03-12 20:12:04 +08:00
vsxd
50adf3545d refactor(auth): improve DeviceAuthService error handling and tests
Strengthen device auth flow with better error messages and
additional test coverage.
2026-03-12 20:11:40 +08:00
vsxd
4dfa17dc4e refactor(domain): improve SkillRating validation and add domain tests
- Add rating value validation in SkillRating entity
- Improve SkillRatingService error handling
- Add SkillPublishService and SkillQueryService test coverage
2026-03-12 20:11:32 +08:00
vsxd
cab627be02 feat(infra): add i18n messages, Redis config, and slug normalization migration
- Add rating/admin i18n message keys (en + zh)
- Improve IdempotencyInterceptor error handling
- Add RedisTemplateConfig for consistent serialization
- Add V4 migration to normalize skill slugs
- Fix RequestIdFilterTest
2026-03-12 20:11:24 +08:00
vsxd
c0e9c10e15 feat(admin): add idempotency layer and admin management API
- Add IdempotencyRecord entity with status tracking (PROCESSING/COMPLETED/FAILED)
- Implement IdempotencyInterceptor for request deduplication via X-Request-Id header
- Add scheduled cleanup tasks for expired and stale idempotency records
- Create admin API endpoints for user management (list/update role/update status)
- Create admin API endpoints for audit log viewing with filtering
- Add comprehensive unit tests for all components
- Configure test Redis mocks to support idempotency layer
2026-03-12 19:32:09 +08:00
vsxd
efd43ef3cd feat(compat): add ClawHub compatibility layer 2026-03-12 19:20:02 +08:00
vsxd
fae775eb97 fix(test): provide mock RedisTemplate for test context
- Add TestRedisConfig with mock RedisTemplate bean
- Restore DeviceAuthService as normal @Service (no conditional)
- Restore controllers as normal @RestController (no conditional)
- Remove DeviceAuthConfig and DeviceAuthWebConfig (not needed)
- All 179 tests pass
2026-03-12 19:08:25 +08:00
vsxd
5cc595b0ff feat(cli): add skill package check endpoint 2026-03-12 18:26:50 +08:00
vsxd
f47377cff1 feat(cli): add Device Auth controllers 2026-03-12 18:19:03 +08:00
vsxd
9a4d64b11b feat(cli): implement DeviceAuthService with Redis storage 2026-03-12 18:13:46 +08:00
vsxd
37fd831ce7 feat(cli): add Device Flow data models 2026-03-12 18:11:13 +08:00
vsxd
dd4f8d8abe feat(social): add SkillStar and SkillRating controllers 2026-03-12 18:06:03 +08:00
vsxd
dbb6d9f39e feat(ops): improve Dockerfile caching, add dockerignore, docker profile, Makefile help
- Server Dockerfile: add Maven dependency caching layer for faster rebuilds
- Add .dockerignore for server and web to reduce build context
- Add docker profile to application.yml for container env var mapping
- Makefile: add help, logs, db-reset targets with ## annotations
2026-03-12 17:50:34 +08:00
vsxd
b520689130 feat(app): update controllers, DTOs, config, rate limiting, and add new components
- Add BaseApiController, MeController, AuthContextFilter
- Add standardized ApiResponse/ApiResponseFactory/PageResponse DTOs
- Add i18n messages (en/zh)
- Replace SlidingWindowRateLimiter with RateLimiter interface + Redis/InMemory impls
- Add localized exception handling
- Update application.yml with messages config
- Update Flyway migrations V1-V3
- Add SkillController and SkillSearchController tests
2026-03-12 17:47:58 +08:00
vsxd
6df55e3768 feat(infra): update JPA repository implementations 2026-03-12 17:47:37 +08:00
vsxd
db0d86ea08 feat(search): update search documents and query services 2026-03-12 17:47:18 +08:00
vsxd
d44f9415fe feat(auth): update security config, auth entities, and token services 2026-03-12 17:47:08 +08:00
vsxd
cfcdb545f0 feat(domain): update entities, services, repositories, and add shared exceptions 2026-03-12 17:46:48 +08:00
vsxd
217ed7e918 feat(social): add SkillStarService and SkillRatingService with events 2026-03-12 17:36:42 +08:00