Skip to content

Commit

Permalink
Expose ConfigurationProvider in Oracle Providers
Browse files Browse the repository at this point in the history
  • Loading branch information
srpurani committed Oct 1, 2021
1 parent fab91a5 commit 3709d46
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 25 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require (
github.com/go-openapi/validate v0.19.12
github.com/golang/mock v1.4.4
github.com/mitchellh/go-homedir v1.1.0
github.com/oracle/oci-go-sdk/v28 v28.0.0 // indirect
github.com/oracle/oci-go-sdk/v48 v48.0.0
github.com/stretchr/testify v1.6.1
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897
Expand Down
6 changes: 0 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,6 @@ github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/oracle/oci-go-sdk v1.8.0 h1:4SO45bKV0I3/Mn1os3ANDZmV0eSE5z5CLdSUIkxtyzs=
github.com/oracle/oci-go-sdk v24.3.0+incompatible h1:x4mcfb4agelf1O4/1/auGlZ1lr97jXRSSN5MxTgG/zU=
github.com/oracle/oci-go-sdk/v28 v28.0.0 h1:19QPbl+gCbgU3hFGwOS4hRNpM3A+86Xf9mPLdu/wUlk=
github.com/oracle/oci-go-sdk/v28 v28.0.0/go.mod h1:wpcs8ZqLlnn+SisD7SV959mncC58IZOMKAEM7yUlFPQ=
github.com/oracle/oci-go-sdk/v47 v47.1.0 h1:oXkuD18OpcE2bsl6AHMJWKcoPcQrsFq7TiNzCuDiRU8=
github.com/oracle/oci-go-sdk/v47 v47.1.0/go.mod h1:kO/m5/YgYWrCnLqdudqvhKEUxexwGR2hc6Mogu+8QZw=
github.com/oracle/oci-go-sdk/v48 v48.0.0 h1:ux/bkBFIHOPWhcCxx/c67jTIr/TDGJGRKn5rW6zqy1s=
github.com/oracle/oci-go-sdk/v48 v48.0.0/go.mod h1:eCa0yXKSofRr/J5fv8pqnxX72yTG2FkbBkL5vC2RXuQ=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
Expand Down
13 changes: 7 additions & 6 deletions provider/oracle/cloudshell_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,13 @@ func NewCSProvider(configSource provider.ConfigSource, passphraseSource provider
ociClient.Host = apiUrl.String()

return &OracleProvider{
FnApiUrl: apiUrl,
Signer: signer,
Interceptor: interceptor,
DisableCerts: disableCerts,
CompartmentID: compartmentID,
ociClient: ociClient,
FnApiUrl: apiUrl,
Signer: signer,
Interceptor: interceptor,
DisableCerts: disableCerts,
CompartmentID: compartmentID,
ConfigurationProvider: configProvider,
ociClient: ociClient,
}, nil
}

Expand Down
13 changes: 7 additions & 6 deletions provider/oracle/ip_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,12 @@ func NewIPProvider(configSource provider.ConfigSource, passphraseSource provider
}

return &OracleProvider{
FnApiUrl: apiUrl,
Signer: common.DefaultRequestSigner(configProvider),
Interceptor: nil,
DisableCerts: disableCerts,
CompartmentID: compartmentID,
ociClient: ociClient,
FnApiUrl: apiUrl,
Signer: common.DefaultRequestSigner(configProvider),
Interceptor: nil,
DisableCerts: disableCerts,
CompartmentID: compartmentID,
ConfigurationProvider: configProvider,
ociClient: ociClient,
}, nil
}
3 changes: 3 additions & 0 deletions provider/oracle/oracle_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ type OracleProvider struct {
// CompartmentID is the ocid of the functions compartment ID for a given function
CompartmentID string

// ConfigurationProvider is the OCI configuration provider for signing requests
ConfigurationProvider common.ConfigurationProvider

ociClient functions.FunctionsManagementClient
}

Expand Down
13 changes: 7 additions & 6 deletions provider/oracle/user_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ func NewFromConfig(configSource provider.ConfigSource, passphraseSource provider
}

return &OracleProvider{
FnApiUrl: apiUrl,
Signer: oci.DefaultRequestSigner(configProvider),
Interceptor: nil,
DisableCerts: disableCerts,
CompartmentID: compartmentID,
ociClient: ociClient,
FnApiUrl: apiUrl,
Signer: oci.DefaultRequestSigner(configProvider),
Interceptor: nil,
DisableCerts: disableCerts,
CompartmentID: compartmentID,
ConfigurationProvider: configProvider,
ociClient: ociClient,
}, nil
}

Expand Down

0 comments on commit 3709d46

Please sign in to comment.