Review main Abandoned

67495[FEATURE] Add referer header to fetch oembed json for embedded videos

Pascal Rinker CR 0 V 0 Normal +117 −8 updated 11/27/21, 12:46

Commit message

To allow embedding of vimeo videos with restricted embedding settings
the o embed request must include a HTTP referer. This must be compatible
with multi domain sites so it is not possible to use the backend url
as referrer.

The new option "Use this site configuration for online media requests"
inside the site configuration allows to use one or more sites as referrer
for vimeo videos.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 6

Review log 1217

  1. Pascal Rinker uploaded patch set 1 01/21/21, 11:37

  2. TYPO3com voted on patch set 1 V -1 01/21/21, 11:37 Completed build in 18s on Thu, 21 Jan, 11:37 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8960

  3. Pascal Rinker uploaded patch set 2 01/21/21, 12:25

  4. TYPO3com voted on patch set 2 V -1 01/21/21, 12:36 Completed build in 10m 35s on Thu, 21 Jan, 12:36 PM Test Summary: 32601 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8962

  5. Pascal Rinker uploaded patch set 3 01/21/21, 13:10

  6. TYPO3com voted on patch set 3 V +1 01/21/21, 13:20 Completed build in 10m 29s on Thu, 21 Jan, 01:20 PM Test Summary: 32601 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8963

  7. Stefan Froemken commented on patch set 3 CR -1 01/22/21, 09:45

    IMO SiteConfiguration is a good place to solve this problem, but we should prevent requesting vimeo API a hundred times, if this checkbox is activated for all SiteConfiguration. You have declared this patch as FEATURE. TYPO3 9 and 10 are Feature freeze. Maybe as BUGFIX this patch has the possibility to get in these releases.

    Unresolved

    I would prefer "Add referer header". In case of HTTP header it is called "referer". But yes, in english language it is called "referrer"

    Unresolved

    "a HTTP referer"

    site.php:69 Unresolved

    Can you please add a default

    siteconfiguration_fieldinformation.xlf:19 Unresolved

    In commit message you say it's just for Vimeo requests.

    AbstractOEmbedHelper.php:71 Unresolved

    getAllSites() just have this annotation. So no need to add it here again

    AbstractOEmbedHelper.php:79

    I don't like this approach. Annotations let me expect that result is an array containing Site objects.

    AbstractOEmbedHelper.php:104

    Check if result of getSitesForOEmbedRequest is empty array and start a single request without HTTP referer. Else loop and start individual requests. Move request code into its own method with Site and Header as argument. What, if you have 100 SiteConfiguration and 80 of them are marked as "useAsRefererForOEmbedHelperRequests". I prefer to stop after 3 or 5 requests to prevent memory_limits or max_execution_time problems.
  8. Oli Bartsch commented on patch set 3 01/22/21, 10:34

    I'm missing some tests for this feature.

    AbstractOEmbedHelper.php:89

    Since we are in an abstract class, please make this method an abstract method. So extending classes have to implement it properly. And sth. like `isValidOEmbedDataRespose()` would suite better IMO.
  9. Pascal Rinker commented on patch set 3 01/22/21, 14:49

    AbstractOEmbedHelper.php:79 Reply Unresolved

    You're right, this was just to move that if into this method. What do you think about putting a n condition in getOEmbedData() after calling this method to check if the array is not empty. Then the method only returns Sites or an empty array.

    AbstractOEmbedHelper.php:89 Reply

    I wanted to make this an abstract method too but then it's a breaking change. Other extensions like ext:youku would stop working. Really like `isValidOEmbedDataRespose()` and will change that.

    AbstractOEmbedHelper.php:104 Reply Unresolved

    This is a hard one. If a user checks 80 configurations to be used as referer, then 80 requests should be fired imo. Otherwise the user is frustrated because he checks the option and his config will be ignored because it's number 6 or so. Maybe a notice like "too many sites as referer may affect the performance" or so is what we want?
  10. Pascal Rinker uploaded patch set 4 01/22/21, 14:56

  11. TYPO3com voted on patch set 4 V +1 01/22/21, 15:06 Completed build in 09m 46s on Fri, 22 Jan, 03:06 PM Test Summary: 32601 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8989

  12. Oli Bartsch commented on patch set 4 01/22/21, 15:09

    AbstractOEmbedHelper.php:89 Reply

    Ack
  13. Andreas Kienast updated the commit message in patch set 5 01/22/21, 16:47

  14. Andreas Kienast commented on patch set 5 01/22/21, 16:48

    FYI: Since this is a feature, I've removed 10.4 and 9.5 from the "Releases" line. Usually, features don't go into already released versions unless absolutely mandatory.
  15. TYPO3com voted on patch set 5 V +1 01/22/21, 17:07 Completed build in 17m 49s on Fri, 22 Jan, 05:07 PM Test Summary: 32601 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8996

  16. Georg Ringer commented on patch set 5 01/25/21, 14:22

    site.php:65 Unresolved

    I would like to see no additional UI field but a config via yml only
  17. Benni Mack abandoned the change 11/27/21, 12:46

    I will abandon this change now ... there was no movement since initial feedback of various people. Can be restored at a later time.