UNPKG

@omnigraph/neo4j

Version:

19 lines (18 loc) 858 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAuthFromOpts = void 0; const tslib_1 = require("tslib"); const neo4j_driver_1 = tslib_1.__importDefault(require("neo4j-driver")); function getAuthFromOpts(authOpts) { switch (authOpts.type) { case 'basic': return neo4j_driver_1.default.auth.basic(authOpts.username, authOpts.password, authOpts.realm); case 'kerberos': return neo4j_driver_1.default.auth.kerberos(authOpts.base64EncodedTicket); case 'bearer': return neo4j_driver_1.default.auth.bearer(authOpts.base64EncodedToken); case 'custom': return neo4j_driver_1.default.auth.custom(authOpts.principal, authOpts.credentials, authOpts.realm, authOpts.scheme, authOpts.parameters); } } exports.getAuthFromOpts = getAuthFromOpts;