Improve auditing
This commit is contained in:
@@ -26,6 +26,9 @@ from gatehouse_app.exceptions.auth_exceptions import (
|
||||
AccountSuspendedError,
|
||||
AccountInactiveError,
|
||||
)
|
||||
from gatehouse_app.utils.constants import AuditAction
|
||||
from gatehouse_app.services.audit_service import AuditService
|
||||
from gatehouse_app.services.oidc_audit_service import OIDCAuditService
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -849,6 +852,18 @@ def oidc_register():
|
||||
)
|
||||
client.save()
|
||||
|
||||
OIDCAuditService.log_event(
|
||||
event_type="client_registration",
|
||||
client_id=client_id,
|
||||
user_id=g.current_user.id if hasattr(g, "current_user") else None,
|
||||
success=True,
|
||||
metadata={
|
||||
"client_name": client_name,
|
||||
"redirect_uris": redirect_uris,
|
||||
"organization_id": str(organization.id),
|
||||
},
|
||||
)
|
||||
|
||||
response = jsonify({
|
||||
"client_id": client_id,
|
||||
"client_secret": client_secret,
|
||||
|
||||
Reference in New Issue
Block a user