[Debuginfod] DEBUGINFOD_HEADERS_FILE environment variable
authorDaniel Thornburgh <dthorn@google.com>
Tue, 18 Oct 2022 22:20:49 +0000 (15:20 -0700)
committerDaniel Thornburgh <dthorn@google.com>
Tue, 8 Nov 2022 00:34:37 +0000 (16:34 -0800)
commit32a02a9c6bad489ce7c02f3f0b306a8fc1e67fd5
tree3c613844f80d6d5beb84e59e0e1cc1b261c04884
parent7c2d3153a9481793da58894dbf35d4994f3b67a4
[Debuginfod] DEBUGINFOD_HEADERS_FILE environment variable

This change adds a DEBUGINFOD_HEADERS_FILE environment variable provides
a file containing HTTP headers to attach to outgoing HTTP requests, one
per line. This allows a file permissioned with OS access control
mechanisms to supply bearer credentials for Debuginfod requests.

This matches the mechanism recently added to elfutils' libdebuginfod.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D136303
llvm/include/llvm/Debuginfod/HTTPClient.h
llvm/lib/Debuginfod/Debuginfod.cpp
llvm/lib/Debuginfod/HTTPClient.cpp
llvm/test/tools/llvm-debuginfod-find/Inputs/capture_req.py [new file with mode: 0644]
llvm/test/tools/llvm-debuginfod-find/Inputs/headers [new file with mode: 0644]
llvm/test/tools/llvm-debuginfod-find/headers.test [new file with mode: 0644]