Skip to content

Log route templates instead of request paths #748

Closed

Description

@uniqueg

Follow-up to #743 / #745, which made error messages value-free and moved rejected values to DEBUG. The PR listed log lines that still write values of clients at INFO; this issue covers three of them, for log hygiene and privacy:

  • Request traffic log (foca.utils.logging.log_traffic): logs the full request line, including the concrete path with its path parameters, e.g., Incoming request: "PUT /api/tasks/1/permissions/users/<subject> HTTP/1.1". Log the route template instead (e.g., /ga4gh/tes/v1/tasks/{id}), and the concrete path at DEBUG only.
  • Access denials (foca/security/access_control/enforcement.py): Access denied: <method> <path> to '<subject>' logs the path at the configured level. Log the route template instead, at the same level, and the concrete path at DEBUG only.
  • Request validation (foca/errors/exceptions.py): when no invalid fields are listed, the validation handler logs the validator's reason at INFO. Keep a value-free INFO line (e.g., the mapped detail or the title) and log the reason at DEBUG.

If no route template is known (e.g., no operation serves the request), log a fixed placeholder instead of the path.

Unchanged on purpose: audit logs of grants and resource changes, which name subjects, roles and resources that FOCA has validated.

Docs: logging, access control and exceptions configuration pages, migration guide and release notes for 0.22.0.

Activity

  1. added this to the v0.22.0 milestone on Nov 8, 2026
  2. added
    priority: medium
    status: in progress
    type: security
    workload: hours
    on Nov 8, 2026
  3. removed
    status: in progress
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: mediumtype: securityworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions