Bug 171217 - Support removal of authentication data through the Website data store API.
Summary: Support removal of authentication data through the Website data store API.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Per Arne Vollan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-24 05:49 PDT by Per Arne Vollan
Modified: 2017-06-07 09:51 PDT (History)
10 users (show)

See Also:


Attachments
Patch (12.44 KB, patch)
2017-04-24 08:52 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (52.06 KB, patch)
2017-04-27 05:44 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (33.19 KB, patch)
2017-05-06 01:14 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (33.25 KB, patch)
2017-05-19 07:17 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (25.44 KB, patch)
2017-06-04 23:52 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (25.44 KB, patch)
2017-06-05 00:19 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (25.46 KB, patch)
2017-06-05 00:29 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (25.47 KB, patch)
2017-06-05 00:33 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (25.87 KB, patch)
2017-06-05 00:43 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (25.90 KB, patch)
2017-06-05 01:44 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (27.80 KB, patch)
2017-06-06 23:35 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (28.06 KB, patch)
2017-06-07 01:24 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (28.10 KB, patch)
2017-06-07 01:39 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff
Patch (28.51 KB, patch)
2017-06-07 01:52 PDT, Per Arne Vollan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Per Arne Vollan 2017-04-24 05:49:46 PDT
WebKit needs to support removal of authentication data through WebsiteDataStore.
Comment 1 Per Arne Vollan 2017-04-24 08:52:21 PDT
Created attachment 307978 [details]
Patch
Comment 2 John Wilander 2017-04-24 09:44:58 PDT
I think this needs to be tested since time comparisons are tricky. The ability to test might require a way to set the timestamp explicitly. Setting the timestamp will also be required if we are to support loading of persisted credentials.
Comment 3 Per Arne Vollan 2017-04-24 10:45:29 PDT
(In reply to John Wilander from comment #2)
> I think this needs to be tested since time comparisons are tricky. The
> ability to test might require a way to set the timestamp explicitly. Setting
> the timestamp will also be required if we are to support loading of
> persisted credentials.

Thanks for reviewing! I will add test(s).
Comment 4 John Wilander 2017-04-24 17:08:24 PDT
rdar://problem/29522573
Comment 5 mitz 2017-04-24 20:26:50 PDT
Comment on attachment 307978 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=307978&action=review

At first sight, it seems very strange to treat user credentials as website data. The credentials are user data, so I don’t understand how it makes sense, even conceptually, to expose them via the website data store API. The implementation further shows how confusing or misleading this is. Because persisting website credentials isn’t under WebKit’s purview, even removing credentials from a persistent website data store doesn’t remove persistent credentials.

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h:59
> +WK_EXTERN NSString * const WKWebsiteDataTypeCredentials WK_API_AVAILABLE(macosx(10.12), ios(10.0));

This availability attribute is clearly wrong, because this is not part of the macOS 10.12 and iOS 10 API.

> Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:779
> +    if (dataTypes.contains(WebsiteDataType::Credentials)) {
> +        auto storage = WebCore::NetworkStorageSession::defaultStorageSession().credentialStorage();
> +        storage.removeCredentialsModifiedSince(modifiedSince);
> +    }

So this operates on the global default storage session regardless of which WKWebsiteDataStore the client messaged?
Comment 6 John Wilander 2017-04-24 20:41:31 PDT
(In reply to mitz from comment #5)
> Comment on attachment 307978 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=307978&action=review
> 
> At first sight, it seems very strange to treat user credentials as website
> data. The credentials are user data, so I don’t understand how it makes
> sense, even conceptually, to expose them via the website data store API. The
> implementation further shows how confusing or misleading this is. Because
> persisting website credentials isn’t under WebKit’s purview, even removing
> credentials from a persistent website data store doesn’t remove persistent
> credentials.

Clients tell WebKit which website datatypes to remove. Would you add another parameter type or have a whole new API for this? We need both a "clear all" and a "clear modified since."

> > Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h:59
> > +WK_EXTERN NSString * const WKWebsiteDataTypeCredentials WK_API_AVAILABLE(macosx(10.12), ios(10.0));
> 
> This availability attribute is clearly wrong, because this is not part of
> the macOS 10.12 and iOS 10 API.
> 
> > Source/WebKit2/UIProcess/WebsiteData/WebsiteDataStore.cpp:779
> > +    if (dataTypes.contains(WebsiteDataType::Credentials)) {
> > +        auto storage = WebCore::NetworkStorageSession::defaultStorageSession().credentialStorage();
> > +        storage.removeCredentialsModifiedSince(modifiedSince);
> > +    }
> 
> So this operates on the global default storage session regardless of which
> WKWebsiteDataStore the client messaged?

You're right. This needs to happen on either the right storage session or all storage sessions. To be able to test it we probably need to get a test runner callback when credentials have been removed.
Comment 7 mitz 2017-04-24 20:50:52 PDT
(In reply to John Wilander from comment #6)
> (In reply to mitz from comment #5)
> > Comment on attachment 307978 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=307978&action=review
> > 
> > At first sight, it seems very strange to treat user credentials as website
> > data. The credentials are user data, so I don’t understand how it makes
> > sense, even conceptually, to expose them via the website data store API. The
> > implementation further shows how confusing or misleading this is. Because
> > persisting website credentials isn’t under WebKit’s purview, even removing
> > credentials from a persistent website data store doesn’t remove persistent
> > credentials.
> 
> Clients tell WebKit which website datatypes to remove. Would you add another
> parameter type or have a whole new API for this? We need both a "clear all"
> and a "clear modified since."

This data type isn’t a website data type, so it seems inappropriate to include in the website data API.

The notion if a website credential’s modification date is also strange. What is the use case for forgetting only credentials modified since some time?
Comment 8 Brent Fulgham 2017-04-24 20:56:23 PDT
Comment on attachment 307978 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=307978&action=review

>>> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h:59
>>> +WK_EXTERN NSString * const WKWebsiteDataTypeCredentials WK_API_AVAILABLE(macosx(10.12), ios(10.0));
>> 
>> This availability attribute is clearly wrong, because this is not part of the macOS 10.12 and iOS 10 API.
> 
> You're right. This needs to happen on either the right storage session or all storage sessions. To be able to test it we probably need to get a test runner callback when credentials have been removed.

This should probably be WK_API_AVAILBLE(WK_MAC_TBA, WK_IOS_TBA)
Comment 9 Jessie Berlin 2017-04-25 10:21:51 PDT
(In reply to mitz from comment #7)
> (In reply to John Wilander from comment #6)
> > (In reply to mitz from comment #5)
> > > Comment on attachment 307978 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=307978&action=review
> > > 
> > > At first sight, it seems very strange to treat user credentials as website
> > > data. The credentials are user data, so I don’t understand how it makes
> > > sense, even conceptually, to expose them via the website data store API. The
> > > implementation further shows how confusing or misleading this is. Because
> > > persisting website credentials isn’t under WebKit’s purview, even removing
> > > credentials from a persistent website data store doesn’t remove persistent
> > > credentials.
> > 
> > Clients tell WebKit which website datatypes to remove. Would you add another
> > parameter type or have a whole new API for this? We need both a "clear all"
> > and a "clear modified since."
> 
> This data type isn’t a website data type, so it seems inappropriate to
> include in the website data API.
> 
> The notion if a website credential’s modification date is also strange. What
> is the use case for forgetting only credentials modified since some time?

This gives Safari the ability to include it in clearing UI that is "clear for the last hour" to cover tracks. HTTP auth could also be used by websites to surreptitiously track users (e.g. by putting HTTP auth credentials in the URL of a subresource).

Per Arne Vollan - is this going to clear the data that is stored in keychain as well? That seems different than what the original goal was here (clear authentication that is not stored in keychain, since the user can clear it from keychain).
Comment 10 mitz 2017-04-25 10:28:07 PDT
(In reply to Jessie Berlin from comment #9)
> (In reply to mitz from comment #7)
> > (In reply to John Wilander from comment #6)
> > > (In reply to mitz from comment #5)
> > > > Comment on attachment 307978 [details]
> > > > Patch
> > > > 
> > > > View in context:
> > > > https://bugs.webkit.org/attachment.cgi?id=307978&action=review
> > > > 
> > > > At first sight, it seems very strange to treat user credentials as website
> > > > data. The credentials are user data, so I don’t understand how it makes
> > > > sense, even conceptually, to expose them via the website data store API. The
> > > > implementation further shows how confusing or misleading this is. Because
> > > > persisting website credentials isn’t under WebKit’s purview, even removing
> > > > credentials from a persistent website data store doesn’t remove persistent
> > > > credentials.
> > > 
> > > Clients tell WebKit which website datatypes to remove. Would you add another
> > > parameter type or have a whole new API for this? We need both a "clear all"
> > > and a "clear modified since."
> > 
> > This data type isn’t a website data type, so it seems inappropriate to
> > include in the website data API.
> > 
> > The notion if a website credential’s modification date is also strange. What
> > is the use case for forgetting only credentials modified since some time?
> 
> This gives Safari the ability to include it in clearing UI that is "clear
> for the last hour" to cover tracks.

So in this hypothetical Safari is going to also remove the corresponding Keychain items? This proposed API doesn’t seem to support something like that.

> HTTP auth could also be used by websites
> to surreptitiously track users (e.g. by putting HTTP auth credentials in the
> URL of a subresource).
> 
> Per Arne Vollan - is this going to clear the data that is stored in keychain
> as well? That seems different than what the original goal was here (clear
> authentication that is not stored in keychain, since the user can clear it
> from keychain).
Comment 11 Per Arne Vollan 2017-04-25 11:53:56 PDT
(In reply to Jessie Berlin from comment #9)
> > 
> > The notion if a website credential’s modification date is also strange. What
> > is the use case for forgetting only credentials modified since some time?
> 
> This gives Safari the ability to include it in clearing UI that is "clear
> for the last hour" to cover tracks. HTTP auth could also be used by websites
> to surreptitiously track users (e.g. by putting HTTP auth credentials in the
> URL of a subresource).
> 
> Per Arne Vollan - is this going to clear the data that is stored in keychain
> as well? That seems different than what the original goal was here (clear
> authentication that is not stored in keychain, since the user can clear it
> from keychain).

I believe the goal here is to only remove the items in the Credential Storage, and not remove Keychain items.
Comment 12 Per Arne Vollan 2017-04-25 11:59:23 PDT
(In reply to mitz from comment #7)
> (In reply to John Wilander from comment #6)
> > (In reply to mitz from comment #5)
> > > Comment on attachment 307978 [details]
> > > Patch
> > > 
> > > View in context:
> > > https://bugs.webkit.org/attachment.cgi?id=307978&action=review
> > > 
> > > At first sight, it seems very strange to treat user credentials as website
> > > data. The credentials are user data, so I don’t understand how it makes
> > > sense, even conceptually, to expose them via the website data store API. The
> > > implementation further shows how confusing or misleading this is. Because
> > > persisting website credentials isn’t under WebKit’s purview, even removing
> > > credentials from a persistent website data store doesn’t remove persistent
> > > credentials.
> > 
> > Clients tell WebKit which website datatypes to remove. Would you add another
> > parameter type or have a whole new API for this? We need both a "clear all"
> > and a "clear modified since."
> 
> This data type isn’t a website data type, so it seems inappropriate to
> include in the website data API.
> 

I am currently working on creating a new C API for this. I will upload a modified patch soon.

Thanks for reviewing!
Comment 13 Jessie Berlin 2017-04-26 15:02:54 PDT
(In reply to mitz from comment #10)
> (In reply to Jessie Berlin from comment #9)
> > (In reply to mitz from comment #7)
> > > (In reply to John Wilander from comment #6)
> > > > (In reply to mitz from comment #5)
> > > > > Comment on attachment 307978 [details]
> > > > > Patch
> > > > > 
> > > > > View in context:
> > > > > https://bugs.webkit.org/attachment.cgi?id=307978&action=review
> > > > > 
> > > > > At first sight, it seems very strange to treat user credentials as website
> > > > > data. The credentials are user data, so I don’t understand how it makes
> > > > > sense, even conceptually, to expose them via the website data store API. The
> > > > > implementation further shows how confusing or misleading this is. Because
> > > > > persisting website credentials isn’t under WebKit’s purview, even removing
> > > > > credentials from a persistent website data store doesn’t remove persistent
> > > > > credentials.
> > > > 
> > > > Clients tell WebKit which website datatypes to remove. Would you add another
> > > > parameter type or have a whole new API for this? We need both a "clear all"
> > > > and a "clear modified since."
> > > 
> > > This data type isn’t a website data type, so it seems inappropriate to
> > > include in the website data API.
> > > 
> > > The notion if a website credential’s modification date is also strange. What
> > > is the use case for forgetting only credentials modified since some time?
> > 
> > This gives Safari the ability to include it in clearing UI that is "clear
> > for the last hour" to cover tracks.
> 
> So in this hypothetical Safari is going to also remove the corresponding
> Keychain items? This proposed API doesn’t seem to support something like
> that.
> 
> > HTTP auth could also be used by websites
> > to surreptitiously track users (e.g. by putting HTTP auth credentials in the
> > URL of a subresource).
> > 
> > Per Arne Vollan - is this going to clear the data that is stored in keychain
> > as well? That seems different than what the original goal was here (clear
> > authentication that is not stored in keychain, since the user can clear it
> > from keychain).

Dan and I talked about this further - it isn't necessary for this to have a "clear for the last hour" functionality. I agree with him that this should be about clearing the session based data, and a separate API.

Has Geoff looked at the proposal for the new API?
Comment 14 Per Arne Vollan 2017-04-27 05:44:19 PDT
Created attachment 308381 [details]
Patch
Comment 15 Geoffrey Garen 2017-05-03 14:57:53 PDT
> Dan and I talked about this further - it isn't necessary for this to have a
> "clear for the last hour" functionality. I agree with him that this should
> be about clearing the session based data, and a separate API.

Sorry, are you saying that you and Dan agree that this API should be separate from WKWebsiteDataStore?
Comment 16 Geoffrey Garen 2017-05-03 15:03:26 PDT
Comment on attachment 308381 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308381&action=review

> Source/WebKit2/UIProcess/API/C/WKCredentialManager.h:35
> +typedef void (*WKCredentialManagerRemovedCredentialsResult)(bool, WKErrorRef, void*);

Is there any condition under which we will fail to remove and still invoke this callback? I don't think there is, so I think the bool argument doesn't make sense. (And what about the WKErrorRef and void* arguments?)
Comment 17 Brady Eidson 2017-05-03 15:14:58 PDT
I have so many opinions.
Comment 18 Brady Eidson 2017-05-03 15:26:43 PDT
(In reply to mitz from comment #7)
> This data type isn’t a website data type, so it seems inappropriate to
> include in the website data API.

I agree that persistent credentials are not "website data"

I disagree that session credentials (which this API is targeted at) are not "website data"

They are, exactly the same way that session cookies are. They do little more than allow for the same tracking vectors as session cookies and they can be explicitly set by websites.

(In reply to Jessie Berlin from comment #13)

> Dan and I talked about this further - I agree with him that this should
> be about clearing the session based data, and a separate API.

Yes, this should be about the session based data only. But I think it makes perfect sense to include it in WebsiteDataStore operations. This is website data that the user has as much control over as they do session cookies, and does not conflict with the keychain which is user data.

There's also problems with the patch I'll include in review.
Comment 19 Brady Eidson 2017-05-03 15:28:40 PDT
Comment on attachment 308381 [details]
Patch

The patch doesn't message the WebProcesses. While most credential storage operations are in the networking process, sadly there's still a bit left in WebProcesses as well.

It also can't be correct because it operates on the global session ID. Note, this came up in earlier comments but was never addressed.

The testing is also problematic. The API tests are designed to work offline, yet the added test hits a public URL. Additionally it doesn't attempt to do any validation on credentials actually being sent to the server. The test doesn't actually verify the behavior that is important; That the credentials were cleared.

I think:
- "Session Credentials" can be a new type on WebsiteDataStore, and that's where it should be exposed in SPI
- As long as there's any doubt that WebsiteDataStore is the wrong place, I still think that's fine as the C-API is SPI, and we'll learn whether it was right or not before adding anything to the Cocoa API (but I think it's right)
- This needs to go to the WebProcess(es) in addition to Networking
- To that effect, the "Web" prefix should be dropped from the CredentialManager objects and the receiver-side should be moved to Shared.
Comment 20 Per Arne Vollan 2017-05-05 09:36:36 PDT
Thanks for reviewing! I will upload a new patch soon.
Comment 21 Per Arne Vollan 2017-05-06 01:14:24 PDT
Created attachment 309279 [details]
Patch
Comment 22 Per Arne Vollan 2017-05-19 07:17:53 PDT
Created attachment 310654 [details]
Patch
Comment 23 Ansh Shukla 2017-05-31 02:19:44 PDT
Can we get a review on the latest patch? Three Safari bugs are blocked by progress here. Thank you!
Comment 24 Brady Eidson 2017-05-31 11:38:51 PDT
Comment on attachment 310654 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=310654&action=review

Thinking it was very odd that this patch adds a deleter without a completion handler, I dug in to the history of WKWebsiteDataStoreRef.

It was added in r181707 and its sole purpose was to provide a toll-free bridge from WKContextRef to WKWebsiteDataStore (the Cocoa API object) It never should've had any API/SPI added to it. In fact some of the methods there (rightfully) have zero clients.

In my 5-3 comment I suggested adding it to the C-SPI was fine, but I misunderstood the history of WebsiteDataStoreRef - It never predated WKWebsiteDataStore and never had any API.

The rest of my 5-3 comment applies. You'll need to add this to WKWebsiteDataStore.

Look at WKWebsiteDataRecord.h and WKWebsiteDataRecordPrivate.h to see how the types are exposed - They're just strings, and you'll need to add a new string type.

Additionally, it's not okay to *only* expose a deleter. WKWebsiteDataStore supports Safari's privacy UI, and that UI needs to accurately reflect when a site has data stored against it. In other words, you'll need to add the getters as well.

> Source/WebKit2/UIProcess/API/C/WKCredential.cpp:-55
>  {
>      return toCopiedAPI(toImpl(credentialRef)->credential().user());
>  }
> -

This does not need to be in this patch.
Comment 25 Per Arne Vollan 2017-05-31 12:30:27 PDT
(In reply to Brady Eidson from comment #24)
> Comment on attachment 310654 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=310654&action=review
> 
> Thinking it was very odd that this patch adds a deleter without a completion
> handler, I dug in to the history of WKWebsiteDataStoreRef.
> 
> It was added in r181707 and its sole purpose was to provide a toll-free
> bridge from WKContextRef to WKWebsiteDataStore (the Cocoa API object) It
> never should've had any API/SPI added to it. In fact some of the methods
> there (rightfully) have zero clients.
> 
> In my 5-3 comment I suggested adding it to the C-SPI was fine, but I
> misunderstood the history of WebsiteDataStoreRef - It never predated
> WKWebsiteDataStore and never had any API.
> 
> The rest of my 5-3 comment applies. You'll need to add this to
> WKWebsiteDataStore.
> 
> Look at WKWebsiteDataRecord.h and WKWebsiteDataRecordPrivate.h to see how
> the types are exposed - They're just strings, and you'll need to add a new
> string type.
> 
> Additionally, it's not okay to *only* expose a deleter. WKWebsiteDataStore
> supports Safari's privacy UI, and that UI needs to accurately reflect when a
> site has data stored against it. In other words, you'll need to add the
> getters as well.
> 
> > Source/WebKit2/UIProcess/API/C/WKCredential.cpp:-55
> >  {
> >      return toCopiedAPI(toImpl(credentialRef)->credential().user());
> >  }
> > -
> 
> This does not need to be in this patch.

Thanks Brady! I will update the patch.
Comment 26 Per Arne Vollan 2017-06-04 23:52:36 PDT
Created attachment 311987 [details]
Patch
Comment 27 Per Arne Vollan 2017-06-05 00:19:04 PDT
Created attachment 311990 [details]
Patch
Comment 28 Per Arne Vollan 2017-06-05 00:29:37 PDT
Created attachment 311991 [details]
Patch
Comment 29 Per Arne Vollan 2017-06-05 00:33:33 PDT
Created attachment 311992 [details]
Patch
Comment 30 Per Arne Vollan 2017-06-05 00:43:25 PDT
Created attachment 311993 [details]
Patch
Comment 31 Per Arne Vollan 2017-06-05 01:44:06 PDT
Created attachment 311997 [details]
Patch
Comment 32 Brady Eidson 2017-06-05 21:56:19 PDT
Comment on attachment 311997 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=311997&action=review

> Source/WebCore/platform/network/CredentialStorage.h:60
> +    HashSet<String> originsWithCredentials() const { return m_originsWithCredentials; }

This makes a copy of the set on every call.

const HashSet<String>&

> Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h:60
> +/*! @constant WKWebsiteDataTypeCredentials Credentials, such as Basic Authentication. */
> +WK_EXTERN NSString * const WKWebsiteDataTypeCredentials WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
> +

I don't think we intend to actually go through API review for this... do we?

If you're planning to, then fine... If not, this has to be moved to the private header.

I do not think it's important to make this API (and, in fact, discussion in this bug has been centered around *not* making it API for now)

> Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:208
> +void TestController::removeAllSessionCredentials()
> +{
> +#if WK_API_ENABLED
> +    [globalWebViewConfiguration.websiteDataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { }];
> +#endif
> +}

I'm very concerned about inherent flakiness in this test.

Since the UI process doesn't wait on the completion handler for this call, the iframe that is loaded can definitely end up having the credentials still applied.
Comment 33 Per Arne Vollan 2017-06-06 23:35:31 PDT
Created attachment 312165 [details]
Patch
Comment 34 Per Arne Vollan 2017-06-07 01:24:36 PDT
Created attachment 312167 [details]
Patch
Comment 35 Per Arne Vollan 2017-06-07 01:39:38 PDT
Created attachment 312168 [details]
Patch
Comment 36 Per Arne Vollan 2017-06-07 01:52:10 PDT
Created attachment 312170 [details]
Patch
Comment 37 Per Arne Vollan 2017-06-07 03:14:52 PDT
(In reply to Brady Eidson from comment #32)
> Comment on attachment 311997 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=311997&action=review
> 
> > Source/WebCore/platform/network/CredentialStorage.h:60
> > +    HashSet<String> originsWithCredentials() const { return m_originsWithCredentials; }
> 
> This makes a copy of the set on every call.
> 
> const HashSet<String>&
> 
> > Source/WebKit2/UIProcess/API/Cocoa/WKWebsiteDataRecord.h:60
> > +/*! @constant WKWebsiteDataTypeCredentials Credentials, such as Basic Authentication. */
> > +WK_EXTERN NSString * const WKWebsiteDataTypeCredentials WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
> > +
> 
> I don't think we intend to actually go through API review for this... do we?
> 
> If you're planning to, then fine... If not, this has to be moved to the
> private header.
> 
> I do not think it's important to make this API (and, in fact, discussion in
> this bug has been centered around *not* making it API for now)
> 
> > Tools/WebKitTestRunner/cocoa/TestControllerCocoa.mm:208
> > +void TestController::removeAllSessionCredentials()
> > +{
> > +#if WK_API_ENABLED
> > +    [globalWebViewConfiguration.websiteDataStore removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler:^() { }];
> > +#endif
> > +}
> 
> I'm very concerned about inherent flakiness in this test.
> 
> Since the UI process doesn't wait on the completion handler for this call,
> the iframe that is loaded can definitely end up having the credentials still
> applied.

Thanks for reviewing! I have updated the patch.
Comment 38 Brady Eidson 2017-06-07 09:06:13 PDT
Comment on attachment 312170 [details]
Patch

👍🏻👍🏻👍🏻
Comment 39 Per Arne Vollan 2017-06-07 09:20:39 PDT
(In reply to Brady Eidson from comment #38)
> Comment on attachment 312170 [details]
> Patch
> 
> 👍🏻👍🏻👍🏻

Thanks, Brady :)
Comment 40 WebKit Commit Bot 2017-06-07 09:51:28 PDT
Comment on attachment 312170 [details]
Patch

Clearing flags on attachment: 312170

Committed r217886: <http://trac.webkit.org/changeset/217886>
Comment 41 WebKit Commit Bot 2017-06-07 09:51:30 PDT
All reviewed patches have been landed.  Closing bug.