Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3b6d46e87 |
No files matched your search
@@ -1,11 +0,0 @@
|
||||
## PCI review checklist
|
||||
|
||||
<!-- heimdall_github_prtemplate:grc-pci_dss-2024-01-05 -->
|
||||
|
||||
- [ ] I have documented a clear reason for, and description of, the change I am making.
|
||||
|
||||
- [ ] If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
|
||||
|
||||
- [ ] If applicable, I've documented the impact of any changes to security controls.
|
||||
|
||||
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.
|
||||
+1
-4
@@ -15,7 +15,4 @@
|
||||
# vendor/
|
||||
|
||||
# Test credentials and other items
|
||||
/plugin/private*
|
||||
|
||||
# vscode settings
|
||||
.vscode
|
||||
/plugin/private/*
|
||||
@@ -1,4 +0,0 @@
|
||||
# These owners will be the default owners for everything in
|
||||
# the repo, unless a later match takes precedence.
|
||||
|
||||
* @hashicorp/boundary
|
||||
@@ -1,5 +1,3 @@
|
||||
Copyright IBM Corp. 2021, 2025
|
||||
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ This repo contains a Host-type plugin for [HashiCorp
|
||||
Boundary](https://www.boundaryproject.io/) allowing dynamically sourcing hosts
|
||||
from Azure.
|
||||
|
||||
Host sets created with this plugin define filters which select and group Virtual Machines
|
||||
and Virtual Machine instances enscapsulated in both Flexible and Uniform Virtual Machine Scale Sets.
|
||||
These host sets can in turn be added to targets within Boundary as host sources.
|
||||
Host sets created with this plugin define filters which select and group like VM
|
||||
resources within Azure; these host sets can in turn be added to targets within
|
||||
Boundary as host sources.
|
||||
|
||||
At creation or update of a host catalog of this type, configuration of the
|
||||
plugin is performed via the attribute/secret values passed to the create or
|
||||
@@ -15,6 +15,8 @@ are indicated below with the valid fields.
|
||||
|
||||
Current limitations of this plugin:
|
||||
|
||||
- Only VMs can be added to host sets through this plugin, not any other type of
|
||||
compute resource
|
||||
- A client secret must be generated against a registered application with any
|
||||
necessary permissions
|
||||
- For now, credential rotation must be disabled using the `disable_credential_rotation`
|
||||
@@ -74,7 +76,7 @@ The following attributes are valid on an Azure host Set resource:
|
||||
|
||||
## Filters
|
||||
|
||||
Azure Resource Manager is used to find matching VMs and VM Scale Sets before their details are
|
||||
Azure Resource Manager is used to find matching VMs before their details are
|
||||
looked up. There are some limitations with the filtering syntax; specifically,
|
||||
when using tags, other types of filters (such as on resource type) are not
|
||||
allowed. As a result, it will generally be useful to filter directly on tag
|
||||
|
||||
@@ -1,59 +1,63 @@
|
||||
module github.com/hashicorp/boundary-plugin-azure
|
||||
module github.com/hashicorp/boundary-plugin-host-azure
|
||||
|
||||
go 1.23.0
|
||||
go 1.17
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible
|
||||
github.com/Azure/go-autorest/autorest v0.11.28
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11
|
||||
github.com/hashicorp/boundary/sdk v0.0.31
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7
|
||||
github.com/Azure/azure-sdk-for-go v59.2.0+incompatible
|
||||
github.com/Azure/go-autorest/autorest v0.11.22
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.9
|
||||
github.com/hashicorp/boundary/sdk v0.0.14-0.20220309214551-bb4528aa139b
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.2
|
||||
github.com/kr/pretty v0.3.0
|
||||
github.com/manicminer/hamilton v0.46.0
|
||||
github.com/mitchellh/mapstructure v1.5.0
|
||||
github.com/stretchr/testify v1.8.2
|
||||
golang.org/x/sync v0.12.0
|
||||
google.golang.org/grpc v1.56.3
|
||||
google.golang.org/protobuf v1.33.0
|
||||
github.com/manicminer/hamilton v0.33.0
|
||||
github.com/mitchellh/mapstructure v1.4.2
|
||||
github.com/stretchr/testify v1.7.0
|
||||
google.golang.org/protobuf v1.27.1
|
||||
)
|
||||
|
||||
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/adal v0.9.14 // indirect
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 // indirect
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
|
||||
github.com/Azure/go-autorest/autorest/to v0.4.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/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/dimchansky/utfbom v1.1.1 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
|
||||
github.com/golang/protobuf v1.5.3 // indirect
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/eventlogger v0.1.2-0.20230227112545-f26a3bdf6871 // indirect
|
||||
github.com/hashicorp/eventlogger/filters/encrypt v0.1.8-0.20230227112545-f26a3bdf6871 // indirect
|
||||
github.com/hashicorp/eventlogger v0.1.1-0.20211106154408-4ff8da3a890c // indirect
|
||||
github.com/hashicorp/eventlogger/filters/encrypt v0.1.6-0.20220309214434-500febbe5843 // indirect
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
|
||||
github.com/hashicorp/go-kms-wrapping/v2 v2.0.9-0.20230228185604-529de2006180 // indirect
|
||||
github.com/hashicorp/go-kms-wrapping/v2 v2.0.0 // indirect
|
||||
github.com/hashicorp/go-kms-wrapping/wrappers/aead/v2 v2.0.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
|
||||
github.com/hashicorp/go-retryablehttp v0.7.0 // indirect
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 // indirect
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.3 // indirect
|
||||
github.com/hashicorp/go-uuid v1.0.2 // indirect
|
||||
github.com/hashicorp/go-version v1.3.0 // indirect
|
||||
github.com/kr/text v0.2.0 // indirect
|
||||
github.com/mitchellh/copystructure v1.2.0 // indirect
|
||||
github.com/mitchellh/go-homedir v1.1.0 // indirect
|
||||
github.com/mitchellh/pointerstructure v1.2.1 // indirect
|
||||
github.com/mitchellh/pointerstructure v1.2.0 // indirect
|
||||
github.com/mitchellh/reflectwalk v1.0.2 // indirect
|
||||
github.com/pmezard/go-difflib v1.0.0 // indirect
|
||||
github.com/rogpeppe/go-internal v1.6.2 // indirect
|
||||
github.com/rogpeppe/go-internal v1.8.1 // indirect
|
||||
github.com/ryanuber/go-glob v1.0.0 // indirect
|
||||
golang.org/x/crypto v0.36.0 // indirect
|
||||
golang.org/x/net v0.38.0 // indirect
|
||||
golang.org/x/oauth2 v0.27.0 // indirect
|
||||
golang.org/x/sys v0.31.0 // indirect
|
||||
golang.org/x/text v0.23.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c // indirect
|
||||
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect
|
||||
golang.org/x/text v0.3.7 // indirect
|
||||
google.golang.org/appengine v1.6.7 // indirect
|
||||
google.golang.org/genproto v0.0.0-20220208230804-65c12eb4c068 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
|
||||
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
|
||||
google.golang.org/grpc v1.44.0
|
||||
)
|
||||
@@ -31,24 +31,25 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl
|
||||
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible h1:bmmC38SlE8/E81nNADlgmVGurPWMHDX2YNXVQMrBpEE=
|
||||
github.com/Azure/azure-sdk-for-go v66.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
github.com/Azure/azure-sdk-for-go v59.2.0+incompatible h1:mbxiZy1K820hQ+dI+YIO/+a0wQDYqOu18BAGe4lXjVk=
|
||||
github.com/Azure/azure-sdk-for-go v59.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
|
||||
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
|
||||
github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc=
|
||||
github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM=
|
||||
github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ=
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 h1:P6bYXFoao05z5uhOQzbC3Qd8JqF3jUoocoTeIxkp2cA=
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11/go.mod h1:84w/uV8E37feW2NCJ08uT9VBfjfUHpgLVnG2InYD6cg=
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 h1:0W/yGmFdTIT77fvdlGZ0LMISoLHFJ7Tx4U0yeB+uFs4=
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5/go.mod h1:ADQAXrkgm7acgWVUNamOgh8YNrv4p27l3Wc55oVfpzg=
|
||||
github.com/Azure/go-autorest/autorest v0.11.19/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA=
|
||||
github.com/Azure/go-autorest/autorest v0.11.22 h1:bXiQwDjrRmBQOE67bwlvUKAC1EU1yZTPQ38c+bstZws=
|
||||
github.com/Azure/go-autorest/autorest v0.11.22/go.mod h1:BAWYUWGPEtKPzjVkp0Q6an0MJcJDsoh5Z1BFAEFs4Xs=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.13/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.14 h1:G8hexQdV5D4khOXrWG2YuLCFKhWYmWD8bHYaXN5ophk=
|
||||
github.com/Azure/go-autorest/autorest/adal v0.9.14/go.mod h1:W/MM4U6nLxnIskrw4UwWzlHfGjwUS50aOsc/I3yuU8M=
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.9 h1:Y2CgdzitFDsdMwYMzf9LIZWrrTFysqbRc7b94XVVJ78=
|
||||
github.com/Azure/go-autorest/autorest/azure/auth v0.5.9/go.mod h1:hg3/1yw0Bq87O3KvvnJoAh34/0zbP7SFizX/qN5JvjU=
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.4.2 h1:dMOmEJfkLKW/7JsokJqkyoYSgmR08hi9KrhjZb+JALY=
|
||||
github.com/Azure/go-autorest/autorest/azure/cli v0.4.2/go.mod h1:7qkJkT+j6b+hIpzMOwPChJhTqS8VbsqqgULzMNRugoM=
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
|
||||
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw=
|
||||
github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU=
|
||||
github.com/Azure/go-autorest/autorest/to v0.4.0 h1:oXVqrxakqqV1UZdSazDOPOLvOIz+XA683u8EctwboHk=
|
||||
github.com/Azure/go-autorest/autorest/to v0.4.0/go.mod h1:fE8iZBn7LQR7zH/9XU2NcPR4o9jEImooCeWJcYV/zLE=
|
||||
github.com/Azure/go-autorest/autorest/validation v0.3.1 h1:AgyqjAd94fwNAoTjl/WQXg4VvFeRFpO+UhNyRXqF1ac=
|
||||
@@ -59,45 +60,54 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM
|
||||
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
|
||||
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g=
|
||||
github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
|
||||
github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA=
|
||||
github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM=
|
||||
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
|
||||
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
|
||||
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
|
||||
github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y=
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
|
||||
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
|
||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI=
|
||||
github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
|
||||
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
|
||||
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
|
||||
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
|
||||
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
|
||||
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8=
|
||||
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
|
||||
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
|
||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
|
||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
|
||||
github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
|
||||
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
|
||||
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
|
||||
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk=
|
||||
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
|
||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-test/deep v1.0.4 h1:u2CU3YKy9I2pmu9pX0eq50wCgjfGIt539SqR7FbHiho=
|
||||
github.com/go-test/deep v1.0.4/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.2 h1:YtQM7lnr8iZ+j5q71MGKkNw9Mn7AjHM68uc9g5fXeUI=
|
||||
github.com/golang-jwt/jwt/v4 v4.5.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||
@@ -122,10 +132,10 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
@@ -137,8 +147,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
@@ -149,75 +159,79 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf
|
||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/hashicorp/boundary/sdk v0.0.31 h1:KAPWpic7UFSUc/V4BDOVmXBYtSbSHKwAVrDXA8u/CxE=
|
||||
github.com/hashicorp/boundary/sdk v0.0.31/go.mod h1:6SNSerq1eWX35xsC2NE3VLmFzMjsllCbaVXE7dsueaI=
|
||||
github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
github.com/hashicorp/boundary/sdk v0.0.14-0.20220309214551-bb4528aa139b h1:7xwNP6W9BOIyFz4GQgjtEoSiKyFf9bFhavfxGQfuGoo=
|
||||
github.com/hashicorp/boundary/sdk v0.0.14-0.20220309214551-bb4528aa139b/go.mod h1:eRiwdUEhOgBLLY18iC/s3phlKWp4w0XjQUkjBxl1RkU=
|
||||
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||
github.com/hashicorp/eventlogger v0.1.2-0.20230227112545-f26a3bdf6871 h1:F5Q9e2zB5xxItZKb7PI3+DVRHajMyVXnulBgbnQqcDU=
|
||||
github.com/hashicorp/eventlogger v0.1.2-0.20230227112545-f26a3bdf6871/go.mod h1://CHt6/j+Q2lc0NlUB5af4aS2M0c0aVBg9/JfcpAyhM=
|
||||
github.com/hashicorp/eventlogger/filters/encrypt v0.1.8-0.20230227112545-f26a3bdf6871 h1:PETLEST31DMXHOibJLl/nvcc5Tz4mo6eaXdCxT+lebQ=
|
||||
github.com/hashicorp/eventlogger/filters/encrypt v0.1.8-0.20230227112545-f26a3bdf6871/go.mod h1:EQPLoX6CONA9BSYUovTQBHfPGE91g7wOxv03sO29FzY=
|
||||
github.com/hashicorp/eventlogger v0.1.0/go.mod h1:a3IXf1aEJfpCPzseTOrwKj4fVW/Qn3oEmpQeaIznzH0=
|
||||
github.com/hashicorp/eventlogger v0.1.1-0.20211106154408-4ff8da3a890c h1:u1Zq+LfTXaagmJCHK3XH/fi7pk7oRY933VjGNG7/Ynw=
|
||||
github.com/hashicorp/eventlogger v0.1.1-0.20211106154408-4ff8da3a890c/go.mod h1:NaXU8p/pl5a2RX/N0/yncinT3Iw5CLkbF4JRxAVnk3c=
|
||||
github.com/hashicorp/eventlogger/filters/encrypt v0.1.6-0.20220309214434-500febbe5843 h1:b1TEFbvQ4xQcAHU6tTr0U3SWIHVVNqJIyDZ2nZ8k608=
|
||||
github.com/hashicorp/eventlogger/filters/encrypt v0.1.6-0.20220309214434-500febbe5843/go.mod h1:xnr17kr1vsNHHY4ZAN+dCQ421uMXQ49PA7mBzk49wIA=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
|
||||
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
|
||||
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
|
||||
github.com/hashicorp/go-hclog v1.6.3 h1:Qr2kF+eVWjTiYmU7Y31tYlP1h0q/X3Nl3tPGdaB11/k=
|
||||
github.com/hashicorp/go-hclog v1.6.3/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||
github.com/hashicorp/go-kms-wrapping/plugin/v2 v2.0.4-0.20230228185604-529de2006180 h1:IiTnT/t7PXQjGGm9PW9IfvSohCG+pY2hsttdMsgNm9g=
|
||||
github.com/hashicorp/go-kms-wrapping/plugin/v2 v2.0.4-0.20230228185604-529de2006180/go.mod h1:RZme+h7iDhMMn77JTAhE+AWlIbMXK6QOeHhBnW3ncU0=
|
||||
github.com/hashicorp/go-kms-wrapping/v2 v2.0.9-0.20230228185604-529de2006180 h1:HtAdVRTzteZYPBGPNpi3M6+EaCWFicoHr7DZwz5kNtk=
|
||||
github.com/hashicorp/go-kms-wrapping/v2 v2.0.9-0.20230228185604-529de2006180/go.mod h1:iRHxwFG8L24HhemSuvDYtuwVkjkl+OkTLvQ5bmqzAqE=
|
||||
github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-hclog v1.1.0 h1:QsGcniKx5/LuX2eYoeL+Np3UKYPNaN7YKpTh29h8rbw=
|
||||
github.com/hashicorp/go-hclog v1.1.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ=
|
||||
github.com/hashicorp/go-kms-wrapping/plugin/v2 v2.0.0 h1:8qUXiUcayCr1RxMzS/D0DK1TPFTlpP8z3cWSR3BUf8E=
|
||||
github.com/hashicorp/go-kms-wrapping/plugin/v2 v2.0.0/go.mod h1:bmYifnHykiAB5yR+FK9fNjvE0GzE1Ev2F4eMTVourcA=
|
||||
github.com/hashicorp/go-kms-wrapping/v2 v2.0.0 h1:hKWzjzqfUi1HtpBEJ9tLKlRya1u6kRQGZAW9OFR+ia8=
|
||||
github.com/hashicorp/go-kms-wrapping/v2 v2.0.0/go.mod h1:H+TfVXu/Eyi6Ccs4EoT8pa3gR5lRh12sw4AOq6XkXCg=
|
||||
github.com/hashicorp/go-kms-wrapping/wrappers/aead/v2 v2.0.0 h1:fcqS+xjtWjBKKFIo1Dx34frnQVtVgxbbyc9Lv/OwTbA=
|
||||
github.com/hashicorp/go-kms-wrapping/wrappers/aead/v2 v2.0.0/go.mod h1:YdrJE0Yqex9DoLBiS0rcfXOQdZKL9j9QJmb+B6rob1g=
|
||||
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||
github.com/hashicorp/go-plugin v1.4.9 h1:ESiK220/qE0aGxWdzKIvRH69iLiuN/PjoLTm69RoWtU=
|
||||
github.com/hashicorp/go-plugin v1.4.9/go.mod h1:viDMjcLJuDui6pXb8U4HVfb8AamCWhHGUjr2IrTF67s=
|
||||
github.com/hashicorp/go-plugin v1.4.3 h1:DXmvivbWD5qdiBts9TpBC7BYL1Aia5sxbRgQB+v6UZM=
|
||||
github.com/hashicorp/go-plugin v1.4.3/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.0 h1:eu1EI/mbirUgP5C8hVsTNaGZreBDlYiwC1FZWkvQPQ4=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.0/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7 h1:C8hUCYzor8PIfXHa4UrZkU4VvK8o9ISHxT2Q8+VepXU=
|
||||
github.com/hashicorp/go-retryablehttp v0.7.7/go.mod h1:pkQpWZeYWskR+D1tR2O5OcBFOxfA7DoAO6xtkuQnHTk=
|
||||
github.com/hashicorp/go-secure-stdlib/base62 v0.1.1/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw=
|
||||
github.com/hashicorp/go-secure-stdlib/base62 v0.1.2 h1:ET4pqyjiGmY09R5y+rSd70J2w45CtbWDNvGqWp/R3Ng=
|
||||
github.com/hashicorp/go-secure-stdlib/base62 v0.1.2/go.mod h1:EdWO6czbmthiwZ3/PUsDV+UD1D5IRU4ActiaWGwt0Yw=
|
||||
github.com/hashicorp/go-secure-stdlib/configutil/v2 v2.0.7 h1:b1VFIL6LpAh7iVCoQdoZtXAHqfAClpGsESfZULhfGm0=
|
||||
github.com/hashicorp/go-secure-stdlib/configutil/v2 v2.0.7/go.mod h1:3SpPba0gPDe21iawzV368GMEKJyG+MU7NgFwjW33w5o=
|
||||
github.com/hashicorp/go-secure-stdlib/listenerutil v0.1.5 h1:+vfyObZczNFbpGxHJWTZ+ZdTEF9boRal5rAkwKTc2yg=
|
||||
github.com/hashicorp/go-secure-stdlib/listenerutil v0.1.5/go.mod h1:MSXg3Md+eg1hOJFSKuTELy6YnFhfMJBVYu7t07BdPc4=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7 h1:UpiO20jno/eV1eVZcxqWnUohyKRe1g8FPV/xH1s/2qs=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.7/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8=
|
||||
github.com/hashicorp/go-secure-stdlib/pluginutil/v2 v2.0.3 h1:2RnQ/iL17y9FIwGR+ZaPj7fMn2uzdZT+T5ptCi97q8c=
|
||||
github.com/hashicorp/go-secure-stdlib/pluginutil/v2 v2.0.3/go.mod h1:M+NBT0f9tDBLuhZFAwUwQjAcxMLmwEyHiPQm1O2pBVs=
|
||||
github.com/hashicorp/go-secure-stdlib/configutil/v2 v2.0.0 h1:RtZP+7D6ZWtL1l/dFr3dUnCyLzJD2yWXn3E/5Lp3iy8=
|
||||
github.com/hashicorp/go-secure-stdlib/configutil/v2 v2.0.0/go.mod h1:Sw46o0V6HEv///9IZuszp6hG4ZSLZjQ5nImXU4Byx9g=
|
||||
github.com/hashicorp/go-secure-stdlib/listenerutil v0.1.4 h1:6ajbq64FhrIJZ6prrff3upVVDil4yfCrnSKwTH0HIPE=
|
||||
github.com/hashicorp/go-secure-stdlib/listenerutil v0.1.4/go.mod h1:myX7XYMJRIP4PLHtYJiKMTJcKOX0M5ZJNwP0iw+l3uw=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.1/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.2 h1:Tz6v3Jb2DRnDCfifRSjYKG0m8dLdNq6bcDkB41en7nw=
|
||||
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.2/go.mod h1:QmrqtbKuxxSWTN3ETMPuB+VtEiBJ/A9XhoYGv8E1uD8=
|
||||
github.com/hashicorp/go-secure-stdlib/pluginutil/v2 v2.0.0 h1:TszfJJ1vJWdvPkPxYivP5TUTkOaXziE1jTKGmfOck94=
|
||||
github.com/hashicorp/go-secure-stdlib/pluginutil/v2 v2.0.0/go.mod h1:Io+g8iYs//ESo5x2Gy1rTTYaIHUyCZD7h16K7DiOUI4=
|
||||
github.com/hashicorp/go-secure-stdlib/reloadutil v0.1.1 h1:SMGUnbpAcat8rIKHkBPjfv81yC46a8eCNZ2hsR2l1EI=
|
||||
github.com/hashicorp/go-secure-stdlib/reloadutil v0.1.1/go.mod h1:Ch/bf00Qnx77MZd49JRgHYqHQjtEmTgGU2faufpVZb0=
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.1 h1:nd0HIW15E6FG1MsnArYaHfuw9C2zgzM8LxkG5Ty/788=
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.1/go.mod h1:gKOamz3EwoIoJq7mlMIRBpVTAUn8qPCrEclOKKWhD3U=
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 h1:kes8mmyCpxJsI7FTwtzRqEy9CdjCtrXrXGuOpxEA7Ts=
|
||||
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2/go.mod h1:Gou2R9+il93BqX25LAKCLuM+y9U2T4hlwvT1yprcna4=
|
||||
github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.2 h1:phcbL8urUzF/kxA/Oj6awENaRwfWsjP59GW7u2qlDyY=
|
||||
github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.2/go.mod h1:l8slYwnJA26yBz+ErHpp2IRCLr0vuOMGBORIz4rRiAs=
|
||||
github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1 h1:Yc026VyMyIpq1UWRnakHRG01U8fJm+nEfEmjoAb00n8=
|
||||
github.com/hashicorp/go-secure-stdlib/tlsutil v0.1.1/go.mod h1:l8slYwnJA26yBz+ErHpp2IRCLr0vuOMGBORIz4rRiAs=
|
||||
github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc=
|
||||
github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A=
|
||||
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
|
||||
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
|
||||
github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||
github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw=
|
||||
github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
|
||||
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
|
||||
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
|
||||
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M=
|
||||
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
|
||||
github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw=
|
||||
github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk=
|
||||
github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg=
|
||||
github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA=
|
||||
github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA=
|
||||
github.com/jefferai/isbadcipher v0.0.0-20190226160619-51d2077c035f h1:E87tDTVS5W65euzixn7clSzK66puSt1H4I5SC0EmHH4=
|
||||
github.com/jefferai/isbadcipher v0.0.0-20190226160619-51d2077c035f/go.mod h1:3J2qVK16Lq8V+wfiL2lPeDZ7UWMxk5LemerHa1p6N00=
|
||||
github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
|
||||
github.com/jhump/protoreflect v1.8.1/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg=
|
||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
@@ -229,70 +243,77 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/manicminer/hamilton v0.46.0 h1:ag0xqWnALt9uQSfrrrXuQvm6puV8y+LghJQD32lzW+M=
|
||||
github.com/manicminer/hamilton v0.46.0/go.mod h1:lbVyngC+/nCWuDp8UhC6Bw+bh7jcP/E+YwqzHTmzemk=
|
||||
github.com/manicminer/hamilton v0.33.0 h1:G58jBVHg2qsJqb5cPJ3tKzWj3JTf8gW3r5+4RmnEa0E=
|
||||
github.com/manicminer/hamilton v0.33.0/go.mod h1:QryxpD/4+cdKuXNi0UjLDvgxYdP0LLmYz7dYU7DAX4U=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
|
||||
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
|
||||
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-isatty v0.0.13 h1:qdl+GuBjcsKKDco5BsxPJlId98mSWNKqYA+Co0SC1yA=
|
||||
github.com/mattn/go-isatty v0.0.13/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng=
|
||||
github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4=
|
||||
github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw=
|
||||
github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4=
|
||||
github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw=
|
||||
github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw=
|
||||
github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s=
|
||||
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
|
||||
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
|
||||
github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
|
||||
github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0=
|
||||
github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI=
|
||||
github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
|
||||
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
|
||||
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw=
|
||||
github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
|
||||
github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo=
|
||||
github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
|
||||
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
|
||||
github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
|
||||
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
|
||||
github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=
|
||||
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/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso=
|
||||
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
|
||||
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
|
||||
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
|
||||
github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo=
|
||||
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
|
||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.6.2 h1:aIihoIOHCiLZHxyoNQ+ABL4NKhFTgKLBdMLyEAh98m0=
|
||||
github.com/rogpeppe/go-internal v1.6.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rogpeppe/go-internal v1.8.1 h1:geMPLpDpQOgVyCg5z5GoRwLHepNdb71NXb67XFkP+Eg=
|
||||
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
|
||||
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
|
||||
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
|
||||
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
|
||||
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
|
||||
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
|
||||
go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo=
|
||||
go.uber.org/goleak v1.0.0/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
@@ -300,11 +321,12 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
|
||||
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -338,6 +360,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB
|
||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
@@ -366,17 +390,17 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R
|
||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
|
||||
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
|
||||
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c h1:pkQiBZBvdos9qq4wBAHqlzuZHEXo07pqV06ef90u1WI=
|
||||
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||
golang.org/x/oauth2 v0.27.0 h1:da9Vo7/tDv5RH/7nZDz1eMGS/q1Vv1N/7FCrBhI9I3M=
|
||||
golang.org/x/oauth2 v0.27.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
@@ -386,11 +410,11 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
|
||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
|
||||
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -399,9 +423,11 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -413,22 +439,28 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
|
||||
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a h1:ppl5mZgokTT8uPkmYOyEUmPTr3ypaKkg5eFOGrAmxxE=
|
||||
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
|
||||
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
|
||||
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@@ -469,16 +501,19 @@ golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWc
|
||||
golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||
golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||
golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
|
||||
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
@@ -502,7 +537,9 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
|
||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||
google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||
@@ -526,14 +563,16 @@ google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfG
|
||||
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
|
||||
google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
|
||||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
|
||||
google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
|
||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A=
|
||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU=
|
||||
google.golang.org/genproto v0.0.0-20220208230804-65c12eb4c068 h1:pwzFiZfBTH/GjBWz1BcDwMBaHBo8mZvpLa7eBKJpFAk=
|
||||
google.golang.org/genproto v0.0.0-20220208230804-65c12eb4c068/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
|
||||
google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||
@@ -546,8 +585,10 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa
|
||||
google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
|
||||
google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||
google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc=
|
||||
google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||
google.golang.org/grpc v1.44.0 h1:weqSxi/TMs1SqFRMHCtBgXRs8k3X39QIDEZ0pRcttUg=
|
||||
google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@@ -558,19 +599,23 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
|
||||
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
||||
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
|
||||
+2
-55
@@ -1,6 +1,3 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
@@ -11,7 +8,7 @@ import (
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/network/mgmt/network"
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/resources"
|
||||
"github.com/manicminer/hamilton/environments"
|
||||
hauth "github.com/manicminer/hamilton/auth"
|
||||
"github.com/manicminer/hamilton/msgraph"
|
||||
)
|
||||
|
||||
@@ -65,56 +62,6 @@ func getVirtualMachinesClient(opt ...Option) (*compute.VirtualMachinesClient, er
|
||||
return &client, nil
|
||||
}
|
||||
|
||||
func getVirtualMachineScaleSetsClient(opt ...Option) (*compute.VirtualMachineScaleSetsClient, error) {
|
||||
opts, err := getOpts(opt...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error parsing ops: %w", err)
|
||||
}
|
||||
if opts.withSubscriptionId == "" {
|
||||
return nil, errors.New("subscription id is empty")
|
||||
}
|
||||
if opts.withAuthorizer == nil {
|
||||
return nil, errors.New("authorizer is nil")
|
||||
}
|
||||
var client compute.VirtualMachineScaleSetsClient
|
||||
switch opts.withBaseUrl {
|
||||
case "":
|
||||
client = compute.NewVirtualMachineScaleSetsClient(opts.withSubscriptionId)
|
||||
default:
|
||||
client = compute.NewVirtualMachineScaleSetsClientWithBaseURI(opts.withBaseUrl, opts.withSubscriptionId)
|
||||
}
|
||||
client.Authorizer = opts.withAuthorizer
|
||||
if err := client.AddToUserAgent(opts.withUserAgent); err != nil {
|
||||
return nil, fmt.Errorf("error adding identifier to user-agent: %w", err)
|
||||
}
|
||||
return &client, nil
|
||||
}
|
||||
|
||||
func getVirtualMachineScaleSetVMsClient(opt ...Option) (*compute.VirtualMachineScaleSetVMsClient, error) {
|
||||
opts, err := getOpts(opt...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error parsing ops: %w", err)
|
||||
}
|
||||
if opts.withSubscriptionId == "" {
|
||||
return nil, errors.New("subscription id is empty")
|
||||
}
|
||||
if opts.withAuthorizer == nil {
|
||||
return nil, errors.New("authorizer is nil")
|
||||
}
|
||||
var client compute.VirtualMachineScaleSetVMsClient
|
||||
switch opts.withBaseUrl {
|
||||
case "":
|
||||
client = compute.NewVirtualMachineScaleSetVMsClient(opts.withSubscriptionId)
|
||||
default:
|
||||
client = compute.NewVirtualMachineScaleSetVMsClientWithBaseURI(opts.withBaseUrl, opts.withSubscriptionId)
|
||||
}
|
||||
client.Authorizer = opts.withAuthorizer
|
||||
if err := client.AddToUserAgent(opts.withUserAgent); err != nil {
|
||||
return nil, fmt.Errorf("error adding identifier to user-agent: %w", err)
|
||||
}
|
||||
return &client, nil
|
||||
}
|
||||
|
||||
func getNetworkInterfacesClient(opt ...Option) (*network.InterfacesClient, error) {
|
||||
opts, err := getOpts(opt...)
|
||||
if err != nil {
|
||||
@@ -170,7 +117,7 @@ func getApplicationsClient(ctx context.Context, authzInfo *AuthorizationInfo) (*
|
||||
return nil, errors.New("empty auth config id when fetching service principals client")
|
||||
}
|
||||
|
||||
authorizer, err := authzInfo.HamiltonConfig.NewAuthorizer(ctx, environments.Global.MsGraph)
|
||||
authorizer, err := authzInfo.HamiltonConfig.NewAuthorizer(ctx, hauth.MsGraph)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching hauth authorizer when fetching service principals client: %w", err)
|
||||
}
|
||||
|
||||
+14
-25
@@ -1,33 +1,22 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
const (
|
||||
// Azure service constants
|
||||
constMsComputeService = "Microsoft.Compute"
|
||||
constMsNetworkService = "Microsoft.Network"
|
||||
constSubscriptions = "subscriptions"
|
||||
constResourceGroups = "resourceGroups"
|
||||
constProviders = "providers"
|
||||
|
||||
// Resource type constants
|
||||
constVirtualMachinesResource = "virtualMachines"
|
||||
constVirtualMachineScaleSetsResource = "virtualMachineScaleSets"
|
||||
constNetworkInterfacesResource = "networkInterfaces"
|
||||
constPublicIpAddressesResource = "publicIPAddresses"
|
||||
|
||||
// Field constants
|
||||
constBaseUrl = "base_url"
|
||||
constFilter = "filter"
|
||||
constSecretId = "secret_id"
|
||||
constSubscriptionId = "subscription_id"
|
||||
constClientId = "client_id"
|
||||
constSecretValue = "secret_value"
|
||||
constCredsLastRotatedTime = "creds_last_rotated_time"
|
||||
constDisableCredentialRotation = "disable_credential_rotation"
|
||||
constSubscriptionId = "subscription_id"
|
||||
constSecretId = "secret_id"
|
||||
constTenantId = "tenant_id"
|
||||
constClientId = "client_id"
|
||||
constBaseUrl = "base_url"
|
||||
|
||||
// Worker pool configuration
|
||||
constDefaultWorkers = 1000
|
||||
constDefaultFilter = "resourceType eq 'Microsoft.Compute/virtualMachines'"
|
||||
constMsComputeService = "Microsoft.Compute"
|
||||
constVirtualMachinesResource = "virtualMachines"
|
||||
constMsNetworkService = "Microsoft.Network"
|
||||
constNetworkInterfacesResource = "networkInterfaces"
|
||||
constPublicIpAddressesResource = "publicIPAddresses"
|
||||
constSubscriptions = "subscriptions"
|
||||
constResourceGroups = "resourceGroups"
|
||||
constProviders = "providers"
|
||||
constDisableCredentialRotation = "disable_credential_rotation"
|
||||
)
|
||||
@@ -1,280 +0,0 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/network/mgmt/network"
|
||||
)
|
||||
|
||||
type networkInfo struct {
|
||||
IpAddresses []string
|
||||
}
|
||||
|
||||
// Common interface for IP configuration processing
|
||||
type networkProcessor interface {
|
||||
processIPConfigurations(ctx context.Context, ipConfigs []network.InterfaceIPConfiguration, ifName string) (*networkInfo, error)
|
||||
getPublicIPAddress(ctx context.Context, publicIPRef *network.PublicIPAddress, ipConf *network.InterfaceIPConfiguration, ifName string) (string, error)
|
||||
getNetworkInterface(ctx context.Context, interfaceID string) (*network.Interface, string, error)
|
||||
}
|
||||
|
||||
// Standard VM network processor
|
||||
type vmNetworkProcessor struct {
|
||||
clients *azureClients
|
||||
resourceGroup string
|
||||
}
|
||||
|
||||
// VMSS network processor
|
||||
type vmssNetworkProcessor struct {
|
||||
clients *azureClients
|
||||
resourceGroup string
|
||||
vmssName string
|
||||
instanceID string
|
||||
}
|
||||
|
||||
func processNetworkProfile(
|
||||
ctx context.Context,
|
||||
interfaces []compute.NetworkInterfaceReference,
|
||||
processor networkProcessor,
|
||||
targetInfo *networkInfo,
|
||||
) error {
|
||||
|
||||
for _, ifaceRef := range interfaces {
|
||||
if ifaceRef.ID == nil {
|
||||
return fmt.Errorf("nil ID for network interface")
|
||||
}
|
||||
|
||||
iface, ifName, err := processor.getNetworkInterface(ctx, *ifaceRef.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if iface.InterfacePropertiesFormat == nil || iface.InterfacePropertiesFormat.IPConfigurations == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
networkInfo, err := processor.processIPConfigurations(ctx, *iface.InterfacePropertiesFormat.IPConfigurations, ifName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
targetInfo.IpAddresses = append(targetInfo.IpAddresses, networkInfo.IpAddresses...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *vmNetworkProcessor) getNetworkInterface(ctx context.Context, interfaceID string) (*network.Interface, string, error) {
|
||||
ifResGroup, ifName, err := splitId(interfaceID, constMsNetworkService, constNetworkInterfacesResource)
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("error splitting network interface id %q: %w", interfaceID, err)
|
||||
}
|
||||
|
||||
iface, err := p.clients.ifClient.Get(ctx, ifResGroup, ifName, "")
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("error fetching network interface: %w", err)
|
||||
}
|
||||
|
||||
return &iface, ifName, nil
|
||||
}
|
||||
|
||||
func (p *vmNetworkProcessor) processIPConfigurations(
|
||||
ctx context.Context,
|
||||
ipConfigs []network.InterfaceIPConfiguration,
|
||||
ifName string,
|
||||
) (
|
||||
*networkInfo,
|
||||
error,
|
||||
) {
|
||||
tempInfo := &networkInfo{}
|
||||
for _, ipconf := range ipConfigs {
|
||||
// Process private IP
|
||||
if ipconf.PrivateIPAddress != nil {
|
||||
tempInfo.IpAddresses = append(tempInfo.IpAddresses, *ipconf.PrivateIPAddress)
|
||||
}
|
||||
|
||||
// Process public IP if available
|
||||
if ipconf.PublicIPAddress != nil {
|
||||
ipAddress, err := p.getPublicIPAddress(ctx, ipconf.PublicIPAddress, &ipconf, ifName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tempInfo.IpAddresses = append(tempInfo.IpAddresses, ipAddress)
|
||||
}
|
||||
}
|
||||
return tempInfo, nil
|
||||
}
|
||||
|
||||
func (p *vmNetworkProcessor) getPublicIPAddress(
|
||||
ctx context.Context,
|
||||
publicIP *network.PublicIPAddress,
|
||||
ipConf *network.InterfaceIPConfiguration,
|
||||
ifName string,
|
||||
) (
|
||||
string,
|
||||
error,
|
||||
) {
|
||||
if publicIP.ID == nil {
|
||||
return "", fmt.Errorf("ip configuration has public IP address info but nil id")
|
||||
}
|
||||
|
||||
ipResGroup, ipName, err := splitId(*publicIP.ID, constMsNetworkService, constPublicIpAddressesResource)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error splitting public ip address id: %w", err)
|
||||
}
|
||||
|
||||
pipInfo, err := p.clients.pipClient.Get(ctx, ipResGroup, ipName, "")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error fetching public IP information: %w", err)
|
||||
}
|
||||
|
||||
if pipInfo.PublicIPAddressPropertiesFormat == nil {
|
||||
return "", fmt.Errorf("nil public ip address properties format for public ip %q", *publicIP.ID)
|
||||
}
|
||||
|
||||
if pipInfo.PublicIPAddressPropertiesFormat.IPAddress == nil {
|
||||
return "", fmt.Errorf("nil IP address for public ip %q", *publicIP.ID)
|
||||
}
|
||||
|
||||
return *pipInfo.PublicIPAddressPropertiesFormat.IPAddress, nil
|
||||
}
|
||||
|
||||
func (p *vmssNetworkProcessor) getNetworkInterface(ctx context.Context, interfaceID string) (*network.Interface, string, error) {
|
||||
ifName := extractResourceSuffix(interfaceID)
|
||||
|
||||
iface, err := p.clients.ifClient.GetVirtualMachineScaleSetNetworkInterface(
|
||||
ctx,
|
||||
p.resourceGroup,
|
||||
p.vmssName,
|
||||
p.instanceID,
|
||||
ifName,
|
||||
"")
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("error fetching VMSS network interface: %w", err)
|
||||
}
|
||||
|
||||
return &iface, ifName, nil
|
||||
}
|
||||
|
||||
func (p *vmssNetworkProcessor) processIPConfigurations(
|
||||
ctx context.Context,
|
||||
ipConfigs []network.InterfaceIPConfiguration,
|
||||
ifName string,
|
||||
) (
|
||||
*networkInfo,
|
||||
error,
|
||||
) {
|
||||
tempInfo := &networkInfo{}
|
||||
for _, ipconf := range ipConfigs {
|
||||
if ipconf.PrivateIPAddress != nil {
|
||||
tempInfo.IpAddresses = append(tempInfo.IpAddresses, *ipconf.PrivateIPAddress)
|
||||
}
|
||||
|
||||
if ipconf.PublicIPAddress != nil {
|
||||
ipAddress, err := p.getPublicIPAddress(ctx, ipconf.PublicIPAddress, &ipconf, ifName)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tempInfo.IpAddresses = append(tempInfo.IpAddresses, ipAddress)
|
||||
}
|
||||
}
|
||||
return tempInfo, nil
|
||||
}
|
||||
|
||||
func (p *vmssNetworkProcessor) getPublicIPAddress(
|
||||
ctx context.Context,
|
||||
publicIP *network.PublicIPAddress,
|
||||
ipConf *network.InterfaceIPConfiguration,
|
||||
ifName string,
|
||||
) (
|
||||
string,
|
||||
error,
|
||||
) {
|
||||
if publicIP == nil || publicIP.ID == nil || ipConf.Name == nil {
|
||||
return "", fmt.Errorf("invalid public IP configuration")
|
||||
}
|
||||
|
||||
pipName := extractResourceSuffix(*publicIP.ID)
|
||||
pipInfo, err := p.clients.pipClient.GetVirtualMachineScaleSetPublicIPAddress(
|
||||
ctx,
|
||||
p.resourceGroup,
|
||||
p.vmssName,
|
||||
p.instanceID,
|
||||
ifName,
|
||||
*ipConf.Name,
|
||||
pipName,
|
||||
"")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error fetching public IP information: %w", err)
|
||||
}
|
||||
|
||||
if pipInfo.PublicIPAddressPropertiesFormat == nil {
|
||||
return "", fmt.Errorf("nil public ip address properties format")
|
||||
}
|
||||
|
||||
if pipInfo.PublicIPAddressPropertiesFormat.IPAddress == nil {
|
||||
return "", fmt.Errorf("nil IP address for public ip %q", *publicIP.ID)
|
||||
}
|
||||
|
||||
return *pipInfo.PublicIPAddressPropertiesFormat.IPAddress, nil
|
||||
}
|
||||
|
||||
func processVMNetworkInterfaces(
|
||||
ctx context.Context,
|
||||
vm compute.VirtualMachine,
|
||||
clients *azureClients,
|
||||
resourceGroup string,
|
||||
netInfo *networkInfo,
|
||||
) error {
|
||||
|
||||
if vm.VirtualMachineProperties == nil || vm.VirtualMachineProperties.NetworkProfile == nil {
|
||||
return fmt.Errorf("error fetching network profile")
|
||||
}
|
||||
|
||||
processor := &vmNetworkProcessor{
|
||||
clients: clients,
|
||||
resourceGroup: resourceGroup,
|
||||
}
|
||||
|
||||
return processNetworkProfile(ctx, *vm.VirtualMachineProperties.NetworkProfile.NetworkInterfaces, processor, netInfo)
|
||||
}
|
||||
|
||||
func processVMSSNetworkInterfaces(
|
||||
ctx context.Context,
|
||||
vmssvm compute.VirtualMachineScaleSetVM,
|
||||
resourceGroup, vmssName string,
|
||||
clients *azureClients,
|
||||
netInfo *networkInfo,
|
||||
) error {
|
||||
|
||||
if vmssvm.VirtualMachineScaleSetVMProperties == nil ||
|
||||
vmssvm.VirtualMachineScaleSetVMProperties.NetworkProfile == nil {
|
||||
return fmt.Errorf("error fetching network profile")
|
||||
}
|
||||
|
||||
if vmssvm.InstanceID == nil {
|
||||
return fmt.Errorf("instance ID is nil")
|
||||
}
|
||||
|
||||
processor := &vmssNetworkProcessor{
|
||||
clients: clients,
|
||||
resourceGroup: resourceGroup,
|
||||
vmssName: vmssName,
|
||||
instanceID: *vmssvm.InstanceID,
|
||||
}
|
||||
|
||||
return processNetworkProfile(ctx,
|
||||
*vmssvm.VirtualMachineScaleSetVMProperties.NetworkProfile.NetworkInterfaces, processor, netInfo)
|
||||
}
|
||||
|
||||
// extractResourceSuffix extracts the resource name from the end of an Azure resource ID
|
||||
func extractResourceSuffix(resourceID string) string {
|
||||
parts := strings.Split(resourceID, "/")
|
||||
if len(parts) > 0 {
|
||||
return parts[len(parts)-1]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
|
||||
+288
-374
@@ -1,8 +1,3 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
// Package plugin implements the Azure host plugin for Boundary,
|
||||
// providing functionality to manage and list Azure hosts.
|
||||
package plugin
|
||||
|
||||
import (
|
||||
@@ -10,20 +5,17 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/network/mgmt/network"
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/resources"
|
||||
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostcatalogs"
|
||||
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostsets"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/types/known/structpb"
|
||||
|
||||
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostcatalogs"
|
||||
"github.com/hashicorp/boundary/sdk/pbs/controller/api/resources/hostsets"
|
||||
pb "github.com/hashicorp/boundary/sdk/pbs/plugin"
|
||||
)
|
||||
|
||||
@@ -33,19 +25,37 @@ type AzurePlugin struct {
|
||||
}
|
||||
|
||||
// Ensure that we are implementing HostPluginServiceServer
|
||||
var _ pb.HostPluginServiceServer = (*AzurePlugin)(nil)
|
||||
var (
|
||||
_ pb.HostPluginServiceServer = (*AzurePlugin)(nil)
|
||||
)
|
||||
|
||||
type SetAttributes struct {
|
||||
Filter string `mapstructure:"filter"`
|
||||
}
|
||||
|
||||
type azureClients struct {
|
||||
resClient *resources.Client
|
||||
vmClient *compute.VirtualMachinesClient
|
||||
vmssClient *compute.VirtualMachineScaleSetsClient
|
||||
vmssvmClient *compute.VirtualMachineScaleSetVMsClient
|
||||
ifClient *network.InterfacesClient
|
||||
pipClient *network.PublicIPAddressesClient
|
||||
func rotateCredFromCallback(ctx context.Context, catalog *hostcatalogs.HostCatalog) (*pb.HostCatalogPersisted, error) {
|
||||
authzInfo, err := getAuthorizationInfo(catalog)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting hauth config when creating catalog: %w", err)
|
||||
}
|
||||
newPass, err := rotateCredential(ctx, authzInfo)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error rotating credentials when creating catalog: %w", err)
|
||||
}
|
||||
if newPass == nil {
|
||||
return nil, errors.New("new credential back from rotate is nil")
|
||||
}
|
||||
newSecrets, err := structpb.NewStruct(map[string]interface{}{
|
||||
constSecretId: *newPass.KeyId,
|
||||
constSecretValue: *newPass.SecretText,
|
||||
constCredsLastRotatedTime: time.Now().Format(time.RFC3339Nano),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error formatting new credential data as struct")
|
||||
}
|
||||
return &pb.HostCatalogPersisted{
|
||||
Secrets: newSecrets,
|
||||
}, err
|
||||
}
|
||||
|
||||
func (p *AzurePlugin) OnCreateCatalog(_ context.Context, req *pb.OnCreateCatalogRequest) (*pb.OnCreateCatalogResponse, error) {
|
||||
@@ -81,10 +91,13 @@ func (p *AzurePlugin) OnUpdateCatalog(_ context.Context, req *pb.OnUpdateCatalog
|
||||
}
|
||||
currentCatalog := req.GetCurrentCatalog()
|
||||
if currentCatalog == nil {
|
||||
// Should never happen
|
||||
return nil, status.Error(codes.FailedPrecondition, "current catalog is nil")
|
||||
}
|
||||
secrets := req.GetNewCatalog().GetSecrets()
|
||||
if secrets == nil {
|
||||
// If new secrets weren't passed in, don't rotate what we have on
|
||||
// update.
|
||||
return &pb.OnUpdateCatalogResponse{}, nil
|
||||
}
|
||||
if err := validateSecrets(secrets); err != nil {
|
||||
@@ -126,161 +139,10 @@ func (p *AzurePlugin) OnUpdateSet(_ context.Context, req *pb.OnUpdateSetRequest)
|
||||
|
||||
func (p *AzurePlugin) ListHosts(ctx context.Context, req *pb.ListHostsRequest) (*pb.ListHostsResponse, error) {
|
||||
if len(req.GetSets()) == 0 {
|
||||
// Nothing to fetch
|
||||
return &pb.ListHostsResponse{}, nil
|
||||
}
|
||||
|
||||
// Initialize Azure clients and authorization
|
||||
clients, err := p.initializeAzureResources(req.GetCatalog(), req.GetPersisted().GetSecrets())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Find matching resources and map them to sets
|
||||
vmResources, vmssResources, resourceToSetMap, err := p.findMatchingResources(ctx, req.GetSets(), clients.resClient)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Create mutex and errgroup for parallel processing
|
||||
mu := &sync.Mutex{}
|
||||
vmToNetworkMap := make(map[string]networkInfo)
|
||||
g, ctx := errgroup.WithContext(ctx)
|
||||
|
||||
// Process standard VMs in parallel if they exist
|
||||
if len(vmResources) > 0 {
|
||||
g.Go(func() error {
|
||||
vmNetworkMap, err := p.processStandardVMs(ctx, vmResources, clients)
|
||||
if err != nil {
|
||||
return fmt.Errorf("processing VMs: %w", err)
|
||||
}
|
||||
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
for k, v := range vmNetworkMap {
|
||||
vmToNetworkMap[k] = v
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// Process VMSS in parallel if they exist
|
||||
if len(vmssResources) > 0 {
|
||||
g.Go(func() error {
|
||||
vmssNetworkMap, err := p.processVMScaleSets(ctx, vmssResources, clients)
|
||||
if err != nil {
|
||||
return fmt.Errorf("processing VMSS: %w", err)
|
||||
}
|
||||
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
for k, v := range vmssNetworkMap {
|
||||
vmToNetworkMap[k] = v
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// Wait for all goroutines to complete and check for errors
|
||||
if err := g.Wait(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
response := buildHostsResponse(vmToNetworkMap, resourceToSetMap)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func rotateCredFromCallback(ctx context.Context, catalog *hostcatalogs.HostCatalog) (*pb.HostCatalogPersisted, error) {
|
||||
authzInfo, err := getAuthorizationInfo(catalog)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting auth config when creating catalog: %w", err)
|
||||
}
|
||||
newPass, err := rotateCredential(ctx, authzInfo)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error rotating credentials when creating catalog: %w", err)
|
||||
}
|
||||
if newPass == nil {
|
||||
return nil, errors.New("new credential back from rotate is nil")
|
||||
}
|
||||
newSecrets, err := structpb.NewStruct(map[string]interface{}{
|
||||
constSecretId: *newPass.KeyId,
|
||||
constSecretValue: *newPass.SecretText,
|
||||
constCredsLastRotatedTime: time.Now().Format(time.RFC3339Nano),
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error formatting new credential data as struct")
|
||||
}
|
||||
return &pb.HostCatalogPersisted{
|
||||
Secrets: newSecrets,
|
||||
}, err
|
||||
}
|
||||
|
||||
func buildHostsResponse(
|
||||
vmToNetworkMap map[string]networkInfo,
|
||||
resourceToSetMap map[string][]string) *pb.ListHostsResponse {
|
||||
|
||||
ret := &pb.ListHostsResponse{}
|
||||
|
||||
for resourceID, networkInfo := range vmToNetworkMap {
|
||||
host, err := createHostFromResource(resourceID, networkInfo, resourceToSetMap)
|
||||
if err != nil {
|
||||
fmt.Printf("Error creating host from resource: %v\n", err)
|
||||
continue
|
||||
}
|
||||
ret.Hosts = append(ret.Hosts, host)
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
func createHostFromResource(resourceID string, networkInfo networkInfo,
|
||||
resourceToSetMap map[string][]string) (*pb.ListHostsResponseHost, error) {
|
||||
|
||||
// Extract the resource type from the ID
|
||||
resourceType, err := extractResourceType(resourceID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid resource ID: %w", err)
|
||||
}
|
||||
|
||||
switch resourceType {
|
||||
case constVirtualMachineScaleSetsResource:
|
||||
externalName, err := getExternalNameforVMSSInstance(resourceID)
|
||||
if err != nil {
|
||||
externalName = "" // Use empty name if there's an error
|
||||
}
|
||||
|
||||
setId, err := getSetForVMSSInstance(resourceID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not determine set for resource ID: %w", err)
|
||||
}
|
||||
return &pb.ListHostsResponseHost{
|
||||
ExternalId: resourceID,
|
||||
ExternalName: externalName,
|
||||
IpAddresses: networkInfo.IpAddresses,
|
||||
SetIds: resourceToSetMap[setId],
|
||||
}, nil
|
||||
|
||||
case constVirtualMachinesResource:
|
||||
_, externalName, err := splitId(resourceID, constMsComputeService, constVirtualMachinesResource)
|
||||
if err != nil {
|
||||
externalName = "" // Use empty name if there's an error
|
||||
}
|
||||
|
||||
return &pb.ListHostsResponseHost{
|
||||
ExternalId: resourceID,
|
||||
ExternalName: externalName,
|
||||
IpAddresses: networkInfo.IpAddresses,
|
||||
SetIds: resourceToSetMap[resourceID],
|
||||
}, nil
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported resource type: %s", resourceType) // Return explicit error
|
||||
}
|
||||
}
|
||||
|
||||
func (p *AzurePlugin) initializeAzureResources(
|
||||
catalog *hostcatalogs.HostCatalog,
|
||||
secrets *structpb.Struct) (*azureClients, error) {
|
||||
|
||||
catalog := req.GetCatalog()
|
||||
if catalog == nil {
|
||||
return nil, status.Error(codes.FailedPrecondition, "catalog is nil")
|
||||
}
|
||||
@@ -289,8 +151,8 @@ func (p *AzurePlugin) initializeAzureResources(
|
||||
return nil, status.Error(codes.FailedPrecondition, "catalog has no attributes")
|
||||
}
|
||||
|
||||
// Create authorizer
|
||||
catalog.Secrets = secrets
|
||||
// Create an authorizer
|
||||
catalog.Secrets = req.GetPersisted().GetSecrets()
|
||||
authzInfo, err := getAuthorizationInfo(catalog)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching authorizationInfo: %w", err)
|
||||
@@ -298,7 +160,6 @@ func (p *AzurePlugin) initializeAzureResources(
|
||||
if authzInfo == nil {
|
||||
return nil, status.Error(codes.FailedPrecondition, "authorization info is nil")
|
||||
}
|
||||
|
||||
authorizer, err := authzInfo.autorestAuthorizer()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching autorest authorizer: %w", err)
|
||||
@@ -307,13 +168,16 @@ func (p *AzurePlugin) initializeAzureResources(
|
||||
return nil, errors.New("fetched authorizer is nil")
|
||||
}
|
||||
|
||||
// Set up common client options
|
||||
commonOpts := []Option{
|
||||
commonOpts := make([]Option, 0, 3)
|
||||
commonOpts = append(commonOpts,
|
||||
WithSubscriptionId(authzInfo.AuthParams.SubscriptionId),
|
||||
WithAuthorizer(authorizer),
|
||||
}
|
||||
)
|
||||
|
||||
// Add base URL if specified
|
||||
// Getting authorizer will fail if the attr fields are not populated, so
|
||||
// it's safe to access directly at this point.
|
||||
//
|
||||
// TODO: plumb base URL everywhere, not just here
|
||||
catalogAttrFields := catalogAttrs.GetFields()
|
||||
if catalogAttrFields[constBaseUrl] != nil {
|
||||
if baseUrl := catalogAttrFields[constBaseUrl].GetStringValue(); baseUrl != "" {
|
||||
@@ -321,182 +185,276 @@ func (p *AzurePlugin) initializeAzureResources(
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize clients
|
||||
clients := &azureClients{}
|
||||
var initErr error
|
||||
|
||||
// Initialize individual clients with error handling
|
||||
if clients.resClient, initErr = getResourcesClient(commonOpts...); initErr != nil {
|
||||
return nil, fmt.Errorf("error fetching resources client: %w", initErr)
|
||||
}
|
||||
|
||||
if clients.vmClient, initErr = getVirtualMachinesClient(commonOpts...); initErr != nil {
|
||||
return nil, fmt.Errorf("error fetching virtual machines client: %w", initErr)
|
||||
}
|
||||
|
||||
if clients.vmssClient, initErr = getVirtualMachineScaleSetsClient(commonOpts...); initErr != nil {
|
||||
return nil, fmt.Errorf("error fetching virtual machine scale set client: %w", initErr)
|
||||
}
|
||||
|
||||
if clients.vmssvmClient, initErr = getVirtualMachineScaleSetVMsClient(commonOpts...); initErr != nil {
|
||||
return nil, fmt.Errorf("error fetching virtual machine scale set vms client: %w", initErr)
|
||||
}
|
||||
|
||||
if clients.ifClient, initErr = getNetworkInterfacesClient(commonOpts...); initErr != nil {
|
||||
return nil, fmt.Errorf("error fetching network interfaces client: %w", initErr)
|
||||
}
|
||||
|
||||
if clients.pipClient, initErr = getPublicIpAddressesClient(commonOpts...); initErr != nil {
|
||||
return nil, fmt.Errorf("error fetching public ip address client: %w", initErr)
|
||||
}
|
||||
|
||||
return clients, nil
|
||||
}
|
||||
|
||||
func (p *AzurePlugin) findMatchingResources(ctx context.Context,
|
||||
sets []*hostsets.HostSet,
|
||||
resClient *resources.Client) (
|
||||
vmResources []resources.GenericResourceExpanded,
|
||||
vmssResources []resources.GenericResourceExpanded,
|
||||
resourceToSetMap map[string][]string,
|
||||
_ error) {
|
||||
|
||||
resourceToSetMap = make(map[string][]string, len(sets)*10) // Pre-allocate map size
|
||||
|
||||
for _, set := range sets {
|
||||
if err := validateHostSet(set); err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
filter := getSetFilter(set)
|
||||
setVMResources, setVMSSResources, setResourceToSetMap, err := listAndFilterResources(ctx, resClient, filter, set.GetId())
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
vmResources = append(vmResources, setVMResources...)
|
||||
vmssResources = append(vmssResources, setVMSSResources...)
|
||||
for k, v := range setResourceToSetMap {
|
||||
resourceToSetMap[k] = append(resourceToSetMap[k], v...)
|
||||
}
|
||||
}
|
||||
|
||||
return vmResources, vmssResources, resourceToSetMap, nil
|
||||
}
|
||||
|
||||
func listAndFilterResources(ctx context.Context,
|
||||
resClient *resources.Client,
|
||||
filter, setID string) (
|
||||
vmResources []resources.GenericResourceExpanded,
|
||||
vmssResources []resources.GenericResourceExpanded,
|
||||
resourceToSetMap map[string][]string,
|
||||
_ error) {
|
||||
|
||||
resourceToSetMap = make(map[string][]string)
|
||||
iter, err := resClient.ListComplete(ctx, filter, "", nil)
|
||||
// Create clients
|
||||
resClient, err := getResourcesClient(commonOpts...)
|
||||
if err != nil {
|
||||
return nil, nil, nil, fmt.Errorf("error listing resources: %w", err)
|
||||
return nil, fmt.Errorf("error fetching resources client: %w", err)
|
||||
}
|
||||
if resClient == nil {
|
||||
return nil, errors.New("resource client is nil")
|
||||
}
|
||||
vmClient, err := getVirtualMachinesClient(commonOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching virtual machines client: %w", err)
|
||||
}
|
||||
if vmClient == nil {
|
||||
return nil, errors.New("virtual machines client is nil")
|
||||
}
|
||||
ifClient, err := getNetworkInterfacesClient(commonOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching network interfaces client: %w", err)
|
||||
}
|
||||
if ifClient == nil {
|
||||
return nil, errors.New("network interfaces client is nil")
|
||||
}
|
||||
pipClient, err := getPublicIpAddressesClient(commonOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching public ip address client: %w", err)
|
||||
}
|
||||
if pipClient == nil {
|
||||
return nil, errors.New("public ip address client is nil")
|
||||
}
|
||||
|
||||
for iter.NotDone() {
|
||||
val := iter.Value()
|
||||
if err := iter.NextWithContext(ctx); err != nil {
|
||||
return nil, nil, nil, fmt.Errorf("error iterating resources: %w", err)
|
||||
// This next section finds resource IDs that match to the filter in each
|
||||
// host set, and stores a mapping of, for each resource ID, which host sets
|
||||
// it belongs to
|
||||
resourceToSetMap := make(map[string][]string, len(req.GetSets())*10)
|
||||
var resourceInfos []resources.GenericResourceExpanded
|
||||
for _, set := range req.GetSets() {
|
||||
if set == nil {
|
||||
return nil, errors.New("set is nil")
|
||||
}
|
||||
setAttrs := set.GetAttributes()
|
||||
if setAttrs == nil {
|
||||
return nil, fmt.Errorf("set %s has no attributes", set.GetId())
|
||||
}
|
||||
setAttrFields := setAttrs.GetFields()
|
||||
if len(setAttrFields) == 0 {
|
||||
return nil, fmt.Errorf("set %s attributes has no filter", set.GetId())
|
||||
}
|
||||
|
||||
if val.ID == nil || val.Type == nil {
|
||||
continue
|
||||
filter := constDefaultFilter
|
||||
if setAttrFields[constFilter] != nil {
|
||||
if filter = setAttrFields[constFilter].GetStringValue(); filter == "" {
|
||||
return nil, fmt.Errorf("set %s filter is empty", set.GetId())
|
||||
}
|
||||
}
|
||||
virtualMachineType := constMsComputeService + "/" + constVirtualMachinesResource
|
||||
virtualMachineScaleSetType := constMsComputeService + "/" + constVirtualMachineScaleSetsResource
|
||||
if strings.EqualFold(*val.Type, virtualMachineType) {
|
||||
vmResources = append(vmResources, val)
|
||||
resourceToSetMap[*val.ID] = append(resourceToSetMap[*val.ID], setID)
|
||||
} else if strings.EqualFold(*val.Type, virtualMachineScaleSetType) {
|
||||
vmssResources = append(vmssResources, val)
|
||||
resourceToSetMap[*val.ID] = append(resourceToSetMap[*val.ID], setID)
|
||||
|
||||
// List values matching the filter; ask for provisioning state information
|
||||
// to ensure we are seeing only fully provisioned machines
|
||||
{
|
||||
iter, err := resClient.ListComplete(ctx, filter, "", nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error listing resources: %w", err)
|
||||
}
|
||||
for iter.NotDone() {
|
||||
val := iter.Value()
|
||||
if err := iter.NextWithContext(ctx); err != nil {
|
||||
return nil, fmt.Errorf("error iterating resources: %w", err)
|
||||
}
|
||||
if val.ID == nil { // something went wrong, likely iterator has advanced beyond the end
|
||||
continue
|
||||
}
|
||||
if val.Type == nil || *val.Type != "Microsoft.Compute/virtualMachines" {
|
||||
// no point continuing if we can't validate that it's a VM
|
||||
continue
|
||||
}
|
||||
resourceInfos = append(resourceInfos, val)
|
||||
resourceToSetMap[*val.ID] = append(resourceToSetMap[*val.ID], set.GetId())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return vmResources, vmssResources, resourceToSetMap, nil
|
||||
// At this point we have a list of distinct resources and a mapping between
|
||||
// them and the set(s) they belong to. Iterate through them and fetch
|
||||
// information.
|
||||
//
|
||||
// Listing returns IDs which are basically URLs that have key-value
|
||||
// pairs but not the individual components. Get requires the individual
|
||||
// components, and won't accept the ID...
|
||||
//
|
||||
// Anyways, now we find VM details for those resources
|
||||
vmToIfaceMap := make(map[string][]network.Interface)
|
||||
{
|
||||
for _, res := range resourceInfos {
|
||||
resourceGroup, name, err := splitId(*res.ID, constMsComputeService, constVirtualMachinesResource)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error splitting vm id %q: %w", *res.ID, err)
|
||||
}
|
||||
vm, err := vmClient.Get(ctx, resourceGroup, name, "")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching vm with id %q: %w", *res.ID, err)
|
||||
}
|
||||
|
||||
iv, err := vmClient.InstanceView(ctx, resourceGroup, name)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching instance view for vm with id %q: %w", *res.ID, err)
|
||||
}
|
||||
if iv.Statuses == nil {
|
||||
return nil, fmt.Errorf("instance view statuses returned for vm with id %q is null", *res.ID)
|
||||
}
|
||||
var running bool
|
||||
for _, s := range *iv.Statuses {
|
||||
if s.Code == nil {
|
||||
continue
|
||||
}
|
||||
state := strings.ToLower(*s.Code)
|
||||
prefix := "powerstate/"
|
||||
if !strings.HasPrefix(state, prefix) {
|
||||
continue
|
||||
}
|
||||
state = strings.TrimPrefix(state, prefix)
|
||||
if state == "running" {
|
||||
running = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !running {
|
||||
continue
|
||||
}
|
||||
|
||||
props := vm.VirtualMachineProperties
|
||||
if props == nil {
|
||||
return nil, fmt.Errorf("error fetching properties for vm with id %q: %w", *res.ID, err)
|
||||
}
|
||||
if props.NetworkProfile == nil {
|
||||
return nil, fmt.Errorf("error fetching network profile for vm with id %q", *res.ID)
|
||||
}
|
||||
|
||||
// Within the VM, catalog the various interfaces
|
||||
var ifaces []network.Interface
|
||||
for _, ifaceRef := range *props.NetworkProfile.NetworkInterfaces {
|
||||
if ifaceRef.ID == nil {
|
||||
return nil, fmt.Errorf("nil ID for network interface for vm with id %q", *res.ID)
|
||||
}
|
||||
ifResGroup, ifName, err := splitId(*ifaceRef.ID, constMsNetworkService, constNetworkInterfacesResource)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error splitting network interface id %q: %w", *ifaceRef.ID, err)
|
||||
}
|
||||
iface, err := ifClient.Get(ctx, ifResGroup, ifName, "")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching network interface with id %q: %w", *ifaceRef.ID, err)
|
||||
}
|
||||
if iface.InterfacePropertiesFormat == nil || iface.InterfacePropertiesFormat.IPConfigurations == nil {
|
||||
continue
|
||||
}
|
||||
ifaces = append(ifaces, iface)
|
||||
}
|
||||
vmToIfaceMap[*res.ID] = ifaces
|
||||
}
|
||||
}
|
||||
|
||||
// Now, fetch IP details for each of the interfaces for each VM
|
||||
type networkInfo struct {
|
||||
IpAddresses []string
|
||||
}
|
||||
vmToNetworkMap := make(map[string]networkInfo)
|
||||
{
|
||||
for vmId, ifaces := range vmToIfaceMap {
|
||||
var netInfo networkInfo
|
||||
for _, iface := range ifaces {
|
||||
for _, ipconf := range *iface.InterfacePropertiesFormat.IPConfigurations {
|
||||
if ipconf.PrivateIPAddress != nil {
|
||||
netInfo.IpAddresses = append(netInfo.IpAddresses, *ipconf.PrivateIPAddress)
|
||||
}
|
||||
if ipconf.PublicIPAddress != nil {
|
||||
if ipconf.PublicIPAddress.ID == nil {
|
||||
return nil, fmt.Errorf("ip configuration %q has public IP address info but nil id", *ipconf.ID)
|
||||
}
|
||||
ipResGroup, ipName, err := splitId(*ipconf.PublicIPAddress.ID, constMsNetworkService, constPublicIpAddressesResource)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error splitting public ip address id %q: %w", *ipconf.PublicIPAddress.ID, err)
|
||||
}
|
||||
pipInfo, err := pipClient.Get(ctx, ipResGroup, ipName, "")
|
||||
if err != nil {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error fetching public IP information with resource group %q and name %q: %w", ipResGroup, ipName, err)
|
||||
}
|
||||
}
|
||||
if pipInfo.PublicIPAddressPropertiesFormat == nil {
|
||||
return nil, fmt.Errorf("nil public ip address properties format for public ip %q", *ipconf.PublicIPAddress.ID)
|
||||
}
|
||||
if pipInfo.PublicIPAddressPropertiesFormat.IPAddress != nil {
|
||||
netInfo.IpAddresses = append(netInfo.IpAddresses, *pipInfo.PublicIPAddressPropertiesFormat.IPAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
vmToNetworkMap[vmId] = netInfo
|
||||
}
|
||||
}
|
||||
|
||||
ret := &pb.ListHostsResponse{}
|
||||
for k, v := range vmToNetworkMap {
|
||||
host := &pb.ListHostsResponseHost{
|
||||
ExternalId: k,
|
||||
IpAddresses: v.IpAddresses,
|
||||
SetIds: resourceToSetMap[k],
|
||||
}
|
||||
ret.Hosts = append(ret.Hosts, host)
|
||||
}
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
// Resource Filter Management
|
||||
func getSetFilter(set *hostsets.HostSet) string {
|
||||
setAttrFields := set.GetAttributes().GetFields()
|
||||
if setAttrFields[constFilter] != nil {
|
||||
if filter := setAttrFields[constFilter].GetStringValue(); filter != "" {
|
||||
return filter
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func validateHostSet(set *hostsets.HostSet) error {
|
||||
if set == nil {
|
||||
return errors.New("set is nil")
|
||||
}
|
||||
setAttrs := set.GetAttributes()
|
||||
if setAttrs == nil {
|
||||
return fmt.Errorf("set %s has no attributes", set.GetId())
|
||||
}
|
||||
if len(setAttrs.GetFields()) == 0 {
|
||||
return fmt.Errorf("set %s attributes has no filter", set.GetId())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ID Parsing Functions
|
||||
func splitId(in, expectedService, expectedResource string) (string, string, error) {
|
||||
// Note: this could be stolen from the helpers directory in the TF AzureRM
|
||||
// provider but I'm not at the moment because it does a bunch of trickery
|
||||
// for some Azure APIs and we have a much more limited scope.
|
||||
// for some Azure APIs and we have a much more limited scope. I may come to
|
||||
// regret this.
|
||||
splitId := strings.Split(strings.TrimLeft(in, "/"), "/")
|
||||
|
||||
// Run through some sanity checks
|
||||
if len(splitId) != 8 ||
|
||||
!strings.EqualFold(splitId[0], constSubscriptions) ||
|
||||
!strings.EqualFold(splitId[2], constResourceGroups) ||
|
||||
!strings.EqualFold(splitId[4], constProviders) ||
|
||||
!strings.EqualFold(splitId[5], expectedService) ||
|
||||
!strings.EqualFold(splitId[6], expectedResource) {
|
||||
splitId[0] != constSubscriptions ||
|
||||
splitId[2] != constResourceGroups ||
|
||||
splitId[4] != constProviders ||
|
||||
splitId[5] != expectedService ||
|
||||
splitId[6] != expectedResource {
|
||||
return "", "", fmt.Errorf("unexpected format of resource ID: %v", splitId)
|
||||
}
|
||||
return splitId[3], splitId[7], nil
|
||||
}
|
||||
|
||||
func extractResourceType(resourceID string) (string, error) {
|
||||
if resourceID == "" {
|
||||
return "", fmt.Errorf("empty resource ID provided")
|
||||
// Returns an invalid argument error with the problematic fields included
|
||||
// in the error message.
|
||||
func invalidArgumentError(msg string, f map[string]string) error {
|
||||
var fieldMsgs []string
|
||||
for field, val := range f {
|
||||
fieldMsgs = append(fieldMsgs, fmt.Sprintf("%q: %q", field, val))
|
||||
}
|
||||
|
||||
parts := strings.Split(strings.TrimLeft(resourceID, "/"), "/")
|
||||
|
||||
// Validate minimum length and basic structure
|
||||
if len(parts) < 6 {
|
||||
return "", fmt.Errorf("resource ID too short: %s", resourceID)
|
||||
if len(fieldMsgs) > 0 {
|
||||
msg = fmt.Sprintf("%s: [%s]", msg, strings.Join(fieldMsgs, ", "))
|
||||
}
|
||||
|
||||
// Check for required segments in correct positions
|
||||
if !strings.EqualFold(parts[0], constSubscriptions) ||
|
||||
!strings.EqualFold(parts[2], constResourceGroups) ||
|
||||
!strings.EqualFold(parts[4], constProviders) {
|
||||
return "", fmt.Errorf("malformed resource ID, missing required segments: %s", resourceID)
|
||||
}
|
||||
|
||||
// Check for Microsoft.Compute in correct position
|
||||
if !strings.EqualFold(parts[5], constMsComputeService) {
|
||||
return "", nil // Not a compute resource, return empty string without error
|
||||
}
|
||||
|
||||
// Ensure there's a resource type after Microsoft.Compute
|
||||
if len(parts) < 7 {
|
||||
return "", fmt.Errorf("no resource type found after Microsoft.Compute: %s", resourceID)
|
||||
}
|
||||
|
||||
return parts[6], nil
|
||||
return status.Error(codes.InvalidArgument, msg)
|
||||
}
|
||||
|
||||
func validateSecrets(s *structpb.Struct) error {
|
||||
if s == nil {
|
||||
return status.Error(codes.InvalidArgument, "Secrets not provided but are required")
|
||||
}
|
||||
var secrets SecretData
|
||||
if err := mapstructure.Decode(s.AsMap(), &secrets); err != nil {
|
||||
return status.Errorf(codes.InvalidArgument, "error decoding catalog secrets: %s", err)
|
||||
}
|
||||
badFields := make(map[string]string)
|
||||
if len(secrets.SecretValue) == 0 {
|
||||
badFields["secrets.secret_value"] = "This field is required."
|
||||
}
|
||||
if len(secrets.CredsLastRotatedTime) != 0 {
|
||||
badFields["secrets.creds_last_rotated_time"] = "This field is reserved and cannot be set."
|
||||
}
|
||||
if len(badFields) > 0 {
|
||||
return invalidArgumentError("Error in the secrets provided", badFields)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var allowedCatalogFields = map[string]struct{}{
|
||||
constDisableCredentialRotation: {},
|
||||
constSubscriptionId: {},
|
||||
constTenantId: {},
|
||||
constClientId: {},
|
||||
}
|
||||
|
||||
// Validation Functions
|
||||
func validateCatalog(c *hostcatalogs.HostCatalog) error {
|
||||
if c == nil {
|
||||
return status.Error(codes.InvalidArgument, "catalog is nil")
|
||||
@@ -506,7 +464,6 @@ func validateCatalog(c *hostcatalogs.HostCatalog) error {
|
||||
if err := mapstructure.Decode(attrMap, &attrs); err != nil {
|
||||
return status.Errorf(codes.InvalidArgument, "error decoding catalog attributes: %s", err)
|
||||
}
|
||||
|
||||
badFields := make(map[string]string)
|
||||
if !attrs.DisableCredentialRotation {
|
||||
badFields["attributes.disable_credential_rotation"] = "This field must be set to true."
|
||||
@@ -533,26 +490,8 @@ func validateCatalog(c *hostcatalogs.HostCatalog) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func validateSecrets(s *structpb.Struct) error {
|
||||
if s == nil {
|
||||
return status.Error(codes.InvalidArgument, "Secrets not provided but are required")
|
||||
}
|
||||
var secrets SecretData
|
||||
if err := mapstructure.Decode(s.AsMap(), &secrets); err != nil {
|
||||
return status.Errorf(codes.InvalidArgument, "error decoding catalog secrets: %s", err)
|
||||
}
|
||||
|
||||
badFields := make(map[string]string)
|
||||
if len(secrets.SecretValue) == 0 {
|
||||
badFields["secrets.secret_value"] = "This field is required."
|
||||
}
|
||||
if len(secrets.CredsLastRotatedTime) != 0 {
|
||||
badFields["secrets.creds_last_rotated_time"] = "This field is reserved and cannot be set."
|
||||
}
|
||||
if len(badFields) > 0 {
|
||||
return invalidArgumentError("Error in the secrets provided", badFields)
|
||||
}
|
||||
return nil
|
||||
var allowedSetFields = map[string]struct{}{
|
||||
constFilter: {},
|
||||
}
|
||||
|
||||
func validateSet(s *hostsets.HostSet) error {
|
||||
@@ -564,7 +503,6 @@ func validateSet(s *hostsets.HostSet) error {
|
||||
if err := mapstructure.Decode(attrMap, &attrs); err != nil {
|
||||
return status.Errorf(codes.InvalidArgument, "error decoding set attributes: %s", err)
|
||||
}
|
||||
|
||||
badFields := make(map[string]string)
|
||||
if _, ok := attrMap[constFilter]; ok && len(attrs.Filter) == 0 {
|
||||
badFields["attributes.filter"] = "This field must be not empty."
|
||||
@@ -581,27 +519,3 @@ func validateSet(s *hostsets.HostSet) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Error Handling Functions
|
||||
func invalidArgumentError(msg string, f map[string]string) error {
|
||||
var fieldMsgs []string
|
||||
for field, val := range f {
|
||||
fieldMsgs = append(fieldMsgs, fmt.Sprintf("%q: %q", field, val))
|
||||
}
|
||||
if len(fieldMsgs) > 0 {
|
||||
msg = fmt.Sprintf("%s: [%s]", msg, strings.Join(fieldMsgs, ", "))
|
||||
}
|
||||
return status.Error(codes.InvalidArgument, msg)
|
||||
}
|
||||
|
||||
// Map Definitions for Allowed Fields
|
||||
var allowedCatalogFields = map[string]struct{}{
|
||||
constDisableCredentialRotation: {},
|
||||
constSubscriptionId: {},
|
||||
constTenantId: {},
|
||||
constClientId: {},
|
||||
}
|
||||
|
||||
var allowedSetFields = map[string]struct{}{
|
||||
constFilter: {},
|
||||
}
|
||||
+41
-366
@@ -1,14 +1,9 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -48,7 +43,6 @@ func TestListHosts(t *testing.T) {
|
||||
})
|
||||
require.NoError(err)
|
||||
require.NotNil(lhResp)
|
||||
require.NotEmpty(lhResp.GetHosts())
|
||||
|
||||
pretty.Println(lhResp.GetHosts())
|
||||
}
|
||||
@@ -136,9 +130,7 @@ func TestValidateCatalog(t *testing.T) {
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
got := validateCatalog(&hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: tc.catalogAttrs,
|
||||
},
|
||||
Attributes: tc.catalogAttrs,
|
||||
})
|
||||
if tc.wantError {
|
||||
assert.Error(t, got)
|
||||
@@ -239,9 +231,7 @@ func TestValidateSet(t *testing.T) {
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
got := validateSet(&hostsets.HostSet{
|
||||
Attrs: &hostsets.HostSet_Attributes{
|
||||
Attributes: tc.setAttrs,
|
||||
},
|
||||
Attributes: tc.setAttrs,
|
||||
})
|
||||
if tc.wantError {
|
||||
assert.Error(t, got)
|
||||
@@ -267,10 +257,8 @@ func TestCreateCatalog(t *testing.T) {
|
||||
})
|
||||
|
||||
res, err := p.OnCreateCatalog(ctx, &pb.OnCreateCatalogRequest{Catalog: &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: attrs,
|
||||
},
|
||||
Secrets: secrets,
|
||||
Attributes: attrs,
|
||||
Secrets: secrets,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, res.GetPersisted().GetSecrets().AsMap(), secrets.AsMap())
|
||||
@@ -281,10 +269,8 @@ func TestCreateCatalog(t *testing.T) {
|
||||
"extraField": "extra_value",
|
||||
})
|
||||
res, err = p.OnCreateCatalog(ctx, &pb.OnCreateCatalogRequest{Catalog: &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: attrs,
|
||||
},
|
||||
Secrets: secretsWithExtra,
|
||||
Attributes: attrs,
|
||||
Secrets: secretsWithExtra,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
// still only persist the fields we care about.
|
||||
@@ -296,10 +282,8 @@ func TestCreateCatalog(t *testing.T) {
|
||||
constCredsLastRotatedTime: "something",
|
||||
})
|
||||
res, err = p.OnCreateCatalog(ctx, &pb.OnCreateCatalogRequest{Catalog: &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: attrs,
|
||||
},
|
||||
Secrets: secretsWithRotationTime,
|
||||
Attributes: attrs,
|
||||
Secrets: secretsWithRotationTime,
|
||||
}})
|
||||
assert.Error(t, err)
|
||||
}
|
||||
@@ -309,14 +293,12 @@ func TestUpdateCatalog(t *testing.T) {
|
||||
p := &AzurePlugin{}
|
||||
|
||||
oldCatalog := &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constDisableCredentialRotation: true,
|
||||
constClientId: "foo",
|
||||
constTenantId: "foo",
|
||||
constSubscriptionId: "foo",
|
||||
}),
|
||||
},
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constDisableCredentialRotation: true,
|
||||
constClientId: "foo",
|
||||
constTenantId: "foo",
|
||||
constSubscriptionId: "foo",
|
||||
}),
|
||||
}
|
||||
|
||||
attrs := wrapMap(t, map[string]interface{}{
|
||||
@@ -326,14 +308,10 @@ func TestUpdateCatalog(t *testing.T) {
|
||||
constSubscriptionId: "sub_id",
|
||||
})
|
||||
|
||||
res, err := p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{
|
||||
CurrentCatalog: oldCatalog,
|
||||
res, err := p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{CurrentCatalog: oldCatalog,
|
||||
NewCatalog: &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: attrs,
|
||||
},
|
||||
},
|
||||
})
|
||||
Attributes: attrs,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
assert.Nil(t, res.GetPersisted())
|
||||
|
||||
@@ -342,15 +320,11 @@ func TestUpdateCatalog(t *testing.T) {
|
||||
constSecretId: "secret_id",
|
||||
})
|
||||
|
||||
res, err = p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{
|
||||
CurrentCatalog: oldCatalog,
|
||||
res, err = p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{CurrentCatalog: oldCatalog,
|
||||
NewCatalog: &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: attrs,
|
||||
},
|
||||
Secrets: secrets,
|
||||
},
|
||||
})
|
||||
Attributes: attrs,
|
||||
Secrets: secrets,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, res.GetPersisted().GetSecrets().AsMap(), secrets.AsMap())
|
||||
|
||||
@@ -359,15 +333,11 @@ func TestUpdateCatalog(t *testing.T) {
|
||||
constSecretId: "secret_id",
|
||||
"extraField": "extra_value",
|
||||
})
|
||||
res, err = p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{
|
||||
CurrentCatalog: oldCatalog,
|
||||
res, err = p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{CurrentCatalog: oldCatalog,
|
||||
NewCatalog: &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: attrs,
|
||||
},
|
||||
Secrets: secretsWithExtra,
|
||||
},
|
||||
})
|
||||
Attributes: attrs,
|
||||
Secrets: secretsWithExtra,
|
||||
}})
|
||||
require.NoError(t, err)
|
||||
// still only persist the fields we care about.
|
||||
assert.Equal(t, res.GetPersisted().GetSecrets().AsMap(), secrets.AsMap())
|
||||
@@ -377,15 +347,11 @@ func TestUpdateCatalog(t *testing.T) {
|
||||
constSecretId: "secret_id",
|
||||
constCredsLastRotatedTime: "something",
|
||||
})
|
||||
res, err = p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{
|
||||
CurrentCatalog: oldCatalog,
|
||||
res, err = p.OnUpdateCatalog(ctx, &pb.OnUpdateCatalogRequest{CurrentCatalog: oldCatalog,
|
||||
NewCatalog: &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: attrs,
|
||||
},
|
||||
Secrets: secretsWithRotationTime,
|
||||
},
|
||||
})
|
||||
Attributes: attrs,
|
||||
Secrets: secretsWithRotationTime,
|
||||
}})
|
||||
assert.Error(t, err)
|
||||
}
|
||||
|
||||
@@ -396,10 +362,9 @@ func waitForCreds(t *testing.T, authzInfo *AuthorizationInfo, shouldWork bool) a
|
||||
auth, err := auth.NewClientSecretAuthorizer(
|
||||
ctx,
|
||||
environments.Global,
|
||||
environments.Global.MsGraph,
|
||||
auth.MsGraph,
|
||||
auth.TokenVersion2,
|
||||
authzInfo.AuthParams.TenantId,
|
||||
nil,
|
||||
authzInfo.AuthParams.ClientId,
|
||||
authzInfo.AuthParams.SecretValue)
|
||||
require.NoError(err)
|
||||
@@ -433,13 +398,11 @@ func testGetHostStructs(t *testing.T) (*hostcatalogs.HostCatalog, []*hostsets.Ho
|
||||
|
||||
// These values will not change througout the test
|
||||
hc := &hostcatalogs.HostCatalog{
|
||||
Attrs: &hostcatalogs.HostCatalog_Attributes{
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constSubscriptionId: subscriptionId,
|
||||
constTenantId: tenantId,
|
||||
constClientId: clientId,
|
||||
}),
|
||||
},
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constSubscriptionId: subscriptionId,
|
||||
constTenantId: tenantId,
|
||||
constClientId: clientId,
|
||||
}),
|
||||
Secrets: wrapMap(t, map[string]interface{}{
|
||||
constSecretValue: secretValue,
|
||||
}),
|
||||
@@ -448,19 +411,15 @@ func testGetHostStructs(t *testing.T) (*hostcatalogs.HostCatalog, []*hostsets.Ho
|
||||
hses := []*hostsets.HostSet{
|
||||
{
|
||||
Id: "set1",
|
||||
Attrs: &hostsets.HostSet_Attributes{
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constFilter: "",
|
||||
}),
|
||||
},
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constFilter: constDefaultFilter,
|
||||
}),
|
||||
},
|
||||
{
|
||||
Id: "set2",
|
||||
Attrs: &hostsets.HostSet_Attributes{
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constFilter: "",
|
||||
}),
|
||||
},
|
||||
Attributes: wrapMap(t, map[string]interface{}{
|
||||
constFilter: constDefaultFilter,
|
||||
}),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -507,287 +466,3 @@ func testCreateInitialSecret(t *testing.T, hostCatalog *hostcatalogs.HostCatalog
|
||||
|
||||
return authzInfo, initialCred, cleanup
|
||||
}
|
||||
|
||||
func TestSplitId(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
expectedService string
|
||||
expectedResource string
|
||||
wantRG string
|
||||
wantName string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "valid resource id",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1",
|
||||
expectedService: "Microsoft.Compute",
|
||||
expectedResource: "virtualMachines",
|
||||
wantRG: "rg1",
|
||||
wantName: "vm1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "valid with different case",
|
||||
input: "/SUBSCRIPTIONS/sub1/RESOURCEGROUPS/rg1/PROVIDERS/MICROSOFT.COMPUTE/VIRTUALMACHINES/vm1",
|
||||
expectedService: "Microsoft.Compute",
|
||||
expectedResource: "virtualMachines",
|
||||
wantRG: "rg1",
|
||||
wantName: "vm1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "invalid - trailing slash",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/",
|
||||
expectedService: "Microsoft.Compute",
|
||||
expectedResource: "virtualMachines",
|
||||
wantRG: "",
|
||||
wantName: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - wrong service",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Storage/virtualMachines/vm1",
|
||||
expectedService: "Microsoft.Compute",
|
||||
expectedResource: "virtualMachines",
|
||||
wantRG: "",
|
||||
wantName: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - wrong resource type",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des1",
|
||||
expectedService: "Microsoft.Compute",
|
||||
expectedResource: "virtualMachines",
|
||||
wantRG: "",
|
||||
wantName: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - missing segments",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1",
|
||||
expectedService: "Microsoft.Compute",
|
||||
expectedResource: "virtualMachines",
|
||||
wantRG: "",
|
||||
wantName: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - empty string",
|
||||
input: "",
|
||||
expectedService: "Microsoft.Compute",
|
||||
expectedResource: "virtualMachines",
|
||||
wantRG: "",
|
||||
wantName: "",
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
gotRG, gotName, err := splitId(tt.input, tt.expectedService, tt.expectedResource)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("splitId() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if gotRG != tt.wantRG {
|
||||
t.Errorf("splitId() gotRG = %v, want %v", gotRG, tt.wantRG)
|
||||
}
|
||||
if gotName != tt.wantName {
|
||||
t.Errorf("splitId() gotName = %v, want %v", gotName, tt.wantName)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestExtractResourceType(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
want string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "valid compute resource",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1",
|
||||
want: "virtualMachines",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "valid compute resource different case",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/MICROSOFT.COMPUTE/virtualMachines/vm1",
|
||||
want: "virtualMachines",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "valid with trailing slash",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/",
|
||||
want: "virtualMachines",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "different compute resource type",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/diskEncryptionSets/des1",
|
||||
want: "diskEncryptionSets",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "non-compute resource",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1",
|
||||
want: "",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "malformed - missing provider",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/Microsoft.Compute/virtualMachines/vm1",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "malformed - missing resource type",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "empty string",
|
||||
input: "",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "too short",
|
||||
input: "/subscriptions/sub1",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "malformed structure",
|
||||
input: "/something/else/entirely",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := extractResourceType(tt.input)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("extractResourceType() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if got != tt.want {
|
||||
t.Errorf("extractResourceType() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateHostFromResource(t *testing.T) {
|
||||
// Setup common test data
|
||||
testNetwork := networkInfo{
|
||||
IpAddresses: []string{"192.168.1.1", "192.168.1.2"},
|
||||
}
|
||||
|
||||
// Use full Azure resource paths as keys
|
||||
vmssPath := "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1"
|
||||
vmPath := "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm-resource1"
|
||||
|
||||
resourceToSetMap := map[string][]string{
|
||||
vmssPath: {"set1", "set2"},
|
||||
vmPath: {"set3", "set4"},
|
||||
}
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
resourceID string
|
||||
network networkInfo
|
||||
setMap map[string][]string
|
||||
want *pb.ListHostsResponseHost
|
||||
wantErr bool
|
||||
errMessage string
|
||||
}{
|
||||
{
|
||||
name: "valid VMSS resource",
|
||||
resourceID: vmssPath + "/virtualMachines/vm1",
|
||||
network: testNetwork,
|
||||
setMap: resourceToSetMap,
|
||||
want: &pb.ListHostsResponseHost{
|
||||
ExternalId: vmssPath + "/virtualMachines/vm1",
|
||||
ExternalName: "vmss1_vm1",
|
||||
IpAddresses: []string{"192.168.1.1", "192.168.1.2"},
|
||||
SetIds: []string{"set1", "set2"},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "valid VM resource",
|
||||
resourceID: vmPath,
|
||||
network: testNetwork,
|
||||
setMap: resourceToSetMap,
|
||||
want: &pb.ListHostsResponseHost{
|
||||
ExternalId: vmPath,
|
||||
ExternalName: "vm-resource1",
|
||||
IpAddresses: []string{"192.168.1.1", "192.168.1.2"},
|
||||
SetIds: []string{"set3", "set4"},
|
||||
},
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "invalid resource ID",
|
||||
resourceID: "invalid-resource-id",
|
||||
network: testNetwork,
|
||||
setMap: resourceToSetMap,
|
||||
want: nil,
|
||||
wantErr: true,
|
||||
errMessage: "invalid resource ID",
|
||||
},
|
||||
{
|
||||
name: "unsupported resource type",
|
||||
resourceID: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/unsupportedResource/resource1",
|
||||
network: testNetwork,
|
||||
setMap: resourceToSetMap,
|
||||
want: nil,
|
||||
wantErr: true,
|
||||
errMessage: "unsupported resource type",
|
||||
},
|
||||
{
|
||||
name: "VMSS with valid resource type but invalid structure",
|
||||
resourceID: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets", // Missing required segments after virtualMachineScaleSets
|
||||
network: testNetwork,
|
||||
setMap: resourceToSetMap,
|
||||
want: nil,
|
||||
wantErr: true,
|
||||
errMessage: "could not determine set for resource ID: not a valid VMSS resource ID",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := createHostFromResource(tt.resourceID, tt.network, tt.setMap)
|
||||
|
||||
// Check error cases
|
||||
if tt.wantErr {
|
||||
if err == nil {
|
||||
t.Errorf("createHostFromResource() expected error containing %q, got nil", tt.errMessage)
|
||||
return
|
||||
}
|
||||
if !strings.Contains(err.Error(), tt.errMessage) {
|
||||
t.Errorf("createHostFromResource() error = %v, want error containing %q", err, tt.errMessage)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Check non-error cases
|
||||
if err != nil {
|
||||
t.Errorf("createHostFromResource() unexpected error: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
// Compare the results
|
||||
if !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("createHostFromResource() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/resources"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
// vmJob represents a single VM processing job
|
||||
type vmJob struct {
|
||||
resource resources.GenericResourceExpanded
|
||||
resourceGroup string
|
||||
name string
|
||||
}
|
||||
|
||||
func (p *AzurePlugin) processStandardVMs(ctx context.Context, resourceInfos []resources.GenericResourceExpanded,
|
||||
clients *azureClients) (map[string]networkInfo, error) {
|
||||
|
||||
// Initialize the map that we'll return
|
||||
vmToNetworkMap := make(map[string]networkInfo)
|
||||
|
||||
// Pre-validate all resource IDs and create jobs slice
|
||||
jobs := make([]vmJob, 0, len(resourceInfos))
|
||||
for _, res := range resourceInfos {
|
||||
resourceGroup, name, err := splitId(*res.ID, constMsComputeService, constVirtualMachinesResource)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid vm id %q: %w", *res.ID, err)
|
||||
}
|
||||
jobs = append(jobs, vmJob{
|
||||
resource: res,
|
||||
resourceGroup: resourceGroup,
|
||||
name: name,
|
||||
})
|
||||
}
|
||||
|
||||
// Create error group for worker management
|
||||
g, ctx := errgroup.WithContext(ctx)
|
||||
|
||||
// Create job channel
|
||||
jobsChan := make(chan vmJob)
|
||||
|
||||
// Result handling
|
||||
mu := &sync.Mutex{}
|
||||
|
||||
// Start worker pool
|
||||
for i := 0; i < constDefaultWorkers; i++ {
|
||||
g.Go(func() error {
|
||||
for job := range jobsChan {
|
||||
// Process single VM
|
||||
vm, err := clients.vmClient.Get(ctx, job.resourceGroup, job.name, "")
|
||||
if err != nil {
|
||||
return fmt.Errorf("error fetching vm with id %q: %w", *job.resource.ID, err)
|
||||
}
|
||||
|
||||
// Only process running VMs
|
||||
running, err := isVMRunning(ctx, clients.vmClient, job.resourceGroup, job.name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !running {
|
||||
continue
|
||||
}
|
||||
|
||||
var netInfo networkInfo
|
||||
if err := processVMNetworkInterfaces(ctx, vm, clients, job.resourceGroup, &netInfo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
mu.Lock()
|
||||
vmToNetworkMap[*job.resource.ID] = netInfo
|
||||
mu.Unlock()
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// Send jobs to workers
|
||||
go func() {
|
||||
defer close(jobsChan)
|
||||
for _, job := range jobs {
|
||||
// Check context cancellation
|
||||
if ctx.Err() != nil {
|
||||
return
|
||||
}
|
||||
jobsChan <- job
|
||||
}
|
||||
}()
|
||||
|
||||
// Wait for all workers to complete
|
||||
if err := g.Wait(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return vmToNetworkMap, nil
|
||||
}
|
||||
|
||||
// VM Status Check
|
||||
func isVMRunning(
|
||||
ctx context.Context,
|
||||
vmClient *compute.VirtualMachinesClient,
|
||||
resourceGroup,
|
||||
name string,
|
||||
) (
|
||||
bool,
|
||||
error,
|
||||
) {
|
||||
|
||||
iv, err := vmClient.InstanceView(ctx, resourceGroup, name)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error fetching instance view for vm %s: %w", name, err)
|
||||
}
|
||||
if iv.Statuses == nil {
|
||||
return false, fmt.Errorf("instance view statuses is null for vm %s", name)
|
||||
}
|
||||
|
||||
for _, s := range *iv.Statuses {
|
||||
if s.Code == nil {
|
||||
continue
|
||||
}
|
||||
state := strings.ToLower(*s.Code)
|
||||
if strings.HasPrefix(state, "powerstate/") && strings.TrimPrefix(state, "powerstate/") == "running" {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
@@ -1,305 +0,0 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
|
||||
"github.com/Azure/azure-sdk-for-go/profiles/latest/resources/mgmt/resources"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
// vmssJob represents a single VMSS processing job
|
||||
type vmssJob struct {
|
||||
resource resources.GenericResourceExpanded
|
||||
resourceGroup string
|
||||
name string
|
||||
}
|
||||
|
||||
// vmssInstanceJob represents a single VMSS instance processing job
|
||||
type vmssInstanceJob struct {
|
||||
vmssvm compute.VirtualMachineScaleSetVM
|
||||
resourceGroup string
|
||||
vmssName string
|
||||
}
|
||||
|
||||
func (p *AzurePlugin) processVMScaleSets(
|
||||
ctx context.Context,
|
||||
resourceInfos []resources.GenericResourceExpanded,
|
||||
clients *azureClients,
|
||||
) (
|
||||
map[string]networkInfo,
|
||||
error,
|
||||
) {
|
||||
|
||||
// Initialize the map that we'll return
|
||||
vmToNetworkMap := make(map[string]networkInfo)
|
||||
|
||||
// Pre-validate all resource IDs and create jobs slice
|
||||
jobs := make([]vmssJob, 0, len(resourceInfos))
|
||||
for _, res := range resourceInfos {
|
||||
resourceGroup, name, err := splitId(*res.ID, constMsComputeService, constVirtualMachineScaleSetsResource)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid vmss id %q: %w", *res.ID, err)
|
||||
}
|
||||
jobs = append(jobs, vmssJob{
|
||||
resource: res,
|
||||
resourceGroup: resourceGroup,
|
||||
name: name,
|
||||
})
|
||||
}
|
||||
|
||||
// Create error group for worker management
|
||||
g, ctx := errgroup.WithContext(ctx)
|
||||
|
||||
// Create job channel
|
||||
jobsChan := make(chan vmssJob)
|
||||
|
||||
// Start worker pool
|
||||
for i := 0; i < constDefaultWorkers; i++ {
|
||||
g.Go(func() error {
|
||||
for job := range jobsChan {
|
||||
vmss, err := clients.vmssClient.Get(ctx, job.resourceGroup, job.name, "")
|
||||
if err != nil {
|
||||
return fmt.Errorf("error fetching vmss with id %q: %w", *job.resource.ID, err)
|
||||
}
|
||||
|
||||
// Check if VMSS properties exist
|
||||
if vmss.VirtualMachineScaleSetProperties == nil {
|
||||
continue
|
||||
}
|
||||
vmssProperties := vmss.VirtualMachineScaleSetProperties
|
||||
|
||||
// Skip if OrchestrationMode is empty or Flexible
|
||||
if vmssProperties.OrchestrationMode == "" {
|
||||
continue
|
||||
}
|
||||
if vmssProperties.OrchestrationMode == compute.OrchestrationModeFlexible {
|
||||
continue
|
||||
}
|
||||
|
||||
if err := processVMSSInstancesParallel(ctx, vmss, job.resourceGroup, clients, vmToNetworkMap); err != nil {
|
||||
return fmt.Errorf("error processing uniform vmss instances: %w", err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// Send jobs to workers
|
||||
go func() {
|
||||
defer close(jobsChan)
|
||||
for _, job := range jobs {
|
||||
if ctx.Err() != nil {
|
||||
return
|
||||
}
|
||||
jobsChan <- job
|
||||
}
|
||||
}()
|
||||
|
||||
// Wait for all workers to complete
|
||||
if err := g.Wait(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return vmToNetworkMap, nil
|
||||
}
|
||||
|
||||
func processVMSSInstancesParallel(
|
||||
ctx context.Context,
|
||||
vmss compute.VirtualMachineScaleSet,
|
||||
resourceGroup string,
|
||||
clients *azureClients,
|
||||
vmToNetworkMap map[string]networkInfo,
|
||||
) error {
|
||||
|
||||
if vmss.Name == nil {
|
||||
return fmt.Errorf("vmss name is nil")
|
||||
}
|
||||
|
||||
vmssvms, err := clients.vmssvmClient.List(ctx, resourceGroup, *vmss.Name, "", "", "")
|
||||
if err != nil {
|
||||
return fmt.Errorf("error fetching vms for vmss %s: %w", *vmss.Name, err)
|
||||
}
|
||||
|
||||
// Create new error group for instance processing
|
||||
g, ctx := errgroup.WithContext(ctx)
|
||||
instanceJobs := make(chan vmssInstanceJob)
|
||||
|
||||
// Start instance workers
|
||||
instanceWorkerCount := constDefaultWorkers
|
||||
if len(vmssvms.Values()) < instanceWorkerCount {
|
||||
instanceWorkerCount = len(vmssvms.Values())
|
||||
}
|
||||
|
||||
mu := &sync.Mutex{}
|
||||
|
||||
// Start instance worker pool
|
||||
for i := 0; i < instanceWorkerCount; i++ {
|
||||
g.Go(func() error {
|
||||
for job := range instanceJobs {
|
||||
if job.vmssvm.ID == nil {
|
||||
return fmt.Errorf("nil ID for vmss vm in scale set %s", *vmss.Name)
|
||||
}
|
||||
|
||||
if err := processVMSSInstanceParallel(ctx, job.vmssvm, job.resourceGroup,
|
||||
job.vmssName, clients, vmToNetworkMap, mu); err != nil {
|
||||
return fmt.Errorf("error processing vmss instance %s: %w", *job.vmssvm.ID, err)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
// Send instance jobs
|
||||
go func() {
|
||||
defer close(instanceJobs)
|
||||
for _, vmssvm := range vmssvms.Values() {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
default:
|
||||
}
|
||||
|
||||
instanceJobs <- vmssInstanceJob{
|
||||
vmssvm: vmssvm,
|
||||
resourceGroup: resourceGroup,
|
||||
vmssName: *vmss.Name,
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return g.Wait()
|
||||
}
|
||||
|
||||
func processVMSSInstanceParallel(
|
||||
ctx context.Context,
|
||||
vmssvm compute.VirtualMachineScaleSetVM,
|
||||
resourceGroup,
|
||||
vmssName string,
|
||||
clients *azureClients,
|
||||
vmToNetworkMap map[string]networkInfo,
|
||||
mu *sync.Mutex,
|
||||
) error {
|
||||
|
||||
if vmssvm.InstanceID == nil {
|
||||
return fmt.Errorf("instance ID is nil")
|
||||
}
|
||||
|
||||
// Check if instance is running
|
||||
if running, err := isVMSSInstanceRunning(ctx, clients.vmssvmClient, resourceGroup,
|
||||
vmssName, vmssvm.InstanceID); err != nil {
|
||||
return err
|
||||
} else if !running {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Process network interfaces for the instance
|
||||
var netInfo networkInfo
|
||||
if err := processVMSSNetworkInterfaces(ctx, vmssvm, resourceGroup, vmssName, clients, &netInfo); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func() {
|
||||
mu.Lock()
|
||||
defer mu.Unlock()
|
||||
vmToNetworkMap[*vmssvm.ID] = netInfo
|
||||
}()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// VMSS Instance Status Check
|
||||
func isVMSSInstanceRunning(
|
||||
ctx context.Context,
|
||||
vmssvmClient *compute.VirtualMachineScaleSetVMsClient,
|
||||
resourceGroup,
|
||||
vmssName string,
|
||||
instanceID *string,
|
||||
) (
|
||||
bool,
|
||||
error,
|
||||
) {
|
||||
|
||||
if instanceID == nil {
|
||||
return false, fmt.Errorf("instance ID is nil")
|
||||
}
|
||||
|
||||
iv, err := vmssvmClient.GetInstanceView(ctx, resourceGroup, vmssName, *instanceID)
|
||||
if err != nil {
|
||||
return false, fmt.Errorf("error fetching instance view for instance %s: %w", *instanceID, err)
|
||||
}
|
||||
if iv.Statuses == nil {
|
||||
return false, fmt.Errorf("instance view statuses returned for instance %s is null", *instanceID)
|
||||
}
|
||||
|
||||
for _, s := range *iv.Statuses {
|
||||
if s.Code == nil {
|
||||
continue
|
||||
}
|
||||
state := strings.ToLower(*s.Code)
|
||||
prefix := "powerstate/"
|
||||
if !strings.HasPrefix(state, prefix) {
|
||||
continue
|
||||
}
|
||||
state = strings.TrimPrefix(state, prefix)
|
||||
if state == "running" {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// Helper Functions
|
||||
func getSetForVMSSInstance(in string) (string, error) {
|
||||
if in == "" {
|
||||
return "", fmt.Errorf("empty resource ID provided")
|
||||
}
|
||||
|
||||
// Split the path into segments
|
||||
segments := strings.Split(strings.TrimLeft(in, "/"), "/")
|
||||
|
||||
// Check if this is a VMSS path by looking for required segments
|
||||
if len(segments) < 8 ||
|
||||
!strings.EqualFold(segments[0], constSubscriptions) ||
|
||||
!strings.EqualFold(segments[2], constResourceGroups) ||
|
||||
!strings.EqualFold(segments[4], constProviders) ||
|
||||
!strings.EqualFold(segments[5], constMsComputeService) ||
|
||||
!strings.EqualFold(segments[6], constVirtualMachineScaleSetsResource) {
|
||||
return "", fmt.Errorf("not a valid VMSS resource ID: %s", in)
|
||||
}
|
||||
|
||||
// Reconstruct the VMSS path (everything up to but not including virtualMachines)
|
||||
vmssPath := "/" + strings.Join(segments[:8], "/")
|
||||
|
||||
// Additional validation: if the path contains virtualMachines, it should be in the correct position
|
||||
for i, segment := range segments[8:] {
|
||||
if strings.EqualFold(segment, constVirtualMachinesResource) {
|
||||
if i != 0 { // virtualMachines should be immediately after VMSS name
|
||||
return "", fmt.Errorf("unexpected virtualMachines segment position in resource ID: %s", in)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
return vmssPath, nil
|
||||
}
|
||||
|
||||
func getExternalNameforVMSSInstance(in string) (string, error) {
|
||||
splitId := strings.Split(strings.TrimLeft(in, "/"), "/")
|
||||
if len(splitId) != 10 ||
|
||||
!strings.EqualFold(splitId[0], constSubscriptions) ||
|
||||
!strings.EqualFold(splitId[2], constResourceGroups) ||
|
||||
!strings.EqualFold(splitId[4], constProviders) ||
|
||||
!strings.EqualFold(splitId[5], constMsComputeService) ||
|
||||
!strings.EqualFold(splitId[6], constVirtualMachineScaleSetsResource) ||
|
||||
!strings.EqualFold(splitId[8], constVirtualMachinesResource) {
|
||||
return "", fmt.Errorf("unexpected format of virtual machine stateful set ID: %v", splitId)
|
||||
}
|
||||
return splitId[7] + "_" + splitId[9], nil
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
// Copyright IBM Corp. 2021, 2025
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package plugin
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetExternalNameforVMSSInstance(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
want string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "valid vmss instance id",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/instance1",
|
||||
want: "vmss1_instance1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "invalid - vmss instance id with trailing slash",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/instance1/",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "case insensitive segment validation",
|
||||
input: "/SUBSCRIPTIONS/sub1/RESOURCEGROUPS/rg1/PROVIDERS/MICROSOFT.COMPUTE/VIRTUALMACHINESCALESETS/vmss1/VIRTUALMACHINES/instance1",
|
||||
want: "vmss1_instance1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "invalid - missing segment",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - wrong resource type",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - empty string",
|
||||
input: "",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - malformed id",
|
||||
input: "invalid/format/string",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := getExternalNameforVMSSInstance(tt.input)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("getExternalNameforVMSSInstance() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if got != tt.want {
|
||||
t.Errorf("getExternalNameforVMSSInstance() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetSetForVMSSInstance(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
want string
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "valid vmss instance id",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/instance1",
|
||||
want: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "valid vmss path without instance",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1",
|
||||
want: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "case insensitive validation",
|
||||
input: "/SUBSCRIPTIONS/sub1/RESOURCEGROUPS/rg1/PROVIDERS/MICROSOFT.COMPUTE/VIRTUALMACHINESCALESETS/vmss1",
|
||||
want: "/SUBSCRIPTIONS/sub1/RESOURCEGROUPS/rg1/PROVIDERS/MICROSOFT.COMPUTE/VIRTUALMACHINESCALESETS/vmss1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "path with trailing slash",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/virtualMachines/instance1/",
|
||||
want: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1",
|
||||
wantErr: false,
|
||||
},
|
||||
{
|
||||
name: "empty string",
|
||||
input: "",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - flexible orchestration mode VM path",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vmss1_instance1",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - wrong provider",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/providers/Microsoft.Storage/virtualMachineScaleSets/vmss1",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - malformed path missing segments",
|
||||
input: "/subscriptions/sub1/resourceGroups",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - malformed with virtualMachines in wrong position",
|
||||
input: "/subscriptions/sub1/resourceGroups/rg1/virtualMachines/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "invalid - random string",
|
||||
input: "not/a/valid/path",
|
||||
want: "",
|
||||
wantErr: true,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
got, err := getSetForVMSSInstance(tt.input)
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("getSetForVMSSInstance() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
}
|
||||
if got != tt.want {
|
||||
t.Errorf("getSetForVMSSInstance() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user