feat(auth): 新增仅限邀请注册档位 - #3900
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
关闭公开注册后,邀请链接只显示登录表单,全新用户无法注册加入。新增「仅限邀请注册」档位,使持有效邀请链接的新用户可以注册并直接加入受邀空间。
self_serve(开放注册)invite_register(仅限邀请注册)invite_only(禁止注册)兼容性变化: 保留现有配置值及
DISABLE_REGISTRATION=true→invite_only的映射,但invite_only现在也会对/auth/register-by-invite返回 403。此前直接调用该接口注册的部署需要显式切换到invite_register。OIDC 和管理员创建账号仍使用原有策略。Type of Change
Related Issue
无。
Testing
go test ./internal/config ./internal/handler ./internal/application/service -run 'Test(Register|RegistrationMode|GetAuthConfig|ApplyAuthAndTenantDefaults|ValidateInvitationRegistrationMode|ValidateRegistrationModes|.*Accept.*Token)' -count=1frontend/执行:npm test -- src/views/auth/registrationPolicy.test.ts src/i18n/localeKeyAudit.test.ts:18 项通过。npm run type-check:通过。npm run build:通过,有 chunk 大小提示。git diff --check origin/main...HEAD:通过。golangci-lint run --new-from-merge-base=9842e51d40a54ca2dbb61153f3fb587da1265b7a:通过,0 issues。Checklist
git diff --check origin/main...HEADpasseswebsite-docs/, Swagger annotations, etc.)Screenshots / Recordings
未附截图:本地未启动完整后端做浏览器联调。注册入口策略通过前端测试验证;合并前可在全局设置切换三档,并分别以新用户和已有账号打开有效邀请链接验收。