Skip to content

Commit bd0b52a

Browse files
committed
Adjust documentation
1 parent 8c9e22f commit bd0b52a

File tree

4 files changed

+35
-13
lines changed

4 files changed

+35
-13
lines changed

packages/core/src/auth-token-manager.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,28 @@ import { util } from './internal'
2424
/**
2525
* Interface for the piece of software responsible for keeping track of current active {@link AuthToken} across the driver.
2626
* @interface
27+
* @experimental Exposed as preview feature.
2728
* @since 5.7
2829
*/
2930
export default class AuthTokenManager {
3031
/**
31-
* Returns a valid token
32+
* Returns a valid token.
33+
*
34+
* **Warning**: This method must only ever return auth information belonging to the same identity.
35+
* Switching identities using the `AuthTokenManager` is undefined behavior.
3236
*
3337
* @returns {Promise<AuthToken>|AuthToken} The valid auth token or a promise for a valid auth token
3438
*/
3539
getToken (): Promise<AuthToken> | AuthToken {
3640
throw new Error('Not Implemented')
3741
}
3842

43+
/**
44+
* Called to notify a token expiration.
45+
*
46+
* @param {AuthToken} token The expired token.
47+
* @return {void}
48+
*/
3949
onTokenExpired (token: AuthToken): void {
4050
throw new Error('Not implemented')
4151
}
@@ -78,8 +88,12 @@ export class TemporalAuthData {
7888
/**
7989
* Creates a {@link AuthTokenManager} for handle {@link AuthToken} which is expires.
8090
*
91+
* **Warning**: `getAuthData` must only ever return auth information belonging to the same identity.
92+
* Switching identities using the `AuthTokenManager` is undefined behavior.
93+
*
8194
* @param {object} param0 - The params
82-
* @param {function(): Promise<TemporalAuthData>} param0.getAuthData - Retrieves a new valid auth token
95+
* @param {function(): Promise<TemporalAuthData>} param0.getAuthData - Retrieves a new valid auth token.
96+
* Must only ever return auth information belonging to the same identity.
8397
* @returns {AuthTokenManager} The temporal auth data manager.
8498
* @experimental Exposed as preview feature.
8599
*/

packages/core/src/driver.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,7 @@ class SessionConfig {
205205
* session lifetime.
206206
*
207207
* **Warning**: This option is only enable by default when the driver is connected with Neo4j Database servers
208-
* which supports Bolt 5.1 and onwards. For enabling backwards compatibility mode, please configure the
209-
* driver with `backwardsCompatibleAuth` enable. Beware, the backwards compatible mode comes with
210-
* a huge performance penalty since it uses a new connection for each unit of work run in a session
211-
* configured with an auth.
208+
* which supports Bolt 5.1 and onwards.
212209
*
213210
* @type {AuthToken|undefined}
214211
* @experimental Exposed as preview feature.

packages/neo4j-driver-deno/lib/core/auth-token-manager.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,28 @@ import { util } from './internal/index.ts'
2424
/**
2525
* Interface for the piece of software responsible for keeping track of current active {@link AuthToken} across the driver.
2626
* @interface
27+
* @experimental Exposed as preview feature.
2728
* @since 5.7
2829
*/
2930
export default class AuthTokenManager {
3031
/**
31-
* Returns a valid token
32-
*
32+
* Returns a valid token.
33+
*
34+
* **Warning**: This method must only ever return auth information belonging to the same identity.
35+
* Switching identities using the `AuthTokenManager` is undefined behavior.
36+
*
3337
* @returns {Promise<AuthToken>|AuthToken} The valid auth token or a promise for a valid auth token
3438
*/
3539
getToken (): Promise<AuthToken> | AuthToken {
3640
throw new Error('Not Implemented')
3741
}
3842

43+
/**
44+
* Called to notify a token expiration.
45+
*
46+
* @param {AuthToken} token The expired token.
47+
* @return {void}
48+
*/
3949
onTokenExpired (token: AuthToken): void {
4050
throw new Error('Not implemented')
4151
}
@@ -77,9 +87,13 @@ export class TemporalAuthData {
7787

7888
/**
7989
* Creates a {@link AuthTokenManager} for handle {@link AuthToken} which is expires.
90+
*
91+
* **Warning**: `getAuthData` must only ever return auth information belonging to the same identity.
92+
* Switching identities using the `AuthTokenManager` is undefined behavior.
8093
*
8194
* @param {object} param0 - The params
82-
* @param {function(): Promise<TemporalAuthData>} param0.getAuthData - Retrieves a new valid auth token
95+
* @param {function(): Promise<TemporalAuthData>} param0.getAuthData - Retrieves a new valid auth token.
96+
* Must only ever return auth information belonging to the same identity.
8397
* @returns {AuthTokenManager} The temporal auth data manager.
8498
* @experimental Exposed as preview feature.
8599
*/

packages/neo4j-driver-deno/lib/core/driver.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,7 @@ class SessionConfig {
205205
* session lifetime.
206206
*
207207
* **Warning**: This option is only enable by default when the driver is connected with Neo4j Database servers
208-
* which supports Bolt 5.1 and onwards. For enabling backwards compatibility mode, please configure the
209-
* driver with `backwardsCompatibleAuth` enable. Beware, the backwards compatible mode comes with
210-
* a huge performance penalty since it uses a new connection for each unit of work run in a session
211-
* configured with an auth.
208+
* which supports Bolt 5.1 and onwards.
212209
*
213210
* @type {AuthToken|undefined}
214211
* @experimental Exposed as preview feature.

0 commit comments

Comments
 (0)