#112 Add --header option to spectool
Merged by ngompa. Opened by mattoliverau.
mattoliverau/rpmdevtools spectool_custom_headers  into  main

Download 112.patch

This patch adds a new misc option --header. Which can be used multiple
times to create a list of custom headers to send with the HTTP request
used to download files (patch or sources).

The form is "header:value" or "header: value".

I have found the need for this when needing to send in a gitlab token
along with spectool to download sources:

spectool -g ../my.spec --header "PRIVATE-TOKEN: "

Just whipped this up this arvo. I plan to test it more downstream here in the morning.. but wanted to get something up incase either anyone is interested or if there is a better way.

I guess I should probably look to see if there is any testing in the repo and add some tests. But first dinner time!

I wonder, why do you need tokens to download GitLab sources? Are you handling private repositories?

Yeah, we have a private gitlab instance downstream with private repos. And
changing them to public is not an option.
I'm reworking/modernising the build system here, but some specs point to
public repos, some on github, but there are quite alot of specs whose main
sources are in private repos.
And this allows me to optionally pass in the token header when using spec
tool to pull the sources in the latter.

Matt

On Tue, 20 June 2023, 4:55 am Fabio Valentini, pagure@pagure.io wrote:

decathorpe commented on the pull-request: Add --header option to spectool that you are following:
I wonder, why do you need tokens to download GitLab sources? Are you handling private repositories?

To reply, visit the link below or just reply to this email
https://pagure.io/rpmdevtools/pull-request/112

I guess for completeness I should make this:

headers=headers

too.

rebased onto be785797dcf032bc09da7dad56460748c865b6bd

Please change this to http-header

Sure can, I was just matching curl's, but yeah header alone could be confusing, great thought!

rebased onto 97b2d4b36b9fdd9e2499774cd7191852e24bf4d8

rebased onto 782c621f1ed30874c882b2d91c9f6301408240a2

rebased onto 83b35ac789d6ee4ec63bac57201ca216944965fc

Is the anything else needed or suggested for this patch? We're building it and using downstream in our env now.. It would be much nicer if one day we didn't have to ;)

:thumbsup:

Pull-Request has been merged by ngompa

Metadata