Repository navigation
OCI: returned URLs have an unexpanded endpoint template in the host - #59
Merged
Merged
Conversation
On an OCI store with no endpoint configured, the location returned by
UploadFile and the link returned by PresignedURL had a host such as
objectstorage.us-chicago-1.{dualStack?ds.oci.:}oraclecloud.com, so they
could not be fetched. Uploads and other object operations were unaffected.
oci-go-sdk v65.126.1 adds the {dualStack?...} option to the Object Storage
endpoint template and fills it in per request on a copy of the client, so
client.Host keeps the raw template. NewOCI now fills in the endpoint options
with common.UpdateEndpointTemplateForOptions on a copy before saving the host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
milos-lk
approved these changes
Oct 22, 2026
pksgit
added a commit
to livekit/egress
that referenced
this pull request
Oct 23, 2026
OCI upload locations and presigned URLs had an unexpanded endpoint template in the host. Fixed in livekit/storage#59. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks
On an OCI store with no
endpointconfigured, every URL the store returns is unusable:UploadFile, e.g.https://objectstorage.us-chicago-1.%7BdualStack%3Fds.oci.:%7Doraclecloud.com/n/<ns>/b/<bucket>/o/<key>PresignedURLThe host is not a valid hostname, so these URLs can't be fetched, and Go's
url.Parserejects them outright ("invalid port"). Anything that stores these URLs or hands them to users gets links that don't open. The upload itself succeeds, and removing the{dualStack...}segment by hand gives a working link.Not affected: object operations (put, get, list, delete, exists), which the SDK sends to the correct host, and stores with
endpointset.This starts with oci-go-sdk v65.126.1, which this module has required since #51.
Cause
v65.126.1 adds a
{dualStack?ds.oci.:}option to the Object Storage endpoint template. The SDK fills it in on a copy of the client for each request, soclient.Hostkeeps the raw template, andNewOCIsaved that raw value as the host it builds URLs from.Fix
NewOCIfills in the endpoint options withcommon.UpdateEndpointTemplateForOptionson a copy of the client before saving the host, the same way the SDK does for each request. The URL host is thenobjectstorage.<region>.oraclecloud.com, orobjectstorage.<region>.ds.oci.oraclecloud.comwhen dual-stack is enabled.TestOCILocationHostchecks the host of a returned location; it fails on main with the parse error above.Not covered
With
OCI_REALM_SPECIFIC_SERVICE_ENDPOINT_TEMPLATE_ENABLED, the oc1 template also has{namespaceName+Dot}, which still ends up in the saved host. That predates this change.🤖 Generated with Claude Code