forked from claw/flaskpaste
audit: migrate enums to StrEnum
This commit is contained in:
@@ -4,7 +4,7 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
from enum import Enum
|
from enum import StrEnum
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from flask import current_app, g
|
from flask import current_app, g
|
||||||
@@ -15,7 +15,7 @@ if TYPE_CHECKING:
|
|||||||
from sqlite3 import Row
|
from sqlite3 import Row
|
||||||
|
|
||||||
|
|
||||||
class AuditEvent(str, Enum):
|
class AuditEvent(StrEnum):
|
||||||
"""Security-relevant event types for audit logging."""
|
"""Security-relevant event types for audit logging."""
|
||||||
|
|
||||||
PASTE_CREATE = "paste_create"
|
PASTE_CREATE = "paste_create"
|
||||||
@@ -33,7 +33,7 @@ class AuditEvent(str, Enum):
|
|||||||
URL_DELETE = "url_delete"
|
URL_DELETE = "url_delete"
|
||||||
|
|
||||||
|
|
||||||
class AuditOutcome(str, Enum):
|
class AuditOutcome(StrEnum):
|
||||||
"""Outcome types for audit events."""
|
"""Outcome types for audit events."""
|
||||||
|
|
||||||
SUCCESS = "success"
|
SUCCESS = "success"
|
||||||
|
|||||||
Reference in New Issue
Block a user