docs: update session.clearAuthCache (#22292)

* docs: update session.clearAuthCache

* Update specs to match doc change.
This commit is contained in:
John Kleinschmidt 2020-02-21 13:40:45 -05:00 committed by GitHub
parent e965703e62
commit e0c0875d6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 4 additions and 28 deletions

View file

@ -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 sessions HTTP authentication cache has been cleared.

View file

@ -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.

View file

@ -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`.

View file

@ -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",

View file

@ -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:test@127.0.0.1:${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()
})

View file

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