OCI Object Storage: scenarios 403 Forbidden When Accessing Pre-Signed URL with Python SDK
I've spent hours debugging this and I'm building a feature where I'm performance testing and Hey everyone, I'm running into an issue that's driving me crazy... I'm currently working on an application that generates pre-signed URLs for my objects stored in OCI Object Storage, but I'm working with a `403 Forbidden` behavior when trying to access the pre-signed URL. Here's a snippet of the code I'm using to generate the pre-signed URL: ```python import oci config = oci.config.from_file("~/.oci/config") # Load OCI configuration object_storage_client = oci.object_storage.ObjectStorageClient(config) bucket_name = 'my_bucket' object_name = 'my_object' namespace = object_storage_client.get_namespace().data pre_signed_url = object_storage_client.generate_pre_signed_url( namespace_name=namespace, bucket_name=bucket_name, object_name=object_name, expiry_seconds=3600 # URL valid for 1 hour ) print(pre_signed_url) ``` When I try to access the generated URL, I get the following behavior: ``` 403 Forbidden ``` I have verified that the object `my_object` does exist in `my_bucket`. I've also checked the IAM policies and the user has the required permissions to access the bucket. Here are the relevant IAM policies set up: ``` Allow group my_group to manage objects in compartment my_compartment Allow group my_group to read buckets in compartment my_compartment ``` Additionally, I've tested generating the URL with a different object and got the same behavior. I suspect that there might be an scenario with the way I'm generating the pre-signed URL or perhaps the configuration of the Object Storage service itself. Has anyone faced a similar scenario or could offer insights into what might be going wrong? For context: I'm using Python on Linux. Any suggestions would be helpful. I'm coming from a different tech stack and learning Python. Any ideas how to fix this? I'm working with Python in a Docker container on macOS.