Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions campus/audit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,13 @@ def init_app(app: flask.Flask | flask.Blueprint) -> None:
# Organise audit routes under audit blueprint
bp = flask.Blueprint('audit_v1', __name__, url_prefix='/audit/v1')

# Apply authentication to the traces blueprint (before registering)
# This ensures only trace routes require auth, not health routes
traces_blueprint.before_request(audit_authenticator.authenticate)

# Register authenticated routes (traces)
bp.register_blueprint(traces_blueprint)

# Apply authentication to the traces blueprint
# Note: We apply to the traces blueprint directly so that health
# routes can remain publicly accessible
bp.before_request(audit_authenticator.authenticate)

# Register public health routes WITHOUT authentication
bp.register_blueprint(health_blueprint)

Expand Down
Loading
Loading