Commit graph

808 commits

Author SHA1 Message Date
dongmucat
311d12626c fix(namespace): use data-testid to scope namespace card in delete e2e 2026-05-06 18:07:17 +08:00
dongmucat
3acd5ef292 fix(namespace): relocate delete i18n keys to match frontend usage
The delete translations lived under myNamespaces.delete.* but every caller
looks them up as namespace.delete.* (my-namespaces.tsx and
delete-namespace-dialog.tsx). i18next fell back to the raw key, so the
rendered button read 'namespace.delete.button' and the E2E regex
/^delete$/i never matched. Move the block under namespace.* in both
locales to make the keys resolvable.
2026-05-06 17:53:24 +08:00
dongmucat
7d8d0df812 chore(api): regenerate OpenAPI types for canDelete field 2026-05-06 16:59:25 +08:00
dongmucat
5581d4ec0b fix(namespace): add missing canDelete field to MyNamespaceResponse DTO 2026-05-06 16:56:36 +08:00
dongmucat
628098ce43 fix(e2e): use admin credentials for namespace delete spec to own created namespace 2026-05-06 16:28:05 +08:00
dongmucat
86a4c0b4de fix(namespace): align delete e2e selectors with my-namespaces ui
The failed CI run showed three timeouts on getByRole('link'), but the
namespace cards render as clickable divs and the archive flow uses a
ConfirmDialog with no textarea. Rewrite the delete spec to operate
directly on the card, and seed the archived state through the real API
instead of walking the archive UI.
2026-05-06 16:01:16 +08:00
dongmucat
d5af863d73 test(namespace): add comprehensive tests for delete functionality 2026-05-06 14:39:36 +08:00
dongmucat
5cc41c4e92 feat(namespace): implement frontend delete functionality with reason input
Add complete frontend implementation for namespace deletion:
- API layer: add delete() method to namespaceApi
- Hooks layer: add useDeleteNamespace() mutation hook
- UI layer: add DeleteNamespaceDialog component with reason input
- Add delete button in my-namespaces page (only shown when canDelete is true)
- Add i18n keys for delete confirmation, reason input, and success/error messages
- Update ManagedNamespace type to include canDelete permission flag
- Fix test mocks to include canDelete property

The delete dialog requires users to provide a deletion reason before confirming,
following the backend requirement. After successful deletion, users are redirected
to the my-namespaces page.
2026-05-06 14:39:36 +08:00
dongmucat
f36cd43689 chore(api): regenerate OpenAPI types for namespace delete endpoint 2026-05-06 14:39:36 +08:00
dongmucat
ee054b74ef feat(namespace): add soft delete support with DELETED status
Implements namespace deletion via soft delete (DELETED status) to preserve audit history and prevent accidental data loss. Only namespace OWNER can delete, and namespace must be ARCHIVED first with no ACTIVE skills.

- Add DELETED status to NamespaceStatus enum
- Add canDelete() permission check in NamespaceAccessPolicy
- Implement deleteNamespace() in NamespaceGovernanceService with validation
- Add DELETE /api/web/namespaces/{slug} endpoint in NamespaceController
- Add i18n messages for delete errors (en/zh)
- Add V41 migration to document DELETED status

