camillelamy / explainers

11 stars 5 forks source link

access-to-coop-page-from-openee should report the openerURL instead of the openeeURL #16

Closed ArthurSonzogni closed 4 years ago

ArthurSonzogni commented 4 years ago

For the violations:

This should be the opposite. This is likely a copy-pasting error from "access-from-coop-page-to-{openee,opener}". The same way, "referrer" and "initialPopupURL" might have to be exchanged in the explainer.

ArthurSonzogni commented 4 years ago

I was wrong, your explainer was right. Here the potential implementation I am using, passing the tests:

  switch (report_type) {
    // Reporter is the openee:
    case network::mojom::CoopAccessReportType::kAccessFromCoopPageToOpener:
    case network::mojom::CoopAccessReportType::kAccessToCoopPageFromOpener:
      body.SetStringPath(kOpenerURL, reported_urls->opener_url);
      body.SetStringPath(kReferrer, reported_urls->referrer_url);
      break;

    // Reporter is the opener:
    case network::mojom::CoopAccessReportType::kAccessFromCoopPageToOpenee:
    case network::mojom::CoopAccessReportType::kAccessToCoopPageFromOpenee:
      body.SetStringPath(kOpeneeURL, reported_urls->openee_url);
      body.SetStringPath(kInitialPopupURL, reported_urls->initial_popup_url);
      break;

    // Other:
    case network::mojom::CoopAccessReportType::kAccessFromCoopPageToOther:
    case network::mojom::CoopAccessReportType::kAccessToCoopPageFromOther:
      body.SetStringPath(kOtherDocumentURL, reported_urls->other_document_url);
      break;
  }

What matters is not "who is accessed", but "who is not the reporter"