Browse Source

docs: update session.clearAuthCache (#22292)

* docs: update session.clearAuthCache

* Update specs to match doc change.
John Kleinschmidt 5 years ago
parent
commit
e0c0875d6f

+ 1 - 3
docs/api/session.md

@@ -440,9 +440,7 @@ event. The [DownloadItem](download-item.md) will not have any `WebContents` asso
 the initial state will be `interrupted`. The download will start only when the
 `resume` API is called on the [DownloadItem](download-item.md).
 
-#### `ses.clearAuthCache(options)`
-
-* `options` ([RemovePassword](structures/remove-password.md) | [RemoveClientCertificate](structures/remove-client-certificate.md))
+#### `ses.clearAuthCache()`
 
 Returns `Promise<void>` - resolves when the session’s HTTP authentication cache has been cleared.
 

+ 0 - 5
docs/api/structures/remove-client-certificate.md

@@ -1,5 +0,0 @@
-# RemoveClientCertificate Object
-
-* `type` String - `clientCertificate`.
-* `origin` String - Origin of the server whose associated client certificate
-  must be removed from the cache.

+ 0 - 15
docs/api/structures/remove-password.md

@@ -1,15 +0,0 @@
-# RemovePassword Object
-
-* `type` String - `password`.
-* `origin` String (optional) - When provided, the authentication info
-  related to the origin will only be removed otherwise the entire cache
-  will be cleared.
-* `scheme` String (optional) - Scheme of the authentication.
-  Can be `basic`, `digest`, `ntlm`, `negotiate`. Must be provided if
-  removing by `origin`.
-* `realm` String (optional) - Realm of the authentication. Must be provided if
-  removing by `origin`.
-* `username` String (optional) - Credentials of the authentication. Must be
-  provided if removing by `origin`.
-* `password` String (optional) - Credentials of the authentication. Must be
-  provided if removing by `origin`.

+ 0 - 2
filenames.auto.gni

@@ -108,8 +108,6 @@ auto_filenames = {
     "docs/api/structures/protocol-response.md",
     "docs/api/structures/rectangle.md",
     "docs/api/structures/referrer.md",
-    "docs/api/structures/remove-client-certificate.md",
-    "docs/api/structures/remove-password.md",
     "docs/api/structures/scrubber-item.md",
     "docs/api/structures/segmented-control-segment.md",
     "docs/api/structures/service-worker-info.md",

+ 2 - 2
spec-main/api-session-spec.ts

@@ -526,7 +526,7 @@ describe('session module', () => {
     })
   })
 
-  describe('ses.clearAuthCache(options)', () => {
+  describe('ses.clearAuthCache()', () => {
     it('can clear http auth info from cache', async () => {
       const ses = session.fromPartition('auth-cache')
       const server = http.createServer((req, res) => {
@@ -569,7 +569,7 @@ describe('session module', () => {
       expect(await fetch(`http://test:[email protected]:${port}`)).to.equal('authenticated')
       // subsequently, the credentials are cached
       expect(await fetch(`http://127.0.0.1:${port}`)).to.equal('authenticated')
-      await ses.clearAuthCache({ type: 'password' })
+      await ses.clearAuthCache()
       // once the cache is cleared, we should get an error again
       await expect(fetch(`http://127.0.0.1:${port}`)).to.eventually.be.rejected()
     })

+ 1 - 1
spec-main/api-web-contents-spec.ts

@@ -1660,7 +1660,7 @@ describe('webContents module', () => {
     })
 
     afterEach(async () => {
-      await session.defaultSession.clearAuthCache({ type: 'password' })
+      await session.defaultSession.clearAuthCache()
     })
 
     after(() => {