I want to create pre-authenticated request for an object inside a bucket in the OCI object storage using python SDK. I found out that I can use get_preauthenticated_request for the bucket to put objects inside the bucket but not to get the objects pre-authenticated. I can create a pre-authenticated request using the OCI console but I need to do it in a python script. can anybody help me in this issue?
how to get a Pre-Authenticated request for an object in OCI object storage using python SDK?
1.8k views Asked by msaei At
1
You can use
create_preauthenticated_request
(see code) for both buckets and individual objects.The difference is in the access type:
ANY_OBJECT_WRITE
is for the whole bucketOBJECT_READ
,OBJECT_READ_WRITE
andOBJECT_WRITE
are for objectsSo you should be able to create a Pre-Authenticated Request with something like
You can find more on the request details here and for the request itself here.
Let me know if this works for you, I don't have an account to test against at the moment.