oracledb 6.8.0 → 6.9.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.
Files changed (67) hide show
  1. package/README.md +39 -3
  2. package/build/Release/oracledb-6.9.0-darwin-arm64.node +0 -0
  3. package/build/Release/oracledb-6.9.0-darwin-arm64.node-buildinfo.txt +1 -0
  4. package/build/Release/oracledb-6.9.0-darwin-x64.node +0 -0
  5. package/build/Release/oracledb-6.9.0-darwin-x64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-6.9.0-js-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-6.9.0-linux-arm64.node +0 -0
  8. package/build/Release/oracledb-6.9.0-linux-arm64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.9.0-linux-x64.node +0 -0
  10. package/build/Release/oracledb-6.9.0-linux-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-6.9.0-win32-x64.node +0 -0
  12. package/build/Release/oracledb-6.9.0-win32-x64.node-buildinfo.txt +1 -0
  13. package/lib/aqMessage.js +10 -1
  14. package/lib/configProviders/file.js +72 -0
  15. package/lib/connection.js +87 -2
  16. package/lib/dbObject.js +9 -0
  17. package/lib/errors.js +56 -31
  18. package/lib/impl/connection.js +9 -0
  19. package/lib/impl/pool.js +10 -1
  20. package/lib/impl/resultset.js +5 -4
  21. package/lib/lob.js +9 -1
  22. package/lib/oracledb.js +129 -16
  23. package/lib/pool.js +12 -1
  24. package/lib/poolStatistics.js +3 -1
  25. package/lib/thin/connection.js +117 -10
  26. package/lib/thin/dbObject.js +8 -6
  27. package/lib/thin/lob.js +2 -3
  28. package/lib/thin/pool.js +105 -28
  29. package/lib/thin/protocol/capabilities.js +7 -3
  30. package/lib/thin/protocol/constants.js +29 -1
  31. package/lib/thin/protocol/messages/auth.js +13 -0
  32. package/lib/thin/protocol/messages/base.js +98 -9
  33. package/lib/thin/protocol/messages/dataType.js +2 -1
  34. package/lib/thin/protocol/messages/execute.js +46 -4
  35. package/lib/thin/protocol/messages/lobOp.js +5 -22
  36. package/lib/thin/protocol/messages/logOff.js +0 -1
  37. package/lib/thin/protocol/messages/sessionRelease.js +0 -1
  38. package/lib/thin/protocol/messages/transactionSwitch.js +12 -4
  39. package/lib/thin/protocol/protocol.js +2 -1
  40. package/lib/thin/sqlnet/connStrategy.js +2 -1
  41. package/lib/thin/sqlnet/navNodes.js +1 -1
  42. package/lib/thin/sqlnet/networkSession.js +9 -3
  43. package/lib/thin/sqlnet/packet.js +2 -1
  44. package/lib/thin/sqlnet/sessionAtts.js +2 -3
  45. package/lib/types.js +0 -5
  46. package/lib/util.js +76 -2
  47. package/lib/version.js +1 -1
  48. package/package/install.js +3 -3
  49. package/package/prunebinaries.js +6 -12
  50. package/package.json +2 -2
  51. package/{lib/configProviders/azure.js → plugins/configProviders/azure/index.js} +70 -63
  52. package/plugins/configProviders/azurevault/index.js +84 -0
  53. package/{lib → plugins}/configProviders/base.js +13 -3
  54. package/{lib/configProviders/ociobject.js → plugins/configProviders/ociobject/index.js} +43 -78
  55. package/plugins/configProviders/ocivault/index.js +100 -0
  56. package/plugins/token/extensionOci/index.js +71 -35
  57. package/build/Release/oracledb-6.8.0-darwin-arm64.node +0 -0
  58. package/build/Release/oracledb-6.8.0-darwin-arm64.node-buildinfo.txt +0 -1
  59. package/build/Release/oracledb-6.8.0-darwin-x64.node +0 -0
  60. package/build/Release/oracledb-6.8.0-darwin-x64.node-buildinfo.txt +0 -1
  61. package/build/Release/oracledb-6.8.0-js-buildinfo.txt +0 -1
  62. package/build/Release/oracledb-6.8.0-linux-arm64.node +0 -0
  63. package/build/Release/oracledb-6.8.0-linux-arm64.node-buildinfo.txt +0 -1
  64. package/build/Release/oracledb-6.8.0-linux-x64.node +0 -0
  65. package/build/Release/oracledb-6.8.0-linux-x64.node-buildinfo.txt +0 -1
  66. package/build/Release/oracledb-6.8.0-win32-x64.node +0 -0
  67. package/build/Release/oracledb-6.8.0-win32-x64.node-buildinfo.txt +0 -1
