oracledb 6.9.0 → 7.0.0
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/LICENSE.txt +1 -1
- package/NOTICE.txt +1 -1
- package/README.md +9 -9
- package/build/Release/oracledb-7.0.0-darwin-arm64.node +0 -0
- package/build/Release/oracledb-7.0.0-darwin-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-7.0.0-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-7.0.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-7.0.0-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-7.0.0-linux-x64.node +0 -0
- package/build/Release/oracledb-7.0.0-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-7.0.0-win32-x64.node +0 -0
- package/build/Release/oracledb-7.0.0-win32-x64.node-buildinfo.txt +1 -0
- package/eslint.config.js +39 -0
- package/lib/aqDeqOptions.js +18 -1
- package/lib/aqQueue.js +10 -6
- package/lib/connection.js +418 -39
- package/lib/dbObject.js +25 -4
- package/lib/endUserSecurityContext.js +176 -0
- package/lib/errors.js +99 -8
- package/lib/impl/aqDeqOptions.js +10 -1
- package/lib/impl/connection.js +76 -2
- package/lib/impl/datahandlers/buffer.js +68 -5
- package/lib/impl/datahandlers/oson.js +7 -2
- package/lib/impl/datahandlers/vector.js +25 -5
- package/lib/impl/lob.js +9 -0
- package/lib/impl/parserHelpers.js +443 -0
- package/lib/impl/resultset.js +1 -1
- package/lib/impl/sodaDocument.js +5 -14
- package/lib/lob.js +27 -14
- package/lib/obfuscation.js +97 -0
- package/lib/oracledb.js +163 -49
- package/lib/parser.js +204 -0
- package/lib/pipeline.js +113 -0
- package/lib/pool.js +203 -147
- package/lib/poolStatistics.js +1 -1
- package/lib/resultset.js +42 -21
- package/lib/settings.js +1 -0
- package/lib/sodaCollection.js +12 -8
- package/lib/sodaDatabase.js +35 -8
- package/lib/sodaDocument.js +24 -6
- package/lib/sodaOperation.js +7 -6
- package/lib/thin/aq.js +475 -0
- package/lib/thin/connection.js +518 -54
- package/lib/thin/dbObject.js +7 -1
- package/lib/thin/lob.js +20 -1
- package/lib/thin/pool.js +42 -62
- package/lib/thin/protocol/capabilities.js +21 -4
- package/lib/thin/protocol/constants.js +143 -2
- package/lib/thin/protocol/encryptDecrypt.js +45 -10
- package/lib/thin/protocol/messages/aqArray.js +238 -0
- package/lib/thin/protocol/messages/aqBase.js +305 -0
- package/lib/thin/protocol/messages/aqDeq.js +164 -0
- package/lib/thin/protocol/messages/aqEnq.js +135 -0
- package/lib/thin/protocol/messages/auth.js +18 -28
- package/lib/thin/protocol/messages/base.js +245 -4
- package/lib/thin/protocol/messages/dataType.js +8 -3
- package/lib/thin/protocol/messages/directPathLoadStream.js +377 -0
- package/lib/thin/protocol/messages/directPathOp.js +65 -0
- package/lib/thin/protocol/messages/directPathPrepare.js +158 -0
- package/lib/thin/protocol/messages/endPipeline.js +56 -0
- package/lib/thin/protocol/messages/execute.js +9 -7
- package/lib/thin/protocol/messages/index.js +9 -1
- package/lib/thin/protocol/messages/protocol.js +2 -2
- package/lib/thin/protocol/messages/withData.js +10 -142
- package/lib/thin/protocol/packet.js +120 -28
- package/lib/thin/protocol/protocol.js +110 -25
- package/lib/thin/protocol/utils.js +1 -26
- package/lib/thin/resultSet.js +13 -19
- package/lib/thin/sqlnet/ezConnectResolver.js +2 -2
- package/lib/thin/sqlnet/networkSession.js +63 -41
- package/lib/thin/sqlnet/ntTcp.js +24 -0
- package/lib/thin/sqlnet/nvStrToNvPair.js +50 -25
- package/lib/thin/sqlnet/packet.js +25 -4
- package/lib/thin/sqlnet/paramParser.js +10 -7
- package/lib/thin/statementCache.js +2 -4
- package/lib/traceHandler.js +59 -2
- package/lib/transformer.js +8 -3
- package/lib/types.js +36 -22
- package/lib/util.js +6 -19
- package/lib/version.js +3 -3
- package/package/install.js +5 -5
- package/package/prunebinaries.js +1 -1
- package/package.json +1 -1
- package/plugins/configProviders/awsCommon.js +125 -0
- package/plugins/configProviders/awss3/index.js +138 -0
- package/plugins/configProviders/awssecretsmanager/index.js +147 -0
- package/plugins/configProviders/azure/index.js +7 -5
- package/plugins/token/extensionAzure/index.js +0 -1
- package/plugins/token/extensionOci/index.js +0 -1
- package/build/Release/oracledb-6.9.0-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.9.0-darwin-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.9.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.9.0-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.9.0-js-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.9.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.9.0-linux-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.9.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.9.0-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.9.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.9.0-win32-x64.node-buildinfo.txt +0 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Copyright (c) 2025, Oracle and/or its affiliates.
|
|
2
|
+
|
|
3
|
+
//-----------------------------------------------------------------------------
|
|
4
|
+
//
|
|
5
|
+
// This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
// either license.
|
|
9
|
+
//
|
|
10
|
+
// If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
// the following applies:
|
|
12
|
+
//
|
|
13
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
// you may not use this file except in compliance with the License.
|
|
15
|
+
// You may obtain a copy of the License at
|
|
16
|
+
//
|
|
17
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
//
|
|
19
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
// See the License for the specific language governing permissions and
|
|
23
|
+
// limitations under the License.
|
|
24
|
+
//
|
|
25
|
+
//-----------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
//-----------------------------------------------------------------------------
|
|
28
|
+
// aqDeq.js
|
|
29
|
+
//
|
|
30
|
+
// This file defines the messages that are sent to the database and the
|
|
31
|
+
// responses that are received by the client for dequeuing an AQ message.
|
|
32
|
+
//-----------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
'use strict';
|
|
35
|
+
|
|
36
|
+
const AqBaseMessage = require("./aqBase.js");
|
|
37
|
+
const constants = require("../constants.js");
|
|
38
|
+
|
|
39
|
+
class AqDeqMessage extends AqBaseMessage {
|
|
40
|
+
|
|
41
|
+
constructor(connImpl) {
|
|
42
|
+
super(connImpl);
|
|
43
|
+
this.functionCode = constants.TNS_FUNC_AQ_DEQ;
|
|
44
|
+
this.propsImpl = null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//--------------------------------------------------------------------------
|
|
48
|
+
// processReturnParameter()
|
|
49
|
+
//
|
|
50
|
+
// Process the return parameters of the AQ Dequeue request.
|
|
51
|
+
//--------------------------------------------------------------------------
|
|
52
|
+
processReturnParameter(buf) {
|
|
53
|
+
const numBytes = buf.readUB4();
|
|
54
|
+
if (numBytes > 0) {
|
|
55
|
+
this._processMsgProps(buf, this.propsImpl);
|
|
56
|
+
this.propsImpl.recipients = this._processRecipients(buf);
|
|
57
|
+
this.propsImpl.payload = this._processPayload(buf);
|
|
58
|
+
this.propsImpl.msgId = this._processMsgId(buf);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//--------------------------------------------------------------------------
|
|
63
|
+
// _writeMessageBody()
|
|
64
|
+
//
|
|
65
|
+
// Writes the body of the message to the buffer.
|
|
66
|
+
//--------------------------------------------------------------------------
|
|
67
|
+
encode(buf) {
|
|
68
|
+
const queueNameBytes = Buffer.from(this.queueImpl.name, 'utf-8');
|
|
69
|
+
const consumerNameBytes = this.deqOptionsImpl.consumerName ?
|
|
70
|
+
Buffer.from(this.deqOptionsImpl.consumerName, 'utf-8') : null;
|
|
71
|
+
const correlationBytes = this.deqOptionsImpl.correlation ?
|
|
72
|
+
Buffer.from(this.deqOptionsImpl.correlation, 'utf-8') : null;
|
|
73
|
+
const conditionBytes = this.deqOptionsImpl.condition ?
|
|
74
|
+
Buffer.from(this.deqOptionsImpl.condition, 'utf-8') : null;
|
|
75
|
+
let msgIdBytes = this.deqOptionsImpl.msgId ?
|
|
76
|
+
this.deqOptionsImpl.msgId.slice(0, 16) : null;
|
|
77
|
+
const deliveryMode = this.deqOptionsImpl.deliveryMode;
|
|
78
|
+
let deqFlags = 0;
|
|
79
|
+
|
|
80
|
+
if (msgIdBytes && msgIdBytes.length < 16) {
|
|
81
|
+
msgIdBytes = Buffer.concat([msgIdBytes,
|
|
82
|
+
Buffer.alloc(16 - msgIdBytes.length)]);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (deliveryMode === constants.TNS_AQ_MSG_BUFFERED) {
|
|
86
|
+
deqFlags |= constants.TNS_KPD_AQ_BUFMSG;
|
|
87
|
+
} else if (deliveryMode === constants.TNS_AQ_MSG_PERSISTENT_OR_BUFFERED) {
|
|
88
|
+
deqFlags |= constants.TNS_KPD_AQ_EITHER;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
this.writeFunctionHeader(buf);
|
|
92
|
+
buf.writeUInt8(1); // queue name (ptr)
|
|
93
|
+
buf.writeUB4(queueNameBytes.length); // queue name len
|
|
94
|
+
buf.writeUInt8(1); // message properties
|
|
95
|
+
buf.writeUInt8(1); // msg props len
|
|
96
|
+
buf.writeUInt8(1); // recipient list
|
|
97
|
+
buf.writeUInt8(1); // recipient list len
|
|
98
|
+
if (consumerNameBytes) {
|
|
99
|
+
buf.writeUInt8(1); // consumer name
|
|
100
|
+
buf.writeUB4(consumerNameBytes.length);
|
|
101
|
+
} else {
|
|
102
|
+
buf.writeUInt8(0); // consumer name
|
|
103
|
+
buf.writeUB4(0); // consumer name len
|
|
104
|
+
}
|
|
105
|
+
buf.writeSB4(this.deqOptionsImpl.mode); // dequeue mode
|
|
106
|
+
buf.writeSB4(this.deqOptionsImpl.navigation); // navigation
|
|
107
|
+
buf.writeSB4(this.deqOptionsImpl.visibility); // visibility
|
|
108
|
+
buf.writeSB4(this.deqOptionsImpl.wait); // wait
|
|
109
|
+
if (msgIdBytes) {
|
|
110
|
+
buf.writeUInt8(1); // select mesg id
|
|
111
|
+
buf.writeUB4(constants.TNS_AQ_MESSAGE_ID_LENGTH); // mesg id len
|
|
112
|
+
} else {
|
|
113
|
+
buf.writeUInt8(0); // select mesg id
|
|
114
|
+
buf.writeUB4(0); // select mesg id len
|
|
115
|
+
}
|
|
116
|
+
if (correlationBytes) {
|
|
117
|
+
buf.writeUInt8(1); // correlation id
|
|
118
|
+
buf.writeUB4(correlationBytes.length); // correlation id len
|
|
119
|
+
} else {
|
|
120
|
+
buf.writeUInt8(0); // correlation id
|
|
121
|
+
buf.writeUB4(0); // correlation id len
|
|
122
|
+
}
|
|
123
|
+
buf.writeUInt8(1); // toid of payload
|
|
124
|
+
buf.writeUB4(16); // toid len
|
|
125
|
+
buf.writeUB2(constants.TNS_AQ_MESSAGE_VERSION);
|
|
126
|
+
buf.writeUInt8(1); // payload
|
|
127
|
+
buf.writeUInt8(1); // return msg id
|
|
128
|
+
buf.writeUB4(constants.TNS_AQ_MESSAGE_ID_LENGTH);
|
|
129
|
+
buf.writeUB4(deqFlags); // dequeue flags
|
|
130
|
+
if (conditionBytes) {
|
|
131
|
+
buf.writeUInt8(1); // condition (pointer)
|
|
132
|
+
buf.writeUB4(conditionBytes.length); // condition len
|
|
133
|
+
} else {
|
|
134
|
+
buf.writeUInt8(0); // condition
|
|
135
|
+
buf.writeUB4(0); // condition len
|
|
136
|
+
}
|
|
137
|
+
buf.writeUInt8(0); // extensions
|
|
138
|
+
buf.writeUB4(0); // number of extensions
|
|
139
|
+
if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_20_1) {
|
|
140
|
+
buf.writeUInt8(0); // JSON payload
|
|
141
|
+
}
|
|
142
|
+
if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_21_1) {
|
|
143
|
+
buf.writeUB4(0xffffffff); // shard id
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
buf.writeBytesWithLength(queueNameBytes);
|
|
147
|
+
if (consumerNameBytes) {
|
|
148
|
+
buf.writeBytesWithLength(consumerNameBytes);
|
|
149
|
+
}
|
|
150
|
+
if (msgIdBytes) {
|
|
151
|
+
buf.writeBytes(msgIdBytes);
|
|
152
|
+
}
|
|
153
|
+
if (correlationBytes) {
|
|
154
|
+
buf.writeBytesWithLength(correlationBytes);
|
|
155
|
+
}
|
|
156
|
+
buf.writeBytes(this.queueImpl.payloadToid);
|
|
157
|
+
if (conditionBytes) {
|
|
158
|
+
buf.writeBytesWithLength(conditionBytes);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
module.exports = AqDeqMessage;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// Copyright (c) 2025, Oracle and/or its affiliates.
|
|
2
|
+
|
|
3
|
+
//-----------------------------------------------------------------------------
|
|
4
|
+
//
|
|
5
|
+
// This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
// either license.
|
|
9
|
+
//
|
|
10
|
+
// If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
// the following applies:
|
|
12
|
+
//
|
|
13
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
// you may not use this file except in compliance with the License.
|
|
15
|
+
// You may obtain a copy of the License at
|
|
16
|
+
//
|
|
17
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
//
|
|
19
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
// See the License for the specific language governing permissions and
|
|
23
|
+
// limitations under the License.
|
|
24
|
+
//
|
|
25
|
+
//-----------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
//-----------------------------------------------------------------------------
|
|
28
|
+
// aqEnq.js
|
|
29
|
+
//
|
|
30
|
+
// This file defines the messages that are sent to the database and the
|
|
31
|
+
// responses that are received by the client for enqueuing an AQ message.
|
|
32
|
+
//-----------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
'use strict';
|
|
35
|
+
|
|
36
|
+
const AqBaseMessage = require("./aqBase.js");
|
|
37
|
+
const constants = require("../constants.js");
|
|
38
|
+
|
|
39
|
+
class AqEnqMessage extends AqBaseMessage {
|
|
40
|
+
|
|
41
|
+
constructor(connImpl) {
|
|
42
|
+
super(connImpl);
|
|
43
|
+
this.functionCode = constants.TNS_FUNC_AQ_ENQ;
|
|
44
|
+
this.propsImpl = null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//--------------------------------------------------------------------------
|
|
48
|
+
// processReturnParameter()
|
|
49
|
+
//
|
|
50
|
+
// Process the return parameters for the AQ enqueue request.
|
|
51
|
+
//--------------------------------------------------------------------------
|
|
52
|
+
processReturnParameter(buf) {
|
|
53
|
+
this.propsImpl.msgId = this._processMsgId(buf);
|
|
54
|
+
buf.skipUB2(); // extensions length
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//--------------------------------------------------------------------------
|
|
58
|
+
// encode()
|
|
59
|
+
//
|
|
60
|
+
// Writes the body of the message to the buffer.
|
|
61
|
+
//--------------------------------------------------------------------------
|
|
62
|
+
encode(buf) {
|
|
63
|
+
const queueNameBytes = Buffer.from(this.queueImpl.name, 'utf-8');
|
|
64
|
+
let enqFlags = 0;
|
|
65
|
+
|
|
66
|
+
if (this.enqOptionsImpl.deliveryMode === constants.TNS_AQ_MSG_BUFFERED) {
|
|
67
|
+
enqFlags |= constants.TNS_KPD_AQ_BUFMSG;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
this.writeFunctionHeader(buf);
|
|
71
|
+
buf.writeUInt8(1); // queue name (ptr)
|
|
72
|
+
buf.writeUB4(queueNameBytes.length); // queue name len
|
|
73
|
+
this._writeMsgProps(buf, this.propsImpl);
|
|
74
|
+
if (!this.propsImpl.recipients) {
|
|
75
|
+
buf.writeUInt8(0); // recipients (ptr)
|
|
76
|
+
buf.writeUB4(0); // no. of key/value pairs
|
|
77
|
+
} else {
|
|
78
|
+
buf.writeUInt8(1); // recipients (ptr)
|
|
79
|
+
buf.writeUB4(3 * this.propsImpl.recipients.length);
|
|
80
|
+
}
|
|
81
|
+
buf.writeUB4(this.enqOptionsImpl.visibility);
|
|
82
|
+
buf.writeUInt8(0); // relative msg id
|
|
83
|
+
buf.writeUB4(0); // relative msg len
|
|
84
|
+
buf.writeUB4(0); // sequence deviation
|
|
85
|
+
buf.writeUInt8(1); // TOID of payload (ptr)
|
|
86
|
+
buf.writeUB4(16); // TOID of payload len
|
|
87
|
+
buf.writeUB2(constants.TNS_AQ_MESSAGE_VERSION);
|
|
88
|
+
if (this.queueImpl.isJson) {
|
|
89
|
+
buf.writeUInt8(0); // payload (ptr)
|
|
90
|
+
buf.writeUInt8(0); // RAW payload (ptr)
|
|
91
|
+
buf.writeUB4(0); // RAW payload len
|
|
92
|
+
} else if (this.queueImpl.payloadTypeClass) {
|
|
93
|
+
buf.writeUInt8(1); // payload (ptr)
|
|
94
|
+
buf.writeUInt8(0); // RAW payload (ptr)
|
|
95
|
+
buf.writeUB4(0); // RAW payload len
|
|
96
|
+
} else {
|
|
97
|
+
buf.writeUInt8(0); // payload (ptr)
|
|
98
|
+
buf.writeUInt8(1); // RAW payload (ptr)
|
|
99
|
+
buf.writeUB4(this.propsImpl.payload.length);
|
|
100
|
+
}
|
|
101
|
+
buf.writeUInt8(1); // return msg id (ptr)
|
|
102
|
+
buf.writeUB4(constants.TNS_AQ_MESSAGE_ID_LENGTH); // return msg id len
|
|
103
|
+
buf.writeUB4(enqFlags); // enqueue flags
|
|
104
|
+
buf.writeUInt8(0); // extensions 1 (ptr)
|
|
105
|
+
buf.writeUB4(0); // number of extensions 1
|
|
106
|
+
buf.writeUInt8(0); // extensions 2 (ptr)
|
|
107
|
+
buf.writeUB4(0); // number of extensions 2
|
|
108
|
+
buf.writeUInt8(0); // source sequence number
|
|
109
|
+
buf.writeUB4(0); // source sequence len
|
|
110
|
+
buf.writeUInt8(0); // max sequence number
|
|
111
|
+
buf.writeUB4(0); // max sequence len
|
|
112
|
+
buf.writeUInt8(0); // output ack len
|
|
113
|
+
buf.writeUInt8(0); // correlation (ptr)
|
|
114
|
+
buf.writeUB4(0); // correlation len
|
|
115
|
+
buf.writeUInt8(0); // sender name (ptr)
|
|
116
|
+
buf.writeUB4(0); // sender name len
|
|
117
|
+
buf.writeUInt8(0); // sender address (ptr)
|
|
118
|
+
buf.writeUB4(0); // sender address len
|
|
119
|
+
buf.writeUInt8(0); // sender charset id
|
|
120
|
+
buf.writeUInt8(0); // sender ncharset id
|
|
121
|
+
if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_20_1) {
|
|
122
|
+
buf.writeUInt8(this.queueImpl.isJson ? 1 : 0); // JSON payload (ptr)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
buf.writeBytesWithLength(queueNameBytes);
|
|
126
|
+
if (this.propsImpl.recipients) {
|
|
127
|
+
this._writeRecipients(buf, this.propsImpl);
|
|
128
|
+
}
|
|
129
|
+
buf.writeBytes(this.queueImpl.payloadToid);
|
|
130
|
+
this._writePayload(buf, this.propsImpl);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
module.exports = AqEnqMessage;
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
const { Buffer } = require('buffer');
|
|
30
30
|
const constants = require("../constants.js");
|
|
31
31
|
const errors = require("../../../errors.js");
|
|
32
|
+
const parser = require("../../../parser.js");
|
|
32
33
|
const process = require("process");
|
|
33
34
|
const ED = require("../encryptDecrypt.js");
|
|
34
35
|
const Message = require("./base.js");
|
|
@@ -158,6 +159,10 @@ class AuthMessage extends Message {
|
|
|
158
159
|
let sign, tzRepr;
|
|
159
160
|
if (process.env.ORA_SDTZ) {
|
|
160
161
|
tzRepr = process.env.ORA_SDTZ;
|
|
162
|
+
// LOCAL and DBTIMEZONE are SQL keywords and must not be quoted.
|
|
163
|
+
if (["LOCAL", "DBTIMEZONE"].includes(tzRepr.toUpperCase())) {
|
|
164
|
+
return `ALTER SESSION SET TIME_ZONE =${tzRepr}\x00`;
|
|
165
|
+
}
|
|
161
166
|
} else {
|
|
162
167
|
const date = new Date();
|
|
163
168
|
const timezoneMinutes = date.getTimezoneOffset();
|
|
@@ -172,7 +177,7 @@ class AuthMessage extends Message {
|
|
|
172
177
|
tzHour = tzHour.toLocaleString('en-US', {minimumIntegerDigits: 2});
|
|
173
178
|
tzRepr = `${sign}${tzHour}:${tzMinutes}`;
|
|
174
179
|
}
|
|
175
|
-
return `ALTER SESSION SET TIME_ZONE
|
|
180
|
+
return `ALTER SESSION SET TIME_ZONE =${parser.enquoteLiteral(tzRepr)}\x00`;
|
|
176
181
|
}
|
|
177
182
|
|
|
178
183
|
encode(buf) {
|
|
@@ -355,34 +360,19 @@ class AuthMessage extends Message {
|
|
|
355
360
|
}
|
|
356
361
|
if (this.functionCode === constants.TNS_FUNC_AUTH_PHASE_ONE) {
|
|
357
362
|
this.functionCode = constants.TNS_FUNC_AUTH_PHASE_TWO;
|
|
358
|
-
} else {
|
|
359
|
-
|
|
360
|
-
let
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const fullVersionNum = Number(this.sessionData['AUTH_VERSION_NO']);
|
|
371
|
-
const versionNum = (fullVersionNum >> 24) & 0xFF;
|
|
372
|
-
this.conn.warning = this.warning;
|
|
373
|
-
if (buf.caps.ttcFieldVersion >= constants.TNS_CCAP_FIELD_VERSION_18_1_EXT_1) {
|
|
374
|
-
releaseNum = (fullVersionNum >> 16) & 0xFF;
|
|
375
|
-
updateNum = (fullVersionNum >> 12) & 0x0F;
|
|
376
|
-
portReleaseNum = (fullVersionNum >> 4) & 0xFF;
|
|
377
|
-
portUpdateNum = fullVersionNum & 0x0F;
|
|
378
|
-
} else {
|
|
379
|
-
releaseNum = (fullVersionNum >> 20) & 0x0F;
|
|
380
|
-
updateNum = (fullVersionNum >> 12) & 0xFF;
|
|
381
|
-
portReleaseNum = (fullVersionNum >> 8) & 0x0F;
|
|
382
|
-
portUpdateNum = fullVersionNum & 0xFF;
|
|
363
|
+
} else if (!this.changePassword && this.comboKey) {
|
|
364
|
+
const value = this.sessionData.AUTH_SVR_RESPONSE;
|
|
365
|
+
let response;
|
|
366
|
+
if (value) {
|
|
367
|
+
const encodedResponse = Buffer.from(value, "hex");
|
|
368
|
+
response = ED.decrypt(this.comboKey, encodedResponse);
|
|
369
|
+
}
|
|
370
|
+
if (
|
|
371
|
+
!response ||
|
|
372
|
+
!response.subarray(16, 32).equals(Buffer.from("SERVER_TO_CLIENT"))
|
|
373
|
+
) {
|
|
374
|
+
errors.throwErr(errors.ERR_INVALID_SERVER_RESPONSE);
|
|
383
375
|
}
|
|
384
|
-
this.conn.serverVersionString = versionNum + '.' + releaseNum + '.' + updateNum + '.' + portReleaseNum + '.' + portUpdateNum;
|
|
385
|
-
this.conn.serverVersion = versionNum * 100000000 + releaseNum * 1000000 + updateNum * 10000 + portReleaseNum * 100 + portUpdateNum * 1;
|
|
386
376
|
}
|
|
387
377
|
}
|
|
388
378
|
|