Skip to content

Commit

Permalink
Backport 1.9: add PR #34 and #35 (#51)
Browse files Browse the repository at this point in the history
* Allow for system & user-assigned identity auth & misc (#50)

- Update to go1.17.6
- Rev dependencies
- Use 2021-11-01 compute client sdk
- Remove unused params & address other codestyle issues

Fix #35

* Use object ID for the logical name (#34)

Co-authored-by: Jonas-Taha El Sesiy <[email protected]>
Co-authored-by: cccs-ob <[email protected]>
  • Loading branch information
3 people authored Feb 17, 2022
1 parent 3283185 commit 64d90e5
Show file tree
Hide file tree
Showing 11 changed files with 444 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1

references:
images:
golang: &GO_IMAGE docker.mirror.hashicorp.services/cimg/go:1.17.2
golang: &GO_IMAGE docker.mirror.hashicorp.services/cimg/go:1.17.6

jobs:
make-test:
Expand Down
4 changes: 2 additions & 2 deletions azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync"
"time"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/azure/auth"
Expand All @@ -28,7 +28,7 @@ type computeClient interface {
}

type vmssClient interface {
Get(ctx context.Context, resourceGroup, vmssName string) (compute.VirtualMachineScaleSet, error)
Get(ctx context.Context, resourceGroup, vmssName string, expandTypes compute.ExpandTypesForGetVMScaleSets) (compute.VirtualMachineScaleSet, error)
}

type tokenVerifier interface {
Expand Down
4 changes: 2 additions & 2 deletions azure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"fmt"
"strings"

"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-07-01/compute"
"github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2021-11-01/compute"
"github.com/coreos/go-oidc"
)

Expand Down Expand Up @@ -51,7 +51,7 @@ func (c *mockComputeClient) Get(_ context.Context, _, vmName string, _ compute.I
return compute.VirtualMachine{}, nil
}

func (c *mockVMSSClient) Get(_ context.Context, _, vmssName string) (compute.VirtualMachineScaleSet, error) {
func (c *mockVMSSClient) Get(_ context.Context, _, vmssName string, _ compute.ExpandTypesForGetVMScaleSets) (compute.VirtualMachineScaleSet, error) {
if c.vmssClientFunc != nil {
return c.vmssClientFunc(vmssName)
}
Expand Down
4 changes: 2 additions & 2 deletions backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// Factory is used by framework
func Factory(ctx context.Context, c *logical.BackendConfig) (logical.Backend, error) {
b := backend(c)
b := backend()
if err := b.Setup(ctx, c); err != nil {
return nil, err
}
Expand All @@ -25,7 +25,7 @@ type azureAuthBackend struct {
provider provider
}

func backend(c *logical.BackendConfig) *azureAuthBackend {
func backend() *azureAuthBackend {
b := new(azureAuthBackend)

b.Backend = &framework.Backend{
Expand Down
2 changes: 1 addition & 1 deletion backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func getTestBackendWithComputeClient(t *testing.T, c computeClientFunc, v vmssCl
},
StorageView: &logical.InmemStorage{},
}
b := backend(config)
b := backend()
err := b.Setup(context.Background(), config)
if err != nil {
t.Fatalf("unable to create backend: %v", err)
Expand Down
75 changes: 64 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,74 @@
module github.com/hashicorp/vault-plugin-auth-azure

go 1.15
go 1.17

require (
github.com/Azure/azure-sdk-for-go v58.3.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.21
github.com/Azure/go-autorest/autorest/azure/auth v0.5.8
github.com/Azure/azure-sdk-for-go v61.4.0+incompatible
github.com/Azure/go-autorest/autorest v0.11.24
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11
github.com/Azure/go-autorest/autorest/to v0.4.0
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/hashicorp/errwrap v1.1.0
github.com/hashicorp/go-cleanhttp v0.5.2
github.com/hashicorp/go-hclog v1.0.0
github.com/hashicorp/vault/api v1.3.0
github.com/hashicorp/go-hclog v1.1.0
github.com/hashicorp/vault/api v1.3.1
github.com/hashicorp/vault/sdk v0.3.0
github.com/pquerna/cachecontrol v0.0.0-20201205024021-ac21108117ac // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
)

require (
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/armon/go-metrics v0.3.10 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
github.com/fatih/color v1.13.0 // indirect
github.com/golang-jwt/jwt/v4 v4.2.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-kms-wrapping/entropy v0.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.4.3 // indirect
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/mlock v0.1.2 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.2 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/go-version v1.4.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/crypto v0.0.0-20220208050332-20e1d8d225ab // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220207234003-57398862261d // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220207185906-7721543eae58 // indirect
google.golang.org/grpc v1.44.0 // indirect
google.golang.org/protobuf v1.27.1 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
)
Loading

0 comments on commit 64d90e5

Please sign in to comment.