Skip to content

Commit ce4800f

Browse files
Support and document OCI_REGION parameter for config-based providers (#209)
* Support and document OCI_REGION parameter for config-based providers * Clarify OCI_REGION usage beyond gov regions in documentation
1 parent af1047b commit ce4800f

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

ojdbc-provider-oci/README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,40 @@ in Optional Parameters</td>
278278
</tbody>
279279
</table>
280280

281-
<i>*Note: this parameter is introduced to align with entries of the config file. The region that is used for calling Object Storage, Database Tools Connection, and Secret services will be extracted from the Object Storage URL, Database Tools Connection OCID or Secret OCID</i>
281+
<i>*Note: The region that is used for calling Object Storage, Database Tools Connection, and Vault services may be inferred from the Object Storage URL, Database Tools Connection OCID, or Secret OCID. However, for interactive authentication (e.g., using <code>OCI_INTERACTIVE</code>), it is recommended to explicitly set <code>OCI_REGION</code> to ensure the login is directed to the correct realm (such as <code>oraclegovcloud.com</code> for government regions).</i>
282+
283+
### Additional Optional Parameters
284+
285+
The following parameters can be used alongside any supported authentication method to configure specific behaviors.
286+
287+
<table>
288+
<thead><tr>
289+
<th>Parameter Name</th>
290+
<th>Description</th>
291+
<th>Accepted Values</th>
292+
<th>Default Value</th>
293+
</tr></thead>
294+
<tbody>
295+
<tr>
296+
<td><code>OCI_REGION</code></td>
297+
<td>
298+
Specifies the OCI Region Identifier to be used for requests and interactive authentication.
299+
This allows targeting a specific region for login, which is especially useful when the region differs from the default behavior.<br>
300+
<i>For example, specifying <code>us-langley-1</code> will direct the login to
301+
<code>https://login.us-langley-1.oraclegovcloud.com/</code></i>
302+
</td>
303+
<td>
304+
A valid <a href="https://docs.oracle.com/en-us/iaas/Content/General/Concepts/regions.htm">region identifier</a>,
305+
such as <code>us-langley-1</code> or <code>ap-sydney-1</code>.
306+
</td>
307+
<td>
308+
<i>If not provided, the login URL will default to <code>https://login.oci.oraclecloud.com</code>,
309+
which may not work for your target region.</i>
310+
</td>
311+
</tr>
312+
</tbody>
313+
</table>
314+
282315

283316
## Caching configuration
284317

ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciConfigurationParameters.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
package oracle.jdbc.provider.oci.configuration;
4040

41+
import com.oracle.bmc.Region;
4142
import oracle.jdbc.provider.oci.authentication.AuthenticationDetailsFactory;
4243
import oracle.jdbc.provider.oci.authentication.AuthenticationMethod;
4344
import oracle.jdbc.provider.parameter.Parameter;
@@ -92,6 +93,7 @@ private OciConfigurationParameters(){}
9293
.addParameter("OCI_FINGERPRINT", FINGERPRINT)
9394
.addParameter("OCI_KEY_FILE", PRIVATE_KEY)
9495
.addParameter("OCI_PASS_PHRASE", PASS_PHRASE)
96+
.addParameter("OCI_REGION", REGION, null, Region::fromRegionCodeOrId)
9597
.addParameter("OCI_INSTANCE_PRINCIPAL_TIMEOUT", INSTANCE_PRINCIPAL_TIMEOUT,
9698
5,
9799
s -> {

0 commit comments

Comments
 (0)