-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
36 lines (23 loc) · 867 Bytes
/
models.py
File metadata and controls
36 lines (23 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from datetime import datetime
from sqlalchemy import DateTime
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
class Base(DeclarativeBase):
pass
class HTTPRequest(Base):
__tablename__ = "http_request"
id: Mapped[int] = mapped_column(primary_key=True)
created: Mapped[datetime] = mapped_column(DateTime, default=datetime.now)
path: Mapped[str]
method: Mapped[str]
remote_ip: Mapped[str]
request_started: Mapped[datetime]
request_finished: Mapped[datetime]
class SSHRequest(Base):
__tablename__ = "ssh_request"
id: Mapped[int] = mapped_column(primary_key=True)
created: Mapped[datetime] = mapped_column(DateTime, default=datetime.now)
username: Mapped[str]
password: Mapped[str]
remote_ip: Mapped[str]
request_started: Mapped[datetime]
request_finished: Mapped[datetime]