oci-go-sdk
oci-go-sdk copied to clipboard
[Feature] Allow use private key to be outside of a file
Currently, common.ConfigurationProviderEnvironmentVariables takes a private key path. Also, the default option looks for the .oci file under a specific folder Would it be possible to add an option that allows private key string to be used to authenticate?
Hi @GustavoOS - Can you explain what is the usecase of passing a key string and not the file path ? We do not do that due to security concerns.
I have a Vercel Function written in Golang that I wish to create a bucket inside Object Storage with auto tiering. As that function is not hosted in OCI, the only way to authenticate it is to have the key inside a secret vault or using Vercel Environment variables.
The reason i have to do it with oracle sdk is because AWS Intelligent tiering maps to standard tier instead of auto tiering when using S3 compatibility API.
From my perspective, either way could solve my problem:
- Changing compatibility API so Intelligent Tiering maps to Auto Tiering
- Enabling the key to be hosted outside of a file
@GustavoOS You might want to look at the NewRawConfigurationProvider instead. Just lookup the env variables in your code use the following. NOTE: here the privateKey is the contents of a private key file.
provider := common.NewRawConfigurationProvider(
tenancy,
user,
region,
fingerprint,
privateKey,
nil,
)