Boilerplate FastAPI & Dockerfile + NGINX
This commit is contained in:
14
app/models/sshkey.py
Normal file
14
app/models/sshkey.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from sqlalchemy import ForeignKey, String, DateTime, Boolean
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from datetime import datetime, timezone
|
||||
from app.models.user import Base
|
||||
|
||||
class SSHKey(Base):
|
||||
__tablename__ = "ssh_keys"
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
user_id: Mapped[int] = mapped_column(ForeignKey("users.id", ondelete="CASCADE"))
|
||||
name: Mapped[str] = mapped_column(String(80))
|
||||
public_key: Mapped[str] = mapped_column(String(4096))
|
||||
algo: Mapped[str] = mapped_column(String(32))
|
||||
expires_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True))
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
Reference in New Issue
Block a user