Closed teolemon closed 4 months ago
@teolemon - what exactly is the misuse? I'm afraid simply adding a user agent won't solve any essential misuse - and - would not help in contacting.
Who do you reach out to on a useragent like e.g. "PHP-SDK - Crawler"?
Would't it be better to create personalized (organizational or independent) API keys?
@teolemon this package is already doing this: https://github.com/openfoodfacts/openfoodfacts-laravel/blob/44ee0c288278d683b2bf4f6956e1ed53c337665b/src/OpenFoodFactsApiWrapper.php#L38
@epalmans
@Dwarfex : for now, just personalized headers.
- Do we concatenate a custom part to the Laravel part ?
No. Currently, the user-agent value is populated with the name of the app the developer is using the package within. On default laravel installation this is "Laravel". As a fallback the value is set instead "Laravel Open Food Facts - https://github.com/openfoodfacts/openfoodfacts-laravel". However in practice, that latter shouldn't ever happen since the APP_NAME environment variabele is - as far as I am aware - always available and set in Laravel app's.
- Is there a warning if no custom part is added ?
No, but it won't happen anyhow. See previous answer.
@teolemon
what exactly is the misuse?
It's not Laravel SDK specific, we're getting many search queries (and other) that don't make any sense for human usage, and it would be cool to have an idea of who is using the API.
for the SDK's in general we could maybe introduce some kind of custom headers, like X-OFF-SDK (e.g. having a value of Laravel, Android, Ruby, whatever) along with X-OFF-SDK-VERSION to specify the SDK version no.
What