oracledb 6.6.0 → 6.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/build/Release/Linux_cmds.txt +972 -0
- package/build/Release/oracledb-6.7.1-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.7.1-darwin-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.1-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.7.1-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.1-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.1-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.7.1-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.1-linux-x64.node +0 -0
- package/build/Release/oracledb-6.7.1-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.1-win32-x64.node +0 -0
- package/build/Release/oracledb-6.7.1-win32-x64.node-buildinfo.txt +1 -0
- package/examples/example.js +5 -5
- package/lib/configProviders/azure.js +26 -15
- package/lib/configProviders/base.js +23 -37
- package/lib/configProviders/ociobject.js +53 -45
- package/lib/connection.js +75 -3
- package/lib/errors.js +26 -14
- package/lib/impl/aqQueue.js +2 -1
- package/lib/impl/base.js +45 -0
- package/lib/impl/connection.js +53 -0
- package/lib/impl/lob.js +2 -1
- package/lib/impl/pool.js +15 -0
- package/lib/impl/resultset.js +2 -1
- package/lib/impl/sodaCollection.js +2 -1
- package/lib/impl/sodaDatabase.js +2 -1
- package/lib/impl/sodaDocCursor.js +2 -1
- package/lib/impl/sodaOperation.js +2 -1
- package/lib/lob.js +3 -2
- package/lib/oracledb.js +221 -36
- package/lib/pool.js +14 -5
- package/lib/settings.js +1 -0
- package/lib/thin/connection.js +150 -91
- package/lib/thin/dbObject.js +13 -4
- package/lib/thin/pool.js +3 -0
- package/lib/thin/protocol/constants.js +1 -1
- package/lib/thin/protocol/messages/auth.js +12 -6
- package/lib/thin/protocol/messages/base.js +3 -0
- package/lib/thin/protocol/messages/sessionRelease.js +1 -0
- package/lib/thin/protocol/messages/withData.js +6 -13
- package/lib/thin/protocol/protocol.js +23 -0
- package/lib/thin/sqlnet/connStrategy.js +12 -3
- package/lib/thin/sqlnet/constants.js +2 -0
- package/lib/thin/sqlnet/navNodes.js +30 -23
- package/lib/thin/sqlnet/networkSession.js +18 -14
- package/lib/thin/sqlnet/ntTcp.js +12 -6
- package/lib/thin/sqlnet/nvStrToNvPair.js +23 -26
- package/lib/thin/sqlnet/paramParser.js +42 -43
- package/lib/thin/sqlnet/sessionAtts.js +1 -1
- package/lib/thin/util.js +4 -3
- package/lib/traceHandler.js +133 -0
- package/lib/util.js +177 -33
- package/lib/version.js +2 -2
- package/package.json +1 -1
- package/build/Release/oracledb-6.6.0-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.6.0-darwin-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-js-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.6.0-linux-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-win32-x64.node-buildinfo.txt +0 -1
- package/examples/README.md +0 -138
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
oracledb-6.7.1-darwin-arm64.node v22.2.0 3f1f1cc28d6ee3c6489f660d243b4a79ada60299 ca4b004c471033328549f8b4d461cb5985fe2230 Fri, 13 Dec 2024 13:19:16 GMT
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
oracledb-6.7.1-darwin-x64.node v20.11.1 3f1f1cc28d6ee3c6489f660d243b4a79ada60299 ca4b004c471033328549f8b4d461cb5985fe2230 Fri, 13 Dec 2024 11:43:56 GMT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3f1f1cc28d6ee3c6489f660d243b4a79ada60299
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
oracledb-6.7.1-linux-arm64.node v20.16.0 3f1f1cc28d6ee3c6489f660d243b4a79ada60299 ca4b004c471033328549f8b4d461cb5985fe2230 Fri, 13 Dec 2024 14:47:19 GMT
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
oracledb-6.7.1-linux-x64.node v20.16.0 3f1f1cc28d6ee3c6489f660d243b4a79ada60299 ca4b004c471033328549f8b4d461cb5985fe2230 Fri, 13 Dec 2024 14:40:02 GMT
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
oracledb-6.7.1-win32-x64.node v20.0.0 3f1f1cc28d6ee3c6489f660d243b4a79ada60299 ca4b004c471033328549f8b4d461cb5985fe2230 Fri, 13 Dec 2024 14:18:47 GMT
|
package/examples/example.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Copyright (c) 2018,
|
|
1
|
+
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates. */
|
|
2
2
|
|
|
3
3
|
/******************************************************************************
|
|
4
4
|
*
|
|
@@ -47,16 +47,16 @@ const dbConfig = require('./dbconfig.js');
|
|
|
47
47
|
if (process.env.NODE_ORACLEDB_DRIVER_MODE === 'thick') {
|
|
48
48
|
|
|
49
49
|
// Thick mode requires Oracle Client or Oracle Instant Client libraries.
|
|
50
|
-
// On Windows and macOS
|
|
50
|
+
// On Windows and macOS you can specify the directory containing the
|
|
51
51
|
// libraries at runtime or before Node.js starts. On other platforms (where
|
|
52
52
|
// Oracle libraries are available) the system library search path must always
|
|
53
53
|
// include the Oracle library path before Node.js starts. If the search path
|
|
54
54
|
// is not correct, you will get a DPI-1047 error. See the node-oracledb
|
|
55
55
|
// installation documentation.
|
|
56
56
|
let clientOpts = {};
|
|
57
|
-
// On Windows and macOS
|
|
58
|
-
//
|
|
59
|
-
if (process.platform === 'win32' ||
|
|
57
|
+
// On Windows and macOS platforms, set the environment variable
|
|
58
|
+
// NODE_ORACLEDB_CLIENT_LIB_DIR to the Oracle Client library path
|
|
59
|
+
if (process.platform === 'win32' || process.platform === 'darwin') {
|
|
60
60
|
clientOpts = { libDir: process.env.NODE_ORACLEDB_CLIENT_LIB_DIR };
|
|
61
61
|
}
|
|
62
62
|
oracledb.initOracleClient(clientOpts); // enable node-oracledb Thick mode
|
|
@@ -40,11 +40,11 @@ class AzureProvider extends base {
|
|
|
40
40
|
//---------------------------------------------------------------------------
|
|
41
41
|
// init()
|
|
42
42
|
//
|
|
43
|
-
// Require/import modules from
|
|
43
|
+
// Require/import modules from Azure SDK
|
|
44
44
|
//---------------------------------------------------------------------------
|
|
45
45
|
init() {
|
|
46
|
-
({AppConfigurationClient } = require("@azure/app-configuration"));
|
|
47
|
-
({ClientSecretCredential, ClientCertificateCredential, ChainedTokenCredential, ManagedIdentityCredential, EnvironmentCredential} = require("@azure/identity"));
|
|
46
|
+
({ AppConfigurationClient } = require("@azure/app-configuration"));
|
|
47
|
+
({ ClientSecretCredential, ClientCertificateCredential, ChainedTokenCredential, ManagedIdentityCredential, EnvironmentCredential } = require("@azure/identity"));
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
//---------------------------------------------------------------------------
|
|
@@ -112,11 +112,11 @@ class AzureProvider extends base {
|
|
|
112
112
|
async returnConfig() {
|
|
113
113
|
const configObject = {};
|
|
114
114
|
const label = this.paramMap.get("label");
|
|
115
|
-
|
|
115
|
+
this.credential = this._returnCredential();
|
|
116
116
|
// azure config store
|
|
117
117
|
const client = new AppConfigurationClient(
|
|
118
118
|
"https://" + this.paramMap.get("appconfigname"), // ex: <https://<your appconfig resource>.azconfig.io>
|
|
119
|
-
credential
|
|
119
|
+
this.credential
|
|
120
120
|
);
|
|
121
121
|
// retrieve connect_description
|
|
122
122
|
configObject.connectString = (await this._getConfigurationSetting(client, this.paramMap.get("key") + 'connect_descriptor', label)).value;
|
|
@@ -139,29 +139,40 @@ class AzureProvider extends base {
|
|
|
139
139
|
configObject.user = null;
|
|
140
140
|
}
|
|
141
141
|
//retrieve password
|
|
142
|
-
|
|
142
|
+
configObject.password = await this.retrieveParamValueFromVault(client, label, 'password');
|
|
143
|
+
// retrieve wallet_location
|
|
144
|
+
configObject.walletContent = await this.retrieveParamValueFromVault(client, label, 'wallet_location');
|
|
145
|
+
if (configObject.walletContent) {
|
|
146
|
+
//only Pem file supported
|
|
147
|
+
if (!this.isPemFile(configObject.walletContent))
|
|
148
|
+
errors.throwErr(errors.ERR_WALLET_TYPE_NOT_SUPPORTED);
|
|
149
|
+
}
|
|
150
|
+
return configObject;
|
|
151
|
+
}
|
|
152
|
+
async retrieveParamValueFromVault(client, label, param) {
|
|
153
|
+
let paramJson = null;
|
|
143
154
|
try {
|
|
144
|
-
|
|
155
|
+
paramJson = await this._getConfigurationSetting(client, this.paramMap.get("key") + param, label);
|
|
145
156
|
} catch {
|
|
146
|
-
|
|
157
|
+
return null;
|
|
147
158
|
}
|
|
148
|
-
if (
|
|
159
|
+
if (paramJson) {
|
|
149
160
|
let obj;
|
|
150
161
|
try {
|
|
151
|
-
obj = JSON.parse(
|
|
162
|
+
obj = JSON.parse(paramJson.value);
|
|
152
163
|
} catch {
|
|
153
|
-
obj =
|
|
164
|
+
obj = paramJson.value;
|
|
154
165
|
}
|
|
155
166
|
if (obj.uri) {
|
|
156
167
|
const { SecretClient } = require("@azure/keyvault-secrets");
|
|
157
168
|
const vault_detail = await this._parsePwd(obj.uri);
|
|
158
|
-
const client1 = new SecretClient(vault_detail[0], credential);
|
|
159
|
-
|
|
169
|
+
const client1 = new SecretClient(vault_detail[0], this.credential);
|
|
170
|
+
return (await client1.getSecret(vault_detail[1])).value;
|
|
160
171
|
} else {
|
|
161
|
-
|
|
172
|
+
return paramJson.value;
|
|
162
173
|
}
|
|
163
174
|
}
|
|
164
|
-
|
|
175
|
+
|
|
165
176
|
}
|
|
166
177
|
}
|
|
167
178
|
module.exports = AzureProvider;
|
|
@@ -26,49 +26,35 @@
|
|
|
26
26
|
|
|
27
27
|
'use strict';
|
|
28
28
|
|
|
29
|
+
const pemHeaders = [
|
|
30
|
+
'-----BEGIN CERTIFICATE-----',
|
|
31
|
+
'-----BEGIN PUBLIC KEY-----',
|
|
32
|
+
'-----BEGIN PRIVATE KEY-----',
|
|
33
|
+
'-----BEGIN RSA PRIVATE KEY-----',
|
|
34
|
+
'-----BEGIN DSA PRIVATE KEY-----',
|
|
35
|
+
'-----BEGIN EC PRIVATE KEY-----',
|
|
36
|
+
'-----BEGIN ENCRYPTED PRIVATE KEY-----'
|
|
37
|
+
];
|
|
38
|
+
const pemFooters = [
|
|
39
|
+
'-----END CERTIFICATE-----',
|
|
40
|
+
'-----END PUBLIC KEY-----',
|
|
41
|
+
'-----END PRIVATE KEY-----',
|
|
42
|
+
'-----END RSA PRIVATE KEY-----',
|
|
43
|
+
'-----END DSA PRIVATE KEY-----',
|
|
44
|
+
'-----END EC PRIVATE KEY-----',
|
|
45
|
+
'-----END ENCRYPTED PRIVATE KEY-----'
|
|
46
|
+
];
|
|
29
47
|
class base {
|
|
30
48
|
constructor(url) {
|
|
31
49
|
const params = new URLSearchParams(url);
|
|
32
50
|
this.paramMap = new URLSearchParams([...params].map(([key, value]) => [key.toLowerCase(), value])); //parse the extended part and store parameters in Map
|
|
33
51
|
}
|
|
34
52
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
modifyOptionsPrecedence(cloudConfig, userConfig) {
|
|
41
|
-
// create a copy of userConfig object
|
|
42
|
-
userConfig = { ...userConfig };
|
|
43
|
-
if (!userConfig.user)
|
|
44
|
-
userConfig.user = cloudConfig.user;
|
|
45
|
-
if (!userConfig.password)
|
|
46
|
-
userConfig.password = cloudConfig.password;
|
|
47
|
-
if (cloudConfig.connectString) {
|
|
48
|
-
userConfig.connectString = cloudConfig.connectString;
|
|
49
|
-
userConfig.connectionString = undefined;
|
|
50
|
-
}
|
|
51
|
-
if (cloudConfig.poolMin)
|
|
52
|
-
userConfig.poolMin = cloudConfig.poolMin;
|
|
53
|
-
if (cloudConfig.poolMax)
|
|
54
|
-
userConfig.poolMax = cloudConfig.poolMax;
|
|
55
|
-
if (cloudConfig.poolIncrement)
|
|
56
|
-
userConfig.poolIncrement = cloudConfig.poolIncrement;
|
|
57
|
-
if (cloudConfig.poolTimeout)
|
|
58
|
-
userConfig.poolTimeout = cloudConfig.poolTimeout;
|
|
59
|
-
if (cloudConfig.poolPingInterval)
|
|
60
|
-
userConfig.poolPingInterval = cloudConfig.poolPingInterval;
|
|
61
|
-
if (cloudConfig.poolPingTimeout)
|
|
62
|
-
userConfig.poolPingTimeout = cloudConfig.poolPingTimeout;
|
|
63
|
-
if (cloudConfig.stmtCacheSize)
|
|
64
|
-
userConfig.stmtCacheSize = cloudConfig.stmtCacheSize;
|
|
65
|
-
if (cloudConfig.prefetchRows)
|
|
66
|
-
userConfig.prefetchRows = cloudConfig.prefetchRows;
|
|
67
|
-
if (cloudConfig.lobPrefetch)
|
|
68
|
-
userConfig.lobPrefetch = cloudConfig.lobPrefetch;
|
|
69
|
-
|
|
70
|
-
return userConfig;
|
|
71
|
-
|
|
53
|
+
isPemFile(content) {
|
|
54
|
+
//remove any line breaks at the end of the content
|
|
55
|
+
content = content.trim();
|
|
56
|
+
return pemHeaders.some(header => content.includes(header)) &&
|
|
57
|
+
pemFooters.some(footer => content.endsWith(footer));
|
|
72
58
|
}
|
|
73
59
|
|
|
74
60
|
//---------------------------------------------------------------------------
|
|
@@ -29,10 +29,9 @@ const errors = require("../errors.js");
|
|
|
29
29
|
const { base } = require("./base.js");
|
|
30
30
|
const fs = require('fs');
|
|
31
31
|
|
|
32
|
-
const cloud_net_naming_pattern_oci = new RegExp("(?<objservername>[A-Za-z0-9._-]+)/n/" + "(?<namespace>[A-Za-z0-9._-]+)/b/" + "(?<bucketname>[A-Za-z0-9._-]+)/o/" + "(?<filename>[A-Za-z0-9._-]+)"
|
|
32
|
+
const cloud_net_naming_pattern_oci = new RegExp("(?<objservername>[A-Za-z0-9._-]+)/n/" + "(?<namespace>[A-Za-z0-9._-]+)/b/" + "(?<bucketname>[A-Za-z0-9._-]+)/o/" + "(?<filename>[A-Za-z0-9._-]+)$");
|
|
33
33
|
// object to store module references that will be populated by init()
|
|
34
34
|
const oci = {};
|
|
35
|
-
|
|
36
35
|
class OCIProvider extends base {
|
|
37
36
|
constructor(provider_arg, urlExtendedPart) {
|
|
38
37
|
super(urlExtendedPart);
|
|
@@ -42,8 +41,6 @@ class OCIProvider extends base {
|
|
|
42
41
|
this._addParam("namespace", match.groups.namespace);
|
|
43
42
|
this._addParam("bucketname", match.groups.bucketname);
|
|
44
43
|
this._addParam("filename", match.groups.filename);
|
|
45
|
-
if (match.groups.alias)
|
|
46
|
-
this._addParam("alias", match.groups.alias);
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
|
|
@@ -127,65 +124,41 @@ class OCIProvider extends base {
|
|
|
127
124
|
//---------------------------------------------------------------------------
|
|
128
125
|
async returnConfig() {
|
|
129
126
|
const configObject = {};
|
|
130
|
-
|
|
127
|
+
this.credential = await this._returnCredential();
|
|
131
128
|
// oci object store
|
|
132
129
|
const client_oci = new (oci.objectstorage).ObjectStorageClient({
|
|
133
|
-
authenticationDetailsProvider: credential
|
|
130
|
+
authenticationDetailsProvider: this.credential
|
|
134
131
|
});
|
|
135
132
|
const getObjectRequest = {
|
|
136
133
|
objectName: this.paramMap.get('filename'),
|
|
137
134
|
bucketName: this.paramMap.get('bucketname'),
|
|
138
135
|
namespaceName: this.paramMap.get('namespace')
|
|
139
136
|
};
|
|
140
|
-
let credential1;
|
|
141
137
|
const getObjectResponse = await client_oci.getObject(getObjectRequest);
|
|
142
138
|
const resp = await this._streamToString(getObjectResponse.value);
|
|
143
139
|
// Entire object we get from OCI Object Storage
|
|
144
|
-
|
|
145
|
-
const userAlias = this.paramMap.get('
|
|
140
|
+
this.obj = JSON.parse(resp);
|
|
141
|
+
const userAlias = this.paramMap.get('key'); // alias
|
|
146
142
|
if (userAlias) {
|
|
147
|
-
obj = obj[userAlias];
|
|
143
|
+
this.obj = this.obj[userAlias];
|
|
148
144
|
}
|
|
149
145
|
const pmSection = 'node-oracledb';
|
|
150
|
-
const params = obj[pmSection];
|
|
146
|
+
const params = this.obj[pmSection];
|
|
151
147
|
for (const key in params) {
|
|
152
148
|
var val = params[key];
|
|
153
149
|
configObject[key] = val;
|
|
154
150
|
}
|
|
155
|
-
configObject.connectString = obj.connect_descriptor;
|
|
156
|
-
configObject.user = obj.user;
|
|
157
|
-
if (obj.password) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
else
|
|
167
|
-
errors.throwErr(errors.ERR_AZURE_VAULT_AUTH_FAILED);
|
|
168
|
-
const vault_detail = await this._parsePwd(obj.password.value);
|
|
169
|
-
const client1 = new SecretClient(vault_detail[0], credential1);
|
|
170
|
-
configObject.password = (await client1.getSecret(vault_detail[1])).value;
|
|
171
|
-
} else {
|
|
172
|
-
errors.throwErr(errors.ERR_AZURE_VAULT_AUTH_FAILED);
|
|
173
|
-
}
|
|
174
|
-
} else if (obj.password.type == "vault-oci") {
|
|
175
|
-
const secrets = require('oci-secrets');
|
|
176
|
-
const secretClientOci = new secrets.SecretsClient({
|
|
177
|
-
authenticationDetailsProvider: credential
|
|
178
|
-
});
|
|
179
|
-
const getSecretBundleRequest = {
|
|
180
|
-
secretId: obj.password.value
|
|
181
|
-
};
|
|
182
|
-
const getSecretBundleResponse = await secretClientOci.getSecretBundle(getSecretBundleRequest);
|
|
183
|
-
configObject.password = getSecretBundleResponse.secretBundle.secretBundleContent.content;
|
|
184
|
-
} else if (obj.password) {
|
|
185
|
-
configObject.password = obj.password;
|
|
186
|
-
}
|
|
187
|
-
} else {
|
|
188
|
-
configObject.password = null;
|
|
151
|
+
configObject.connectString = this.obj.connect_descriptor;
|
|
152
|
+
configObject.user = this.obj.user;
|
|
153
|
+
if (this.obj.password) {
|
|
154
|
+
configObject.password = await this.retrieveParamValueFromVault('password');
|
|
155
|
+
}
|
|
156
|
+
if (this.obj.wallet_location) {
|
|
157
|
+
// retrieve wallet_location
|
|
158
|
+
configObject.walletContent = await this.retrieveParamValueFromVault('wallet_location');
|
|
159
|
+
//only Pem file supported
|
|
160
|
+
if (!this.isPemFile(configObject.walletContent))
|
|
161
|
+
errors.throwErr(errors.ERR_WALLET_TYPE_NOT_SUPPORTED);
|
|
189
162
|
}
|
|
190
163
|
return configObject;
|
|
191
164
|
}
|
|
@@ -199,5 +172,40 @@ class OCIProvider extends base {
|
|
|
199
172
|
const arr = objservername.split(".");
|
|
200
173
|
return arr[1].toUpperCase().replaceAll('-', '_');
|
|
201
174
|
}
|
|
175
|
+
|
|
176
|
+
async retrieveParamValueFromVault(param) {
|
|
177
|
+
if (this.obj[param].type == "azurevault") {
|
|
178
|
+
if (this.obj[param].authentication) {
|
|
179
|
+
const { SecretClient } = require("@azure/keyvault-secrets");
|
|
180
|
+
const {ClientSecretCredential, ClientCertificateCredential} = require("@azure/identity");
|
|
181
|
+
if (this.obj[param].authentication.azure_client_secret)
|
|
182
|
+
this.credential = new ClientSecretCredential(this.obj[param].authentication.azure_tenant_id, this.obj[param].authentication.azure_client_id, this.obj[param].authentication.azure_client_secret);
|
|
183
|
+
else if (this.obj[param].authentication.azure_client_certificate_path)
|
|
184
|
+
this.credential = new ClientCertificateCredential(this.obj[param].authentication.azure_tenant_id, this.obj[param].authentication.azure_client_id, this.obj[param].authentication.azure_client_certificate_path);
|
|
185
|
+
else
|
|
186
|
+
errors.throwErr(errors.ERR_AZURE_VAULT_AUTH_FAILED);
|
|
187
|
+
const vault_detail = await this._parsePwd(this.obj[param].value);
|
|
188
|
+
const client1 = new SecretClient(vault_detail[0], this.credential);
|
|
189
|
+
return (await client1.getSecret(vault_detail[1])).value;
|
|
190
|
+
} else {
|
|
191
|
+
errors.throwErr(errors.ERR_AZURE_VAULT_AUTH_FAILED);
|
|
192
|
+
}
|
|
193
|
+
} else if (this.obj[param].type == "ocivault") {
|
|
194
|
+
const secrets = require('oci-secrets');
|
|
195
|
+
const secretClientOci = new secrets.SecretsClient({
|
|
196
|
+
authenticationDetailsProvider: this.credential
|
|
197
|
+
});
|
|
198
|
+
const getSecretBundleRequest = {
|
|
199
|
+
secretId: this.obj[param].value
|
|
200
|
+
};
|
|
201
|
+
const getSecretBundleResponse = await secretClientOci.getSecretBundle(getSecretBundleRequest);
|
|
202
|
+
const base64content = getSecretBundleResponse.secretBundle.secretBundleContent.content;
|
|
203
|
+
// decode base64 content
|
|
204
|
+
const returnVal = Buffer.from(base64content, "base64").toString("utf-8");
|
|
205
|
+
return returnVal;
|
|
206
|
+
} else {
|
|
207
|
+
return this.obj[param];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
202
210
|
}
|
|
203
211
|
module.exports = OCIProvider;
|
package/lib/connection.js
CHANGED
|
@@ -748,6 +748,11 @@ class Connection extends EventEmitter {
|
|
|
748
748
|
}
|
|
749
749
|
|
|
750
750
|
delete this._impl;
|
|
751
|
+
if (!this.thin) {
|
|
752
|
+
for (const cls of this._dbObjectClasses.values()) {
|
|
753
|
+
cls._objType.refCleanup();
|
|
754
|
+
}
|
|
755
|
+
}
|
|
751
756
|
this._dbObjectClasses.clear();
|
|
752
757
|
this.emit('_afterConnClose');
|
|
753
758
|
}
|
|
@@ -869,10 +874,15 @@ class Connection extends EventEmitter {
|
|
|
869
874
|
let binds = [];
|
|
870
875
|
let options = {};
|
|
871
876
|
|
|
877
|
+
errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
|
|
878
|
+
|
|
872
879
|
// process arguments
|
|
873
880
|
if (nodbUtil.isObject(sql) && typeof sql.statement === 'string') {
|
|
874
881
|
errors.assertArgCount(arguments, 1, 2);
|
|
875
882
|
if (sql.values) {
|
|
883
|
+
if (this._impl._callLevelTraceData) {
|
|
884
|
+
this._impl._callLevelTraceData.values = sql.values;
|
|
885
|
+
}
|
|
876
886
|
binds = await this._processExecuteBinds(sql.values);
|
|
877
887
|
}
|
|
878
888
|
sql = sql.statement;
|
|
@@ -883,6 +893,9 @@ class Connection extends EventEmitter {
|
|
|
883
893
|
errors.assertArgCount(arguments, 1, 3);
|
|
884
894
|
errors.assertParamValue(typeof sql === 'string', 1);
|
|
885
895
|
if (arguments.length >= 2) {
|
|
896
|
+
if (this._impl._callLevelTraceData) {
|
|
897
|
+
this._impl._callLevelTraceData.values = a2;
|
|
898
|
+
}
|
|
886
899
|
binds = await this._processExecuteBinds(a2);
|
|
887
900
|
}
|
|
888
901
|
if (arguments.length == 3) {
|
|
@@ -890,11 +903,13 @@ class Connection extends EventEmitter {
|
|
|
890
903
|
}
|
|
891
904
|
}
|
|
892
905
|
this._addDefaultsToExecOpts(options);
|
|
893
|
-
errors.assert(this._impl, errors.ERR_INVALID_CONNECTION);
|
|
894
906
|
|
|
895
907
|
// perform actual execute
|
|
896
908
|
let result;
|
|
897
909
|
try {
|
|
910
|
+
if (this._impl._callLevelTraceData) {
|
|
911
|
+
this._impl._callLevelTraceData.statement = sql;
|
|
912
|
+
}
|
|
898
913
|
result = await this._impl.execute(sql, numIters, binds, options, false);
|
|
899
914
|
} catch (err) {
|
|
900
915
|
if (err.errorNum === 1406)
|
|
@@ -1035,6 +1050,63 @@ class Connection extends EventEmitter {
|
|
|
1035
1050
|
return this._impl && this._impl.getDbName();
|
|
1036
1051
|
}
|
|
1037
1052
|
|
|
1053
|
+
//---------------------------------------------------------------------------
|
|
1054
|
+
// hostName (READONLY)
|
|
1055
|
+
//
|
|
1056
|
+
// Property for identifying the hostName of the Oracle Database.
|
|
1057
|
+
//---------------------------------------------------------------------------
|
|
1058
|
+
get hostName() {
|
|
1059
|
+
return this._impl && this._impl.getHostName();
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
//---------------------------------------------------------------------------
|
|
1063
|
+
// port (READONLY)
|
|
1064
|
+
//
|
|
1065
|
+
// Property for identifying the port to which client is connected.
|
|
1066
|
+
//---------------------------------------------------------------------------
|
|
1067
|
+
get port() {
|
|
1068
|
+
return this._impl && this._impl.getPort();
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
//---------------------------------------------------------------------------
|
|
1072
|
+
// protocol (READONLY)
|
|
1073
|
+
//
|
|
1074
|
+
// Property for identifying the protocol used to connect to Oracle Database.
|
|
1075
|
+
//---------------------------------------------------------------------------
|
|
1076
|
+
get protocol() {
|
|
1077
|
+
return this._impl && this._impl.getProtocol();
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
//---------------------------------------------------------------------------
|
|
1081
|
+
// connectString (READONLY)
|
|
1082
|
+
//
|
|
1083
|
+
// User provided connectString to connect to Oracle Database.
|
|
1084
|
+
//---------------------------------------------------------------------------
|
|
1085
|
+
get connectString() {
|
|
1086
|
+
return this._impl && this._impl._connectString;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
//---------------------------------------------------------------------------
|
|
1090
|
+
// user
|
|
1091
|
+
//
|
|
1092
|
+
// User property provided to connect to Oracle Database.
|
|
1093
|
+
//---------------------------------------------------------------------------
|
|
1094
|
+
get user() {
|
|
1095
|
+
if (this.currentSchema.length) {
|
|
1096
|
+
return this.currentSchema;
|
|
1097
|
+
}
|
|
1098
|
+
return this._impl && this._impl._user;
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
//---------------------------------------------------------------------------
|
|
1102
|
+
// connectTraceConfig
|
|
1103
|
+
//
|
|
1104
|
+
// Property for getting the connection related config.
|
|
1105
|
+
//---------------------------------------------------------------------------
|
|
1106
|
+
get connectTraceConfig() {
|
|
1107
|
+
return this._impl && this._impl._getConnectTraceConfig();
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1038
1110
|
//---------------------------------------------------------------------------
|
|
1039
1111
|
// getDbObjectClass()
|
|
1040
1112
|
//
|
|
@@ -1584,9 +1656,9 @@ class Connection extends EventEmitter {
|
|
|
1584
1656
|
// that cannot take place concurrently
|
|
1585
1657
|
// NOTE: breakExecution() should not be serialized
|
|
1586
1658
|
Connection.prototype.break =
|
|
1587
|
-
nodbUtil.callbackify(Connection.prototype.breakExecution);
|
|
1659
|
+
nodbUtil.callbackify(nodbUtil.wrapFn(Connection.prototype.breakExecution));
|
|
1588
1660
|
Connection.prototype.tpcRecover =
|
|
1589
|
-
nodbUtil.callbackify(Connection.prototype.tpcRecover);
|
|
1661
|
+
nodbUtil.callbackify(nodbUtil.wrapFn(Connection.prototype.tpcRecover));
|
|
1590
1662
|
nodbUtil.wrapFns(Connection.prototype,
|
|
1591
1663
|
"changePassword",
|
|
1592
1664
|
"close",
|
package/lib/errors.js
CHANGED
|
@@ -108,7 +108,7 @@ const ERR_MISSING_FILE = 91;
|
|
|
108
108
|
const ERR_INVALID_NUMBER_OF_CONNECTIONS = 92;
|
|
109
109
|
const ERR_EXEC_MODE_ONLY_FOR_DML = 95;
|
|
110
110
|
const ERR_INVALID_BIND_NAME = 97;
|
|
111
|
-
const
|
|
111
|
+
const ERR_WRONG_NUMBER_OF_BINDS = 98;
|
|
112
112
|
const ERR_BUFFER_LENGTH_INSUFFICIENT = 99;
|
|
113
113
|
const ERR_NCHAR_CS_NOT_SUPPORTED = 100;
|
|
114
114
|
const ERR_MISSING_CREDENTIALS = 101;
|
|
@@ -163,6 +163,7 @@ const ERR_INVALID_TRANSACTION_SIZE = 153;
|
|
|
163
163
|
const ERR_INVALID_BRANCH_SIZE = 154;
|
|
164
164
|
const ERR_OPERATION_NOT_SUPPORTED_ON_BFILE = 155;
|
|
165
165
|
const ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE = 156;
|
|
166
|
+
const ERR_EXECMANY_NOT_ALLOWED_ON_QUERIES = 157;
|
|
166
167
|
|
|
167
168
|
// Oracle Net layer errors start from 500
|
|
168
169
|
const ERR_CONNECTION_CLOSED = 500;
|
|
@@ -193,6 +194,8 @@ const ERR_CONFIG_PROVIDER_LOAD_FAILED = 525;
|
|
|
193
194
|
const ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED = 526;
|
|
194
195
|
const ERR_AZURE_VAULT_AUTH_FAILED = 527;
|
|
195
196
|
const ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED = 528;
|
|
197
|
+
const ERR_WALLET_TYPE_NOT_SUPPORTED = 529;
|
|
198
|
+
const ERR_HOST_NOT_FOUND = 530;
|
|
196
199
|
|
|
197
200
|
// Oracle SUCCESS_WITH_INFO warning start from 700
|
|
198
201
|
const WRN_COMPILATION_CREATE = 700;
|
|
@@ -352,8 +355,8 @@ messages.set(ERR_EXEC_MODE_ONLY_FOR_DML, // NJS-095
|
|
|
352
355
|
'setting "batchErrors" or "dmlRowCounts" to true is only permitted for DML statements');
|
|
353
356
|
messages.set(ERR_INVALID_BIND_NAME, // NJS-097
|
|
354
357
|
'no bind placeholder named ":%s" was found in the statement text');
|
|
355
|
-
messages.set(
|
|
356
|
-
'%s
|
|
358
|
+
messages.set(ERR_WRONG_NUMBER_OF_BINDS, // NJS-098
|
|
359
|
+
'%s bind placeholders were used in the SQL statement but %s bind values were provided');
|
|
357
360
|
messages.set(ERR_BUFFER_LENGTH_INSUFFICIENT, // NJS-099
|
|
358
361
|
'internal error: buffer of length %s insufficient to hold %s bytes');
|
|
359
362
|
messages.set(ERR_NCHAR_CS_NOT_SUPPORTED, // NJS-100
|
|
@@ -456,12 +459,14 @@ messages.set(ERR_UNKNOWN_TRANSACTION_STATE, // NJS-152
|
|
|
456
459
|
'internal error: unknown transaction state {state} in Two Phase Commit');
|
|
457
460
|
messages.set(ERR_INVALID_TRANSACTION_SIZE, // NJS-153
|
|
458
461
|
'size of the transaction ID is %d and cannot exceed 64');
|
|
459
|
-
messages.set(ERR_INVALID_BRANCH_SIZE,
|
|
462
|
+
messages.set(ERR_INVALID_BRANCH_SIZE, // NJS-154
|
|
460
463
|
'size of the branch ID is %d and cannot exceed 64');
|
|
461
464
|
messages.set(ERR_OPERATION_NOT_SUPPORTED_ON_BFILE, // NJS-155
|
|
462
465
|
'operation is not supported on BFILE LOBs');
|
|
463
466
|
messages.set(ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE, // NJS-156
|
|
464
467
|
'operation is only supported on BFILE LOBs');
|
|
468
|
+
messages.set(ERR_EXECMANY_NOT_ALLOWED_ON_QUERIES, // NJS-157
|
|
469
|
+
'executeMany() cannot be used with SELECT statement or WITH SQL clause');
|
|
465
470
|
|
|
466
471
|
// Oracle Net layer errors
|
|
467
472
|
|
|
@@ -474,7 +479,7 @@ messages.set(ERR_CONNECTION_INCOMPLETE, // NJS-503
|
|
|
474
479
|
messages.set(ERR_PROXY_CONNECTION_FAILURE, // NJS-504
|
|
475
480
|
'connection establishment through a web proxy at host %s port %d failed. (CONNECTION_ID=%s)\n%s');
|
|
476
481
|
messages.set(ERR_TLS_INIT_FAILURE, // NJS-505
|
|
477
|
-
'unable to initiate TLS connection. Please check if wallet credentials are valid');
|
|
482
|
+
'unable to initiate TLS connection. Please check if wallet credentials are valid\n%s');
|
|
478
483
|
messages.set(ERR_TLS_AUTH_FAILURE, // NJS-506
|
|
479
484
|
'connection to host %s port %d encountered TLS handshake failure. (CONNECTION_ID=%s)\n%s');
|
|
480
485
|
messages.set(ERR_TLS_DNMATCH_FAILURE, // NJS-507
|
|
@@ -507,23 +512,27 @@ messages.set(ERR_TNS_NAMES_FILE_MISSING, // NJS-520
|
|
|
507
512
|
'cannot connect to Oracle Database. File tnsnames.ora not found in %s');
|
|
508
513
|
messages.set(ERR_CONNECTION_EOF, // NJS-521
|
|
509
514
|
'connection to host %s port %d received end-of-file on communication channel. (CONNECTION_ID=%s)');
|
|
510
|
-
messages.set(ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED,
|
|
515
|
+
messages.set(ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED, // NJS-522
|
|
511
516
|
'Azure Authentication Failed: The authentication parameter value %s may be incorrect');
|
|
512
|
-
messages.set(ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG,
|
|
517
|
+
messages.set(ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG, // NJS-523
|
|
513
518
|
'Failed to retrieve configuration from Centralized Configuration Provider:\n %s');
|
|
514
519
|
messages.set(ERR_CONFIG_PROVIDER_NOT_SUPPORTED, // NJS-524
|
|
515
520
|
'Configuration Provider not supported: %s');
|
|
516
521
|
messages.set(ERR_CONFIG_PROVIDER_LOAD_FAILED, // NJS-525
|
|
517
522
|
'Centralized Config Provider failed to load required libraries. Please install the required libraries.\n %s');
|
|
518
|
-
messages.set(ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED,
|
|
523
|
+
messages.set(ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED, // NJS-526
|
|
519
524
|
'OCI authentication failed: The authentication parameter value %s may be incorrect');
|
|
520
|
-
messages.set(ERR_AZURE_VAULT_AUTH_FAILED,
|
|
521
|
-
'Azure Vault: Provide correct
|
|
522
|
-
messages.set(ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED,
|
|
525
|
+
messages.set(ERR_AZURE_VAULT_AUTH_FAILED, // NJS-527
|
|
526
|
+
'Azure Vault: Provide correct Azure Vault authentication details');
|
|
527
|
+
messages.set(ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED, // NJS-528
|
|
523
528
|
'Azure service principal authentication requires either a client certificate path or a client secret string');
|
|
524
|
-
//
|
|
529
|
+
messages.set(ERR_WALLET_TYPE_NOT_SUPPORTED, // NJS-529
|
|
530
|
+
'Invalid wallet content format. Supported format is PEM');
|
|
531
|
+
messages.set(ERR_HOST_NOT_FOUND, // NJS-530
|
|
532
|
+
'The host addresses or URLs provided by the connect string are incorrect or unresolvable in your network.');
|
|
525
533
|
|
|
526
|
-
|
|
534
|
+
// Oracle SUCCESS_WITH_INFO warning
|
|
535
|
+
messages.set(WRN_COMPILATION_CREATE, // NJS-700
|
|
527
536
|
'creation succeeded with compilation errors');
|
|
528
537
|
|
|
529
538
|
//-----------------------------------------------------------------------------
|
|
@@ -837,8 +846,10 @@ module.exports = {
|
|
|
837
846
|
ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG,
|
|
838
847
|
ERR_CONFIG_PROVIDER_NOT_SUPPORTED,
|
|
839
848
|
ERR_CONFIG_PROVIDER_LOAD_FAILED,
|
|
849
|
+
ERR_WALLET_TYPE_NOT_SUPPORTED,
|
|
850
|
+
ERR_HOST_NOT_FOUND,
|
|
840
851
|
ERR_INVALID_BIND_NAME,
|
|
841
|
-
|
|
852
|
+
ERR_WRONG_NUMBER_OF_BINDS,
|
|
842
853
|
ERR_BUFFER_LENGTH_INSUFFICIENT,
|
|
843
854
|
ERR_NCHAR_CS_NOT_SUPPORTED,
|
|
844
855
|
ERR_MISSING_CREDENTIALS,
|
|
@@ -897,6 +908,7 @@ module.exports = {
|
|
|
897
908
|
ERR_CONNECTION_CLOSED_CODE: `${ERR_PREFIX}-${ERR_CONNECTION_CLOSED}`,
|
|
898
909
|
ERR_OPERATION_NOT_SUPPORTED_ON_BFILE,
|
|
899
910
|
ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE,
|
|
911
|
+
ERR_EXECMANY_NOT_ALLOWED_ON_QUERIES,
|
|
900
912
|
WRN_COMPILATION_CREATE,
|
|
901
913
|
assert,
|
|
902
914
|
assertArgCount,
|
package/lib/impl/aqQueue.js
CHANGED
|
@@ -27,8 +27,9 @@
|
|
|
27
27
|
'use strict';
|
|
28
28
|
|
|
29
29
|
const errors = require('../errors.js');
|
|
30
|
+
const BaseImpl = require('./base.js');
|
|
30
31
|
|
|
31
|
-
class AqQueueImpl {
|
|
32
|
+
class AqQueueImpl extends BaseImpl {
|
|
32
33
|
|
|
33
34
|
//---------------------------------------------------------------------------
|
|
34
35
|
// _getConnImpl()
|