Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
mjalmoudy94
2026-10-14 12:08:23 +03:30
13 changed files with 3485 additions and 71 deletions
+28 -1
View File
@@ -76,4 +76,31 @@ class PlatformInviteRow(Base):
return self.expires_at <= reference
__all__ = ["PlatformInviteRow"]
class OrgSetupDraftRow(Base):
"""A user's in-progress org-creation wizard state.
The wizard autosaves its current step here so a refresh resumes. By design
the payload never contains secrets: git tokens, SSH keys and deploy-target
passwords are submitted only on the final ``complete`` call and are held
encrypted elsewhere (``project_external_git`` / ``deploy_targets``). Storing
them in the draft would defeat the encryption at rest.
"""
__tablename__ = "org_setup_drafts"
id: Mapped[str] = pk()
user_id: Mapped[str] = mapped_column(
ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True
)
#: The furthest step the user reached (1..5). Lets the frontend jump back.
step: Mapped[int] = mapped_column(default=1, nullable=False)
#: JSON blob of the non-secret wizard fields. Validated upstream; secrets
#: are stripped before this row is written.
data_json: Mapped[str] = mapped_column(Text, default="{}", nullable=False)
created_at: Mapped[datetime] = created()
updated_at: Mapped[datetime] = mapped_column(
DateTime(timezone=True), default=utcnow, onupdate=utcnow, nullable=False
)
__all__ = ["OrgSetupDraftRow", "PlatformInviteRow"]