meraki / dashboard-api-go

Dashboard API for Golang
MIT License
19 stars 7 forks source link

New main branch SDK doesn't use the intended user agent string format #21

Open TKIPisalegacycipher opened 3 months ago

TKIPisalegacycipher commented 3 months ago

Prerequisites

Describe the bug In https://github.com/meraki/dashboard-api-go/blob/main/sdk/api_client.go, line 85 reads c.SetUserAgent("MerakiGolang/2.0.4 Cisco")

This UA string has a couple of issues.

Expected behavior

  1. It should not have 'Cisco' in it (the equivalent Meraki Python SDK doesn't include 'Cisco' and we want to follow that pattern)
  2. If the user doesn't supply any additional string, then it should be formatted go-meraki/{equivalent Meraki OAS revision number}, e.g. go-meraki/1.47.0
  3. The library should allow a user to name their own application/provide their own string, such as ApplicationName VendorName (similar to the python SDK, see line 86 here and line 75 here)
  4. It should include the user's self-defined UA string (e.g. ApplicationName VendorName) so that the full UA string submitted ends up following this format:

go-meraki/1.47.0 ApplicationName VendorName where 1.47.0 is the dashboard API revision for which the library is built

Screenshots N/A

Environment (please complete the following information): N/A

Thanks in advance for helping with this.

TKIPisalegacycipher commented 3 months ago

Note that the community version of the go SDK already uses and should continue to use golang-meraki/* to differentiate.

fmunozmiranda commented 3 months ago

UserAgent is now custom. And with format golang-meraki/* at default

TKIPisalegacycipher commented 3 months ago

And with format golang-meraki/* at default

This doesn't sound like the right solution, based on my report.