Changeset 238122 in webkit
- Timestamp:
- Nov 12, 2018 11:07:21 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 36 edited
- 3 copied
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r238121 r238122 1 2018-11-12 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Network: show secure certificate details per-request 4 https://bugs.webkit.org/show_bug.cgi?id=191447 5 <rdar://problem/30019476> 6 7 Reviewed by Joseph Pecoraro. 8 9 * http/tests/inspector/network/resource-response-security-expected.txt: Added. 10 * http/tests/inspector/network/resource-response-security.html: Added. 11 12 * platform/gtk/TestExpectations: 13 * platform/wincairo/TestExpectations: 14 * platform/wpe/TestExpectations: 15 1 16 2018-11-12 Matt Baker <mattbaker@apple.com> 2 17 -
trunk/LayoutTests/platform/gtk/TestExpectations
r238071 r238122 1978 1978 1979 1979 webkit.org/b/186847 http/tests/inspector/network/resource-sizes-memory-cache.html [ Pass Failure ] 1980 webkit.org/b/191497 http/tests/inspector/network/resource-response-security.html [ Skip ] 1980 1981 1981 1982 webkit.org/b/186851 imported/w3c/web-platform-tests/xhr/formdata.htm [ Pass Failure ] -
trunk/LayoutTests/platform/wincairo/TestExpectations
r237941 r238122 998 998 999 999 http/tests/xmlviewer [ Skip ] 1000 1001 webkit.org/b/191498 http/tests/inspector/network/resource-response-security.html [ Skip ] 1000 1002 1001 1003 #/////////////////////////////////////////////////////////////////////////////// -
trunk/LayoutTests/platform/wpe/TestExpectations
r237861 r238122 533 533 534 534 Bug(WPE) fast/dom/HTMLAnchorElement [ Skip ] 535 536 webkit.org/b/191497 http/tests/inspector/network/resource-response-security.html [ Skip ] 535 537 536 538 #//////////////////////////////////////////////////////////////////////////////////////// -
trunk/Source/JavaScriptCore/CMakeLists.txt
r238016 r238122 1084 1084 ${JAVASCRIPTCORE_DIR}/inspector/protocol/Runtime.json 1085 1085 ${JAVASCRIPTCORE_DIR}/inspector/protocol/ScriptProfiler.json 1086 ${JAVASCRIPTCORE_DIR}/inspector/protocol/Security.json 1086 1087 ${JAVASCRIPTCORE_DIR}/inspector/protocol/Timeline.json 1087 1088 ${JAVASCRIPTCORE_DIR}/inspector/protocol/Worker.json -
trunk/Source/JavaScriptCore/ChangeLog
r238109 r238122 1 2018-11-12 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Network: show secure certificate details per-request 4 https://bugs.webkit.org/show_bug.cgi?id=191447 5 <rdar://problem/30019476> 6 7 Reviewed by Joseph Pecoraro. 8 9 Add Security domain to hold security related protocol types. 10 11 * CMakeLists.txt: 12 * DerivedSources.make: 13 * inspector/protocol/Network.json: 14 * inspector/protocol/Security.json: Added. 15 * inspector/scripts/codegen/objc_generator.py: 16 (ObjCGenerator): 17 1 18 2018-11-12 Saam barati <sbarati@apple.com> 2 19 -
trunk/Source/JavaScriptCore/DerivedSources.make
r238008 r238122 239 239 $(JavaScriptCore)/inspector/protocol/Runtime.json \ 240 240 $(JavaScriptCore)/inspector/protocol/ScriptProfiler.json \ 241 $(JavaScriptCore)/inspector/protocol/Security.json \ 241 242 $(JavaScriptCore)/inspector/protocol/Timeline.json \ 242 243 $(JavaScriptCore)/inspector/protocol/Worker.json \ -
trunk/Source/JavaScriptCore/inspector/protocol/Network.json
r236995 r238122 73 73 { "name": "statusText", "type": "string", "description": "HTTP response status text." }, 74 74 { "name": "headers", "$ref": "Headers", "description": "HTTP response headers." }, 75 { "name": "headersText", "type": "string", "optional": true, "description": "HTTP response headers text." },76 75 { "name": "mimeType", "type": "string", "description": "Resource mimeType as determined by the browser." }, 77 76 { "name": "source", "type": "string", "enum": ["unknown", "network", "memory-cache", "disk-cache", "service-worker"], "description": "Specifies where the response came from." }, 78 77 { "name": "requestHeaders", "$ref": "Headers", "optional": true, "description": "Refined HTTP request headers that were actually transmitted over the network." }, 79 { "name": " requestHeadersText", "type": "string", "optional": true, "description": "HTTP request headers text." },80 { "name": " timing", "$ref": "ResourceTiming", "optional": true, "description": "Timinginformation for the given request." }78 { "name": "timing", "$ref": "ResourceTiming", "optional": true, "description": "Timing information for the given request." }, 79 { "name": "security", "$ref": "Security.Security", "optional": true, "description": "The security information for the given request." } 81 80 ] 82 81 }, -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py
r236321 r238122 123 123 # Generate ObjC types, command handlers, and event dispatchers for a subset of domains. 124 124 125 DOMAINS_TO_GENERATE = ['CSS', 'DOM', 'DOMStorage', 'Network', ' Page', 'Automation', 'GenericTypes']125 DOMAINS_TO_GENERATE = ['CSS', 'DOM', 'DOMStorage', 'Network', 'Security', 'Page', 'Automation', 'GenericTypes'] 126 126 127 127 def should_generate_types_for_domain(self, domain): -
trunk/Source/WebCore/ChangeLog
r238119 r238122 1 2018-11-12 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Network: show secure certificate details per-request 4 https://bugs.webkit.org/show_bug.cgi?id=191447 5 <rdar://problem/30019476> 6 7 Reviewed by Joseph Pecoraro. 8 9 Test: http/tests/inspector/network/resource-response-security.html 10 11 * loader/ResourceLoader.h: 12 (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): 13 * loader/ResourceLoader.cpp: 14 (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added. 15 Always save certificate information when WebInspector is open. 16 17 * platform/network/CertificateInfoBase.h: Added. 18 (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const): 19 (WebCore::CertificateInfoBase::summaryInfo const): 20 (WebCore::CertificateInfoBase::isEmpty const): 21 * platform/network/cf/CertificateInfo.h: 22 (WebCore::CertificateInfo::summaryInfo const): Added. 23 * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. 24 (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): 25 (WebCore::CertificateInfo::summaryInfo const): Added. 26 * platform/network/curl/CertificateInfo.h: 27 (WebCore::CertificateInfo::summaryInfo const): Added. 28 (WebCore::CertificateInfo::isEmpty const): Added. 29 * platform/network/soup/CertificateInfo.h: 30 (WebCore::CertificateInfo::summaryInfo const): Added. 31 (WebCore::CertificateInfo::isEmpty const): Added. 32 Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have 33 platform-specific code in its implementation. 34 35 * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. 36 * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp. 37 * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp. 38 39 * inspector/NetworkResourcesData.h: 40 (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added. 41 (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added. 42 * inspector/NetworkResourcesData.cpp: 43 (WebCore::NetworkResourcesData::responseReceived): 44 45 * inspector/agents/InspectorNetworkAgent.cpp: 46 (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): 47 48 * PlatformAppleWin.cmake: 49 * PlatformMac.cmake: 50 * SourcesCocoa.txt: 51 * WebCore.xcodeproj/project.pbxproj: 52 * platform/Curl.cmake: 53 * platform/SourcesSoup.txt: 54 1 55 2018-11-12 Zalan Bujtas <zalan@apple.com> 2 56 -
trunk/Source/WebCore/PlatformAppleWin.cmake
r237636 r238122 48 48 49 49 platform/network/cf/AuthenticationCF.cpp 50 platform/network/cf/CertificateInfoCFNet.cpp 50 51 platform/network/cf/CookieStorageCFNet.cpp 51 52 platform/network/cf/CredentialStorageCFNet.cpp -
trunk/Source/WebCore/PlatformMac.cmake
r237636 r238122 415 415 platform/mediastream/mac/MockRealtimeVideoSourceMac.mm 416 416 417 platform/network/cf/CertificateInfoCFNet.cpp 417 418 platform/network/cf/DNSResolveQueueCFNet.cpp 418 419 platform/network/cf/FormDataStreamCFNet.cpp … … 434 435 platform/network/mac/AuthenticationMac.mm 435 436 platform/network/mac/BlobDataFileReferenceMac.mm 436 platform/network/mac/CertificateInfoMac.mm437 437 platform/network/mac/CookieStorageMac.mm 438 438 platform/network/mac/CredentialStorageMac.mm -
trunk/Source/WebCore/SourcesCocoa.txt
r238014 r238122 495 495 platform/mock/MediaPlaybackTargetMock.cpp 496 496 497 platform/network/cf/CertificateInfoCFNet.cpp 497 498 platform/network/cf/DNSResolveQueueCFNet.cpp 498 499 platform/network/cf/FormDataStreamCFNet.cpp … … 502 503 platform/network/cf/SocketStreamHandleImplCFNet.cpp 503 504 505 platform/network/cocoa/CertificateInfoCocoa.mm 504 506 platform/network/cocoa/CookieCocoa.mm 505 507 platform/network/cocoa/CookieStorageObserver.mm … … 518 520 platform/network/mac/AuthenticationMac.mm 519 521 platform/network/mac/BlobDataFileReferenceMac.mm 520 platform/network/mac/CertificateInfoMac.mm521 522 platform/network/mac/CookieStorageMac.mm 522 523 platform/network/mac/CredentialStorageMac.mm -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r238084 r238122 2561 2561 9001774112E0347800648462 /* OESStandardDerivatives.h in Headers */ = {isa = PBXBuildFile; fileRef = 9001773E12E0347800648462 /* OESStandardDerivatives.h */; }; 2562 2562 9001788112E0370700648462 /* JSOESStandardDerivatives.h in Headers */ = {isa = PBXBuildFile; fileRef = 9001787F12E0370700648462 /* JSOESStandardDerivatives.h */; }; 2563 91B8F0B521953D65000C2B00 /* CertificateInfoBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2563 2564 91B952241F58A58F00931DC2 /* RecordingSwizzleTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 91B952221F58A58000931DC2 /* RecordingSwizzleTypes.h */; }; 2564 2565 91C9F2F91AE3BEB00095B61C /* AXTextStateChangeIntent.h in Headers */ = {isa = PBXBuildFile; fileRef = 91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 8968 8969 5EBB89301C7777E100C65D41 /* IceCandidate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IceCandidate.h; sourceTree = "<group>"; }; 8969 8970 5EBB89381C77BDA400C65D41 /* PeerMediaDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PeerMediaDescription.h; sourceTree = "<group>"; }; 8970 5F2DBBE7178E332D00141486 /* CertificateInfo Mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CertificateInfoMac.mm; sourceTree = "<group>"; };8971 5F2DBBE7178E332D00141486 /* CertificateInfoCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CertificateInfoCFNet.cpp; sourceTree = "<group>"; }; 8971 8972 5F2DBBE8178E336900141486 /* CertificateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfo.h; sourceTree = "<group>"; }; 8972 8973 5FC7DC26CFE2563200B85AE5 /* JSEventTarget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSEventTarget.h; sourceTree = "<group>"; }; … … 10373 10374 9001787E12E0370700648462 /* JSOESStandardDerivatives.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOESStandardDerivatives.cpp; sourceTree = "<group>"; }; 10374 10375 9001787F12E0370700648462 /* JSOESStandardDerivatives.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOESStandardDerivatives.h; sourceTree = "<group>"; }; 10376 91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CertificateInfoBase.h; sourceTree = "<group>"; }; 10375 10377 91B952221F58A58000931DC2 /* RecordingSwizzleTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RecordingSwizzleTypes.h; sourceTree = "<group>"; }; 10376 10378 91C9F2F81AE3BE240095B61C /* AXTextStateChangeIntent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AXTextStateChangeIntent.h; sourceTree = "<group>"; }; … … 19601 19603 E43AF8E41AC5B7DD00CA717E /* CacheValidation.cpp */, 19602 19604 E43AF8E51AC5B7DD00CA717E /* CacheValidation.h */, 19605 91B8F0B321953D65000C2B00 /* CertificateInfoBase.h */, 19603 19606 7A56996E2086C618000E0433 /* CookieRequestHeaderFieldProxy.h */, 19604 19607 E13F01EA1270E10D00DFBA71 /* CookieStorage.h */, … … 19674 19677 514C76430CE9234E007EF3CD /* AuthenticationMac.mm */, 19675 19678 E164A2EB191AE6350010737D /* BlobDataFileReferenceMac.mm */, 19676 5F2DBBE7178E332D00141486 /* CertificateInfoMac.mm */,19677 19679 E13F01F01270E19000DFBA71 /* CookieStorageMac.mm */, 19678 19680 E1B4CD2410B322E200BFFD7E /* CredentialStorageMac.mm */, … … 24419 24421 7EE6844E12D26E3800E79415 /* AuthenticationChallenge.h */, 24420 24422 5F2DBBE8178E336900141486 /* CertificateInfo.h */, 24423 5F2DBBE7178E332D00141486 /* CertificateInfoCFNet.cpp */, 24421 24424 B2F34FE80E82F82700F648CD /* DNSResolveQueueCFNet.cpp */, 24422 24425 7EE6845C12D26E3800FF9415 /* DNSResolveQueueCFNet.h */, … … 28028 28031 CDE595971BF26E2100A1CBE8 /* CDMSessionMediaSourceAVFObjC.h in Headers */, 28029 28032 5FA904CA178E61F5004C8A2D /* CertificateInfo.h in Headers */, 28033 91B8F0B521953D65000C2B00 /* CertificateInfoBase.h in Headers */, 28030 28034 E1A8E56717552B2A007488E7 /* CFURLExtras.h in Headers */, 28031 28035 FE36FD1516C7826500F887C1 /* ChangeVersionData.h in Headers */, -
trunk/Source/WebCore/inspector/NetworkResourcesData.cpp
r237567 r238122 165 165 if (InspectorNetworkAgent::shouldTreatAsText(response.mimeType())) 166 166 resourceData->setDecoder(InspectorNetworkAgent::createTextDecoder(response.mimeType(), response.textEncodingName())); 167 168 if (auto& certificateInfo = response.certificateInfo()) 169 resourceData->setCertificateInfo(certificateInfo); 167 170 } 168 171 -
trunk/Source/WebCore/inspector/NetworkResourcesData.h
r234702 r238122 85 85 void setBuffer(RefPtr<SharedBuffer>&& buffer) { m_buffer = WTFMove(buffer); } 86 86 87 const std::optional<CertificateInfo>& certificateInfo() const { return m_certificateInfo; } 88 void setCertificateInfo(const std::optional<CertificateInfo>& certificateInfo) { m_certificateInfo = certificateInfo; } 89 87 90 CachedResource* cachedResource() const { return m_cachedResource; } 88 91 void setCachedResource(CachedResource* cachedResource) { m_cachedResource = cachedResource; } … … 108 111 RefPtr<SharedBuffer> m_dataBuffer; 109 112 RefPtr<SharedBuffer> m_buffer; 113 std::optional<CertificateInfo> m_certificateInfo; 110 114 CachedResource* m_cachedResource { nullptr }; 111 115 InspectorPageAgent::ResourceType m_type { InspectorPageAgent::OtherResource }; -
trunk/Source/WebCore/inspector/agents/InspectorNetworkAgent.cpp
r236995 r238122 39 39 #include "CachedResourceRequestInitiators.h" 40 40 #include "CachedScript.h" 41 #include "CertificateInfo.h" 41 42 #include "Document.h" 42 43 #include "DocumentLoader.h" … … 322 323 responseObject->setTiming(buildObjectForTiming(response.deprecatedNetworkLoadMetrics(), *resourceLoader)); 323 324 325 if (auto& certificateInfo = response.certificateInfo()) { 326 auto securityPayload = Inspector::Protocol::Security::Security::create() 327 .release(); 328 329 if (auto certificateSummaryInfo = certificateInfo.value().summaryInfo()) { 330 auto certificatePayload = Inspector::Protocol::Security::Certificate::create() 331 .release(); 332 333 certificatePayload->setSubject(certificateSummaryInfo.value().subject); 334 335 if (auto validFrom = certificateSummaryInfo.value().validFrom) 336 certificatePayload->setValidFrom(validFrom.seconds()); 337 338 if (auto validUntil = certificateSummaryInfo.value().validUntil) 339 certificatePayload->setValidUntil(validUntil.seconds()); 340 341 auto dnsNamesPayload = JSON::ArrayOf<String>::create(); 342 for (auto& dnsName : certificateSummaryInfo.value().dnsNames) 343 dnsNamesPayload->addItem(dnsName); 344 if (dnsNamesPayload->length()) 345 certificatePayload->setDnsNames(WTFMove(dnsNamesPayload)); 346 347 auto ipAddressesPayload = JSON::ArrayOf<String>::create(); 348 for (auto& ipAddress : certificateSummaryInfo.value().ipAddresses) 349 ipAddressesPayload->addItem(ipAddress); 350 if (ipAddressesPayload->length()) 351 certificatePayload->setDnsNames(WTFMove(ipAddressesPayload)); 352 353 securityPayload->setCertificate(WTFMove(certificatePayload)); 354 } 355 356 responseObject->setSecurity(WTFMove(securityPayload)); 357 } 358 324 359 return WTFMove(responseObject); 325 360 } -
trunk/Source/WebCore/loader/ResourceLoader.cpp
r237266 r238122 718 718 } 719 719 720 bool ResourceLoader::shouldIncludeCertificateInfo() const 721 { 722 if (m_options.certificateInfoPolicy == CertificateInfoPolicy::IncludeCertificateInfo) 723 return true; 724 if (UNLIKELY(InspectorInstrumentation::hasFrontends())) 725 return true; 726 return false; 727 } 728 720 729 void ResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge& challenge) 721 730 { -
trunk/Source/WebCore/loader/ResourceLoader.h
r237266 r238122 128 128 bool shouldSniffContentEncoding() const { return m_options.sniffContentEncoding == ContentEncodingSniffingPolicy::Sniff; } 129 129 WEBCORE_EXPORT bool isAllowedToAskUserForCredentials() const; 130 bool shouldIncludeCertificateInfo() const { return m_options.certificateInfoPolicy == CertificateInfoPolicy::IncludeCertificateInfo; }130 WEBCORE_EXPORT bool shouldIncludeCertificateInfo() const; 131 131 132 132 bool reachedTerminalState() const { return m_reachedTerminalState; } -
trunk/Source/WebCore/platform/Curl.cmake
r237118 r238122 5 5 list(APPEND WebCore_SOURCES 6 6 platform/network/curl/AuthenticationChallengeCurl.cpp 7 platform/network/curl/CertificateInfo .cpp7 platform/network/curl/CertificateInfoCurl.cpp 8 8 platform/network/curl/CookieJarCurlDatabase.cpp 9 9 platform/network/curl/CookieJarDB.cpp -
trunk/Source/WebCore/platform/SourcesSoup.txt
r234376 r238122 23 23 24 24 platform/network/soup/AuthenticationChallengeSoup.cpp 25 platform/network/soup/CertificateInfo .cpp25 platform/network/soup/CertificateInfoSoup.cpp 26 26 platform/network/soup/CookieSoup.cpp 27 27 platform/network/soup/CookieStorageSoup.cpp -
trunk/Source/WebCore/platform/network/CertificateInfoBase.h
r238121 r238122 1 1 /* 2 * Copyright (C) 201 7-2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 .content-view.resource-details { 27 position: absolute; 28 top: 0; 29 left: 0; 30 right: 0; 31 bottom: 0; 26 #pragma once 32 27 33 padding: 12px 20px 0 20px; 34 overflow: scroll; 28 #include <wtf/Optional.h> 29 #include <wtf/Seconds.h> 30 #include <wtf/Vector.h> 31 #include <wtf/text/WTFString.h> 35 32 36 -webkit-user-select: text; 37 white-space: nowrap; 38 } 33 namespace WebCore { 34 35 class CertificateInfoBase { 36 public: 37 bool containsNonRootSHA1SignedCertificate() const { return false; }; 38 39 struct SummaryInfo { 40 String subject; 41 Seconds validFrom; 42 Seconds validUntil; 43 Vector<String> dnsNames; 44 Vector<String> ipAddresses; 45 }; 46 std::optional<SummaryInfo> summaryInfo() const { return std::nullopt; }; 47 48 bool isEmpty() const { return true; }; 49 }; 50 51 } // namespace WebCore -
trunk/Source/WebCore/platform/network/cf/CertificateInfo.h
r228483 r238122 27 27 #define CertificateInfo_h 28 28 29 #include "CertificateInfoBase.h" 29 30 #include <wtf/RetainPtr.h> 30 31 … … 35 36 namespace WebCore { 36 37 37 class CertificateInfo {38 class CertificateInfo : public CertificateInfoBase { 38 39 public: 39 40 CertificateInfo() = default; … … 66 67 WEBCORE_EXPORT bool containsNonRootSHA1SignedCertificate() const; 67 68 69 std::optional<SummaryInfo> summaryInfo() const; 70 68 71 bool isEmpty() const { return type() == Type::None; } 69 72 … … 73 76 74 77 #ifndef NDEBUG 78 #if PLATFORM(COCOA) 75 79 void dump() const; 80 #endif 76 81 #endif 77 82 -
trunk/Source/WebCore/platform/network/cf/CertificateInfoCFNet.cpp
r238121 r238122 24 24 */ 25 25 26 #i mport"config.h"27 #i mport"CertificateInfo.h"26 #include "config.h" 27 #include "CertificateInfo.h" 28 28 29 #import "NotImplemented.h" 30 #import <wtf/cf/TypeCastsCF.h> 31 #import <wtf/spi/cocoa/SecuritySPI.h> 29 #include "NotImplemented.h" 30 #include <wtf/cf/TypeCastsCF.h> 31 32 #if PLATFORM(COCOA) 33 #include <Security/SecCertificate.h> 34 #include <wtf/spi/cocoa/SecuritySPI.h> 32 35 33 36 WTF_DECLARE_CF_TYPE_TRAIT(SecCertificate); 37 #endif 34 38 35 39 namespace WebCore { … … 85 89 #endif 86 90 91 #if PLATFORM(COCOA) 87 92 if (m_certificateChain) { 88 93 // Allow only the root certificate (the last in the chain) to be SHA1. … … 94 99 return false; 95 100 } 101 #endif 96 102 97 103 return false; 98 104 } 99 105 100 #ifndef NDEBUG 101 void CertificateInfo::dump() const 106 std::optional<CertificateInfo::SummaryInfo> CertificateInfo::summaryInfo() const 102 107 { 103 #if HAVE(SEC_TRUST_SERIALIZATION) 104 if ( m_trust) {105 CFIndex entries = SecTrustGetCertificateCount(trust());108 auto chain = certificateChain(); 109 if (!chain) 110 return std::nullopt; 106 111 107 NSLog(@"CertificateInfo SecTrust\n"); 108 NSLog(@" Entries: %ld\n", entries); 109 for (CFIndex i = 0; i < entries; ++i) { 110 RetainPtr<CFStringRef> summary = adoptCF(SecCertificateCopySubjectSummary(SecTrustGetCertificateAtIndex(trust(), i))); 111 NSLog(@" %@", (__bridge NSString *)summary.get()); 112 SummaryInfo summaryInfo; 113 114 #if PLATFORM(COCOA) && !PLATFORM(IOS_FAMILY_SIMULATOR) && !PLATFORM(IOSMAC) 115 auto leafCertificate = checked_cf_cast<SecCertificateRef>(CFArrayGetValueAtIndex(chain, 0)); 116 117 auto subjectCF = adoptCF(SecCertificateCopySubjectSummary(leafCertificate)); 118 summaryInfo.subject = subjectCF.get(); 119 #endif 120 121 #if PLATFORM(MAC) 122 if (auto certificateDictionary = adoptCF(SecCertificateCopyValues(leafCertificate, nullptr, nullptr))) { 123 // CFAbsoluteTime is relative to 01/01/1970 00:00:00 GMT. 124 const Seconds absoluteReferenceDate(978307200); 125 126 if (auto validNotBefore = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), kSecOIDX509V1ValidityNotBefore))) { 127 if (auto number = checked_cf_cast<CFNumberRef>(CFDictionaryGetValue(validNotBefore, CFSTR("value")))) { 128 double numberValue; 129 if (CFNumberGetValue(number, kCFNumberDoubleType, &numberValue)) 130 summaryInfo.validFrom = absoluteReferenceDate + Seconds(numberValue); 131 } 112 132 } 113 133 114 return; 134 if (auto validNotAfter = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), kSecOIDX509V1ValidityNotAfter))) { 135 if (auto number = checked_cf_cast<CFNumberRef>(CFDictionaryGetValue(validNotAfter, CFSTR("value")))) { 136 double numberValue; 137 if (CFNumberGetValue(number, kCFNumberDoubleType, &numberValue)) 138 summaryInfo.validUntil = absoluteReferenceDate + Seconds(numberValue); 139 } 140 } 141 142 if (auto dnsNames = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), CFSTR("DNSNAMES")))) { 143 if (auto dnsNamesArray = checked_cf_cast<CFArrayRef>(CFDictionaryGetValue(dnsNames, CFSTR("value")))) { 144 for (CFIndex i = 0, count = CFArrayGetCount(dnsNamesArray); i < count; ++i) { 145 if (auto dnsName = checked_cf_cast<CFStringRef>(CFArrayGetValueAtIndex(dnsNamesArray, i))) 146 summaryInfo.dnsNames.append(dnsName); 147 } 148 } 149 } 150 151 if (auto ipAddresses = checked_cf_cast<CFDictionaryRef>(CFDictionaryGetValue(certificateDictionary.get(), CFSTR("IPADDRESSES")))) { 152 if (auto ipAddressesArray = checked_cf_cast<CFArrayRef>(CFDictionaryGetValue(ipAddresses, CFSTR("value")))) { 153 for (CFIndex i = 0, count = CFArrayGetCount(ipAddressesArray); i < count; ++i) { 154 if (auto ipAddress = checked_cf_cast<CFStringRef>(CFArrayGetValueAtIndex(ipAddressesArray, i))) 155 summaryInfo.ipAddresses.append(ipAddress); 156 } 157 } 158 } 115 159 } 116 160 #endif 117 if (m_certificateChain) {118 CFIndex entries = CFArrayGetCount(m_certificateChain.get());119 161 120 NSLog(@"CertificateInfo (Certificate Chain)\n"); 121 NSLog(@" Entries: %ld\n", entries); 122 for (CFIndex i = 0; i < entries; ++i) { 123 RetainPtr<CFStringRef> summary = adoptCF(SecCertificateCopySubjectSummary(checked_cf_cast<SecCertificateRef>(CFArrayGetValueAtIndex(m_certificateChain.get(), i)))); 124 NSLog(@" %@", (__bridge NSString *)summary.get()); 125 } 126 127 return; 128 } 129 130 NSLog(@"CertificateInfo (Empty)\n"); 162 return summaryInfo; 131 163 } 132 #endif133 164 134 165 } // namespace WebCore -
trunk/Source/WebCore/platform/network/cocoa/CertificateInfoCocoa.mm
r238121 r238122 24 24 */ 25 25 26 #i mport"config.h"27 #i mport"CertificateInfo.h"26 #include "config.h" 27 #include "CertificateInfo.h" 28 28 29 #i mport "NotImplemented.h"30 #i mport<wtf/cf/TypeCastsCF.h>31 #i mport<wtf/spi/cocoa/SecuritySPI.h>29 #include <Security/SecCertificate.h> 30 #include <wtf/cf/TypeCastsCF.h> 31 #include <wtf/spi/cocoa/SecuritySPI.h> 32 32 33 33 WTF_DECLARE_CF_TYPE_TRAIT(SecCertificate); 34 34 35 35 namespace WebCore { 36 37 #if PLATFORM(COCOA)38 RetainPtr<CFArrayRef> CertificateInfo::certificateChainFromSecTrust(SecTrustRef trust)39 {40 auto count = SecTrustGetCertificateCount(trust);41 auto certificateChain = CFArrayCreateMutable(0, count, &kCFTypeArrayCallBacks);42 for (CFIndex i = 0; i < count; i++)43 CFArrayAppendValue(certificateChain, SecTrustGetCertificateAtIndex(trust, i));44 return adoptCF((CFArrayRef)certificateChain);45 }46 #endif47 48 CertificateInfo::Type CertificateInfo::type() const49 {50 #if HAVE(SEC_TRUST_SERIALIZATION)51 if (m_trust)52 return Type::Trust;53 #endif54 if (m_certificateChain)55 return Type::CertificateChain;56 return Type::None;57 }58 59 CFArrayRef CertificateInfo::certificateChain() const60 {61 #if HAVE(SEC_TRUST_SERIALIZATION)62 if (m_certificateChain)63 return m_certificateChain.get();64 65 if (m_trust)66 m_certificateChain = CertificateInfo::certificateChainFromSecTrust(m_trust.get());67 #endif68 69 return m_certificateChain.get();70 }71 72 bool CertificateInfo::containsNonRootSHA1SignedCertificate() const73 {74 #if HAVE(SEC_TRUST_SERIALIZATION)75 if (m_trust) {76 // Allow only the root certificate (the last in the chain) to be SHA1.77 for (CFIndex i = 0, size = SecTrustGetCertificateCount(trust()) - 1; i < size; ++i) {78 auto certificate = SecTrustGetCertificateAtIndex(trust(), i);79 if (SecCertificateGetSignatureHashAlgorithm(certificate) == kSecSignatureHashAlgorithmSHA1)80 return true;81 }82 83 return false;84 }85 #endif86 87 if (m_certificateChain) {88 // Allow only the root certificate (the last in the chain) to be SHA1.89 for (CFIndex i = 0, size = CFArrayGetCount(m_certificateChain.get()) - 1; i < size; ++i) {90 auto certificate = checked_cf_cast<SecCertificateRef>(CFArrayGetValueAtIndex(m_certificateChain.get(), i));91 if (SecCertificateGetSignatureHashAlgorithm(certificate) == kSecSignatureHashAlgorithmSHA1)92 return true;93 }94 return false;95 }96 97 return false;98 }99 36 100 37 #ifndef NDEBUG … … 127 64 return; 128 65 } 129 66 130 67 NSLog(@"CertificateInfo (Empty)\n"); 131 68 } -
trunk/Source/WebCore/platform/network/curl/CertificateInfo.h
r233919 r238122 26 26 #pragma once 27 27 28 #include "CertificateInfoBase.h" 28 29 #include "NotImplemented.h" 29 30 #include <wtf/Vector.h> … … 31 32 namespace WebCore { 32 33 33 class CertificateInfo {34 class CertificateInfo : public CertificateInfoBase { 34 35 public: 35 36 using Certificate = Vector<uint8_t>; … … 44 45 45 46 bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; } 47 48 std::optional<SummaryInfo> summaryInfo() const { notImplemented(); return std::nullopt; } 49 50 bool isEmpty() const { return m_certificateChain.isEmpty(); } 46 51 47 52 static Certificate makeCertificate(const char*, size_t); -
trunk/Source/WebCore/platform/network/soup/CertificateInfo.h
r185502 r238122 28 28 #define CertificateInfo_h 29 29 30 #include "CertificateInfoBase.h" 30 31 #include "NotImplemented.h" 31 32 #include <libsoup/soup.h> … … 37 38 class ResourceResponse; 38 39 39 class CertificateInfo {40 class CertificateInfo : public CertificateInfoBase { 40 41 public: 41 42 CertificateInfo(); … … 52 53 bool containsNonRootSHA1SignedCertificate() const { notImplemented(); return false; } 53 54 55 std::optional<SummaryInfo> summaryInfo() const { notImplemented(); return std::nullopt; } 56 57 bool isEmpty() const { return !m_certificate; } 58 54 59 private: 55 60 GRefPtr<GTlsCertificate> m_certificate; -
trunk/Source/WebInspectorUI/ChangeLog
r238121 r238122 1 2018-11-12 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Network: show secure certificate details per-request 4 https://bugs.webkit.org/show_bug.cgi?id=191447 5 <rdar://problem/30019476> 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/Controllers/NetworkManager.js: 10 (WI.NetworkManager.prototype.resourceRequestWasServedFromMemoryCache): 11 (WI.NetworkManager.prototype.resourceRequestDidReceiveResponse): 12 13 * UserInterface/Models/Resource.js: 14 (WI.Resource.prototype.get responseSecurity): Added. 15 (WI.Resource.prototype.get loadedSecurely): Added. 16 (WI.Resource.prototype.updateForResponse): 17 18 * UserInterface/Views/NetworkResourceDetailView.js: 19 (WI.NetworkResourceDetailView): 20 (WI.NetworkResourceDetailView.prototype.initialLayout): 21 (WI.NetworkResourceDetailView.prototype.showContentViewForIdentifier): 22 * UserInterface/Views/NetworkResourceDetailView.css: 23 (.content-view.resource-details .go-to-arrow): Added. 24 (.content-view.resource-details.showing-find-banner .search-highlight): Added. 25 26 * UserInterface/Views/ResourceSecurityContentView.js: Added. 27 (WI.ResourceSecurityContentView): 28 (WI.ResourceSecurityContentView.prototype.initialLayout): 29 (WI.ResourceSecurityContentView.prototype.layout): 30 (WI.ResourceSecurityContentView.prototype.closed): 31 (WI.ResourceSecurityContentView.prototype.get supportsSearch): 32 (WI.ResourceSecurityContentView.prototype.get numberOfSearchResults): 33 (WI.ResourceSecurityContentView.prototype.get hasPerformedSearch): 34 (WI.ResourceSecurityContentView.prototype.set automaticallyRevealFirstSearchResult): 35 (WI.ResourceSecurityContentView.prototype.performSearch): 36 (WI.ResourceSecurityContentView.prototype.searchCleared): 37 (WI.ResourceSecurityContentView.prototype.revealPreviousSearchResult): 38 (WI.ResourceSecurityContentView.prototype.revealNextSearchResult): 39 (WI.ResourceSecurityContentView.prototype._refreshCetificateSection): 40 (WI.ResourceSecurityContentView.prototype._perfomSearchOnKeyValuePairs): 41 (WI.ResourceSecurityContentView.prototype._revealSearchResult): 42 (WI.ResourceSecurityContentView.prototype._handleResourceResponseReceived): 43 * UserInterface/Views/ResourceSecurityContentView.css: Added. 44 (body[dir] .resource-security > section.certificate > .details): 45 (.resource-security .details .key): 46 (.resource-security .dns-name + .dns-name > .key,): 47 (.resource-security .show-more): 48 (@media (prefers-dark-interface) body[dir] .resource-security > section.certificate > .details): 49 (@media (prefers-dark-interface) .resource-security .details .key): 50 51 * UserInterface/Views/ResourceCookiesContentView.js: 52 (WI.ResourceCookiesContentView.prototype._refreshRequestCookiesSection): 53 (WI.ResourceCookiesContentView.prototype._refreshResponseCookiesSection): 54 (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithMessage): Deleted. 55 (WI.ResourceCookiesContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. 56 * UserInterface/Views/ResourceHeadersContentView.js: 57 (WI.ResourceHeadersContentView.prototype._refreshSummarySection): 58 (WI.ResourceHeadersContentView.prototype._refreshRedirectHeadersSections): 59 (WI.ResourceHeadersContentView.prototype._refreshRequestHeadersSection): 60 (WI.ResourceHeadersContentView.prototype._refreshResponseHeadersSection): 61 (WI.ResourceHeadersContentView.prototype._refreshQueryStringSection): 62 (WI.ResourceHeadersContentView.prototype._refreshRequestDataSection): 63 (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithMessage): Deleted. 64 (WI.ResourceHeadersContentView.prototype._markIncompleteSectionWithLoadingIndicator): Deleted. 65 (WI.ResourceHeadersContentView.prototype._appendKeyValuePair): Deleted. 66 * UserInterface/Views/ResourceHeadersContentView.css: 67 (.resource-headers .h1-status > .key,): 68 (body[dir] .resource-headers > section.error > .details): Deleted. 69 (.resource-headers > section.error .key): Deleted. 70 (.resource-headers .details): Deleted. 71 (.resource-headers .details .pair): Deleted. 72 (body[dir=rtl] .resource-headers .details .pair): Deleted. 73 (.resource-headers .details .key): Deleted. 74 (.resource-headers .value): Deleted. 75 (.resource-headers .go-to-arrow): Deleted. 76 (.resource-headers.showing-find-banner .search-highlight): Deleted. 77 * UserInterface/Views/ResourceDetailsSection.js: 78 (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithMessage): Added. 79 (WI.ResourceDetailsSection.prototype.markIncompleteSectionWithLoadingIndicator): Added. 80 (WI.ResourceDetailsSection.prototype.appendKeyValuePair): Added. 81 * UserInterface/Views/ResourceDetailsSection.css: 82 (.resource-details > section > .details): Added. 83 (.resource-details > section > .details > .pair): Added. 84 (body[dir=rtl] .resource-details > section > .details > .pair): Added. 85 (.resource-details > section > .details > .pair > .key): Added. 86 (.resource-details > section > .details > .pair > .value): Added. 87 (body[dir] .resource-details > section.error > .details): Added. 88 (.resource-details > section.error > .details > .pair > .key): Added. 89 Move commonly used functions/styles from container classes onto this object. 90 91 * UserInterface/Main.html: 92 * Localizations/en.lproj/localizedStrings.js: 93 1 94 2018-11-12 Matt Baker <mattbaker@apple.com> 2 95 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r237808 r238122 177 177 localizedStrings["Catch Variables"] = "Catch Variables"; 178 178 localizedStrings["Categories"] = "Categories"; 179 localizedStrings["Certificate"] = "Certificate"; 179 180 localizedStrings["Character Data"] = "Character Data"; 180 181 localizedStrings["Charge ‘%s’ to Callers"] = "Charge ‘%s’ to Callers"; … … 462 463 localizedStrings["Highest: %s"] = "Highest: %s"; 463 464 localizedStrings["Host"] = "Host"; 465 localizedStrings["IP"] = "IP"; 464 466 localizedStrings["IP Address"] = "IP Address"; 465 467 localizedStrings["Identity"] = "Identity"; … … 602 604 localizedStrings["No response cookies."] = "No response cookies."; 603 605 localizedStrings["No response headers"] = "No response headers"; 606 localizedStrings["No response security certificate."] = "No response security certificate."; 607 localizedStrings["No response security information."] = "No response security information."; 604 608 localizedStrings["Node"] = "Node"; 605 609 localizedStrings["Node Removed"] = "Node Removed"; … … 767 771 localizedStrings["Search Resource Content"] = "Search Resource Content"; 768 772 localizedStrings["Secure"] = "Secure"; 773 localizedStrings["Security"] = "Security"; 769 774 localizedStrings["Security Issue"] = "Security Issue"; 770 775 localizedStrings["Security Origin"] = "Security Origin"; … … 876 881 localizedStrings["Stylesheet"] = "Stylesheet"; 877 882 localizedStrings["Stylesheets"] = "Stylesheets"; 883 localizedStrings["Subject"] = "Subject"; 878 884 localizedStrings["Subtree Modified"] = "Subtree Modified"; 879 885 localizedStrings["Summary"] = "Summary"; … … 888 894 localizedStrings["Text Node"] = "Text Node"; 889 895 localizedStrings["The page's content has changed"] = "The page's content has changed"; 896 localizedStrings["The resource was requested insecurely."] = "The resource was requested insecurely."; 890 897 localizedStrings["The “%s“ audit failed"] = "The “%s“ audit failed"; 891 898 localizedStrings["The “%s“ audit is unsupported"] = "The “%s“ audit is unsupported"; … … 946 953 localizedStrings["User Interface:"] = "User Interface:"; 947 954 localizedStrings["User Stylesheet"] = "User Stylesheet"; 955 localizedStrings["Valid From"] = "Valid From"; 956 localizedStrings["Valid Until"] = "Valid Until"; 948 957 localizedStrings["Value"] = "Value"; 949 958 localizedStrings["Variables"] = "Variables"; -
trunk/Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
r238048 r238122 420 420 initiatorNode: this._initiatorNodeFromPayload(initiator), 421 421 }); 422 resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, elapsedTime, response.timing, responseSource );422 resource.updateForResponse(cachedResourcePayload.url, response.mimeType, cachedResourcePayload.type, response.headers, response.status, response.statusText, elapsedTime, response.timing, responseSource, response.security); 423 423 resource.increaseSize(cachedResourcePayload.bodySize, elapsedTime); 424 424 resource.increaseTransferSize(cachedResourcePayload.bodySize); … … 482 482 resource.legacyMarkServedFromDiskCache(); 483 483 484 resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, elapsedTime, response.timing, response.source );484 resource.updateForResponse(response.url, response.mimeType, type, response.headers, response.status, response.statusText, elapsedTime, response.timing, response.source, response.security); 485 485 } 486 486 -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r237997 r238122 165 165 <link rel="stylesheet" href="Views/ResourceHeadersContentView.css"> 166 166 <link rel="stylesheet" href="Views/ResourceIcons.css"> 167 <link rel="stylesheet" href="Views/ResourceSecurityContentView.css"> 167 168 <link rel="stylesheet" href="Views/ResourceSizesContentView.css"> 168 169 <link rel="stylesheet" href="Views/ResourceSidebarPanel.css"> … … 726 727 <script src="Views/ResourceDetailsSidebarPanel.js"></script> 727 728 <script src="Views/ResourceHeadersContentView.js"></script> 729 <script src="Views/ResourceSecurityContentView.js"></script> 728 730 <script src="Views/ResourceSidebarPanel.js"></script> 729 731 <script src="Views/ResourceSizesContentView.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Models/Resource.js
r237151 r238122 71 71 this._receivedNetworkLoadMetrics = false; 72 72 this._responseSource = WI.Resource.ResponseSource.Unknown; 73 this._responseSecurity = null; 73 74 this._timingData = new WI.ResourceTimingData(this); 74 75 this._protocol = null; … … 307 308 get statusText() { return this._statusText; } 308 309 get responseSource() { return this._responseSource; } 310 get responseSecurity() { return this._responseSecurity; } 309 311 get timingData() { return this._timingData; } 310 312 get protocol() { return this._protocol; } … … 339 341 } 340 342 343 get loadedSecurely() 344 { 345 if (this.urlComponents.scheme !== "https" && this.urlComponents.scheme !== "wss" && this.urlComponents.scheme !== "sftp") 346 return false; 347 if (isNaN(this._timingData.secureConnectionStart) && !isNaN(this._timingData.connectionStart)) 348 return false; 349 return true; 350 } 351 341 352 get displayName() 342 353 { … … 676 687 } 677 688 678 updateForResponse(url, mimeType, type, responseHeaders, statusCode, statusText, elapsedTime, timingData, source )689 updateForResponse(url, mimeType, type, responseHeaders, statusCode, statusText, elapsedTime, timingData, source, security) 679 690 { 680 691 console.assert(!this._finished); … … 704 715 if (source) 705 716 this._responseSource = WI.Resource.responseSourceFromPayload(source); 717 718 if (security) 719 this._responseSecurity = security; 706 720 707 721 const headerBaseSize = 12; // Length of "HTTP/1.1 ", " ", and "\r\n". -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.css
r237028 r238122 37 37 white-space: nowrap; 38 38 } 39 40 .content-view.resource-details .go-to-arrow { 41 vertical-align: top; 42 bottom: 1px; 43 } 44 45 .content-view.resource-details.showing-find-banner .search-highlight { 46 color: var(--text-color); 47 background-color: hsla(53, 83%, 53%, 0.2); 48 border-bottom: 1px solid hsl(47, 82%, 60%); 49 } -
trunk/Source/WebInspectorUI/UserInterface/Views/NetworkResourceDetailView.js
r237028 r238122 39 39 this._sizesContentView = null; 40 40 this._timingContentView = null; 41 this._securityContentView = null; 41 42 } 42 43 … … 90 91 this.createDetailNavigationItem("sizes", WI.UIString("Sizes")); 91 92 this.createDetailNavigationItem("timing", WI.UIString("Timing")); 93 this.createDetailNavigationItem("security", WI.UIString("Security")); 92 94 93 95 super.initialLayout(); … … 129 131 this._contentBrowser.showContentView(this._timingContentView, this._contentViewCookie); 130 132 break; 133 case "security": 134 if (!this._securityContentView) 135 this._securityContentView = new WI.ResourceSecurityContentView(this.representedObject); 136 this._contentBrowser.showContentView(this._securityContentView, this._contentViewCookie); 137 break; 131 138 } 132 139 -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceCookiesContentView.js
r234822 r238122 120 120 // Private 121 121 122 _markIncompleteSectionWithMessage(section, message)123 {124 section.toggleIncomplete(true);125 126 let p = section.detailsElement.appendChild(document.createElement("p"));127 p.textContent = message;128 }129 130 _markIncompleteSectionWithLoadingIndicator(section)131 {132 section.toggleIncomplete(true);133 134 let p = section.detailsElement.appendChild(document.createElement("p"));135 let spinner = new WI.IndeterminateProgressSpinner;136 p.appendChild(spinner.element);137 }138 139 122 _dataSourceForTable(table) 140 123 { … … 207 190 208 191 if (this._resource.responseSource === WI.Resource.ResponseSource.MemoryCache) { 209 this._ markIncompleteSectionWithMessage(this._requestCookiesSection,WI.UIString("No request, served from the memory cache."));192 this._requestCookiesSection.markIncompleteSectionWithMessage(WI.UIString("No request, served from the memory cache.")); 210 193 return; 211 194 } … … 226 209 if (this._requestCookiesTable.isAttached) 227 210 this.removeSubview(this._requestCookiesTable); 228 this._ markIncompleteSectionWithMessage(this._requestCookiesSection,WI.UIString("No request cookies."));211 this._requestCookiesSection.markIncompleteSectionWithMessage(WI.UIString("No request cookies.")); 229 212 } else { 230 213 this._requestCookiesSection.toggleIncomplete(false); … … 242 225 243 226 if (!this._resource.hasResponse()) { 244 this._ markIncompleteSectionWithLoadingIndicator(this._responseCookiesSection);227 this._responseCookiesSection.markIncompleteSectionWithLoadingIndicator(); 245 228 return; 246 229 } … … 268 251 if (this._responseCookiesTable.isAttached) 269 252 this.removeSubview(this._responseCookiesTable); 270 this._ markIncompleteSectionWithMessage(this._responseCookiesSection,WI.UIString("No response cookies."));253 this._responseCookiesSection.markIncompleteSectionWithMessage(WI.UIString("No response cookies.")); 271 254 } else { 272 255 this._responseCookiesSection.toggleIncomplete(false); -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.css
r224769 r238122 35 35 .resource-details > section > .details { 36 36 -webkit-margin-start: 10px; 37 white-space: normal; 38 word-break: break-all; 37 39 } 38 40 … … 55 57 border-color: var(--console-secondary-text-color) !important; 56 58 } 59 60 .resource-details > section > .details > .pair { 61 --resource-details-value-indent: 15px; 62 -webkit-margin-start: var(--resource-details-value-indent); 63 } 64 65 body[dir=rtl] .resource-details > section > .details > .pair { 66 /* Don't include indents in RTL */ 67 --resource-details-value-indent: 0px; 68 } 69 70 .resource-details > section > .details > .pair > .key { 71 font-weight: 500; 72 -webkit-margin-start: calc(var(--resource-details-value-indent) * -1); 73 } 74 75 .resource-details > section > .details > .pair > .value { 76 color: var(--text-color); 77 } 78 79 body[dir] .resource-details > section.error > .details { 80 border-color: var(--network-error-color); 81 } 82 83 .resource-details > section.error > .details > .pair > .key { 84 color: var(--network-error-color); 85 } -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceDetailsSection.js
r224733 r238122 60 60 this.element.classList.toggle("error", isError); 61 61 } 62 63 markIncompleteSectionWithMessage(message) 64 { 65 this.toggleIncomplete(true); 66 67 let p = this._detailsElement.appendChild(document.createElement("p")); 68 p.textContent = message; 69 } 70 71 markIncompleteSectionWithLoadingIndicator() 72 { 73 this.toggleIncomplete(true); 74 75 let p = this._detailsElement.appendChild(document.createElement("p")); 76 let spinner = new WI.IndeterminateProgressSpinner; 77 p.appendChild(spinner.element); 78 } 79 80 appendKeyValuePair(key, value, className) 81 { 82 let p = this._detailsElement.appendChild(document.createElement("p")); 83 p.className = "pair"; 84 if (className) 85 p.classList.add(className); 86 87 let keyElement = p.appendChild(document.createElement("span")); 88 keyElement.className = "key"; 89 90 console.assert(typeof key === "string" || key instanceof Node); 91 if (key instanceof Node) 92 keyElement.appendChild(key); 93 else { 94 // Don't include a colon if no value. 95 keyElement.textContent = key + (value ? ": " : ""); 96 97 let valueElement = p.appendChild(document.createElement("span")); 98 valueElement.className = "value"; 99 if (value instanceof Node) 100 valueElement.appendChild(value); 101 else 102 valueElement.textContent = value; 103 } 104 105 return p; 106 } 62 107 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.css
r237085 r238122 32 32 } 33 33 34 body[dir] .resource-headers > section.error > .details {35 border-color: var(--network-error-color);36 }37 38 .resource-headers > section.error .key {39 color: var(--network-error-color);40 }41 42 .resource-headers .details {43 white-space: normal;44 word-break: break-all;45 }46 47 .resource-headers .details .pair {48 --resource-headers-value-indent: 15px;49 -webkit-margin-start: var(--resource-headers-value-indent);50 }51 52 body[dir=rtl] .resource-headers .details .pair {53 /* Don't include indents in RTL */54 --resource-headers-value-indent: 0px;55 }56 57 .resource-headers .details .key {58 font-weight: 500;59 -webkit-margin-start: calc(var(--resource-headers-value-indent) * -1);60 }61 62 .resource-headers .value {63 color: var(--text-color);64 }65 66 34 .resource-headers .url + .url > .key { 67 35 color: transparent; … … 80 48 color: var(--network-pseudo-header-color); 81 49 } 82 83 .resource-headers .go-to-arrow {84 vertical-align: top;85 bottom: 1px;86 }87 88 .resource-headers.showing-find-banner .search-highlight {89 color: var(--text-color);90 background-color: hsla(53, 83%, 53%, 0.2);91 border-bottom: 1px solid hsl(47, 82%, 60%);92 } -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceHeadersContentView.js
r236995 r238122 212 212 // Private 213 213 214 _markIncompleteSectionWithMessage(section, message)215 {216 section.toggleIncomplete(true);217 218 let p = section.detailsElement.appendChild(document.createElement("p"));219 p.textContent = message;220 }221 222 _markIncompleteSectionWithLoadingIndicator(section)223 {224 section.toggleIncomplete(true);225 226 let p = section.detailsElement.appendChild(document.createElement("p"));227 let spinner = new WI.IndeterminateProgressSpinner;228 p.appendChild(spinner.element);229 }230 231 _appendKeyValuePair(parentElement, key, value, className)232 {233 let p = parentElement.appendChild(document.createElement("p"));234 p.className = "pair";235 if (className)236 p.classList.add(className);237 238 // Don't include a colon if no value.239 console.assert(typeof key === "string");240 let displayKey = key + (value ? ": " : "");241 242 let keyElement = p.appendChild(document.createElement("span"));243 keyElement.className = "key";244 keyElement.textContent = displayKey;245 246 let valueElement = p.appendChild(document.createElement("span"));247 valueElement.className = "value";248 if (value instanceof Node)249 valueElement.appendChild(value);250 else251 valueElement.textContent = value;252 }253 254 214 _responseSourceDisplayString(responseSource) 255 215 { … … 277 237 278 238 for (let redirect of this._resource.redirects) 279 this._ appendKeyValuePair(detailsElement,WI.UIString("URL"), redirect.url.insertWordBreakCharacters(), "url");280 this._ appendKeyValuePair(detailsElement,WI.UIString("URL"), this._resource.url.insertWordBreakCharacters(), "url");239 this._summarySection.appendKeyValuePair(WI.UIString("URL"), redirect.url.insertWordBreakCharacters(), "url"); 240 this._summarySection.appendKeyValuePair(WI.UIString("URL"), this._resource.url.insertWordBreakCharacters(), "url"); 281 241 282 242 let status = emDash; 283 243 if (!isNaN(this._resource.statusCode)) 284 244 status = this._resource.statusCode + (this._resource.statusText ? " " + this._resource.statusText : ""); 285 this._ appendKeyValuePair(detailsElement,WI.UIString("Status"), status);245 this._summarySection.appendKeyValuePair(WI.UIString("Status"), status); 286 246 287 247 // FIXME: <https://webkit.org/b/178827> Web Inspector: Should be able to link directly to the ServiceWorker that handled a particular load 288 248 289 249 let source = this._responseSourceDisplayString(this._resource.responseSource) || emDash; 290 this._ appendKeyValuePair(detailsElement,WI.UIString("Source"), source);250 this._summarySection.appendKeyValuePair(WI.UIString("Source"), source); 291 251 292 252 if (this._resource.remoteAddress) 293 this._ appendKeyValuePair(detailsElement,WI.UIString("Address"), this._resource.remoteAddress);253 this._summarySection.appendKeyValuePair(WI.UIString("Address"), this._resource.remoteAddress); 294 254 } 295 255 … … 304 264 305 265 // FIXME: <https://webkit.org/b/190214> Web Inspector: expose full load metrics for redirect requests 306 this._appendKeyValuePair(redirectRequestSection.detailsElement,`${redirect.requestMethod} ${redirect.urlComponents.path}`, null, "h1-status");266 redirectRequestSection.appendKeyValuePair(`${redirect.requestMethod} ${redirect.urlComponents.path}`, null, "h1-status"); 307 267 308 268 for (let key in redirect.requestHeaders) 309 this._appendKeyValuePair(redirectRequestSection.detailsElement,key, redirect.requestHeaders[key], "header");269 redirectRequestSection.appendKeyValuePair(key, redirect.requestHeaders[key], "header"); 310 270 311 271 referenceElement = this.element.insertBefore(redirectRequestSection.element, referenceElement.nextElementSibling); … … 315 275 316 276 // FIXME: <https://webkit.org/b/190214> Web Inspector: expose full load metrics for redirect requests 317 this._appendKeyValuePair(redirectResponseSection.detailsElement,`${redirect.responseStatusCode} ${redirect.responseStatusText}`, null, "h1-status");277 redirectResponseSection.appendKeyValuePair(`${redirect.responseStatusCode} ${redirect.responseStatusText}`, null, "h1-status"); 318 278 319 279 for (let key in redirect.responseHeaders) 320 this._appendKeyValuePair(redirectResponseSection.detailsElement,key, redirect.responseHeaders[key], "header");280 redirectResponseSection.appendKeyValuePair(key, redirect.responseHeaders[key], "header"); 321 281 322 282 referenceElement = this.element.insertBefore(redirectResponseSection.element, referenceElement.nextElementSibling); … … 333 293 if (this._resource.statusCode !== 304) { 334 294 if (this._resource.responseSource === WI.Resource.ResponseSource.MemoryCache) { 335 this._ markIncompleteSectionWithMessage(this._requestHeadersSection,WI.UIString("No request, served from the memory cache."));295 this._requestHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No request, served from the memory cache.")); 336 296 return; 337 297 } 338 298 if (this._resource.responseSource === WI.Resource.ResponseSource.DiskCache) { 339 this._ markIncompleteSectionWithMessage(this._requestHeadersSection,WI.UIString("No request, served from the disk cache."));299 this._requestHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No request, served from the disk cache.")); 340 300 return; 341 301 } … … 348 308 // https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1 349 309 let requestLine = `${this._resource.requestMethod} ${urlComponents.path} ${protocol.toUpperCase()}`; 350 this._ appendKeyValuePair(detailsElement,requestLine, null, "h1-status");310 this._requestHeadersSection.appendKeyValuePair(requestLine, null, "h1-status"); 351 311 } else if (protocol === "h2") { 352 312 // HTTP/2 Request pseudo headers: 353 313 // https://tools.ietf.org/html/rfc7540#section-8.1.2.3 354 this._ appendKeyValuePair(detailsElement,":method", this._resource.requestMethod, "h2-pseudo-header");355 this._ appendKeyValuePair(detailsElement,":scheme", urlComponents.scheme, "h2-pseudo-header");356 this._ appendKeyValuePair(detailsElement,":authority", WI.h2Authority(urlComponents), "h2-pseudo-header");357 this._ appendKeyValuePair(detailsElement,":path", WI.h2Path(urlComponents), "h2-pseudo-header");314 this._requestHeadersSection.appendKeyValuePair(":method", this._resource.requestMethod, "h2-pseudo-header"); 315 this._requestHeadersSection.appendKeyValuePair(":scheme", urlComponents.scheme, "h2-pseudo-header"); 316 this._requestHeadersSection.appendKeyValuePair(":authority", WI.h2Authority(urlComponents), "h2-pseudo-header"); 317 this._requestHeadersSection.appendKeyValuePair(":path", WI.h2Path(urlComponents), "h2-pseudo-header"); 358 318 } 359 319 360 320 let requestHeaders = this._resource.requestHeaders; 361 321 for (let key in requestHeaders) 362 this._ appendKeyValuePair(detailsElement,key, requestHeaders[key], "header");322 this._requestHeadersSection.appendKeyValuePair(key, requestHeaders[key], "header"); 363 323 364 324 if (!detailsElement.firstChild) 365 this._ markIncompleteSectionWithMessage(this._requestHeadersSection,WI.UIString("No request headers"));325 this._requestHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No request headers")); 366 326 } 367 327 … … 372 332 373 333 if (!this._resource.hasResponse()) { 374 this._ markIncompleteSectionWithLoadingIndicator(this._responseHeadersSection);334 this._responseHeadersSection.markIncompleteSectionWithLoadingIndicator(); 375 335 return; 376 336 } … … 383 343 // https://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6.1 384 344 let responseLine = `${protocol.toUpperCase()} ${this._resource.statusCode} ${this._resource.statusText}`; 385 this._ appendKeyValuePair(detailsElement,responseLine, null, "h1-status");345 this._responseHeadersSection.appendKeyValuePair(responseLine, null, "h1-status"); 386 346 } else if (protocol === "h2") { 387 347 // HTTP/2 Response pseudo headers: 388 348 // https://tools.ietf.org/html/rfc7540#section-8.1.2.4 389 this._ appendKeyValuePair(detailsElement,":status", this._resource.statusCode, "h2-pseudo-header");349 this._responseHeadersSection.appendKeyValuePair(":status", this._resource.statusCode, "h2-pseudo-header"); 390 350 } 391 351 … … 397 357 console.assert(responseCookies.length > 0); 398 358 for (let cookie of responseCookies) 399 this._ appendKeyValuePair(detailsElement,key, cookie.rawHeader, "header");359 this._responseHeadersSection.appendKeyValuePair(key, cookie.rawHeader, "header"); 400 360 continue; 401 361 } 402 362 403 this._ appendKeyValuePair(detailsElement,key, responseHeaders[key], "header");363 this._responseHeadersSection.appendKeyValuePair(key, responseHeaders[key], "header"); 404 364 } 405 365 406 366 if (!detailsElement.firstChild) 407 this._ markIncompleteSectionWithMessage(this._responseHeadersSection,WI.UIString("No response headers"));367 this._responseHeadersSection.markIncompleteSectionWithMessage(WI.UIString("No response headers")); 408 368 } 409 369 … … 419 379 let queryStringPairs = parseQueryString(queryString, true); 420 380 for (let {name, value} of queryStringPairs) 421 this._ appendKeyValuePair(detailsElement,name, value);381 this._queryStringSection.appendKeyValuePair(name, value); 422 382 } 423 383 … … 435 395 if (requestDataContentType && requestDataContentType.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)) { 436 396 // Simple form data that should be parsable like a query string. 437 this._ appendKeyValuePair(detailsElement,WI.UIString("MIME Type"), requestDataContentType);397 this._requestDataSection.appendKeyValuePair(WI.UIString("MIME Type"), requestDataContentType); 438 398 let queryStringPairs = parseQueryString(requestData, true); 439 399 for (let {name, value} of queryStringPairs) 440 this._ appendKeyValuePair(detailsElement,name, value);400 this._requestDataSection.appendKeyValuePair(name, value); 441 401 return; 442 402 } … … 447 407 let encoding = mimeTypeComponents.encoding; 448 408 449 this._ appendKeyValuePair(detailsElement,WI.UIString("MIME Type"), mimeType);409 this._requestDataSection.appendKeyValuePair(WI.UIString("MIME Type"), mimeType); 450 410 if (boundary) 451 this._ appendKeyValuePair(detailsElement,WI.UIString("Boundary"), boundary);411 this._requestDataSection.appendKeyValuePair(WI.UIString("Boundary"), boundary); 452 412 if (encoding) 453 this._ appendKeyValuePair(detailsElement,WI.UIString("Encoding"), encoding);413 this._requestDataSection.appendKeyValuePair(WI.UIString("Encoding"), encoding); 454 414 455 415 let goToButton = detailsElement.appendChild(WI.createGoToArrowButton()); 456 416 goToButton.addEventListener("click", () => { this._delegate.headersContentViewGoToRequestData(this); }); 457 this._ appendKeyValuePair(detailsElement,WI.UIString("Request Data"), goToButton);417 this._requestDataSection.appendKeyValuePair(WI.UIString("Request Data"), goToButton); 458 418 } 459 419 -
trunk/Source/WebInspectorUI/UserInterface/Views/ResourceSecurityContentView.css
r238121 r238122 1 1 /* 2 * Copyright (C) 2018 Sony Interactive Entertainment Inc.2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #include "config.h" 27 #include "CertificateInfo.h" 28 29 #include <wtf/CrossThreadCopier.h> 30 31 #if USE(CURL) 32 33 namespace WebCore { 34 35 CertificateInfo::CertificateInfo(int verificationError, Vector<Certificate>&& certificateChain) 36 : m_verificationError(verificationError) 37 , m_certificateChain(WTFMove(certificateChain)) 38 { 26 body[dir] .resource-security > section.certificate > .details { 27 border-color: var(--network-dns-color); 39 28 } 40 29 41 CertificateInfo CertificateInfo::isolatedCopy() const 42 { 43 return { m_verificationError, crossThreadCopy(m_certificateChain) }; 30 .resource-security .details .key { 31 color: var(--network-dns-color); 44 32 } 45 33 46 CertificateInfo::Certificate CertificateInfo::makeCertificate(const char* buffer, size_t size) 47 { 48 Certificate certificate; 49 certificate.append(buffer, size); 50 return certificate; 34 .resource-security .dns-name + .dns-name > .key, 35 .resource-security .ip-address + .ip-address > .key { 36 color: transparent; 51 37 } 52 38 39 .resource-security .show-more { 40 text-decoration: underline; 41 cursor: pointer; 42 color: var(--text-color); 53 43 } 54 44 55 #endif 45 @media (prefers-dark-interface) { 46 body[dir] .resource-security > section.certificate > .details { 47 border-color: var(--network-pseudo-header-color); 48 } 49 50 .resource-security .details .key { 51 color: var(--network-pseudo-header-color); 52 } 53 }
Note: See TracChangeset
for help on using the changeset viewer.