Commit graph

20 commits

Author SHA1 Message Date
vsxd
0b1607630f fix(phase1): close auth and frontend acceptance gaps 2026-03-12 00:37:51 +08:00
vsxd
46bda26f9e docs: fix Phase 2 spec issues from review round 1
- CRITICAL: add Namespace entity field补齐 note (type, avatar_url, updatedAt)
- MAJOR: add CLI publish interface deviation note in key decisions
- MAJOR: define search behavior when q is empty + homepage list API
- MAJOR: add SkillRepository.incrementDownloadCount method
- MAJOR: add SecurityConfig update strategy note
- MAJOR: add Web publish interface deviation note
- MINOR: add missing Repository methods for namespace/member
- MINOR: add awaitTerminationSeconds to async thread pool
- MINOR: add starCount to search response
- MINOR: add namespace_slug to skill_search_document
- Clarify bundle.zip repacking strategy
- Add entity alignment verification to Chunk 1 acceptance criteria
2026-03-12 00:37:17 +08:00
vsxd
8b0ffc28c4 docs: add Phase 2 design spec - namespace + skill core
- Database migration: 5 new tables (skill, skill_version, skill_file, skill_tag, skill_search_document)
- Object storage: SPI + LocalFile/S3 dual implementation
- Namespace management: CRUD + member management
- Skill publish: upload → validate → store → persist → publish
- Skill query/download/tags: visibility control, tag management
- Search: PostgreSQL full-text with tsvector + GIN
- Async events: Spring Events + dedicated thread pool
- Rate limiting: Redis sliding window + annotation-driven
- Frontend: modern product-style pages with shadcn/ui
- Testing strategy: unit/integration/API/E2E layers
2026-03-12 00:28:09 +08:00
vsxd
404692d671 Fix phase1 auth flow gaps 2026-03-12 00:26:33 +08:00
vsxd
e6956e79fc feat(web): implement login page, dashboard, and API token management
- Login page with dynamic OAuth provider buttons from /api/v1/auth/providers
- Dashboard with AuthGuard, user info display, and token management
- TokenList component with create/delete operations via TanStack Query
- CreateTokenDialog with one-time token display and copy functionality
- API client with typed auth and token endpoints
- shadcn/ui components: Button, Card, Dialog, Table, Input, Label
- Tailwind CSS with CSS variables theming
- TanStack Router with Home, Login, Dashboard routes
- ESLint + TypeScript strict mode configuration
2026-03-12 00:13:50 +08:00
vsxd
ff5ecc90ac Merge branch 'feature/project-init' into feature/phase1-foundation-auth 2026-03-12 00:03:22 +08:00
vsxd
4d3e2dea02 feat(web): add frontend scaffold with React 19 and TanStack Router
- Initialize Vite + React 19 + TypeScript project
- Add TanStack Router v1.95 with file-based routing
- Add TanStack Query v5.64 for data fetching
- Configure Tailwind CSS + shadcn/ui
- Implement auth features (useAuth hook, LoginButton, AuthGuard)
- Add openapi-fetch client for type-safe API calls
- Configure Nginx for production deployment
- Update Makefile with frontend commands

Implements Task 3 (Chunk 3) of Phase 1 plan.
2026-03-12 00:00:26 +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
cfdb0985a9 Merge branch 'feature/phase1-foundation-auth' into feature/project-init 2026-03-11 23:49:16 +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
aa79a635b3 refactor: server project package renamed 2026-03-11 23:43:49 +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
3824fd439b chore: ignore local git worktrees 2026-03-11 23:16:57 +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
vsxd
dfa66bbfbe docs: rename project to skillhub 2026-03-11 20:34:09 +08:00
vsxd
db64bef098 docs: project's documents 2026-03-11 20:24:01 +08:00
wowo
b36b375ba0 Initial commit 2026-03-11 20:17:06 +08:00