You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The common.DefaultConfigProvider() in the OCI Go SDK is failing to properly read an encrypted private key from the default configuration file, while the OCI CLI works correctly with the same configuration.
Environment
OCI Go SDK Version: v65.75.2
Go Version: go1.22.4 darwin/arm64
Steps to Reproduce
Set up an OCI configuration file at ~/.oci/config with an encrypted private key:
This command succeeds and returns a list of compartments
Go code
package main
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"github.com/oracle/oci-go-sdk/v65/identity"
)
func main() {
configProvider := common.DefaultConfigProvider()
ic, err := identity.NewIdentityClientWithConfigurationProvider(configProvider)
if err != nil {
fmt.Printf("Failed to create identity client: %v\n", err)
return
}
fmt.Println("Successfully created identity client")
}
Expected Behavior
The Go program should successfully create an identity client, just as the CLI is able to use the same configuration to make API calls.
Actual Behavior
The Go program fails with an error:
can not create client, bad configuration: did not find a proper configuration for private key
Additional Context
The private key is encrypted, and the passphrase is provided in the config file.
The OCI CLI works correctly with this configuration, indicating that the file paths and permissions are correct.
Attempts to use ConfigurationProviderFromFileWithProfile with the passphrase explicitly provided also fail.
Attempts to use NewRawConfigurationProvider fails too with private key parsing error.
Questions
Does the SDK need an unencrypted private key file to be passed?
Are there any environment variables that need to be set for the SDK to correctly use the passphrase?
Is there a difference in how the CLI and the SDK read the configuration that could explain this discrepancy?
The text was updated successfully, but these errors were encountered:
No We don't have a workaround. but my team is working on adding this support which is currently in testing phase. We are targeting a release by end of this month.
The common.DefaultConfigProvider() in the OCI Go SDK is failing to properly read an encrypted private key from the default configuration file, while the OCI CLI works correctly with the same configuration.
Environment
OCI Go SDK Version: v65.75.2
Go Version: go1.22.4 darwin/arm64
Steps to Reproduce
This command succeeds and returns a list of compartments
Expected Behavior
The Go program should successfully create an identity client, just as the CLI is able to use the same configuration to make API calls.
Actual Behavior
The Go program fails with an error:
Additional Context
Questions
The text was updated successfully, but these errors were encountered: