Skip to content

Support and document OCI_REGION parameter for config-based providers #209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MouhsinElmajdouby
Copy link
Member

For config-based providers (e.g., config-ociobject, config-ocivault), the OCI_REGION parameter was not previously supported or documented. This caused issues with interactive authentication in government or non-OC1 regions, where requests were incorrectly routed to https://login.oci.oraclecloud.com instead of the correct region-specific login endpoint.

This PR adds support for the OCI_REGION parameter in centralized config providers and updates the README to document it as a common optional parameter. The documentation now clarifies that OCI_REGION should be explicitly set when using OCI_INTERACTIVE in non-default realms.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 29, 2025
@MouhsinElmajdouby MouhsinElmajdouby self-assigned this Jul 29, 2025
<td><code>OCI_REGION</code></td>
<td>
Specifies the OCI Region Identifier to be used for requests and interactive authentication.
This is especially important in government or non-OC1 regions to ensure authentication is routed correctly.<br>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is important to allow using a region that's different than the one of the user's region. Right? If that's true, I think we can remove the 'government' comment.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Updated the description to cover all regions, not just gov.

@@ -92,6 +93,7 @@ private OciConfigurationParameters(){}
.addParameter("OCI_FINGERPRINT", FINGERPRINT)
.addParameter("OCI_KEY_FILE", PRIVATE_KEY)
.addParameter("OCI_PASS_PHRASE", PASS_PHRASE)
.addParameter("OCI_REGION", REGION, null, Region::fromRegionCodeOrId)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change only for the configuration provider? How about the other providers? For example: the token provider.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this change is only for the configuration providers. For resource providers, the region parameter is already supported and documented in their section of the README.

Copy link
Member

@Michael-A-McMahon Michael-A-McMahon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this fix! The changes all appear correct to me.
Please wait for @ting-lan-wang to weigh in on this, b/c they know a lot more config providers and region settings than I do :)

@ting-lan-wang
Copy link
Member

ting-lan-wang commented Jul 31, 2025

For config-based providers, we previously configured OCI_REGION via environment variables, using the OCI_DEFAULT authentication method, or by setting in $HOME/.oci/config. The changes address the issue and look good on my end. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants