实现租户、成员与认证
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 1/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- sql
- Domain
- authentication
Research direction
Start with the schema, endpoint, and isolation designs in issues #2, #3, and #6, then inspect the middleware and project structure from dependency #8. The issue calls for users, tenants, and tenant_members migrations and repositories, authentication and member endpoints, integration tests, and an OpenAPI update. Done means the listed flows and permission cases pass, including single-use setup and invitation tokens and cross-tenant 404 responses.
Written by the indexing model from the issue text.
Description
Background
多租户平台的账户与组织基座。设计见 #2(表)、#3(端点)、#6(隔离与权限)。本 issue 实现租户、成员与认证全流程。
Technical requirement
- 认证:
POST /api/auth/setup(仅系统为空时可用)、POST /api/auth/login(返回 token + 可加入租户列表)、POST /api/auth/select-tenant(换发租户 token)、GET /api/me; - 密码 bcrypt 哈希;JWT 含
sub/tenant/role,有效期 24h; - 成员管理:列表(分页契约)、邀请(邮箱 + 角色 → 创建账号 + 一次性设置密码邀请 token,单次有效且过期)、变更角色、移除成员;
- 租户信息:
GET /api/tenants/current(含品牌)、PATCH /api/tenants/current(tenant_admin); - 新租户创建时自动导入种子模板包(机制实现,种子内容来自 #19,先允许为空);
- 错误码遵循 #3:登录失败
UNAUTHORIZED、越权FORBIDDEN、跨租户NOT_FOUND。
Expect
- 集成测试覆盖:setup 一次性、登录 / 换租户、邀请 token 单次有效、权限矩阵(#6 逐格)、跨租户访问一律 404;
docs/openapi.yaml同步更新。
Potential TODO list
- users / tenants / tenant_members 迁移与 repository(含 scope)
- setup / login / select-tenant / me 端点
- 成员邀请与设置密码流程
- 租户品牌读写
- 集成测试
依赖
#8(骨架与中间件)。
- Dominant language
- No language data
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LinuxSuRen/tick-flow
-
项目门面:logo、README 与仓库 AboutPossibly taken @linuxsuren-fs claimed this 9 days ago. Opendocumentation good first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 20/100
LinuxSuRen/tick-flow#20 ·
-
编写四个内置种子模板包Possibly taken @linuxsuren-fs claimed this 9 days ago. Opengood first issue help wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 35/100
LinuxSuRen/tick-flow#19 ·
-
实现处理工作台前端:列表、详情与处理动作Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 5/5 Over a week Newbie friendliness 25/100
LinuxSuRen/tick-flow#18 ·
-
实现提交门户前端:表单渲染器与我的工单Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#17 ·
-
实现站内通知与邮件通知Possibly taken @linuxsuren-fs claimed this 9 days ago. Openhelp wanted P0
Difficulty 4/5 3-5 days Newbie friendliness 25/100
LinuxSuRen/tick-flow#16 ·
All issues in LinuxSuRen/tick-flow
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
bug security-alert
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
spectrayan/carefold#391 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Pennyw0rth/NetExec#1544 ·
Maintainers usually reply within 1 day
-
security: set top-level least-privilege permissions in five workflowsPossibly taken @JonathanTSilva claimed this today. Openpriority: p2 size: xs type: security
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
JonathanTSilva/jts-website#150 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
router-for-me/CLIProxyAPI#7968 ·
Maintainers usually reply within 1 day