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

Users using the API should have greater control over the user agent string #7464

Open
scottbommarito opened this issue Nov 2, 2018 · 3 comments
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:SDK The NuGet client packages published to nuget.org Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request
Milestone

Comments

@scottbommarito
Copy link

I am currently working on NuGet/NuGetGallery#6584

Right now, if I'd like to set the user agent used by the NuGet Client API, I have to use UserAgent and UserAgentStringBuilder, which gives me very little control. UserAgentStringBuilder allows me to set the client name, but it doesn't let me set the version, and appends the current API version to it.

@scottbommarito
Copy link
Author

Two possible solutions:

  1. Make UserAgent.UserAgentString's setter public.
  2. Improve UserAgentStringBuilder so that it is more general.

I would suggest 1 over 2 because

  • it is simpler, as we don't need to make UserAgentStringBuilder useful to general users
  • users should be allowed to use whatever user agent string they'd like, and UserAgentStringBuilder can be a helper class for internal users

@rrelyea
Copy link
Contributor

rrelyea commented Nov 5, 2018

Why do you need control over version here?
Is it not useful to know which NuGet client version is being used?

/cc @joelverhagen

@joelverhagen
Copy link
Member

Why do you need control over version here?

I'll let @scottbommarito speak to that fully, but my understanding is that he wanted the version to match the version of our job (that is using some client APIs) not the client API version.

Is it not useful to know which NuGet client version is being used?

Yes, it would be useful. We could pick just one of the two possible versions (either client API version or job version). Alternatively, we could encode both in the user agent.

My browser user agent is:

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

As you can see there are many versions in there. We could do something similar for the user agent sent by entry points that use NuGet client APIs but are not themselves NuGet client 😄.

@PatoBeltran PatoBeltran added Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request NuGet API labels Nov 28, 2018
@PatoBeltran PatoBeltran added this to the Backlog milestone Nov 28, 2018
@nkolev92 nkolev92 added Functionality:SDK The NuGet client packages published to nuget.org and removed NuGet API labels Apr 24, 2020
@zivkan zivkan self-assigned this Nov 5, 2020
@zivkan zivkan removed their assignment Nov 17, 2020
@nkolev92 nkolev92 added Category:Quality Week Issues that should be considered for quality week and removed Category:Customer Sprint labels Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Quality Week Issues that should be considered for quality week Functionality:SDK The NuGet client packages published to nuget.org Priority:3 Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog. Type:DCR Design Change Request
Projects
None yet
Development

No branches or pull requests

8 participants