@@ -36,6 +36,8 @@ async function getToken(params) {
36
36
  return await configFileBasedAuthentication(params);
37
37
  case 'simpleauthentication':
38
38
  return await simpleAuthentication(params);
39
+ case 'instanceprincipal':
40
+ return await instancePrincipalAuthentication(params);
39
41
  default:
40
42
  throwErr(`Invalid authentication type ${params.authType} in extensionOci plugins.`);
41
43
  }
@@ -48,6 +50,43 @@ function throwErr(message) {
48
50
  throw new Error(message);
49
51
  }
50
52
 
53
+ //---------------------------------------------------------------------------
54
+ // Requests an access token from the dataplane service
55
+ // Generating security token
56
+ //---------------------------------------------------------------------------
57
+ async function generateAccessToken(provider, scope) {
58
+ // Scope uses the * character to identify all databases in the cloud
59
+ // tenancy of the authenticated user. urn:oracle:db::id::*, default
60
+
61
+ // A scope that authorizes access to all databases within a compartment has
62
+ // the form: urn:oracle:db::id::<compartment-ocid>
63
+ // String scope = "urn:oracle:db::id::ocid1.compartment.oc1..xxxxxxxx"
64
+
65
+ // A scope that authorizes access to a single database within a compartment
66
+ // has the form: urn:oracle:db::id::<compartment-ocid>::<database-ocid>
67
+ // String scope = "urn:oracle:db::id::ocid1.compartment.oc1..xxxxxx::ocid1.autonomousdatabase.oc1.phx.xxxxxx"
68
+
69
+ const client = new identitydataplane.DataplaneClient({
70
+ authenticationDetailsProvider: provider
71
+ });
72
+ const keyPair = await _getKeyPair();
73
+
74
+ const generateScopedAccessTokenRequest = {
75
+ generateScopedAccessTokenDetails: {
76
+ scope: scope ?? "urn:oracle:db::id::*",
77
+ publicKey: keyPair.publicKey
78
+ }
79
+ };
80
+
81
+ const generateScopedAccessTokenResponse =
82
+ await client.generateScopedAccessToken(generateScopedAccessTokenRequest);
83
+
84
+ return {
85
+ token: generateScopedAccessTokenResponse.securityToken.token,
86
+ privateKey: keyPair.privateKey
87
+ };
88
+ }
89
+
51
90
  //---------------------------------------------------------------------------
52
91
  // Generates a public-private key pair for proof of possession when token
53
92
  // requested by this provider is presented for validation.