Resolves #341
2026-05-06 14:39:36 +08:00
XiaoSeS
ebe7db36be
docs: update skill publish concept diagram (#363)
Some checks failed
Deploy Docs / build (push) Has been cancelled
Deploy Docs / Deploy (push) Has been cancelled
* docs: update skill publish concept diagram

* chore: add docs/agents/ to gitignore for local AI agent config
2026-04-30 11:23:22 +08:00
XiaoSeS
a3c07725e5
feat(publish): skill upload limits, nested SKILL.md, session fix (#364)
* feat(publish): increase max file count from 100 to 500

Configurable via SKILLHUB_PUBLISH_MAX_FILE_COUNT env var.

* feat(publish): support SKILL.md in subdirectory with warning for ignored files

When SKILL.md is found in a single subdirectory (e.g. my-skill/SKILL.md),
promote that directory's contents to root and discard files outside it.
Discarded files are reported as warnings through the existing confirm flow.

* feat(publish): pass extraction warnings through confirm flow

When files are ignored during SKILL.md subdirectory promotion,
warnings are surfaced to the user via the existing precheck confirm dialog.

* fix(security): add invalidSessionStrategy to return 401 on expired session

Handles the case where Spring Security detects an invalid session cookie,
returning a clean 401 JSON response instead of triggering cascading exceptions.
Closes #360 (part 1/2)

* fix(security): handle session invalidation IllegalStateException as 401

Catches IllegalStateException with "Session was invalidated" message and
returns 401 instead of letting it fall through to the generic 500 handler.
Non-session IllegalStateExceptions are re-thrown to the catch-all handler.
Closes #360 (part 2/2)

* feat(publish): filter macOS metadata and add integration tests

Skip __MACOSX/, .DS_Store, and ._ resource fork entries during zip
extraction. Add integration tests for nested SKILL.md warning flow,
session invalidation 401 response, and macOS metadata filtering.

* test(publish): add real-world macOS zip and edge case integration tests

Covers: macOS zip with nested SKILL.md + __MACOSX + .DS_Store + stray files,
simple macOS single-folder case, and missing SKILL.md fallback behavior.
2026-04-30 11:20:51 +08:00
dongmucat
f70c1c6d99
Merge pull request #348 from iflytek/feature/oidc-login
feat(auth): support OIDC login
2026-04-29 15:21:37 +08:00
dongmucat
f41723e0dc
Merge pull request #356 from iflytek/feature/skill-subscription-notification
feat(subscription): add skill subscription notification feature
2026-04-29 15:20:40 +08:00
dongmucat
de8d17a2ec
Merge pull request #358 from vzpd/feat/s3-iam-auth
feat(storage): support IAM authentication for S3 storage
2026-04-29 15:10:49 +08:00
dongmucat
a2adec2b06 fix(subscription): improve button spacing and eliminate toggle flicker
- Add visual separator between StarButton and SubscribeButton
- Use optimistic updates in useToggleSubscription for instant feedback
- Remove isLoading guard that caused button to unmount during refetch
2026-04-29 14:47:17 +08:00
vzpd
003f811292 feat(storage): support IAM authentication for S3 storage
When access-key / secret-key are left blank, fall back to the AWS
DefaultCredentialsProvider chain so that deployments on EC2, ECS,
and EKS can authenticate via instance profile, task role, or IRSA
without static credentials.

- Extract buildCredentialsProvider() in S3StorageService
- Add sts dependency for Web Identity Token (EKS) support
- Add unit tests for credential provider selection
- Update storage-spi docs (zh + en) and env example
2026-04-29 11:51:01 +08:00
dongmucat
7f47f8a702 test(subscription): update test DTOs with subscriptionCount field 2026-04-29 10:58:15 +08:00
dongmucat
4882abc043 fix(subscription): expose subscription count in skill detail API
Include subscriptionCount in SkillDetailDTO and SkillDetailResponse
so the frontend SubscribeButton receives the updated count after
subscribe/unsubscribe mutations.
2026-04-29 10:56:20 +08:00
dongmucat
d945c46785 fix(auth): move OIDC email verification to service layer, add logging
Revert emailVerified check in EmailDomainAccessPolicy to preserve
backward compatibility with GitHub/GitLab OAuth users. Instead, null
unverified emails in CustomOidcUserService.toOAuthClaims() so
EmailDomainAccessPolicy naturally denies them via null email.

Add SLF4J logging to CustomOidcUserService for OIDC authentication
flow tracing and failure diagnostics.

Add registration ID collision warning to deployment docs.
2026-04-29 10:36:34 +08:00
dongmucat
62f3c3a0b4 fix(e2e): approve skill review before testing subscription
Published skills start in PENDING_REVIEW status with canInteract=false,
so the SubscribeButton is not rendered. Use admin user to approve the
review first, following the same pattern as search-seed and review-seed.
2026-04-29 10:31:27 +08:00
dongmucat
f0760a6416 fix(e2e): resolve strict mode violation in subscription tests
Use .first() for h1 heading locator since skill detail page
renders two h1 elements (page title + README heading).
Add page-ready wait in second test before locating Subscribe button.
2026-04-29 10:05:51 +08:00
dongmucat
284b0992af test(subscription): add frontend unit and e2e tests 2026-04-29 09:52:54 +08:00
dongmucat
d0e79266f1 feat(subscription): add i18n for subscription notification events 2026-04-29 09:52:54 +08:00
dongmucat
fb3035e545 test(subscription): add SkillSubscriptionController integration tests 2026-04-29 09:52:50 +08:00
dongmucat
fbbd20a5a6 fix(auth): require verified email for domain access
变更摘要:

- 修复 EMAIL_DOMAIN 准入策略,未验证邮箱不再因域名匹配被放行

- 新增回归测试,覆盖 OIDC 场景下 email_verified=false 的拒绝行为

- 保持修复范围收敛,仅调整策略判定与对应测试

关键文件:

- server/skillhub-auth/src/main/java/com/iflytek/skillhub/auth/policy/EmailDomainAccessPolicy.java

- server/skillhub-auth/src/test/java/com/iflytek/skillhub/auth/policy/AccessPolicyTest.java
2026-04-28 16:31:52 +08:00
dongmucat
4f44ea3976 fix(auth): add OIDC sub claim validation and complete env example
- Add null/blank validation for OIDC sub claim in CustomOidcUserService
- Throw OAuth2AuthenticationException when sub is missing or blank
- Complete .env.release.example with all required OIDC environment variables
- Add test cases for sub validation and providerLogin fallback scenarios
- All 5 tests passing
2026-04-28 13:49:26 +08:00
dongmucat
78b7e4f0c2 chore(api): regenerate OpenAPI types for subscription endpoints 2026-04-28 11:15:57 +08:00
dongmucat
f707cfee61
Merge pull request #342 from iflytek/feature/batch-member-import
feat(namespace): batch member import via CSV upload
2026-04-28 09:44:53 +08:00
dongmucat
c667cab280 fix(subscription): replace any type with explicit type assertion 2026-04-27 17:29:31 +08:00
dongmucat
658c44603b feat(subscription): add Chinese i18n for subscription feature 2026-04-27 17:21:39 +08:00
dongmucat
e70de0fc2e feat(subscription): add English i18n for subscription feature 2026-04-27 17:19:50 +08:00
dongmucat
12ed6f9146 feat(subscription): add subscriptions card to dashboard 2026-04-27 17:18:07 +08:00
dongmucat
6b3855e061 feat(subscription): add subscriptions menu item to user menu 2026-04-27 17:17:24 +08:00
dongmucat
6eee7342f3 feat(subscription): add /dashboard/subscriptions route 2026-04-27 17:16:48 +08:00
dongmucat
f0c2403134 feat(subscription): add MySubscriptionsPage component 2026-04-27 17:15:24 +08:00
dongmucat
1afb2085d9 feat(subscription): add SubscribeButton to skill detail page 2026-04-27 17:14:53 +08:00
dongmucat
b0623660c9 feat(subscription): add SubscribeButton component 2026-04-27 17:13:49 +08:00
dongmucat
0175897f45 feat(subscription): add useSubscription and useToggleSubscription hooks 2026-04-27 17:13:19 +08:00
dongmucat
d6ea91e069 feat(subscription): add useMySubscriptions query hooks 2026-04-27 17:12:52 +08:00
dongmucat
ebc3280d65 feat(subscription): add meApi subscriptions methods 2026-04-27 17:12:23 +08:00
dongmucat
7063a6d348 test(subscription): add SkillSubscriptionService unit tests 2026-04-27 17:02:48 +08:00
dongmucat
9bc5d0c784 feat(subscription): notify subscribers on skill publish and version yank 2026-04-27 16:51:40 +08:00
dongmucat
6f0103f013 feat(subscription): publish SkillVersionYankedEvent on version yank 2026-04-27 16:50:38 +08:00
dongmucat
4e62698231 feat(subscription): add /me/subscriptions endpoint for user subscription list 2026-04-27 16:49:26 +08:00
dongmucat
4713e864bd feat(subscription): add SkillSubscriptionController REST endpoints 2026-04-27 16:47:56 +08:00
dongmucat
a2aa4c3fb1 feat(subscription): update subscription count on subscribe/unsubscribe 2026-04-27 16:47:14 +08:00
dongmucat
9d4422cd6c feat(subscription): add increment/decrement subscription count methods 2026-04-27 16:46:34 +08:00
dongmucat
79f1aa4db1 feat(subscription): add subscriptionCount field to Skill entity 2026-04-27 16:44:34 +08:00
dongmucat
7da8ffdb1b feat(subscription): add JPA implementation for SkillSubscriptionRepository 2026-04-27 16:43:34 +08:00