Allow override signing key pass in oracle-bmcs

Adds pass_phrase property to the oracle-bmcs builder to allow users to
specify/override a pass phrase for the private key used to sign requests
to the BMCS API.
This commit is contained in:
Andrew Pryde 2017-02-14 10:58:38 +00:00
parent 25e4843a6f
commit 3c4ec2dc3e
2 changed files with 10 additions and 0 deletions

View File

@ -37,6 +37,7 @@ type Config struct {
Region string `mapstructure:"region"`
Fingerprint string `mapstructure:"fingerprint"`
KeyFile string `mapstructure:"key_file"`
PassPhrase string `mapstructure:"pass_phrase"`
AvailabilityDomain string `mapstructure:"availability_domain"`
CompartmentID string `mapstructure:"compartment_ocid"`
@ -114,6 +115,10 @@ func NewConfig(raws ...interface{}) (*Config, error) {
accessCfg.Fingerprint = c.Fingerprint
}
if c.PassPhrase != "" {
accessCfg.PassPhrase = c.PassPhrase
}
if c.KeyFile != "" {
accessCfg.KeyFile = c.KeyFile
accessCfg.Key, err = client.LoadPrivateKey(accessCfg)

View File

@ -85,6 +85,11 @@ builder.
[BMCS config file](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm)
if present.
- `pass_phrase` (string) - Pass phrase used to decrypt the private key used
to sign requests to the BMCS API. Overrides value provided by the
[BMCS config file](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm)
if present.
- `region` (string) - An Oracle Bare Metal Cloud Services region. Overrides
value provided by the
[BMCS config file](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/sdkconfig.htm)