mirror of
https://github.com/creyD/apilog.git
synced 2026-04-14 20:30:31 +02:00
Compare commits
135 Commits
1.4.1-reno
...
1.4.123-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a4f2bf0a8 | ||
|
|
3c606b5e6d | ||
|
|
0c18fbebb0 | ||
|
|
bbaca6878d | ||
|
|
8e28bf16a7 | ||
|
|
3d3857024a | ||
|
|
ce9441cb99 | ||
|
|
d1f8002353 | ||
|
|
0c7e1cb380 | ||
|
|
ab4a9b5019 | ||
|
|
2e41287840 | ||
|
|
332e41f33b | ||
|
|
b9c61e300c | ||
|
|
c5c823801b | ||
|
|
a81ff366dc | ||
|
|
6b53ba63d0 | ||
|
|
171568685d | ||
|
|
15baaf0bb6 | ||
|
|
38c4b30950 | ||
|
|
2f191d9b8f | ||
|
|
8e1b17a52e | ||
|
|
5d41160514 | ||
|
|
b99070f735 | ||
|
|
15e62f1ff8 | ||
|
|
d0d94f3993 | ||
|
|
53fe2c4a82 | ||
|
|
2e3fa63a94 | ||
|
|
699bcc4fdc | ||
|
|
2b112b56bf | ||
|
|
9b40838bd9 | ||
|
|
fc7fe924bb | ||
|
|
7588918306 | ||
|
|
5739626959 | ||
|
|
84bab4ec16 | ||
|
|
6f8e06ac69 | ||
|
|
25967b7e8e | ||
|
|
e5fe4eb4da | ||
|
|
776cd9c343 | ||
|
|
49fd344aaa | ||
|
|
f22588275c | ||
|
|
9d82b0c566 | ||
|
|
f77fe9f1ae | ||
|
|
3f8997f908 | ||
|
|
bda6afbf2b | ||
|
|
315a73ea6f | ||
|
|
9820520cab | ||
|
|
f49126f403 | ||
|
|
7e322b7fbc | ||
|
|
30dce717c1 | ||
|
|
eae989a9ea | ||
|
|
68f64d5e96 | ||
|
|
b6eaa7c1e7 | ||
|
|
38f7c9234d | ||
|
|
ca6a2a3eaa | ||
|
|
055b8af28a | ||
|
|
abe103dc0f | ||
|
|
8da0f31b16 | ||
| d5907074c9 | |||
|
|
06e5a3af30 | ||
|
|
f42ce7abe1 | ||
|
|
a743969689 | ||
|
|
6fc6117400 | ||
|
|
d8057db909 | ||
|
|
c8872ca437 | ||
|
|
e4a903cd61 | ||
|
|
de7ad24b49 | ||
|
|
da4ebd0a8b | ||
|
|
9f3a7f55db | ||
|
|
f315369ff8 | ||
|
|
86c8e4fc4e | ||
|
|
1c3c2347ee | ||
|
|
d28507ca15 | ||
|
|
191268af6a | ||
|
|
96afee2cf4 | ||
|
|
995bdc0600 | ||
|
|
f2f572ec9a | ||
|
|
61bc957a2c | ||
|
|
235c07466e | ||
|
|
2f70ab2dcf | ||
|
|
076267ec3a | ||
|
|
0af16a831f | ||
|
|
ecf784054f | ||
|
|
50ad31f331 | ||
|
|
493492cd4f | ||
|
|
2df1a18f70 | ||
|
|
9ab291afb5 | ||
|
|
797f869e87 | ||
|
|
3d1597a4d4 | ||
|
|
4c737620bb | ||
|
|
e1f0d012dd | ||
|
|
b6a23f66b4 | ||
|
|
3e4e5d9cf1 | ||
|
|
e3ae8ae526 | ||
|
|
a69b2341d5 | ||
|
|
9a2655d225 | ||
|
|
f6d27c543f | ||
|
|
c53c2db27a | ||
|
|
9e888b9e96 | ||
|
|
f4973dd612 | ||
|
|
b590b4de6a | ||
|
|
7c38e09ac3 | ||
|
|
36d59101fd | ||
|
|
fee836f20e | ||
|
|
85649f94f2 | ||
|
|
a025b3994c | ||
|
|
20dc2c6fa0 | ||
|
|
2c6b35e3dd | ||
|
|
fadc83e19b | ||
|
|
cdc0ac249a | ||
|
|
015d5eb13d | ||
|
|
608ec8de6f | ||
|
|
a21947fe02 | ||
|
|
11e5ff9646 | ||
|
|
971d7743f1 | ||
|
|
1d34b32179 | ||
|
|
59abb07721 | ||
|
|
7fc2a7a1a9 | ||
|
|
ae570acc6a | ||
|
|
24aa470d6d | ||
|
|
112b2def80 | ||
|
|
cc7be6e4ac | ||
|
|
8410fc886e | ||
|
|
13496b0cbd | ||
|
|
e88a617e30 | ||
|
|
76d0866595 | ||
|
|
b194e583fb | ||
|
|
5f45d3aeb8 | ||
|
|
20a107a49c | ||
|
|
087ea50c4e | ||
|
|
f47b44ba95 | ||
| 9b1343b90d | |||
|
|
15d754f68d | ||
|
|
9e0c8f0173 | ||
|
|
0c769ba843 | ||
| 18cce99967 |
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -60,7 +60,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: 3.12
|
python-version: 3.13
|
||||||
cache: 'pip' # caching pip dependencies
|
cache: 'pip' # caching pip dependencies
|
||||||
- name: Setup tests (install dependencies, run migrations)
|
- name: Setup tests (install dependencies, run migrations)
|
||||||
run: |
|
run: |
|
||||||
@@ -91,7 +91,7 @@ jobs:
|
|||||||
git config --local user.name "creyD"
|
git config --local user.name "creyD"
|
||||||
|
|
||||||
- name: Git Version
|
- name: Git Version
|
||||||
uses: codacy/git-version@2.8.0
|
uses: codacy/git-version@2.8.6
|
||||||
id: git_version
|
id: git_version
|
||||||
with:
|
with:
|
||||||
minor-identifier: "feat:"
|
minor-identifier: "feat:"
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
# apilog
|
# apilog
|
||||||
|
|
||||||
Tiny logging API server, for taking logs via HTTP POST requests.
|
Tiny logging API server, for taking logs via HTTP POST requests.
|
||||||
|
|
||||||
|
## TODO
|
||||||
|
|
||||||
|
[ ] Application Patch
|
||||||
|
[ ] Team CRUD
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
from creyPY.fastapi.crud import (
|
|
||||||
create_obj_from_data,
|
|
||||||
)
|
|
||||||
from creyPY.fastapi.db.session import get_db
|
|
||||||
from fastapi import APIRouter, Depends, Security, HTTPException
|
|
||||||
from sqlalchemy.orm import Session
|
|
||||||
from pydantic.json_schema import SkipJsonSchema
|
|
||||||
from app.services.auth import verify
|
|
||||||
from app.schema.app import AppIN, AppOUT
|
|
||||||
from app.models.app import Application
|
|
||||||
from creyPY.fastapi.pagination import Page
|
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
from fastapi_pagination.ext.sqlalchemy import paginate
|
|
||||||
|
from creyPY.fastapi.crud import create_obj_from_data
|
||||||
|
from creyPY.fastapi.db.session import get_db
|
||||||
|
from creyPY.fastapi.pagination import Page, paginate
|
||||||
|
from fastapi import APIRouter, Depends, HTTPException, Security
|
||||||
|
from pydantic.json_schema import SkipJsonSchema
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
|
from app.models.app import Application
|
||||||
|
from app.schema.app import AppIN, AppOUT
|
||||||
|
from app.services.auth import verify
|
||||||
|
|
||||||
router = APIRouter(prefix="/app", tags=["apps"])
|
router = APIRouter(prefix="/app", tags=["apps"])
|
||||||
|
|
||||||
@@ -26,7 +25,7 @@ async def create_app(
|
|||||||
data,
|
data,
|
||||||
Application,
|
Application,
|
||||||
db,
|
db,
|
||||||
additonal_data={"created_by_id": sub},
|
additional_data={"created_by_id": sub},
|
||||||
)
|
)
|
||||||
return AppOUT.model_validate(obj)
|
return AppOUT.model_validate(obj)
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,22 @@
|
|||||||
from creyPY.fastapi.crud import (
|
from datetime import datetime
|
||||||
create_obj_from_data,
|
|
||||||
)
|
|
||||||
from creyPY.fastapi.order_by import order_by
|
|
||||||
from typing import Callable
|
from typing import Callable
|
||||||
from sqlalchemy.sql.selectable import Select
|
|
||||||
from creyPY.fastapi.db.session import get_db
|
|
||||||
from fastapi import APIRouter, Depends, Security, HTTPException
|
|
||||||
from sqlalchemy.orm import Session
|
|
||||||
from sqlalchemy import select
|
|
||||||
from app.services.auth import verify
|
|
||||||
from app.schema.entry import LogIN, LogOUT
|
|
||||||
from app.models.entry import LogEntry
|
|
||||||
from fastapi_pagination.ext.sqlalchemy import paginate
|
|
||||||
from creyPY.fastapi.pagination import Page
|
|
||||||
from uuid import UUID
|
from uuid import UUID
|
||||||
from pydantic.json_schema import SkipJsonSchema
|
|
||||||
|
from creyPY.fastapi.crud import create_obj_from_data
|
||||||
|
from creyPY.fastapi.db.session import get_db
|
||||||
|
from creyPY.fastapi.order_by import order_by
|
||||||
|
from creyPY.fastapi.pagination import Page, paginate
|
||||||
|
from fastapi import APIRouter, Depends, HTTPException, Security
|
||||||
from fastapi_filters import FilterValues, create_filters
|
from fastapi_filters import FilterValues, create_filters
|
||||||
from fastapi_filters.ext.sqlalchemy import apply_filters
|
from fastapi_filters.ext.sqlalchemy import apply_filters
|
||||||
from app.models.entry import LogType, TransactionType
|
from pydantic.json_schema import SkipJsonSchema
|
||||||
from datetime import datetime
|
from sqlalchemy import select
|
||||||
|
from sqlalchemy.orm import Session
|
||||||
|
from sqlalchemy.sql.selectable import Select
|
||||||
|
|
||||||
|
from app.models.entry import LogEntry, LogType, TransactionType
|
||||||
|
from app.schema.entry import LogIN, LogOUT
|
||||||
|
from app.services.auth import verify
|
||||||
|
|
||||||
router = APIRouter(prefix="/log", tags=["logging"])
|
router = APIRouter(prefix="/log", tags=["logging"])
|
||||||
|
|
||||||
@@ -33,7 +31,7 @@ async def create_log(
|
|||||||
data,
|
data,
|
||||||
LogEntry,
|
LogEntry,
|
||||||
db,
|
db,
|
||||||
additonal_data={"created_by_id": sub},
|
additional_data={"created_by_id": sub},
|
||||||
)
|
)
|
||||||
return LogOUT.model_validate(obj)
|
return LogOUT.model_validate(obj)
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
from sqlalchemy_utils import create_database, database_exists
|
|
||||||
|
|
||||||
|
|
||||||
def create_if_not_exists(db_name: str):
|
|
||||||
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL
|
|
||||||
|
|
||||||
if not database_exists(SQLALCHEMY_DATABASE_URL + db_name):
|
|
||||||
create_database(SQLALCHEMY_DATABASE_URL + db_name)
|
|
||||||
@@ -2,6 +2,7 @@ import os
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
|
from creyPY.fastapi.db.helpers import create_if_not_exists
|
||||||
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL, get_db, name
|
from creyPY.fastapi.db.session import SQLALCHEMY_DATABASE_URL, get_db, name
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
@@ -9,7 +10,6 @@ from alembic import command
|
|||||||
from alembic.config import Config
|
from alembic.config import Config
|
||||||
from app.models.app import Application
|
from app.models.app import Application
|
||||||
from app.models.entry import LogEntry
|
from app.models.entry import LogEntry
|
||||||
from app.services.db.session import create_if_not_exists
|
|
||||||
|
|
||||||
|
|
||||||
def delete_old_logs(sess: Session | None = None):
|
def delete_old_logs(sess: Session | None = None):
|
||||||
|
|||||||
@@ -1,39 +1,39 @@
|
|||||||
annotated-types==0.7.0
|
annotated-types==0.7.0
|
||||||
anyio==4.8.0
|
anyio==4.11.0
|
||||||
certifi==2024.8.30
|
certifi==2025.10.5
|
||||||
creyPY==1.2.5
|
creyPY[postgres]==3.0.0
|
||||||
fastapi==0.115.5
|
fastapi==0.120.2
|
||||||
fastapi-pagination==0.12.31
|
fastapi-pagination==0.15.0
|
||||||
h11==0.14.0
|
h11==0.14.0
|
||||||
httpcore==1.0.6
|
httpcore==1.0.8
|
||||||
httpx==0.28.1
|
httpx==0.28.1
|
||||||
idna==3.10
|
idna==3.11
|
||||||
psycopg==3.2.4
|
psycopg==3.2.12
|
||||||
psycopg-binary==3.2.4
|
psycopg-binary==3.2.12
|
||||||
psycopg-pool==3.2.3
|
psycopg-pool==3.2.7
|
||||||
pydantic==2.9.2
|
pydantic==2.9.2
|
||||||
pydantic_core==2.23.4
|
pydantic_core==2.23.4
|
||||||
python-dotenv==1.0.1
|
python-dotenv==1.2.1
|
||||||
sniffio==1.3.1
|
sniffio==1.3.1
|
||||||
SQLAlchemy==2.0.35
|
SQLAlchemy==2.0.44
|
||||||
starlette==0.40.0
|
starlette==0.49.1
|
||||||
typing_extensions==4.12.2
|
typing_extensions==4.15.0
|
||||||
|
|
||||||
Mako==1.3.5 # Alembic
|
Mako==1.3.10 # Alembic
|
||||||
MarkupSafe==3.0.1 # Alembic
|
MarkupSafe==3.0.3 # Alembic
|
||||||
alembic==1.14.1 # Alembic
|
alembic==1.17.0 # Alembic
|
||||||
|
|
||||||
SQLAlchemy-Utils==0.41.2 # SQLAlchemy
|
SQLAlchemy-Utils==0.41.2 # SQLAlchemy
|
||||||
|
|
||||||
click==8.1.8 # Uvicorn
|
click==8.3.0 # Uvicorn
|
||||||
uvicorn==0.31.1 # Uvicorn
|
uvicorn==0.38.0 # Uvicorn
|
||||||
|
|
||||||
iniconfig==2.0.0 # pytest
|
iniconfig==2.3.0 # pytest
|
||||||
packaging==24.1 # pytest
|
packaging==25.0 # pytest
|
||||||
pluggy==1.5.0 # pytest
|
pluggy==1.6.0 # pytest
|
||||||
pytest==8.3.4 # pytest
|
pytest==8.4.2 # pytest
|
||||||
|
|
||||||
fastapi-filters==0.2.9 # Filters
|
fastapi-filters==0.3.1 # Filters
|
||||||
|
|
||||||
APScheduler==3.11.0 # Scheduler for deletion
|
APScheduler==3.11.0 # Scheduler for deletion
|
||||||
tzlocal==5.2 # Scheduler for deletion
|
tzlocal==5.3.1 # Scheduler for deletion
|
||||||
|
|||||||
Reference in New Issue
Block a user