You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update README.md to cover wallet_location and removed unused example … (#155)
* Update README.md to cover wallet_location and removed unused example classes.
* Fix javadoc error
* Update run-tests.yaml to use cache v4
* Optimize imports
Copy file name to clipboardExpand all lines: ojdbc-provider-azure/README.md
+16-39
Original file line number
Diff line number
Diff line change
@@ -53,23 +53,26 @@ JDK versions. The coordinates for the latest release are:
53
53
The Config Provider for Azure is a Centralized Config Provider that provides Oracle JDBC with
54
54
connection properties from the App Configuration service and the Key Vault service.
55
55
56
-
A new prefix of the JDBC URL `jdbc:oracle:thin:@config-azure://` is used by the Oracle DataSource to be able to identify that the configuration parameters should be loaded using Azure App Configuration. Users only need to indicate the App Config's name, a prefix for the key-names and a label (both optional) with the following syntax:
56
+
A new prefix of the JDBC URL `jdbc:oracle:thin:@config-azure://` is used by the Oracle Data Source to be able to identify that the configuration parameters should be loaded using Azure App Configuration. Users only need to indicate the App Config's name, a prefix for the key-names and a label (both optional) using the following syntax, where option-value pairs separated by `&` are optional authentication parameters that vary by provider:
For more details about the option-value pairs, see [Common Parameters for Centralized Config Providers](#common-parameters-for-centralized-config-providers).
63
+
62
64
If prefix and label are not informed, the provider will retrieve all the values that are not labeled or prefixed.
63
65
64
-
There are 3 fixed values that are looked at by the provider in the retrieved configuration:
66
+
There are 4 fixed values that are looked at by the provider in the retrieved configuration:
65
67
66
68
- connect_descriptor (required)
67
69
- user (optional)
68
70
- password (optional)
71
+
- wallet_location (optional)
69
72
70
73
The rest are dependent on the driver, in our case `/jdbc`. The key-value pairs that are with sub-prefix `/jdbc` will be applied to a DataSource. The key values are constant keys which are equivalent to the properties defined in the [OracleConnection](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/oracle/jdbc/OracleConnection.html) interface.
And the configuration in App Configuration '**myappconfig**' as follows (note that some values such as password can be a reference to a Key Vault secret):
| /sales_app1/connect_descriptor | (description=(address=(protocol=tcps)(port=1521)(host=adb.us-phoenix-1.oraclecloud.com))(connect_data=(service_name=gebqqvpozhjbqbs_dbtest_medium.adb.oraclecloud.com))) | dev |
84
87
| /sales_app1/password | {"uri":"myvault.vault.azure.net/secrets/mysecret"} | dev |
88
+
| /sales_app1/wallet_location | {"uri":"myvault.vault.azure.net/secrets/mywallet"} | dev |
85
89
| /sales_app1/jdbc/autoCommit | false | dev |
86
90
| /sales_app1/jdbc/oracle.jdbc.fanEnabled | true | dev |
87
91
| /sales_app1/jdbc/oracle.jdbc.loginTimeout | 20 | dev |
88
92
89
-
In this case the OracleDataSource that gets generated uses the above values as its properties.
93
+
In this case the Oracle Data Source that gets generated uses the above values as its properties.
90
94
91
95
The sample code below executes as expected with the previous configuration (and the Azure Credentials set as explained below).
92
96
@@ -101,15 +105,15 @@ The sample code below executes as expected with the previous configuration (and
101
105
```
102
106
## Azure Vault Config Provider
103
107
Similar to [OCI Vault Config Provider](../ojdbc-provider-oci/README.md#oci-vault-config-provider), JSON Payload can also be stored in the content of Azure Key Vault Secret.
104
-
The Oracle DataSource uses a new prefix `jdbc:oracle:thin:@config-azurevault://`. Users only need to indicate the Vault Secret’s secret identifier, with the following syntax:
108
+
The Oracle Data Source uses a new prefix `jdbc:oracle:thin:@config-azurevault://`. Users only need to indicate the Vault Secret’s secret identifier using the following syntax, where option-value pairs separated by `&` are optional authentication parameters that vary by provider:
To view an example format of JSON Payload, please refer to [JSON Payload format](../ojdbc-provider-oci/README.md#json-payload-format).
111
-
114
+
For more details about the option-value pairs, see [Common Parameters for Centralized Config Providers](#common-parameters-for-centralized-config-providers).
112
115
116
+
To view an example format of JSON Payload, please refer to [JSON Payload format](../ojdbc-provider-oci/README.md#json-payload-format).
113
117
114
118
## Common Parameters for Centralized Config Providers
115
119
Provider that are classified as Centralized Config Providers in this module share the same sets of parameters for authentication configuration.
@@ -183,36 +187,9 @@ The Azure SDK `DefaultAzureCredential` class tries the following flow in order t
183
187
## Caching configuration
184
188
185
189
Config providers in this module store the configuration in caches to minimize
186
-
the number of RPC requests to remote location. Every stored items has a property
187
-
that defines the time-to-live (TTL) value. When TTL expires, the configuration
188
-
becomes "softly expired" and the stored configuration will be refreshed by a
189
-
background thread. If configuration cannot be refreshed, it can still be used
190
-
for another 30 minutes until it becomes "hardly expired". In other words, it takes
191
-
24 hours and 30 minutes for configuration before it becomes completely expired.
192
-
193
-
The default value of TTL is 24 hours and it can be configured using the
194
-
"config_time_to_live" property in the unit of seconds.
195
-
An example of App Configuration in Azure with TTL of 60 seconds is listed below.
196
-
197
-
<table>
198
-
<thead><tr>
199
-
<th>Key</th>
200
-
<th>Value</th>
201
-
</tr></thead>
202
-
<tbody><tr>
203
-
<td>user</td>
204
-
<td>myUsername</td>
205
-
</tr><tr>
206
-
<td>password</td>
207
-
<td>myPassword</td>
208
-
</tr><tr>
209
-
<td>connect_descriptor</td>
210
-
<td>myHost:5521/myService</td>
211
-
</tr><tr>
212
-
<td>config_time_to_live</td>
213
-
<td>60</td>
214
-
</tr></tbody>
215
-
</table>
190
+
the number of RPC requests to remote location. See
191
+
[Caching configuration](../ojdbc-provider-oci/README.md#caching-configuration) for more
192
+
details of the caching mechanism.
216
193
217
194
## Access Token Provider
218
195
The Access Token Provider provides Oracle JDBC with an access token that authorizes
Copy file name to clipboardExpand all lines: ojdbc-provider-oci/README.md
+91-31
Original file line number
Diff line number
Diff line change
@@ -63,38 +63,48 @@ JDK versions. The coordinates for the latest release are:
63
63
## OCI Database Tools Connections Config Provider
64
64
65
65
The OCI Database Tools Connections is a managed service that can be used to configure connections to a database.
66
-
The created resource stores connection properties, including user, password and wallets (these last two optionally as references to a secret in OCI Vault).
67
-
Each configuration has an identifier (OCID) that is used to identify which connection is requested by the driver.
66
+
The created resource stores connection properties, including user, password and wallet (these last two optionally as references to a secret in OCI Vault).
68
67
69
-
JDBC URL Sample that uses the OCI DBTools provider:
68
+
Users only need to indicate the OCID of the resource using the following syntax, where option-value pairs separated by `&` are optional authentication parameters that vary by provider:
For more details about the option-value pairs, see [Common Parameters for Centralized Config Providers](#common-parameters-for-centralized-config-providers).
Provider can now support Database Tools Connections with Proxy Authentication,
76
83
only if username is provided in Proxy Authentication Info, without the password and roles.
77
84
78
85
## OCI Object Storage Config Provider
79
-
The Oracle DataSource uses a new prefix `jdbc:oracle:thin:@config-ociobject://` to be able to identify that the configuration parameters should be loaded using OCI Object Storage. Users only need to indicate the URL Path of the Object containing the JSON payload, with the following syntax:
86
+
The Oracle Data Source uses a new prefix `jdbc:oracle:thin:@config-ociobject://` to be able to identify that the configuration parameters should be loaded using OCI Object Storage. Users only need to indicate the URL Path of the Object containing the JSON payload using the following syntax, where option-value pairs separated by `&` are optional authentication parameters that vary by provider:
The insturctions of obtaining a URL Path can be found in [Get the URI or Pre-Authenticated Request URL to Access the Object Store](https://docs.oracle.com/en/cloud/paas/autonomous-database/csgru/get-uri-access-object-store.html).
92
+
The instructions of obtaining a URL Path can be found in [Get the URI or Pre-Authenticated Request URL to Access the Object Store](https://docs.oracle.com/en/cloud/paas/autonomous-database/csgru/get-uri-access-object-store.html).
93
+
94
+
For more details about the option-value pairs, see [Common Parameters for Centralized Config Providers](#common-parameters-for-centralized-config-providers).
86
95
87
96
### JSON Payload format
88
97
89
-
There are 3 fixed values that are looked at the root level.
98
+
There are 4 fixed values that are looked at the root level.
90
99
91
100
- connect_descriptor (required)
92
101
- user (optional)
93
102
- password (optional)
103
+
- wallet_location (optional)
94
104
95
-
The rest are dependent on the driver, in our case `/jdbc`. The key-value pairs that are with sub-prefix `/jdbc` will be applied to a DataSource. The key values are constant keys which are equivalent to the properties defined in the [OracleConnection](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/oracle/jdbc/OracleConnection.html) interface.
105
+
The rest are dependent on the driver, in our case `/jdbc`. The key-value pairs that are with sub-prefix `/jdbc` will be applied to a Data Source. The key values are constant keys which are equivalent to the properties defined in the [OracleConnection](https://docs.oracle.com/en/database/oracle/oracle-database/23/jajdb/oracle/jdbc/OracleConnection.html) interface.
@@ -132,28 +152,41 @@ The sample code below executes as expected with the previous configuration.
132
152
133
153
### Password JSON Object
134
154
135
-
For the JSON type of provider (OCI Object Storage, HTTP/HTTPS, File) the password is an object itself with the following spec:
155
+
For the JSON type of provider (OCI Object Storage, HTTPS, File) the password is an object itself with the following spec:
136
156
137
-
- type
157
+
-`type`
138
158
- Mandatory
139
-
- Possible values
140
-
- ocivault
141
-
- azurevault
142
-
- base64
143
-
- awssecretsmanager
144
-
- value
159
+
- Possible values:
160
+
-`ocivault`
161
+
-`azurevault`
162
+
-`base64`
163
+
-`awssecretsmanager`
164
+
-`value`
145
165
- Mandatory
146
-
- Possible values
166
+
- Possible values:
147
167
- OCID of the secret (if ocivault)
148
168
- Azure Key Vault URI (if azurevault)
149
169
- Base64 Encoded password (if base64)
150
-
- AWS Secret name (if awssecretsmanager)
151
-
- Text
152
-
- authentication
153
-
- Optional (it will apply defaults in the same way as described in [Configuring Authentication](#configuring-authentication)).
154
-
- Possible Values
155
-
- method
156
-
- optional parameters (depends on the cloud provider, applies the same logic as [Config Provider for Azure](../ojdbc-provider-azure/README.md#config-provider-for-azure)).
170
+
- AWS resource name of the secret (if awssecretsmanager)
171
+
-`authentication`
172
+
- Optional. It will apply defaults in the same way as described in [Configuring Authentication](#configuring-authentication)
173
+
- Possible Values:
174
+
-`method`: equivalent to the 'AUTHENTICATION' Param Value in [Configuring Authentication](#configuring-authentication)
175
+
- Optional parameters: depends on the cloud provider. Equivalent to the Optional Parameters in [Configuring Authentication](#configuring-authentication)
176
+
177
+
### Wallet_location JSON Object
178
+
179
+
The "oracle.net.wallet_location" connection property is not allowed in the "jdbc" object due to security reasons. Instead, users should use the "wallet_location" object to specify the wallet in the configuration.
180
+
181
+
For the JSON type of provider (OCI Object Storage, HTTPS, File) the wallet_location is an object itself with the same spec as the [password JSON object](#password-json-object) mentioned above.
182
+
183
+
The value stored in the secret should be the Base64 representation of the bytes in cwallet.sso. This is equivalent to setting the "oracle.net.wallet_location" connection property in a regular JDBC application using the following format:
184
+
185
+
```
186
+
data:;base64,<Base64 representation of the bytes in cwallet.sso>
187
+
```
188
+
189
+
<i>*Note: When storing a wallet as a secret in OCI Vault, choose the Plain-Text secret type template instead of Base64 to prevent double decoding when the provider retrieves the value.</i>
157
190
158
191
## OCI Vault Config Provider
159
192
Apart from OCI Object Storage, users can also store JSON Payload in the content of OCI Vault Secret. Users need to indicate the OCID of the Secret with the following syntax:
@@ -226,9 +259,36 @@ in Optional Parameters</td>
226
259
## Caching configuration
227
260
228
261
Config providers in this module store the configuration in caches to minimize
229
-
the number of RPC requests to remote location. See
230
-
[Caching configuration](../ojdbc-provider-azure/README.md#caching-configuration) for more
231
-
details of the caching mechanism.
262
+
the number of RPC requests to remote location. Every stored items has a property
263
+
that defines the time-to-live (TTL) value. When TTL expires, the configuration
264
+
becomes "softly expired" and the stored configuration will be refreshed by a
265
+
background thread. If configuration cannot be refreshed, it can still be used
266
+
for another 30 minutes until it becomes "hardly expired". In other words, it takes
267
+
24 hours and 30 minutes for configuration before it becomes completely expired.
268
+
269
+
The default value of TTL is 24 hours, and it can be configured using the
270
+
"config_time_to_live" property in the unit of seconds.
271
+
An example of App Configuration in Azure with TTL of 60 seconds is listed below.
272
+
273
+
<table>
274
+
<thead><tr>
275
+
<th>Key</th>
276
+
<th>Value</th>
277
+
</tr></thead>
278
+
<tbody><tr>
279
+
<td>user</td>
280
+
<td>myUsername</td>
281
+
</tr><tr>
282
+
<td>password</td>
283
+
<td>myPassword</td>
284
+
</tr><tr>
285
+
<td>connect_descriptor</td>
286
+
<td>myHost:5521/myService</td>
287
+
</tr><tr>
288
+
<td>config_time_to_live</td>
289
+
<td>60</td>
290
+
</tr></tbody>
291
+
</table>
232
292
233
293
## Database Connection String Provider
234
294
The Database Connection String Provider provides Oracle JDBC with the connection string of an
Copy file name to clipboardExpand all lines: ojdbc-provider-samples/src/main/java/oracle/jdbc/provider/aws/configuration/AwsSecretsManagerConfigurationExample.java
0 commit comments