Bug 1404753

Summary: /api/model requires external access to https://fonts.googleapis.com
Product: [oVirt] ovirt-engine Reporter: Yaniv Kaul <ykaul>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.1.0CC: bugs, lsvaty, oourfali, ykaul
Target Milestone: ovirt-4.2.0Flags: rule-engine: ovirt-4.2+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
lsvaty: testing_ack+
Target Release: 4.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 10:59:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yaniv Kaul 2016-12-14 14:51:45 UTC
Description of problem:
It has an HREF to a stylesheet @ https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700

Steps to Reproduce:
1. Look at the source code of the /api/model page.

Comment 1 Yaniv Kaul 2016-12-14 14:55:28 UTC
and /apidocs seems to have also https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.9.1/styles/github.min.css

Comment 2 Juan Hernández 2016-12-20 13:24:40 UTC
Do we need/want a completely independent HTML? With no external references?

Comment 3 Yaniv Kaul 2016-12-20 13:33:59 UTC
(In reply to Juan Hernández from comment #2)
> Do we need/want a completely independent HTML? With no external references?

Yes, for more than one reason:
1. In internal networks without Internet, how will it look like?
2. Performance - it takes quite some time, for some reason, to bring those.
3. Reliability - what if they change something? Remove something? inaccessible? have been infected with some malicious JS code? etc....

Comment 4 Juan Hernández 2016-12-20 13:37:58 UTC
OK

Comment 5 Juan Hernández 2017-09-22 12:59:37 UTC
The following changes modify the 'ovirt-engine-api-explorer' application so that it doesn't require access to external resources:

  Bundle JavaScript libraries
  https://gerrit.ovirt.org/82103

  Bundle styles and images
  https://gerrit.ovirt.org/82111

A preview of the modified application is available here:

  https://jhernand.fedorapeople.org/ovirt-api-explorer

The next step is, in my opinion, to modify the engine so that it includes this application in the /ovirt-engine/apidoc URL, instead of the current static document.

Comment 6 Juan Hernández 2017-09-27 09:21:47 UTC
The fix for this issue isn't complete, we still need to modify the engine so that it uses the API explorer instead of the plain HTML documentation.

Comment 7 Juan Hernández 2017-09-30 23:52:42 UTC
The following two patches complete the integration of the API explorer into the engine:

  restapi: Integrate API explorer
  https://gerrit.ovirt.org/82401

  Require ovirt-js-dependencies
  https://gerrit.ovirt.org/82402

The API explorer doesn't use external fonts, or styles. It only uses what it bundles and what the "ovirt-js-dependencies" package provides.

The existing "model.html" file, which requires external fonts, styles and scripts, is still available, but only if explicitly requested. The default page shown when accessing /ovirt-engine/apidoc will be the API explorer.

If we consider it convenient that "model.html" can be removed.

Comment 8 Petr Matyáš 2017-10-16 11:51:23 UTC
Verified on 4.2.0-0.0.master.20171013142622.git15e767c.el7.centos

Comment 9 Sandro Bonazzola 2017-12-20 10:59:56 UTC
This bugzilla is included in oVirt 4.2.0 release, published on Dec 20th 2017.

Since the problem described in this bug report should be
resolved in oVirt 4.2.0 release, published on Dec 20th 2017, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.