Commit graph

41 commits

Author SHA1 Message Date
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
vsxd
ae24a18e64 feat(social): add SkillStar and SkillRating entities and repositories 2026-03-12 17:19:50 +08:00
vsxd
8b17f2c55b feat(review): add ReviewController and PromotionController REST APIs
- Add review DTOs: ReviewTaskRequest, ReviewTaskResponse, ReviewActionRequest
- Add promotion DTOs: PromotionRequestDto, PromotionResponseDto, PromotionActionRequest
- Add ReviewController with submit/approve/reject/withdraw/list endpoints
- Add PromotionController with submit/approve/reject/list endpoints
- Follow existing BaseApiController + ApiResponse pattern
2026-03-12 16:41:32 +08:00
vsxd
51fa37a9c5 feat(review): implement PromotionService
- Add submitPromotion with duplicate check and validation
- Add approvePromotion with optimistic locking and skill copying
- Add rejectPromotion with reason recording
2026-03-12 15:52:54 +08:00
vsxd
bffc36b815 feat(review): implement ReviewService
- Add submitReview with duplicate check via partial unique index
- Add approveReview with optimistic locking and event publishing
- Add rejectReview with reason recording
- Add withdrawReview with PENDING status check
2026-03-12 15:42:21 +08:00
vsxd
644b3efd44 feat(review): add ReviewPermissionChecker with tests
- canReview: self-review blocked, GLOBAL requires SKILL_ADMIN/SUPER_ADMIN,
  TEAM requires namespace ADMIN/OWNER
- canReviewPromotion: self-review blocked, requires SKILL_ADMIN/SUPER_ADMIN
- NamespaceType passed as parameter to avoid internal repository lookup
- 12 unit tests covering all permission scenarios
2026-03-12 15:24:51 +08:00
vsxd
3ebdc2691d feat(repo): add review repositories
- Add ReviewTaskRepository with optimistic lock update
- Add PromotionRequestRepository
- Implement JPA repositories in infra module
2026-03-12 15:17:11 +08:00
vsxd
8a1b1a9d5f feat(domain): add review workflow domain entities
- Add ReviewTaskStatus enum (PENDING, APPROVED, REJECTED)
- Add ReviewTask entity with optimistic locking
- Add PromotionRequest entity for cross-namespace promotion
2026-03-12 15:10:55 +08:00
vsxd
e57efef41b feat(db): add Phase 3 database migration
- Add review_task table with partial unique index
- Add promotion_request table
- Add skill_star and skill_rating tables
- Add idempotency_record table
2026-03-12 15:05:38 +08:00
vsxd
1db4ec1e78 feat: add skill controllers, search, async events, rate limiting, and config 2026-03-12 02:36:59 +08:00
vsxd
28040f36a2 feat(domain): add skill publish, query, download, and tag services with tests 2026-03-12 02:24:03 +08:00
vsxd
c9f9ef03f2 feat: add namespace services, controller, DTOs, and domain events 2026-03-12 02:12:00 +08:00
vsxd
4920506643 feat(domain): add SkillMetadataParser, SkillPackageValidator, and VisibilityChecker with tests 2026-03-12 02:04:29 +08:00
vsxd
8644154157 feat(domain): add Skill domain entities, repositories, and JPA implementations 2026-03-12 02:00:34 +08:00
vsxd
ca36304df9 feat(storage): add object storage SPI with LocalFile and S3 implementations 2026-03-12 01:56:27 +08:00
vsxd
351829e1a9 feat(domain): add SlugValidator with comprehensive validation rules 2026-03-12 01:53:08 +08:00
vsxd
95c8c31561 feat(domain): complete Phase 1 entity fields for Namespace and NamespaceMember 2026-03-12 01:51:57 +08:00
vsxd
3ceee87a20 feat(db): add Phase 2 skill tables migration 2026-03-12 01:50:18 +08:00
vsxd
0b1607630f fix(phase1): close auth and frontend acceptance gaps 2026-03-12 00:37:51 +08:00
vsxd
404692d671 Fix phase1 auth flow gaps 2026-03-12 00:26:33 +08:00
vsxd
6380677fcf feat(auth): complete Chunk 2 - security config, controllers, mock auth
Task 14: Spring Security config
- SecurityConfig with OAuth2 login, CSRF Cookie-to-Header, CLI API exempt
- ApiTokenAuthenticationFilter before UsernamePasswordAuthenticationFilter
- Spring Session Redis + OAuth2 client config in application.yml

