docs: update session.clearAuthCache (#22292)
* docs: update session.clearAuthCache * Update specs to match doc change.
This commit is contained in:
parent
e965703e62
commit
e0c0875d6f
6 changed files with 4 additions and 28 deletions
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
|
@ -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`.
|
|
@ -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",
|
||||
|
|
|
@ -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()
|
||||
})
|
||||
|
|
|
@ -1660,7 +1660,7 @@ describe('webContents module', () => {
|
|||
})
|
||||
|
||||
afterEach(async () => {
|
||||
await session.defaultSession.clearAuthCache({ type: 'password' })
|
||||
await session.defaultSession.clearAuthCache()
|
||||
})
|
||||
|
||||
after(() => {
|
||||
|
|
Loading…
Reference in a new issue