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

[RED-2026] Set a default user agent so Zendesk can identify the requests #323

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

fbvilela
Copy link
Contributor

Description

Sets a default user agent.
We can now see it in our logs the requests are coming from this SDK .

Screenshot 2023-11-14 at 3 21 44 pm

@mikerogers123 are you happy with this user agent string?

@mikerogers123
Copy link
Contributor

@fbvilela This header is fine by me. Although, I am curious what the use case is for knowing requests are coming from this client, in particular? As I understand it, this header lets servers identify the application/OS/vendor of the requesting user. This client is just a wrapper/helper for a consuming application. Would Zendesk not be more interested in what that consuming application is? E.g. "justeat.application1"? And then Zendesk would know all requests from justeat via the justeat. prefix.

Also, if Zendesk did care about requests from this client, what about the case where one of our consumers chooses to overwrite this header? I believe they can using the HttpClientFactory. In this case you wouldn't know these requests were made using this library. I guess what I'm saying is: it makes sense to force consumers to use this header, if we go down this route?

Not sure if that makes sense! Happy to hear thoughts/opinions

@fbvilela
Copy link
Contributor Author

Hi @mikerogers123 ,
Thank you for you Feedback!
User Agent value helps us to understand the usage of languages and associated tools by the developers. It also helps us to determine the level of support, planning and collaboration on changes. We are also bringing improvements to the API Usage Monitoring, so providing the signature details in the reports help customers know the traffic origins and differentiate between native HTTP library and SDK wrappers.
Currently, Zendesk is in plans reduce the availability of Offset Model in pagination in favour of Cursor Model for performance reasons. We want to ensure that customer integrations + API experience is not impacted by this change, so we are doing our best to collaborate and update the libraries that customers are using. Knowing the signature of a library through the user agent will simplify this task.
Customers should be free to change the userAgent value as they see fit. But, in our observation, majority tend to leave it to the default signature. We did not see a mechanism for users to specify a custom user Agent value in this C# library. Please advise if we missed to see it and where can one do it? We can update the readme about it

@mikerogers123
Copy link
Contributor

mikerogers123 commented Nov 15, 2023

Hi @fbvilela thanks for the context - super useful. Makes sense.

I believe it is possible for a consumer to control this header value if they were to instantiate the client via [ZendeskApiClientFactory.cs]

(https://github.com/justeat/ZendeskApiClient/blob/master/src/ZendeskApi.Client/ZendeskApiClientFactory.cs), but it is super unlikely seeing as the consumer would have to register a HttpClient named zendeskApiClient and configure that to use their custom header. So from that perspective I think your observation is effectively correct that a consumer couldn't easily change it.

So yes I am good with this change! Can you bump the version?

@mikerogers123 mikerogers123 merged commit c8b786d into justeat:develop Nov 16, 2023
3 checks passed
mikerogers123 added a commit that referenced this pull request Nov 16, 2023
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.

2 participants