|
17 | 17 | * limitations under the License.
|
18 | 18 | */
|
19 | 19 |
|
20 |
| -import {int, isInt, inSafeRange, toNumber, toString} from './integer'; |
21 |
| -import {Node, Relationship, UnboundRelationship, PathSegment, Path} from './graph-types' |
22 |
| -import {Neo4jError, SERVICE_UNAVAILABLE, SESSION_EXPIRED, PROTOCOL_ERROR} from './error'; |
| 20 | +import {inSafeRange, int, isInt, toNumber, toString} from './integer'; |
| 21 | +import {Node, Path, PathSegment, Relationship, UnboundRelationship} from './graph-types'; |
| 22 | +import {Neo4jError, PROTOCOL_ERROR, SERVICE_UNAVAILABLE, SESSION_EXPIRED} from './error'; |
23 | 23 | import Result from './result';
|
24 | 24 | import ResultSummary from './result-summary';
|
25 | 25 | import Record from './record';
|
26 | 26 | import {Driver, READ, WRITE} from './driver';
|
27 | 27 | import RoutingDriver from './routing-driver';
|
28 | 28 | import VERSION from '../version';
|
29 |
| -import {parseScheme, parseUrl} from "./internal/connector"; |
30 |
| -import {assertString} from "./internal/util"; |
| 29 | +import {parseScheme, parseUrl} from './internal/connector'; |
| 30 | +import {assertString} from './internal/util'; |
31 | 31 |
|
32 | 32 |
|
33 |
| -const auth ={ |
| 33 | +const auth = { |
34 | 34 | basic: (username, password, realm = undefined) => {
|
35 | 35 | if (realm) {
|
36 |
| - return {scheme: "basic", principal: username, credentials: password, realm: realm}; |
| 36 | + return {scheme: 'basic', principal: username, credentials: password, realm: realm}; |
37 | 37 | } else {
|
38 |
| - return {scheme: "basic", principal: username, credentials: password}; |
| 38 | + return {scheme: 'basic', principal: username, credentials: password}; |
39 | 39 | }
|
40 | 40 | },
|
41 |
| - custom: (principal, credentials, realm, scheme, parameters = undefined ) => { |
| 41 | + kerberos: (base64EncodedTicket) => { |
| 42 | + return { |
| 43 | + scheme: 'kerberos', |
| 44 | + principal: '', // This empty string is required for backwards compatibility. |
| 45 | + credentials: base64EncodedTicket |
| 46 | + }; |
| 47 | + }, |
| 48 | + custom: (principal, credentials, realm, scheme, parameters = undefined) => { |
42 | 49 | if (parameters) {
|
43 |
| - return {scheme: scheme, principal: principal, credentials: credentials, realm: realm, |
44 |
| - parameters: parameters} |
| 50 | + return { |
| 51 | + scheme: scheme, principal: principal, credentials: credentials, realm: realm, |
| 52 | + parameters: parameters |
| 53 | + }; |
45 | 54 | } else {
|
46 |
| - return {scheme: scheme, principal: principal, credentials: credentials, realm: realm} |
| 55 | + return {scheme: scheme, principal: principal, credentials: credentials, realm: realm}; |
47 | 56 | }
|
48 | 57 | }
|
49 | 58 | };
|
50 |
| -let USER_AGENT = "neo4j-javascript/" + VERSION; |
| 59 | +const USER_AGENT = "neo4j-javascript/" + VERSION; |
51 | 60 |
|
52 | 61 | /**
|
53 | 62 | * Construct a new Neo4j Driver. This is your main entry point for this
|
|
0 commit comments