Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional headers to DownloadableFile messages when downloading files #306

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

RichardChukwu
Copy link

Fixes #299

This PR implements the recent specification change that allows for optional headers in the DownloadableFile message, which can be used during file downloads to support authentication and other header-based configurations.

The downloadFile function in the packagesSyncer struct has been modified to include optional headers from the DownloadableFile message. This enhancement allows Agents to set custom HTTP headers when downloading files from the server. For instance, headers such as Authorization can now be included to facilitate secure downloads.

Changes Made:

-Updated the downloadFile method to check for the presence of optional headers in the DownloadableFile message.
-Added logic to incorporate these headers into the HTTP request when downloading files.
-Ensured compatibility with the updated protocol specification that outlines the use of headers for authentication and other purposes.

@RichardChukwu RichardChukwu requested a review from a team as a code owner October 23, 2024 13:21
@tigrannajaryan tigrannajaryan changed the title "Add optional headers to DownloadableFile messages when downloading files" Add optional headers to DownloadableFile messages when downloading files Oct 23, 2024
@tigrannajaryan
Copy link
Member

The build fails because we need to update to the new version of Protobufs that have the new Headers field.

This PR does it #307

@tigrannajaryan
Copy link
Member

Please rebase, it should fix the build.

@RichardChukwu
Copy link
Author

Rebase done @tigrannajaryan

@tigrannajaryan
Copy link
Member

Please fix the build: https://github.com/open-telemetry/opamp-go/actions/runs/11499942257/job/32122224014?pr=306

@srikanthccv
Copy link
Member

@RichardChukwu ICYMI, the test failure logs.

Error: client/clientimpl_test.go:1511:17: undefined: createDownloadSrv
Error: client/clientimpl_test.go:1660:17: undefined: createDownloadSrv

you can verify the changes locally by running make test

@RichardChukwu
Copy link
Author

srikanthccv

Thanks, working on it already

Copy link

codecov bot commented Oct 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@36a1afd). Learn more about missing BASE report.

Files with missing lines Patch % Lines
client/internal/packagessyncer.go 0.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #306   +/-   ##
=======================================
  Coverage        ?   77.11%           
=======================================
  Files           ?       25           
  Lines           ?     2307           
  Branches        ?        0           
=======================================
  Hits            ?     1779           
  Misses          ?      423           
  Partials        ?      105           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use optional headers in DownloadableFile messages when fetching files
3 participants