Task 15: MockAuthFilter
- @Profile("local") filter reads X-Mock-User-Id header
- Creates PlatformPrincipal and sets SecurityContext for local dev

Task 16: AuthController + TokenController
- GET /api/v1/auth/me: current user info from session
- GET /api/v1/auth/providers: available OAuth providers
- POST/GET/DELETE /api/v1/tokens: create, list, revoke API tokens

Task 17: Enhanced GlobalExceptionHandler
- ErrorResponse with requestId and timestamp
- 400 for IllegalArgumentException, 500 catch-all with MDC requestId
2026-03-11 23:55:15 +08:00
vsxd
5c4be0a26f feat(auth): add OAuth2 login, access policy, API token, and RBAC
Task 10b: OAuth Claims + Access Policy
- OAuthClaims record, OAuthClaimsExtractor SPI, GitHubClaimsExtractor
- AccessPolicy SPI with Open/EmailDomain/ProviderAllowlist/SubjectWhitelist
- AccessPolicyFactory with config-driven strategy selection
- 8 unit tests for access policies

Task 11: Identity binding + OAuth2 user service
- PlatformPrincipal session-serializable record
- IdentityBindingService: bind-or-create on OAuth login
- CustomOAuth2UserService: policy evaluation + identity binding
- OAuth2LoginSuccessHandler: store principal in session

Task 12: API Token + RBAC
- ApiTokenService: SHA-256 hashed token create/validate/revoke
- ApiTokenAuthenticationFilter: Bearer token authentication
- RbacService: role/permission queries with SUPER_ADMIN bypass
2026-03-11 23:48:16 +08:00
vsxd
2991eb11e0 feat(domain/infra/auth): add domain entities, JPA repos, and auth entities
Task 8: Domain layer
- UserAccount entity with UserStatus lifecycle
- Namespace, NamespaceMember entities with NamespaceRole
- Repository interfaces for domain aggregates

Task 9: Infra layer
- UserAccountJpaRepository, NamespaceJpaRepository, NamespaceMemberJpaRepository
- Spring Data JPA implementations

Task 10: Auth entities and repositories
- IdentityBinding, ApiToken, Role, Permission, RolePermission, UserRoleBinding
- JPA repositories for all auth entities
- UserRoleBinding with eager-loaded Role for RBAC queries
2026-03-11 23:42:53 +08:00
vsxd
edfff6abc7 feat: complete Chunk 1 - backend skeleton and infrastructure
- Migrate all Maven groupId and Java packages to com.iflytek.skillhub
- Add Docker Compose with PostgreSQL 16, Redis 7, MinIO
- Add Flyway V1 migration with Phase 1 core schema (user, auth, RBAC, namespace, audit)
- Add RequestIdFilter with MDC tracing and X-Request-Id header
- Add GlobalExceptionHandler and ErrorResponse DTO
- Add HealthController (/api/v1/health) and OpenAPI config
- Add basic SecurityConfig permitting public endpoints
- Add H2 test profile for CI-friendly testing without external services
- Add top-level Makefile for dev workflow orchestration
- All 3 tests passing
2026-03-11 23:35:47 +08:00
vsxd
e726746f4d feat: add Spring Boot application entry point and base configuration
- Create SkillhubApplication main class
- Add application.yml with JPA, Flyway, graceful shutdown config
- Add application-local.yml for local development profile
- Add database and Redis dependencies to skillhub-app POM
2026-03-11 22:57:03 +08:00
vsxd
b7cc6b883f feat: initialize Maven multi-module project structure
- Parent POM with Spring Boot 3.2.3 and JDK 21
- 6 modules: app, domain, auth, search, storage, infra
- Module dependency directions per architecture design
- Maven Wrapper for reproducible builds
2026-03-11 22:52:04 +08:00
vsxd
27b7a4dad1 feat: project ini and docs updates 2026-03-11 22:47:05 +08:00