Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/security/SecurityPanel.js

Issue 1589703002: Surface SCT (Signed Certificate Timestamp) counts in the Security panel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address latest comments. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.PanelWithSidebar} 7 * @extends {WebInspector.PanelWithSidebar}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.SecurityPanel = function() 10 WebInspector.SecurityPanel = function()
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 * @param {?NetworkAgent.CertificateDetails} certificateDetails 786 * @param {?NetworkAgent.CertificateDetails} certificateDetails
787 */ 787 */
788 function displayCertificateDetails(certificateDetails) 788 function displayCertificateDetails(certificateDetails)
789 { 789 {
790 var sanDiv = this._createSanDiv(certificateDetails.subject); 790 var sanDiv = this._createSanDiv(certificateDetails.subject);
791 var validFromString = new Date(1000 * certificateDetails.validFrom). toUTCString(); 791 var validFromString = new Date(1000 * certificateDetails.validFrom). toUTCString();
792 var validUntilString = new Date(1000 * certificateDetails.validTo).t oUTCString(); 792 var validUntilString = new Date(1000 * certificateDetails.validTo).t oUTCString();
793 793
794 var table = new WebInspector.SecurityDetailsTable(); 794 var table = new WebInspector.SecurityDetailsTable();
795 certificateSection.appendChild(table.element()); 795 certificateSection.appendChild(table.element());
796 table.addRow("Subject", certificateDetails.subject.name); 796 table.addRow("Subject", certificateDetails.subject.name);
pfeldman 2016/02/04 00:16:15 These all should have WebInspector.UIString wrappe
797 table.addRow("SAN", sanDiv); 797 table.addRow("SAN", sanDiv);
798 table.addRow("Valid From", validFromString); 798 table.addRow("Valid From", validFromString);
799 table.addRow("Valid Until", validUntilString); 799 table.addRow("Valid Until", validUntilString);
800 table.addRow("Issuer", certificateDetails.issuer); 800 table.addRow("Issuer", certificateDetails.issuer);
801 table.addRow("SCTs", this.sctSummary(originState.securityDetails.cer tificateValidationDetails));
801 table.addRow("", WebInspector.SecurityPanel.createCertificateViewerB utton(WebInspector.UIString("Open full certificate details"), originState.securi tyDetails.certificateId)); 802 table.addRow("", WebInspector.SecurityPanel.createCertificateViewerB utton(WebInspector.UIString("Open full certificate details"), originState.securi tyDetails.certificateId));
802 // TODO(lgarron): Make SCT status available in certificate details a nd show it here.
803 } 803 }
804 804
805 function displayCertificateDetailsUnavailable () 805 function displayCertificateDetailsUnavailable ()
806 { 806 {
807 certificateSection.createChild("div").textContent = WebInspector.UIS tring("Certificate details unavailable."); 807 certificateSection.createChild("div").textContent = WebInspector.UIS tring("Certificate details unavailable.");
808 } 808 }
809 809
810 originState.certificateDetailsPromise.then(displayCertificateDetails.bin d(this), displayCertificateDetailsUnavailable); 810 originState.certificateDetailsPromise.then(displayCertificateDetails.bin d(this), displayCertificateDetailsUnavailable);
811 811
812 var noteSection = this.element.createChild("div", "origin-view-section") ; 812 var noteSection = this.element.createChild("div", "origin-view-section") ;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 setSecurityState: function(newSecurityState) 872 setSecurityState: function(newSecurityState)
873 { 873 {
874 for (var className of Array.prototype.slice.call(this._originLockIcon.cl assList)) { 874 for (var className of Array.prototype.slice.call(this._originLockIcon.cl assList)) {
875 if (className.startsWith("security-property-")) 875 if (className.startsWith("security-property-"))
876 this._originLockIcon.classList.remove(className); 876 this._originLockIcon.classList.remove(className);
877 } 877 }
878 878
879 this._originLockIcon.classList.add("security-property-" + newSecuritySta te); 879 this._originLockIcon.classList.add("security-property-" + newSecuritySta te);
880 }, 880 },
881 881
882 /**
883 * @constructor
884 * @param {?NetworkAgent.CertificateValidationDetails} details
885 * @return {string}
886 */
887 sctSummary: function(details)
888 {
889 if (!details)
890 return WebInspector.UIString("N/A");
891
892 var sctTypeList = [];
893 if (details.numValidScts)
894 sctTypeList.push(WebInspector.UIString("%d valid SCT%s", details.num ValidScts, (details.numValidScts > 1) ? "s" : ""));
895 if (details.numInvalidScts)
896 sctTypeList.push(WebInspector.UIString("%d invalid SCT%s", details.n umInvalidScts, (details.numInvalidScts > 1) ? "s" : ""));
897 if (details.numUnknownScts)
898 sctTypeList.push(WebInspector.UIString("%d SCT%s from unknown logs", details.numUnknownScts, (details.numUnknownScts > 1) ? "s" : ""));
899 return sctTypeList.length ? sctTypeList.join(", ") : WebInspector.UIStri ng("0 SCTs");
900 },
901
882 __proto__: WebInspector.VBox.prototype 902 __proto__: WebInspector.VBox.prototype
883 } 903 }
884 904
885 /** 905 /**
886 * @constructor 906 * @constructor
887 */ 907 */
888 WebInspector.SecurityDetailsTable = function() 908 WebInspector.SecurityDetailsTable = function()
889 { 909 {
890 this._element = createElement("table"); 910 this._element = createElement("table");
891 this._element.classList.add("details-table"); 911 this._element.classList.add("details-table");
(...skipping 19 matching lines...) Expand all
911 row.createChild("div").textContent = key; 931 row.createChild("div").textContent = key;
912 932
913 var valueDiv = row.createChild("div"); 933 var valueDiv = row.createChild("div");
914 if (typeof value === "string") { 934 if (typeof value === "string") {
915 valueDiv.textContent = value; 935 valueDiv.textContent = value;
916 } else { 936 } else {
917 valueDiv.appendChild(value); 937 valueDiv.appendChild(value);
918 } 938 }
919 } 939 }
920 } 940 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp ('k') | third_party/WebKit/Source/devtools/protocol.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698