Page MenuHomePhabricator

Send user agent w/ federated API requests that includes anonymized unique identifier
Closed, ResolvedPublic3 Estimated Story Points

Description

For the federated properties MVP, we would like to send a user agent with federated API requests that includes some unique, anonymized identifier for the local Wikibase such as hashing of their domain name. These should be sent with the federation requests by default so that traffic can be filtered if necessary.

Configuration documentation T246128 should be updated to mention what information is sent via the user agent [only the Wikibase unique identifier] and why this is sent [filtering traffic/preventing abuse], and that none of this information will be made public.

Technical Notes
There is a GenericActionApiClient that sends all outgoing requests to the source wiki. It uses MediaWiki's HttpRequestFactory::create to create requests, which takes an $options array, which may contain a userAgent field.

Product Note
Eventually, we will also want to know how many Wikibases have opted in to reusing Wikidata's properties so that we can monitor the demands this might put on WD infrastructure in the future. This level of tracking may require a discussion with the community if done by default. We will address this in future phases of federation and will not implement it here. At that point, we should also figure out how not to include ourselves (dev setups) in this count.

Event Timeline

Samantha_Alipio_WMDE renamed this task from Send user agent w/ federated API requests that includes local Wikibase URI to To investigate: Send user agent w/ federated API requests that includes local Wikibase URI.Mar 3 2020, 5:26 PM
Samantha_Alipio_WMDE updated the task description. (Show Details)

We need to know if this form of usage tracking is likely to be accepted by the community prior to implementing.

So from a technical standpoint even if we don't gather metrics from these user agents, we will still want to send them with the federation requests by default so that if needed traffic can be filtered etc.

In terms of what this UA should look like, we can probably use WikibaseQualityConstraints as an example.
It currently does the following using deprecated functions:

wfWikiID() . ' WikibaseQualityConstraints ' . Http::userAgent()

We would want something similar, although wfWikiID might not be so useful for us.

Perhaps:

$wgServer . ' Wikibase FederatedProperties ' . Http::userAgent()
Samantha_Alipio_WMDE renamed this task from To investigate: Send user agent w/ federated API requests that includes local Wikibase URI to Send user agent w/ federated API requests that includes local Wikibase URI.Apr 30 2020, 12:43 PM
Samantha_Alipio_WMDE updated the task description. (Show Details)
Samantha_Alipio_WMDE renamed this task from Send user agent w/ federated API requests that includes local Wikibase URI to Send user agent w/ federated API requests that includes unique identifier.Jun 17 2020, 8:43 AM
Samantha_Alipio_WMDE updated the task description. (Show Details)
Samantha_Alipio_WMDE renamed this task from Send user agent w/ federated API requests that includes unique identifier to Send user agent w/ federated API requests that includes anonymized unique identifier.Jun 17 2020, 8:49 AM