Skip to content
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

Automatic Region Configuration for OCI Access Token Provider #82

Open
Michael-A-McMahon opened this issue May 28, 2024 · 1 comment
Open
Assignees

Comments

@Michael-A-McMahon
Copy link
Member

Database OCIDs contain a region, such as "ca-toronto-1" seen here: ocid1.autonomousdatabase.oc1.ca-toronto-1.....
The OCI Access Token provider should be able to parse this region and configure the OCI SDK client to use it when requesting a token. This would ensure that the client is always using the correct region, and won't spit out 404 error at our users.

The fix for this issue should reuse existing code that can parse a region from an OCID. I believe it is already is being used for object storage OCIDs.

Currently, the provider will use a region read from a OCI config profile. This region may be different from that of the ADB, so it is not always the correct choice.

User's can configure a region parameter to resolve this issue, but this places the burden on them, when it's not necessary to do so. More over, the 404 error really doesn't clue the user in to the fact that they need to configure a region in the first place. Automatically parsing and setting the region could save a lot of headaches for our users.

@Michael-A-McMahon
Copy link
Member Author

Fleshing this out just a bit more:

  • It would only be possible to parse a region when the scope parameter is a URN that contains a database OCID. If the URN does not contain it, then the provider just continues to do what it does now.
  • There is no existing URN parser, so that code would need to be added. I don't think it would be tremendously complicated though.
  • Connection String and TLS providers are also configured with a database OCID, so the fix for this issue should bring automatic region configuration for these providers, along with the token provider.

@Michael-A-McMahon Michael-A-McMahon self-assigned this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant