Skip to content

Commit

Permalink
CAPI-349 Add "User-Agent" header (#63)
Browse files Browse the repository at this point in the history
* set version and header

* update version

* go mod

---------

Co-authored-by: zl0ty <[email protected]>
  • Loading branch information
zl0ty and zl0ty authored Jan 15, 2025
1 parent d240913 commit 653bc0a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions cloudconnexa/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const (
ClientSecretEnvVar = "CLOUDCONNEXA_CLIENT_SECRET"
)

var (
version = "v0.5.1"
)

type Token struct {
AccessToken string `json:"access_token"`
}
Expand Down Expand Up @@ -80,6 +84,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData) (interface{}
clientSecret := d.Get("client_secret").(string)
baseUrl := d.Get("base_url").(string)
cloudConnexaClient, err := cloudconnexa.NewClient(baseUrl, clientId, clientSecret)
cloudConnexaClient.UserAgent = fmt.Sprintf("terraform-provider-cloudconnexa/%v", version)
var diags diag.Diagnostics
if err != nil {
diags = append(diags, diag.Diagnostic{
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module github.com/OpenVPN/terraform-provider-cloudconnexa

go 1.21
go 1.22.0

toolchain go1.22.5

require (
github.com/gruntwork-io/terratest v0.48.1
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-sdk/v2 v2.35.0
github.com/openvpn/cloudconnexa-go-client/v2 v2.0.18
github.com/openvpn/cloudconnexa-go-client/v2 v2.0.19
github.com/stretchr/testify v1.10.0
)

Expand Down Expand Up @@ -67,7 +68,7 @@ require (
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.8.0 // indirect
golang.org/x/time v0.9.0 // indirect
golang.org/x/tools v0.22.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zx
github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/openvpn/cloudconnexa-go-client/v2 v2.0.18 h1:1Z1j1xMx9wj0DTLsAMfX+Q25tHgSyDxXba5vgC62YOY=
github.com/openvpn/cloudconnexa-go-client/v2 v2.0.18/go.mod h1:bnKiUSuEp7J2K/o+gOxotF1m1Cx5dfVUE0GbWN5AXRY=
github.com/openvpn/cloudconnexa-go-client/v2 v2.0.19 h1:H2CaS5lS+3veaEMl2vNxg6Qq5pc30//XzSO2s0kBML4=
github.com/openvpn/cloudconnexa-go-client/v2 v2.0.19/go.mod h1:mtP+pmLDswipEZtuDDQP+fUOT7SHo56jxa/YZZUiJfc=
github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4=
github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down Expand Up @@ -210,8 +210,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg=
golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
Expand Down

0 comments on commit 653bc0a

Please sign in to comment.