feat: replace temp password with HMAC invite links & protect owner role - #79
Merged
Conversation
- Replace temp-password invitation with HMAC-SHA256 signed invite links - Admin creates invitation → gets a link → shares via IM - Invitee opens link → sets own password → auto-joins workspace - Token: base64url(payload).base64url(hmac), SHA-256 hash stored in DB - CAS pattern for single-use acceptance, 72h TTL - Rate limit on public accept endpoint (10 req/min/IP) - Token passed via POST body to avoid proxy log leakage - Set workspace ID in localStorage on accept for correct routing - Protect owner: cannot edit/remove owner role, cannot promote to owner - Owner role dropdown hidden in UI, remove button hidden for owner - Delete temp password generation code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
概述
用 HMAC 签名邀请链接替换临时密码机制,同时保护 owner 角色不可被编辑/移除。
邀请链接
base64url(payload).base64url(hmac-sha256),DB 存 SHA-256 哈希Owner 保护
改动文件
000007_workspace_invitations.sqlauth/invite/invite.gostore/store.godev/routes.goapi-invitations.tsInviteAcceptPage.tsxMembersPage.tsxauth/password/temp.go🤖 Generated with Claude Code