Source: https://en.wikipedia.org/wiki/Magnuson–Moss_Warranty_Act
> Warrantors cannot require that only branded parts be used with the product in order to retain the warranty.[7] This is commonly referred to as the "tie-in sales" provisions,[8] and is frequently mentioned in the context of third-party computer parts, such as memory and hard drives.
> The federal minimum standards for full warranties are waived if the warrantor can show that the problem associated with a warranted consumer product was caused by damage while in the possession of the consumer, or by unreasonable use, including a failure to provide reasonable and necessary maintenance.
In US, it is illegal to force a customer to use authorized repairs or use authentic parts but it is not illegal to deny services if the cause of the damage was due to unauthorized parts/services. Huge differences here, Apple has the right to deny services free of charge to customers who did not use authorized services.
but the damage isnt caused by the part or service but because of apples reaction to it.