drive: add static_label option to apply a label to every written file by steilerDev · Pull Request #9327 · rclone/rclone

@steilerDev @claude

Add a new advanced config option static_label to the Google Drive
backend. When set to a JSON-encoded drive.Label (the same format used
by the labels metadata key), rclone calls files.modifyLabels on every
file it uploads, copies, or moves -- regardless of whether
--drive-metadata-labels is enabled.

This enables organisations that require all files synced to Drive to
carry a sensitivity or classification label (e.g. for DLP or compliance
policy) to do so without needing label metadata on the source.

The label is parsed once at startup in newFs and stored on Fs. It is
applied in fetchAndUpdateMetadata via the existing setLabels callback
chain, which covers all four write paths (Put, Copy, Move, Update).
The label definition must already exist in the Drive label schema.

See: rclone#9326

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>