Skip to content

Provide a way to customize requests.Session #1188

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

Closed
gdetrez opened this issue Oct 26, 2020 · 3 comments
Closed

Provide a way to customize requests.Session #1188

gdetrez opened this issue Oct 26, 2020 · 3 comments
Labels
client Related to the client (updater) implementation enhancement

Comments

@gdetrez
Copy link

gdetrez commented Oct 26, 2020

Description of issue or feature request:
Would it be possible to have a safe way for the user of the update client to customize the Session object used to download files? E.g. providing (limited?) custom parameters for the Session()?

I have two use cases in mind:

  • provide Authorization credentials (e.g. basic auth or bearer token) that may be needed to access the files
  • customizing the user-agent header to prepend the application's own <name>/<version>
@trishankatdatadog
Copy link
Member

@gdetrez you might be interested in following #1171, which should let you do what you want...

@joshuagl
Copy link
Member

See also #1213, which includes a proposal for abstracting out the networking pieces for greater customisation.

@jku jku added the client Related to the client (updater) implementation label Nov 27, 2020
@jku
Copy link
Member

jku commented Nov 30, 2021

I am closing this: both ngclient and the legacy client include a download abstraction that allows any shenanigans a client app might want to do. The included RequestsFetcher implementation does not explicitly expose the requests session but for this purpose a client could easily create their own customized fetcher that modifies the session (this is what I did in my pip POC).

@jku jku closed this as completed Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Related to the client (updater) implementation enhancement
Projects
None yet
Development

No branches or pull requests

4 participants