@@ -79,31 +118,33 @@ async function _getKeyPair() {
79
118
  // scope of requested access. The request will specify a public key
80
119
  // as being paired with a private key that the presenter of the token must
81
120
  // prove to be in possession of.
121
+ //
122
+ // The path and profile of the config file may be configured by optional
123
+ // parameters in object accessTokenConfig. If values not provided in
124
+ // accessTokenConfig then this method will read the DEFAULT
125
+ // profile from $HOME/.oci/config.
126
+ // accessTokenConfig.configFileLocation, Not null.
127
+ // accessTokenConfig.profile, Not null.
128
+ //
129
+ // Return API Key-Based Authentication.
82
130
  //---------------------------------------------------------------------------
83
131
  async function configFileBasedAuthentication(accessTokenConfig) {
84
132
  const provider =
85
133
  new common.ConfigFileAuthenticationDetailsProvider(accessTokenConfig.configFileLocation, accessTokenConfig.profile);
86
- const client = new identitydataplane.DataplaneClient({authenticationDetailsProvider: provider});
87
- const keyPair = await _getKeyPair();
88
- const generateScopedAccessTokenDetails = {
89
- scope: "urn:oracle:db::id::*",
90
- publicKey: keyPair.publicKey
91
- };
92
134
 
93
- const generateScopedAccessTokenRequest = {
94
- generateScopedAccessTokenDetails: generateScopedAccessTokenDetails
95
- };
96
- const generateScopedAccessTokenResponse =
97
- await client.generateScopedAccessToken(generateScopedAccessTokenRequest);
98
- const obj = {
99
- token: generateScopedAccessTokenResponse.securityToken.token,
100
- privateKey: keyPair.privateKey
101
- };
102
- return obj;
135
+ return await generateAccessToken(provider, accessTokenConfig.scope);
103
136
  }
104
137
 
105
138
  //---------------------------------------------------------------------------
106
139
  // simpleAuthentication()
140
+ // Returns authentication details for the provided credentials.
141
+ // tenancy: OCID of the tenancy
142
+ // user: OCID of the user
143
+ // fingerprint: Fingerprint of the public key
144
+ // privateKey: Private key
145
+ // passPhrase: Passphrase that is used to encrypt the private key.
146
+ // null if not used.
147
+ // Return API Key-Based Authentication.
107
148
  //---------------------------------------------------------------------------
108
149
  async function simpleAuthentication(accessTokenConfig) {
109
150
  const tenancy = accessTokenConfig.tenancy ??
@@ -135,27 +176,22 @@ async function simpleAuthentication(accessTokenConfig) {
135
176
  passphrase,
136
177
  region
137
178
  );
138
- const client = new identitydataplane.DataplaneClient({
139
- authenticationDetailsProvider: provider
140
- });
141
- const keyPair = await _getKeyPair();
142
- const generateScopedAccessTokenDetails = {
143
- scope: "urn:oracle:db::id::*",
144
- publicKey: keyPair.publicKey
145
- };
146
- const generateScopedAccessTokenRequest = {
147
- generateScopedAccessTokenDetails: generateScopedAccessTokenDetails
148
- };
149
179
 
150
- const generateScopedAccessTokenResponse = await client.generateScopedAccessToken(
151
- generateScopedAccessTokenRequest
152
- );
180
+ return await generateAccessToken(provider, accessTokenConfig.scope);
181
+ }
153
182
 
154
- const obj = {
155
- token: generateScopedAccessTokenResponse.securityToken.token,
156
- privateKey: keyPair.privateKey
157
- };
158
- return obj;
183
+ //---------------------------------------------------------------------------
184
+ // instancePrincipalAuthentication()
185
+ //
186
+ // Authentication in a Compute Instance, without credentials, as an instance
187
+ // principal. This authentication method should only work on compute
188
+ // instances where internal network endpoints are reachable.
189
+ // Return Instance Principal Authentication.
190
+ //---------------------------------------------------------------------------
191
+ async function instancePrincipalAuthentication(accessTokenConfig) {
192
+ const provider = await new common.InstancePrincipalsAuthenticationDetailsProviderBuilder().build();
193
+
194
+ return await generateAccessToken(provider, accessTokenConfig.scope);
159
195
  }
160
196
 
161
197
  //---------------------------------------------------------------------------
@@ -1 +0,0 @@
1
- oracledb-6.8.0-darwin-arm64.node v22.2.0 1e47f3ef9289df6513744f8cff1ad648f989c8af 6fa744509b8144c7bd2a25a1cb1e7dd8f746d31f Wed, 12 Feb 2025 09:02:05 GMT
@@ -1 +0,0 @@
1
- oracledb-6.8.0-darwin-x64.node v20.11.1 1e47f3ef9289df6513744f8cff1ad648f989c8af 6fa744509b8144c7bd2a25a1cb1e7dd8f746d31f Wed, 12 Feb 2025 08:49:37 GMT
@@ -1 +0,0 @@
1
- 1e47f3ef9289df6513744f8cff1ad648f989c8af
@@ -1 +0,0 @@
1
- oracledb-6.8.0-linux-arm64.node v20.16.0 1e47f3ef9289df6513744f8cff1ad648f989c8af 6fa744509b8144c7bd2a25a1cb1e7dd8f746d31f Wed, 12 Feb 2025 09:53:19 GMT
@@ -1 +0,0 @@
1
- oracledb-6.8.0-linux-x64.node v20.16.0 1e47f3ef9289df6513744f8cff1ad648f989c8af 6fa744509b8144c7bd2a25a1cb1e7dd8f746d31f Wed, 12 Feb 2025 09:52:45 GMT
@@ -1 +0,0 @@
1
- oracledb-6.8.0-win32-x64.node v20.0.0 1e47f3ef9289df6513744f8cff1ad648f989c8af 6fa744509b8144c7bd2a25a1cb1e7dd8f746d31f Wed, 12 Feb 2025 09:31:59 GMT