-
Notifications
You must be signed in to change notification settings - Fork 8
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
base: main
Are you sure you want to change the base?
Conversation
ojdbc-provider-oci/README.md
Outdated
<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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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 :)
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! |
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 usingOCI_INTERACTIVE
in non-default realms.