From 828d82e8719688cf18ec01efd58b9d53d1fecd31 Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Fri, 15 Dec 2023 13:37:04 +0100 Subject: [PATCH] upload/azure: user newer resourcemanager packages The older azure sdk and autorest packages are deprecated. Signed-off-by: Sanne Raymaekers --- cmd/osbuild-worker/jobimpl-osbuild.go | 20 +- go.mod | 8 + go.sum | 13 + internal/upload/azure/azure.go | 127 +- .../2019-03-01/compute/mgmt/compute/models.go | 992 - .../resources/mgmt/resources/models.go | 241 - .../2019-03-01/storage/mgmt/storage/models.go | 325 - .../azure-sdk-for-go/sdk/azcore/arm/client.go | 72 + .../azure-sdk-for-go/sdk/azcore/arm/doc.go | 9 + .../internal/resource/resource_identifier.go | 224 + .../arm/internal/resource/resource_type.go | 114 + .../sdk/azcore/arm/policy/policy.go | 98 + .../sdk/azcore/arm/resource_identifier.go | 23 + .../sdk/azcore/arm/resource_type.go | 40 + .../sdk/azcore/arm/runtime/pipeline.go | 65 + .../azcore/arm/runtime/policy_bearer_token.go | 145 + .../azcore/arm/runtime/policy_register_rp.go | 347 + .../arm/runtime/policy_trace_namespace.go | 30 + .../sdk/azcore/arm/runtime/runtime.go | 24 + .../sdk/azidentity/CHANGELOG.md | 457 + .../sdk/azidentity/LICENSE.txt | 21 + .../sdk/azidentity/MIGRATION.md | 307 + .../azure-sdk-for-go/sdk/azidentity/README.md | 243 + .../sdk/azidentity/TROUBLESHOOTING.md | 207 + .../sdk/azidentity/assets.json | 6 + .../sdk/azidentity/azidentity.go | 178 + .../sdk/azidentity/azure_cli_credential.go | 183 + .../azidentity/chained_token_credential.go | 138 + .../azure-sdk-for-go/sdk/azidentity/ci.yml | 34 + .../azidentity/client_assertion_credential.go | 75 + .../client_certificate_credential.go | 160 + .../azidentity/client_secret_credential.go | 65 + .../sdk/azidentity/confidential_client.go | 156 + .../azidentity/default_azure_credential.go | 196 + .../sdk/azidentity/device_code_credential.go | 106 + .../sdk/azidentity/environment_credential.go | 164 + .../azure-sdk-for-go/sdk/azidentity/errors.go | 128 + .../interactive_browser_credential.go | 86 + .../sdk/azidentity/logging.go | 14 + .../sdk/azidentity/managed_identity_client.go | 404 + .../azidentity/managed_identity_credential.go | 113 + .../sdk/azidentity/on_behalf_of_credential.go | 92 + .../sdk/azidentity/public_client.go | 178 + .../sdk/azidentity/test-resources-pre.ps1 | 36 + .../sdk/azidentity/test-resources.bicep | 1 + .../username_password_credential.go | 66 + .../sdk/azidentity/version.go | 15 + .../sdk/azidentity/workload_identity.go | 126 + .../compute/armcompute/v5/CHANGELOG.md | 327 + .../compute/armcompute/v5/LICENSE.txt | 21 + .../compute/armcompute/v5/README.md | 113 + .../compute/armcompute/v5/assets.json | 6 + .../compute/armcompute/v5/autorest.md | 13 + .../armcompute/v5/availabilitysets_client.go | 485 + .../compute/armcompute/v5/build.go | 7 + .../v5/capacityreservationgroups_client.go | 434 + .../v5/capacityreservations_client.go | 443 + .../compute/armcompute/v5/ci.yml | 28 + .../compute/armcompute/v5/client_factory.go | 333 + .../v5/cloudserviceoperatingsystems_client.go | 301 + .../v5/cloudserviceroleinstances_client.go | 648 + .../armcompute/v5/cloudserviceroles_client.go | 180 + .../armcompute/v5/cloudservices_client.go | 1013 + .../v5/cloudservicesupdatedomain_client.go | 263 + .../v5/communitygalleries_client.go | 109 + .../v5/communitygalleryimages_client.go | 180 + .../communitygalleryimageversions_client.go | 192 + .../compute/armcompute/v5/constants.go | 2717 +++ .../v5/dedicatedhostgroups_client.go | 423 + .../armcompute/v5/dedicatedhosts_client.go | 593 + .../armcompute/v5/diskaccesses_client.go | 846 + .../v5/diskencryptionsets_client.go | 535 + .../armcompute/v5/diskrestorepoint_client.go | 367 + .../compute/armcompute/v5/disks_client.go | 623 + .../compute/armcompute/v5/galleries_client.go | 465 + .../v5/galleryapplications_client.go | 434 + .../v5/galleryapplicationversions_client.go | 464 + .../armcompute/v5/galleryimages_client.go | 433 + .../v5/galleryimageversions_client.go | 463 + .../v5/gallerysharingprofile_client.go | 125 + .../compute/armcompute/v5/images_client.go | 462 + .../armcompute/v5/loganalytics_client.go | 200 + .../compute/armcompute/v5/models.go | 8341 +++++++ .../compute/armcompute/v5/models_serde.go | 19156 ++++++++++++++++ .../armcompute/v5/operations_client.go | 89 + .../compute/armcompute/v5/options.go | 1901 ++ .../v5/proximityplacementgroups_client.go | 421 + .../armcompute/v5/resourceskus_client.go | 105 + .../compute/armcompute/v5/response_types.go | 1646 ++ .../v5/restorepointcollections_client.go | 447 + .../armcompute/v5/restorepoints_client.go | 283 + .../armcompute/v5/sharedgalleries_client.go | 172 + .../v5/sharedgalleryimages_client.go | 182 + .../v5/sharedgalleryimageversions_client.go | 195 + .../compute/armcompute/v5/snapshots_client.go | 625 + .../armcompute/v5/sshpublickeys_client.go | 483 + .../compute/armcompute/v5/time_rfc3339.go | 86 + .../compute/armcompute/v5/usage_client.go | 105 + .../virtualmachineextensionimages_client.go | 259 + .../v5/virtualmachineextensions_client.go | 437 + .../v5/virtualmachineimages_client.go | 470 + .../v5/virtualmachineimagesedgezone_client.go | 430 + .../v5/virtualmachineruncommands_client.go | 562 + .../armcompute/v5/virtualmachines_client.go | 1891 ++ ...virtualmachinescalesetextensions_client.go | 434 + ...almachinescalesetrollingupgrades_client.go | 346 + .../v5/virtualmachinescalesets_client.go | 1861 ++ ...rtualmachinescalesetvmextensions_client.go | 462 + ...tualmachinescalesetvmruncommands_client.go | 462 + .../v5/virtualmachinescalesetvms_client.go | 1321 ++ .../v5/virtualmachinesizes_client.go | 106 + .../resources/armresources/CHANGELOG.md | 45 + .../resources/armresources/LICENSE.txt | 21 + .../resources/armresources/README.md | 100 + .../resources/armresources/assets.json | 6 + .../resources/armresources/autorest.md | 13 + .../resources/armresources/build.go | 7 + .../resources/armresources/ci.yml | 28 + .../resources/armresources/client.go | 1042 + .../resources/armresources/client_factory.go | 86 + .../resources/armresources/constants.go | 402 + .../deploymentoperations_client.go | 685 + .../armresources/deployments_client.go | 2995 +++ .../resources/armresources/models.go | 1173 + .../resources/armresources/models_serde.go | 3108 +++ .../armresources/operations_client.go | 88 + .../resources/armresources/options.go | 654 + .../providerresourcetypes_client.go | 107 + .../armresources/providers_client.go | 511 + .../armresources/resourcegroups_client.go | 495 + .../resources/armresources/response_types.go | 561 + .../resources/armresources/tags_client.go | 544 + .../resources/armresources/time_rfc3339.go | 86 + .../storage/armstorage/CHANGELOG.md | 68 + .../storage/armstorage/LICENSE.txt | 21 + .../storage/armstorage/README.md | 102 + .../storage/armstorage/accounts_client.go | 1330 ++ .../storage/armstorage/assets.json | 6 + .../storage/armstorage/autorest.md | 15 + .../armstorage/blobcontainers_client.go | 1151 + .../blobinventorypolicies_client.go | 318 + .../storage/armstorage/blobservices_client.go | 251 + .../storage/armstorage/build.go | 7 + .../resourcemanager/storage/armstorage/ci.yml | 28 + .../storage/armstorage/client_factory.go | 158 + .../storage/armstorage/constants.go | 1274 + .../armstorage/deletedaccounts_client.go | 163 + .../armstorage/encryptionscopes_client.go | 347 + .../storage/armstorage/fileservices_client.go | 249 + .../storage/armstorage/fileshares_client.go | 572 + .../storage/armstorage/localusers_client.go | 461 + .../armstorage/managementpolicies_client.go | 249 + .../storage/armstorage/models.go | 2832 +++ .../storage/armstorage/models_serde.go | 6851 ++++++ .../objectreplicationpolicies_client.go | 324 + .../storage/armstorage/operations_client.go | 89 + .../storage/armstorage/options.go | 577 + .../privateendpointconnections_client.go | 318 + .../armstorage/privatelinkresources_client.go | 110 + .../storage/armstorage/queue_client.go | 401 + .../armstorage/queueservices_client.go | 250 + .../storage/armstorage/response_types.go | 557 + .../storage/armstorage/skus_client.go | 99 + .../storage/armstorage/table_client.go | 395 + .../armstorage/tableservices_client.go | 250 + .../storage/armstorage/time_rfc3339.go | 86 + .../storage/armstorage/usages_client.go | 105 + .../mgmt/2017-12-01/compute/CHANGELOG.md | 2 - .../mgmt/2017-12-01/compute/_meta.json | 11 - .../2017-12-01/compute/availabilitysets.go | 653 - .../compute/mgmt/2017-12-01/compute/client.go | 43 - .../compute/mgmt/2017-12-01/compute/disks.go | 781 - .../compute/mgmt/2017-12-01/compute/enums.go | 802 - .../compute/mgmt/2017-12-01/compute/images.go | 584 - .../mgmt/2017-12-01/compute/loganalytics.go | 206 - .../compute/mgmt/2017-12-01/compute/models.go | 9510 -------- .../mgmt/2017-12-01/compute/operations.go | 98 - .../mgmt/2017-12-01/compute/resourceskus.go | 144 - .../mgmt/2017-12-01/compute/snapshots.go | 775 - .../compute/mgmt/2017-12-01/compute/usage.go | 155 - .../mgmt/2017-12-01/compute/version.go | 19 - .../compute/virtualmachineextensionimages.go | 270 - .../compute/virtualmachineextensions.go | 363 - .../compute/virtualmachineimages.go | 432 - .../compute/virtualmachineruncommands.go | 237 - .../2017-12-01/compute/virtualmachines.go | 1773 -- .../virtualmachinescalesetextensions.go | 397 - .../virtualmachinescalesetrollingupgrades.go | 268 - .../compute/virtualmachinescalesets.go | 1860 -- .../compute/virtualmachinescalesetvms.go | 1162 - .../2017-12-01/compute/virtualmachinesizes.go | 113 - .../mgmt/2018-05-01/resources/CHANGELOG.md | 2 - .../mgmt/2018-05-01/resources/_meta.json | 11 - .../mgmt/2018-05-01/resources/client.go | 43 - .../resources/deploymentoperations.go | 469 - .../mgmt/2018-05-01/resources/deployments.go | 1618 -- .../mgmt/2018-05-01/resources/enums.go | 56 - .../mgmt/2018-05-01/resources/groups.go | 666 - .../mgmt/2018-05-01/resources/models.go | 2552 -- .../mgmt/2018-05-01/resources/operations.go | 140 - .../mgmt/2018-05-01/resources/providers.go | 382 - .../mgmt/2018-05-01/resources/resources.go | 1360 -- .../mgmt/2018-05-01/resources/tags.go | 443 - .../mgmt/2018-05-01/resources/version.go | 19 - .../mgmt/2017-10-01/storage/CHANGELOG.md | 2 - .../mgmt/2017-10-01/storage/_meta.json | 11 - .../mgmt/2017-10-01/storage/accounts.go | 1026 - .../storage/mgmt/2017-10-01/storage/client.go | 43 - .../storage/mgmt/2017-10-01/storage/enums.go | 355 - .../storage/mgmt/2017-10-01/storage/models.go | 1052 - .../mgmt/2017-10-01/storage/operations.go | 98 - .../storage/mgmt/2017-10-01/storage/skus.go | 102 - .../storage/mgmt/2017-10-01/storage/usage.go | 102 - .../mgmt/2017-10-01/storage/version.go | 19 - .../LICENSE | 21 + .../apps/cache/cache.go | 54 + .../apps/confidential/confidential.go | 685 + .../apps/errors/error_design.md | 111 + .../apps/errors/errors.go | 89 + .../apps/internal/base/base.go | 467 + .../internal/base/internal/storage/items.go | 203 + .../internal/storage/partitioned_storage.go | 436 + .../internal/base/internal/storage/storage.go | 516 + .../apps/internal/exported/exported.go | 34 + .../apps/internal/json/design.md | 140 + .../apps/internal/json/json.go | 184 + .../apps/internal/json/mapslice.go | 333 + .../apps/internal/json/marshal.go | 346 + .../apps/internal/json/struct.go | 290 + .../apps/internal/json/types/time/time.go | 70 + .../apps/internal/local/server.go | 177 + .../apps/internal/oauth/oauth.go | 353 + .../oauth/ops/accesstokens/accesstokens.go | 451 + .../oauth/ops/accesstokens/apptype_string.go | 25 + .../internal/oauth/ops/accesstokens/tokens.go | 338 + .../internal/oauth/ops/authority/authority.go | 552 + .../ops/authority/authorizetype_string.go | 30 + .../internal/oauth/ops/internal/comm/comm.go | 320 + .../oauth/ops/internal/comm/compress.go | 33 + .../oauth/ops/internal/grant/grant.go | 17 + .../apps/internal/oauth/ops/ops.go | 56 + .../ops/wstrust/defs/endpointtype_string.go | 25 + .../wstrust/defs/mex_document_definitions.go | 394 + .../defs/saml_assertion_definitions.go | 230 + .../oauth/ops/wstrust/defs/version_string.go | 25 + .../ops/wstrust/defs/wstrust_endpoint.go | 199 + .../ops/wstrust/defs/wstrust_mex_document.go | 159 + .../internal/oauth/ops/wstrust/wstrust.go | 136 + .../apps/internal/oauth/resolvers.go | 149 + .../apps/internal/options/options.go | 52 + .../apps/internal/shared/shared.go | 72 + .../apps/internal/version/version.go | 8 + .../apps/public/public.go | 713 + .../github.com/golang-jwt/jwt/v5/.gitignore | 4 + vendor/github.com/golang-jwt/jwt/v5/LICENSE | 9 + .../golang-jwt/jwt/v5/MIGRATION_GUIDE.md | 185 + vendor/github.com/golang-jwt/jwt/v5/README.md | 167 + .../github.com/golang-jwt/jwt/v5/SECURITY.md | 19 + .../golang-jwt/jwt/v5/VERSION_HISTORY.md | 137 + vendor/github.com/golang-jwt/jwt/v5/claims.go | 16 + vendor/github.com/golang-jwt/jwt/v5/doc.go | 4 + vendor/github.com/golang-jwt/jwt/v5/ecdsa.go | 134 + .../golang-jwt/jwt/v5/ecdsa_utils.go | 69 + .../github.com/golang-jwt/jwt/v5/ed25519.go | 80 + .../golang-jwt/jwt/v5/ed25519_utils.go | 64 + vendor/github.com/golang-jwt/jwt/v5/errors.go | 49 + .../golang-jwt/jwt/v5/errors_go1_20.go | 47 + .../golang-jwt/jwt/v5/errors_go_other.go | 78 + vendor/github.com/golang-jwt/jwt/v5/hmac.go | 104 + .../golang-jwt/jwt/v5/map_claims.go | 109 + vendor/github.com/golang-jwt/jwt/v5/none.go | 50 + vendor/github.com/golang-jwt/jwt/v5/parser.go | 215 + .../golang-jwt/jwt/v5/parser_option.go | 120 + .../golang-jwt/jwt/v5/registered_claims.go | 63 + vendor/github.com/golang-jwt/jwt/v5/rsa.go | 93 + .../github.com/golang-jwt/jwt/v5/rsa_pss.go | 135 + .../github.com/golang-jwt/jwt/v5/rsa_utils.go | 107 + .../golang-jwt/jwt/v5/signing_method.go | 49 + .../golang-jwt/jwt/v5/staticcheck.conf | 1 + vendor/github.com/golang-jwt/jwt/v5/token.go | 86 + .../golang-jwt/jwt/v5/token_option.go | 5 + vendor/github.com/golang-jwt/jwt/v5/types.go | 150 + .../github.com/golang-jwt/jwt/v5/validator.go | 301 + vendor/github.com/kylelemons/godebug/LICENSE | 202 + .../kylelemons/godebug/diff/diff.go | 186 + .../kylelemons/godebug/pretty/.gitignore | 5 + .../kylelemons/godebug/pretty/doc.go | 25 + .../kylelemons/godebug/pretty/public.go | 188 + .../kylelemons/godebug/pretty/reflect.go | 241 + .../kylelemons/godebug/pretty/structure.go | 223 + vendor/github.com/pkg/browser/LICENSE | 23 + vendor/github.com/pkg/browser/README.md | 55 + vendor/github.com/pkg/browser/browser.go | 57 + .../github.com/pkg/browser/browser_darwin.go | 5 + .../github.com/pkg/browser/browser_freebsd.go | 14 + .../github.com/pkg/browser/browser_linux.go | 21 + .../github.com/pkg/browser/browser_netbsd.go | 14 + .../github.com/pkg/browser/browser_openbsd.go | 14 + .../pkg/browser/browser_unsupported.go | 12 + .../github.com/pkg/browser/browser_windows.go | 7 + vendor/modules.txt | 55 +- 301 files changed, 108023 insertions(+), 32863 deletions(-) delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azure_cli_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/chained_token_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/ci.yml create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_assertion_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_certificate_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/client_secret_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/default_azure_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/device_code_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/errors.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/interactive_browser_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/logging.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/on_behalf_of_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-pre.ps1 create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources.bicep create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/workload_identity.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/CHANGELOG.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/LICENSE.txt create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/README.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/assets.json create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/autorest.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/availabilitysets_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/build.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservationgroups_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/capacityreservations_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/ci.yml create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/client_factory.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceoperatingsystems_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroleinstances_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudserviceroles_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservices_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/cloudservicesupdatedomain_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleries_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/communitygalleryimageversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/constants.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhostgroups_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/dedicatedhosts_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskaccesses_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskencryptionsets_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/diskrestorepoint_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/disks_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleries_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplications_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryapplicationversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/galleryimageversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/gallerysharingprofile_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/images_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/loganalytics_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/models_serde.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/operations_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/options.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/proximityplacementgroups_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/resourceskus_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/response_types.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepointcollections_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/restorepoints_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleries_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sharedgalleryimageversions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/snapshots_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/sshpublickeys_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/time_rfc3339.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/usage_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensionimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineextensions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimages_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineimagesedgezone_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachineruncommands_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachines_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetextensions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetrollingupgrades_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesets_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmextensions_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvmruncommands_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinescalesetvms_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5/virtualmachinesizes_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/CHANGELOG.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/LICENSE.txt create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/README.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/assets.json create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/autorest.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/build.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/ci.yml create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/client_factory.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/constants.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deploymentoperations_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/deployments_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/models_serde.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/operations_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/options.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providerresourcetypes_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/providers_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/resourcegroups_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/response_types.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/tags_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources/time_rfc3339.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/LICENSE.txt create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/build.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/response_types.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/_meta.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/availabilitysets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/disks.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/enums.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/images.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/loganalytics.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/resourceskus.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/snapshots.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/usage.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/version.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensionimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineimages.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachineruncommands.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachines.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetextensions.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetrollingupgrades.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesets.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinescalesetvms.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/virtualmachinesizes.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/_meta.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deploymentoperations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/deployments.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/enums.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/groups.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/providers.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/resources.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/tags.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources/version.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/CHANGELOG.md delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/_meta.json delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/accounts.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/client.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/enums.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/models.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/operations.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/skus.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/usage.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage/version.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/LICENSE create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache/cache.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/error_design.md create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/design.md create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/json.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/mapslice.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/marshal.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/struct.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time/time.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/apptype_string.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authority.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority/authorizetype_string.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/compress.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/grant/grant.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/ops.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/endpointtype_string.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/mex_document_definitions.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/saml_assertion_definitions.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/version_string.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_endpoint.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs/wstrust_mex_document.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/wstrust.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/resolvers.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options/options.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared/shared.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go create mode 100644 vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/.gitignore create mode 100644 vendor/github.com/golang-jwt/jwt/v5/LICENSE create mode 100644 vendor/github.com/golang-jwt/jwt/v5/MIGRATION_GUIDE.md create mode 100644 vendor/github.com/golang-jwt/jwt/v5/README.md create mode 100644 vendor/github.com/golang-jwt/jwt/v5/SECURITY.md create mode 100644 vendor/github.com/golang-jwt/jwt/v5/VERSION_HISTORY.md create mode 100644 vendor/github.com/golang-jwt/jwt/v5/claims.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/doc.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/ecdsa.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/ecdsa_utils.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/ed25519.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/ed25519_utils.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/errors.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/errors_go1_20.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/errors_go_other.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/hmac.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/map_claims.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/none.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/parser.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/parser_option.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/registered_claims.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/rsa.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/rsa_pss.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/rsa_utils.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/signing_method.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/staticcheck.conf create mode 100644 vendor/github.com/golang-jwt/jwt/v5/token.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/token_option.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/types.go create mode 100644 vendor/github.com/golang-jwt/jwt/v5/validator.go create mode 100644 vendor/github.com/kylelemons/godebug/LICENSE create mode 100644 vendor/github.com/kylelemons/godebug/diff/diff.go create mode 100644 vendor/github.com/kylelemons/godebug/pretty/.gitignore create mode 100644 vendor/github.com/kylelemons/godebug/pretty/doc.go create mode 100644 vendor/github.com/kylelemons/godebug/pretty/public.go create mode 100644 vendor/github.com/kylelemons/godebug/pretty/reflect.go create mode 100644 vendor/github.com/kylelemons/godebug/pretty/structure.go create mode 100644 vendor/github.com/pkg/browser/LICENSE create mode 100644 vendor/github.com/pkg/browser/README.md create mode 100644 vendor/github.com/pkg/browser/browser.go create mode 100644 vendor/github.com/pkg/browser/browser_darwin.go create mode 100644 vendor/github.com/pkg/browser/browser_freebsd.go create mode 100644 vendor/github.com/pkg/browser/browser_linux.go create mode 100644 vendor/github.com/pkg/browser/browser_netbsd.go create mode 100644 vendor/github.com/pkg/browser/browser_openbsd.go create mode 100644 vendor/github.com/pkg/browser/browser_unsupported.go create mode 100644 vendor/github.com/pkg/browser/browser_windows.go diff --git a/cmd/osbuild-worker/jobimpl-osbuild.go b/cmd/osbuild-worker/jobimpl-osbuild.go index 2c186ca94..cc0169681 100644 --- a/cmd/osbuild-worker/jobimpl-osbuild.go +++ b/cmd/osbuild-worker/jobimpl-osbuild.go @@ -763,21 +763,29 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error { break } - c, err := azure.NewClient(*impl.AzureConfig.Creds, targetOptions.TenantID) + c, err := azure.NewClient(*impl.AzureConfig.Creds, targetOptions.TenantID, targetOptions.SubscriptionID) if err != nil { targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorInvalidTargetConfig, err.Error(), nil) break } logWithId.Info("[Azure] 🔑 Logged in Azure") + location := targetOptions.Location + if location == "" { + location, err = c.GetResourceGroupLocation(ctx, targetOptions.ResourceGroup) + if err != nil { + targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorInvalidTargetConfig, fmt.Sprintf("retrieving resource group location failed: %v", err), nil) + break + } + } + storageAccountTag := azure.Tag{ Name: "imageBuilderStorageAccount", - Value: fmt.Sprintf("location=%s", targetOptions.Location), + Value: fmt.Sprintf("location=%s", location), } storageAccount, err := c.GetResourceNameByTag( ctx, - targetOptions.SubscriptionID, targetOptions.ResourceGroup, storageAccountTag, ) @@ -793,10 +801,9 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error { err := c.CreateStorageAccount( ctx, - targetOptions.SubscriptionID, targetOptions.ResourceGroup, storageAccount, - targetOptions.Location, + location, storageAccountTag, ) if err != nil { @@ -808,7 +815,6 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error { logWithId.Info("[Azure] 🔑📦 Retrieving a storage account key") storageAccessKey, err := c.GetStorageAccountKey( ctx, - targetOptions.SubscriptionID, targetOptions.ResourceGroup, storageAccount, ) @@ -873,7 +879,7 @@ func (impl *OSBuildJobImpl) Run(job worker.Job) error { storageContainer, blobName, jobTarget.ImageName, - targetOptions.Location, + location, ) if err != nil { targetResult.TargetError = clienterrors.WorkerClientError(clienterrors.ErrorImportingImage, fmt.Sprintf("registering the image failed: %v", err), nil) diff --git a/go.mod b/go.mod index 6bd88507f..87f6613bf 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,10 @@ require ( cloud.google.com/go/compute v1.23.3 cloud.google.com/go/storage v1.36.0 github.com/Azure/azure-sdk-for-go v68.0.0+incompatible + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/azure/auth v0.5.12 @@ -62,6 +66,7 @@ require ( 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/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect github.com/VividCortex/ewma v1.2.0 // indirect github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect @@ -100,6 +105,7 @@ require ( github.com/go-openapi/swag v0.22.4 // indirect github.com/go-openapi/validate v0.22.1 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect + github.com/golang-jwt/jwt/v5 v5.0.0 // indirect github.com/golang/glog v1.1.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect @@ -127,6 +133,7 @@ require ( github.com/klauspost/compress v1.17.3 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kr/text v0.2.0 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -146,6 +153,7 @@ require ( github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opencontainers/runc v1.1.10 // indirect github.com/opencontainers/runtime-spec v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/proglottis/gpgme v0.1.3 // indirect diff --git a/go.sum b/go.sum index 474a3ac39..ed7d6f05e 100644 --- a/go.sum +++ b/go.sum @@ -15,9 +15,17 @@ github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0 h1:qgs/VAMSR+9qFhwTw4OwF2NbVuw+2m83pVZJjqkKQMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0/go.mod h1:uYt4CfhkJA9o0FN7jfE5minm/i4nUE4MjGUJkzB6Zs8= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0/go.mod h1:5kakwfW5CjC9KK+Q4wjXAg+ShuIm2mBMua0ZFj2C8PE= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0 h1:AifHbc4mg0x9zW52WOpKbsHaDKuRhlI7TVl47thgQ70= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0/go.mod h1:T5RfihdXtBDxt1Ch2wobif3TvzTdumDy29kahv6AV9A= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1 h1:AMf7YbZOZIW5b66cXNHMWWT/zkjhz5+a+k/3x40EO7E= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1/go.mod h1:uwfk06ZBcvL/g4VHNjurPfVln9NMbsk2XIZxJ+hu81k= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= @@ -48,6 +56,7 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= +github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= @@ -226,6 +235,7 @@ github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= +github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= @@ -383,6 +393,7 @@ 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/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8= github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8= @@ -471,6 +482,7 @@ github.com/osbuild/pulp-client v0.1.0/go.mod h1:rd/MLdfwwO2cQI1s056h8z32zAi3Bo90 github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= +github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -697,6 +709,7 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/internal/upload/azure/azure.go b/internal/upload/azure/azure.go index ce92db95a..6e7914a5c 100644 --- a/internal/upload/azure/azure.go +++ b/internal/upload/azure/azure.go @@ -5,29 +5,43 @@ import ( "errors" "fmt" - "github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute" - "github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources" - "github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure/auth" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" + + "github.com/osbuild/osbuild-composer/internal/common" ) type Client struct { - authorizer autorest.Authorizer + creds *azidentity.ClientSecretCredential + resFact *armresources.ClientFactory + storFact *armstorage.ClientFactory } // NewClient creates a client for accessing the Azure API. // See https://docs.microsoft.com/en-us/rest/api/azure/ // If you need to work with the Azure Storage API, see NewStorageClient -func NewClient(credentials Credentials, tenantID string) (*Client, error) { - credentialsConfig := auth.NewClientCredentialsConfig(credentials.clientID, credentials.clientSecret, tenantID) - authorizer, err := credentialsConfig.Authorizer() +func NewClient(credentials Credentials, tenantID, subscriptionID string) (*Client, error) { + creds, err := azidentity.NewClientSecretCredential(tenantID, credentials.clientID, credentials.clientSecret, nil) if err != nil { - return nil, fmt.Errorf("creating an azure authorizer failed: %v", err) + return nil, fmt.Errorf("creating azure ClientSecretCredential failed: %v", err) + } + + resFact, err := armresources.NewClientFactory(subscriptionID, creds, nil) + if err != nil { + return nil, fmt.Errorf("creating resources client factory failed: %v", err) + } + + storFact, err := armstorage.NewClientFactory(subscriptionID, creds, nil) + if err != nil { + return nil, fmt.Errorf("creating storage client factory failed: %v", err) } return &Client{ - authorizer: authorizer, + creds, + resFact, + storFact, }, nil } @@ -41,29 +55,29 @@ type Tag struct { // given `tag`. Note that if multiple resources with the same tag exists // in the specified resource group, only one name is returned. It's undefined // which one it is. -func (ac Client) GetResourceNameByTag(ctx context.Context, subscriptionID, resourceGroup string, tag Tag) (string, error) { - c := resources.NewClient(subscriptionID) - c.Authorizer = ac.authorizer +func (ac Client) GetResourceNameByTag(ctx context.Context, resourceGroup string, tag Tag) (string, error) { + c := ac.resFact.NewClient() - filter := fmt.Sprintf("tagName eq '%s' and tagValue eq '%s'", tag.Name, tag.Value) - result, err := c.ListByResourceGroup(ctx, resourceGroup, filter, "", nil) + pager := c.NewListByResourceGroupPager(resourceGroup, &armresources.ClientListByResourceGroupOptions{ + Filter: common.ToPtr(fmt.Sprintf("tagName eq '%s' and tagValue eq '%s'", tag.Name, tag.Value)), + }) + + result, err := pager.NextPage(ctx) if err != nil { return "", fmt.Errorf("listing resources failed: %v", err) } - if len(result.Values()) < 1 { + if len(result.Value) < 1 { return "", nil } - - return *result.Values()[0].Name, nil + return *result.Value[0].Name, nil } // GetResourceGroupLocation returns the location of the given resource group. -func (ac Client) GetResourceGroupLocation(ctx context.Context, subscriptionID, resourceGroup string) (string, error) { - c := resources.NewGroupsClient(subscriptionID) - c.Authorizer = ac.authorizer +func (ac Client) GetResourceGroupLocation(ctx context.Context, resourceGroup string) (string, error) { + c := ac.resFact.NewResourceGroupsClient() - group, err := c.Get(ctx, resourceGroup) + group, err := c.Get(ctx, resourceGroup, nil) if err != nil { return "", fmt.Errorf("retrieving resource group failed: %v", err) } @@ -76,38 +90,32 @@ func (ac Client) GetResourceGroupLocation(ctx context.Context, subscriptionID, r // can be used to specify a tag attached to the account. // The location is optional and if not provided, it is determined // from the resource group. -func (ac Client) CreateStorageAccount(ctx context.Context, subscriptionID, resourceGroup, name, location string, tag Tag) error { - c := storage.NewAccountsClient(subscriptionID) - c.Authorizer = ac.authorizer +func (ac Client) CreateStorageAccount(ctx context.Context, resourceGroup, name, location string, tag Tag) error { + c := ac.storFact.NewAccountsClient() var err error if location == "" { - location, err = ac.GetResourceGroupLocation(ctx, subscriptionID, resourceGroup) + location, err = ac.GetResourceGroupLocation(ctx, resourceGroup) if err != nil { return fmt.Errorf("retrieving resource group location failed: %v", err) } } - result, err := c.Create(ctx, resourceGroup, name, storage.AccountCreateParameters{ - Sku: &storage.Sku{ - Name: storage.StandardLRS, - Tier: storage.Standard, + poller, err := c.BeginCreate(ctx, resourceGroup, name, armstorage.AccountCreateParameters{ + SKU: &armstorage.SKU{ + Name: common.ToPtr(armstorage.SKUNameStandardLRS), + Tier: common.ToPtr(armstorage.SKUTierStandard), }, Location: &location, Tags: map[string]*string{ tag.Name: &tag.Value, }, - }) + }, nil) if err != nil { return fmt.Errorf("sending the create storage account request failed: %v", err) } - err = result.WaitForCompletionRef(ctx, c.Client) - if err != nil { - return fmt.Errorf("waiting for the create storage account request failed: %v", err) - } - - _, err = result.Result(c) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { return fmt.Errorf("create storage account request failed: %v", err) } @@ -118,63 +126,56 @@ func (ac Client) CreateStorageAccount(ctx context.Context, subscriptionID, resou // GetStorageAccountKey returns a storage account key that can be used to // access the given storage account. This method always returns only the first // key. -func (ac Client) GetStorageAccountKey(ctx context.Context, subscriptionID, resourceGroup string, storageAccount string) (string, error) { - c := storage.NewAccountsClient(subscriptionID) - c.Authorizer = ac.authorizer - - keys, err := c.ListKeys(ctx, resourceGroup, storageAccount) +func (ac Client) GetStorageAccountKey(ctx context.Context, resourceGroup string, storageAccount string) (string, error) { + c := ac.storFact.NewAccountsClient() + keys, err := c.ListKeys(ctx, resourceGroup, storageAccount, nil) if err != nil { return "", fmt.Errorf("retrieving keys for a storage account failed: %v", err) } - if len(*keys.Keys) == 0 { + if len(keys.Keys) == 0 { return "", errors.New("azure returned an empty list of keys") } - return *(*keys.Keys)[0].Value, nil + return *keys.Keys[0].Value, nil } // RegisterImage creates a generalized V1 Linux image from a given blob. // The location is optional and if not provided, it is determined // from the resource group. func (ac Client) RegisterImage(ctx context.Context, subscriptionID, resourceGroup, storageAccount, storageContainer, blobName, imageName, location string) error { - c := compute.NewImagesClient(subscriptionID) - c.Authorizer = ac.authorizer + c, err := armcompute.NewImagesClient(subscriptionID, ac.creds, nil) + if err != nil { + return fmt.Errorf("unable to create compute client: %v", err) + } blobURI := fmt.Sprintf("https://%s.blob.core.windows.net/%s/%s", storageAccount, storageContainer, blobName) - var err error if location == "" { - location, err = ac.GetResourceGroupLocation(ctx, subscriptionID, resourceGroup) + location, err = ac.GetResourceGroupLocation(ctx, resourceGroup) if err != nil { return fmt.Errorf("retrieving resource group location failed: %v", err) } } - imageFuture, err := c.CreateOrUpdate(ctx, resourceGroup, imageName, compute.Image{ - Response: autorest.Response{}, - ImageProperties: &compute.ImageProperties{ + imageFuture, err := c.BeginCreateOrUpdate(ctx, resourceGroup, imageName, armcompute.Image{ + Properties: &armcompute.ImageProperties{ SourceVirtualMachine: nil, - StorageProfile: &compute.ImageStorageProfile{ - OsDisk: &compute.ImageOSDisk{ - OsType: compute.Linux, + StorageProfile: &armcompute.ImageStorageProfile{ + OSDisk: &armcompute.ImageOSDisk{ + OSType: common.ToPtr(armcompute.OperatingSystemTypesLinux), BlobURI: &blobURI, - OsState: compute.Generalized, + OSState: common.ToPtr(armcompute.OperatingSystemStateTypesGeneralized), }, }, }, Location: &location, - }) + }, nil) if err != nil { return fmt.Errorf("sending the create image request failed: %v", err) } - err = imageFuture.WaitForCompletionRef(ctx, c.Client) - if err != nil { - return fmt.Errorf("waiting for the create image request failed: %v", err) - } - - _, err = imageFuture.Result(c) + _, err = imageFuture.PollUntilDone(ctx, nil) if err != nil { return fmt.Errorf("create image request failed: %v", err) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute/models.go deleted file mode 100644 index b25110ee2..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/compute/mgmt/compute/models.go +++ /dev/null @@ -1,992 +0,0 @@ -//go:build go1.9 -// +build go1.9 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This code was auto-generated by: -// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder - -package compute - -import ( - "context" - - original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute" -) - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type AccessLevel = original.AccessLevel - -const ( - None AccessLevel = original.None - Read AccessLevel = original.Read -) - -type CachingTypes = original.CachingTypes - -const ( - CachingTypesNone CachingTypes = original.CachingTypesNone - CachingTypesReadOnly CachingTypes = original.CachingTypesReadOnly - CachingTypesReadWrite CachingTypes = original.CachingTypesReadWrite -) - -type ComponentNames = original.ComponentNames - -const ( - MicrosoftWindowsShellSetup ComponentNames = original.MicrosoftWindowsShellSetup -) - -type DiskCreateOption = original.DiskCreateOption - -const ( - Attach DiskCreateOption = original.Attach - Copy DiskCreateOption = original.Copy - Empty DiskCreateOption = original.Empty - FromImage DiskCreateOption = original.FromImage - Import DiskCreateOption = original.Import -) - -type DiskCreateOptionTypes = original.DiskCreateOptionTypes - -const ( - DiskCreateOptionTypesAttach DiskCreateOptionTypes = original.DiskCreateOptionTypesAttach - DiskCreateOptionTypesEmpty DiskCreateOptionTypes = original.DiskCreateOptionTypesEmpty - DiskCreateOptionTypesFromImage DiskCreateOptionTypes = original.DiskCreateOptionTypesFromImage -) - -type IPVersion = original.IPVersion - -const ( - IPv4 IPVersion = original.IPv4 - IPv6 IPVersion = original.IPv6 -) - -type InstanceViewTypes = original.InstanceViewTypes - -const ( - InstanceView InstanceViewTypes = original.InstanceView -) - -type IntervalInMins = original.IntervalInMins - -const ( - FiveMins IntervalInMins = original.FiveMins - SixtyMins IntervalInMins = original.SixtyMins - ThirtyMins IntervalInMins = original.ThirtyMins - ThreeMins IntervalInMins = original.ThreeMins -) - -type MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypes - -const ( - MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesMaintenanceAborted - MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesMaintenanceCompleted - MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesNone - MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesRetryLater -) - -type OperatingSystemStateTypes = original.OperatingSystemStateTypes - -const ( - Generalized OperatingSystemStateTypes = original.Generalized - Specialized OperatingSystemStateTypes = original.Specialized -) - -type OperatingSystemTypes = original.OperatingSystemTypes - -const ( - Linux OperatingSystemTypes = original.Linux - Windows OperatingSystemTypes = original.Windows -) - -type PassNames = original.PassNames - -const ( - OobeSystem PassNames = original.OobeSystem -) - -type ProtocolTypes = original.ProtocolTypes - -const ( - HTTP ProtocolTypes = original.HTTP - HTTPS ProtocolTypes = original.HTTPS -) - -type ResourceIdentityType = original.ResourceIdentityType - -const ( - ResourceIdentityTypeNone ResourceIdentityType = original.ResourceIdentityTypeNone - ResourceIdentityTypeSystemAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssigned - ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssignedUserAssigned - ResourceIdentityTypeUserAssigned ResourceIdentityType = original.ResourceIdentityTypeUserAssigned -) - -type ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleType - -const ( - ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeAutomatic - ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeManual - ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeNone -) - -type ResourceSkuRestrictionsReasonCode = original.ResourceSkuRestrictionsReasonCode - -const ( - NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = original.NotAvailableForSubscription - QuotaID ResourceSkuRestrictionsReasonCode = original.QuotaID -) - -type ResourceSkuRestrictionsType = original.ResourceSkuRestrictionsType - -const ( - Location ResourceSkuRestrictionsType = original.Location - Zone ResourceSkuRestrictionsType = original.Zone -) - -type RollingUpgradeActionType = original.RollingUpgradeActionType - -const ( - Cancel RollingUpgradeActionType = original.Cancel - Start RollingUpgradeActionType = original.Start -) - -type RollingUpgradeStatusCode = original.RollingUpgradeStatusCode - -const ( - Cancelled RollingUpgradeStatusCode = original.Cancelled - Completed RollingUpgradeStatusCode = original.Completed - Faulted RollingUpgradeStatusCode = original.Faulted - RollingForward RollingUpgradeStatusCode = original.RollingForward -) - -type SettingNames = original.SettingNames - -const ( - AutoLogon SettingNames = original.AutoLogon - FirstLogonCommands SettingNames = original.FirstLogonCommands -) - -type StatusLevelTypes = original.StatusLevelTypes - -const ( - Error StatusLevelTypes = original.Error - Info StatusLevelTypes = original.Info - Warning StatusLevelTypes = original.Warning -) - -type StorageAccountTypes = original.StorageAccountTypes - -const ( - PremiumLRS StorageAccountTypes = original.PremiumLRS - StandardLRS StorageAccountTypes = original.StandardLRS -) - -type UpgradeMode = original.UpgradeMode - -const ( - Automatic UpgradeMode = original.Automatic - Manual UpgradeMode = original.Manual - Rolling UpgradeMode = original.Rolling -) - -type UpgradeOperationInvoker = original.UpgradeOperationInvoker - -const ( - Platform UpgradeOperationInvoker = original.Platform - Unknown UpgradeOperationInvoker = original.Unknown - User UpgradeOperationInvoker = original.User -) - -type UpgradeState = original.UpgradeState - -const ( - UpgradeStateCancelled UpgradeState = original.UpgradeStateCancelled - UpgradeStateCompleted UpgradeState = original.UpgradeStateCompleted - UpgradeStateFaulted UpgradeState = original.UpgradeStateFaulted - UpgradeStateRollingForward UpgradeState = original.UpgradeStateRollingForward -) - -type VirtualMachineEvictionPolicyTypes = original.VirtualMachineEvictionPolicyTypes - -const ( - Deallocate VirtualMachineEvictionPolicyTypes = original.Deallocate - Delete VirtualMachineEvictionPolicyTypes = original.Delete -) - -type VirtualMachinePriorityTypes = original.VirtualMachinePriorityTypes - -const ( - Low VirtualMachinePriorityTypes = original.Low - Regular VirtualMachinePriorityTypes = original.Regular -) - -type VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleType - -const ( - VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleTypeAutomatic - VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleTypeNone -) - -type VirtualMachineSizeTypes = original.VirtualMachineSizeTypes - -const ( - BasicA0 VirtualMachineSizeTypes = original.BasicA0 - BasicA1 VirtualMachineSizeTypes = original.BasicA1 - BasicA2 VirtualMachineSizeTypes = original.BasicA2 - BasicA3 VirtualMachineSizeTypes = original.BasicA3 - BasicA4 VirtualMachineSizeTypes = original.BasicA4 - StandardA0 VirtualMachineSizeTypes = original.StandardA0 - StandardA1 VirtualMachineSizeTypes = original.StandardA1 - StandardA10 VirtualMachineSizeTypes = original.StandardA10 - StandardA11 VirtualMachineSizeTypes = original.StandardA11 - StandardA1V2 VirtualMachineSizeTypes = original.StandardA1V2 - StandardA2 VirtualMachineSizeTypes = original.StandardA2 - StandardA2mV2 VirtualMachineSizeTypes = original.StandardA2mV2 - StandardA2V2 VirtualMachineSizeTypes = original.StandardA2V2 - StandardA3 VirtualMachineSizeTypes = original.StandardA3 - StandardA4 VirtualMachineSizeTypes = original.StandardA4 - StandardA4mV2 VirtualMachineSizeTypes = original.StandardA4mV2 - StandardA4V2 VirtualMachineSizeTypes = original.StandardA4V2 - StandardA5 VirtualMachineSizeTypes = original.StandardA5 - StandardA6 VirtualMachineSizeTypes = original.StandardA6 - StandardA7 VirtualMachineSizeTypes = original.StandardA7 - StandardA8 VirtualMachineSizeTypes = original.StandardA8 - StandardA8mV2 VirtualMachineSizeTypes = original.StandardA8mV2 - StandardA8V2 VirtualMachineSizeTypes = original.StandardA8V2 - StandardA9 VirtualMachineSizeTypes = original.StandardA9 - StandardB1ms VirtualMachineSizeTypes = original.StandardB1ms - StandardB1s VirtualMachineSizeTypes = original.StandardB1s - StandardB2ms VirtualMachineSizeTypes = original.StandardB2ms - StandardB2s VirtualMachineSizeTypes = original.StandardB2s - StandardB4ms VirtualMachineSizeTypes = original.StandardB4ms - StandardB8ms VirtualMachineSizeTypes = original.StandardB8ms - StandardD1 VirtualMachineSizeTypes = original.StandardD1 - StandardD11 VirtualMachineSizeTypes = original.StandardD11 - StandardD11V2 VirtualMachineSizeTypes = original.StandardD11V2 - StandardD12 VirtualMachineSizeTypes = original.StandardD12 - StandardD12V2 VirtualMachineSizeTypes = original.StandardD12V2 - StandardD13 VirtualMachineSizeTypes = original.StandardD13 - StandardD13V2 VirtualMachineSizeTypes = original.StandardD13V2 - StandardD14 VirtualMachineSizeTypes = original.StandardD14 - StandardD14V2 VirtualMachineSizeTypes = original.StandardD14V2 - StandardD15V2 VirtualMachineSizeTypes = original.StandardD15V2 - StandardD16sV3 VirtualMachineSizeTypes = original.StandardD16sV3 - StandardD16V3 VirtualMachineSizeTypes = original.StandardD16V3 - StandardD1V2 VirtualMachineSizeTypes = original.StandardD1V2 - StandardD2 VirtualMachineSizeTypes = original.StandardD2 - StandardD2sV3 VirtualMachineSizeTypes = original.StandardD2sV3 - StandardD2V2 VirtualMachineSizeTypes = original.StandardD2V2 - StandardD2V3 VirtualMachineSizeTypes = original.StandardD2V3 - StandardD3 VirtualMachineSizeTypes = original.StandardD3 - StandardD32sV3 VirtualMachineSizeTypes = original.StandardD32sV3 - StandardD32V3 VirtualMachineSizeTypes = original.StandardD32V3 - StandardD3V2 VirtualMachineSizeTypes = original.StandardD3V2 - StandardD4 VirtualMachineSizeTypes = original.StandardD4 - StandardD4sV3 VirtualMachineSizeTypes = original.StandardD4sV3 - StandardD4V2 VirtualMachineSizeTypes = original.StandardD4V2 - StandardD4V3 VirtualMachineSizeTypes = original.StandardD4V3 - StandardD5V2 VirtualMachineSizeTypes = original.StandardD5V2 - StandardD64sV3 VirtualMachineSizeTypes = original.StandardD64sV3 - StandardD64V3 VirtualMachineSizeTypes = original.StandardD64V3 - StandardD8sV3 VirtualMachineSizeTypes = original.StandardD8sV3 - StandardD8V3 VirtualMachineSizeTypes = original.StandardD8V3 - StandardDS1 VirtualMachineSizeTypes = original.StandardDS1 - StandardDS11 VirtualMachineSizeTypes = original.StandardDS11 - StandardDS11V2 VirtualMachineSizeTypes = original.StandardDS11V2 - StandardDS12 VirtualMachineSizeTypes = original.StandardDS12 - StandardDS12V2 VirtualMachineSizeTypes = original.StandardDS12V2 - StandardDS13 VirtualMachineSizeTypes = original.StandardDS13 - StandardDS132V2 VirtualMachineSizeTypes = original.StandardDS132V2 - StandardDS134V2 VirtualMachineSizeTypes = original.StandardDS134V2 - StandardDS13V2 VirtualMachineSizeTypes = original.StandardDS13V2 - StandardDS14 VirtualMachineSizeTypes = original.StandardDS14 - StandardDS144V2 VirtualMachineSizeTypes = original.StandardDS144V2 - StandardDS148V2 VirtualMachineSizeTypes = original.StandardDS148V2 - StandardDS14V2 VirtualMachineSizeTypes = original.StandardDS14V2 - StandardDS15V2 VirtualMachineSizeTypes = original.StandardDS15V2 - StandardDS1V2 VirtualMachineSizeTypes = original.StandardDS1V2 - StandardDS2 VirtualMachineSizeTypes = original.StandardDS2 - StandardDS2V2 VirtualMachineSizeTypes = original.StandardDS2V2 - StandardDS3 VirtualMachineSizeTypes = original.StandardDS3 - StandardDS3V2 VirtualMachineSizeTypes = original.StandardDS3V2 - StandardDS4 VirtualMachineSizeTypes = original.StandardDS4 - StandardDS4V2 VirtualMachineSizeTypes = original.StandardDS4V2 - StandardDS5V2 VirtualMachineSizeTypes = original.StandardDS5V2 - StandardE16sV3 VirtualMachineSizeTypes = original.StandardE16sV3 - StandardE16V3 VirtualMachineSizeTypes = original.StandardE16V3 - StandardE2sV3 VirtualMachineSizeTypes = original.StandardE2sV3 - StandardE2V3 VirtualMachineSizeTypes = original.StandardE2V3 - StandardE3216V3 VirtualMachineSizeTypes = original.StandardE3216V3 - StandardE328sV3 VirtualMachineSizeTypes = original.StandardE328sV3 - StandardE32sV3 VirtualMachineSizeTypes = original.StandardE32sV3 - StandardE32V3 VirtualMachineSizeTypes = original.StandardE32V3 - StandardE4sV3 VirtualMachineSizeTypes = original.StandardE4sV3 - StandardE4V3 VirtualMachineSizeTypes = original.StandardE4V3 - StandardE6416sV3 VirtualMachineSizeTypes = original.StandardE6416sV3 - StandardE6432sV3 VirtualMachineSizeTypes = original.StandardE6432sV3 - StandardE64sV3 VirtualMachineSizeTypes = original.StandardE64sV3 - StandardE64V3 VirtualMachineSizeTypes = original.StandardE64V3 - StandardE8sV3 VirtualMachineSizeTypes = original.StandardE8sV3 - StandardE8V3 VirtualMachineSizeTypes = original.StandardE8V3 - StandardF1 VirtualMachineSizeTypes = original.StandardF1 - StandardF16 VirtualMachineSizeTypes = original.StandardF16 - StandardF16s VirtualMachineSizeTypes = original.StandardF16s - StandardF16sV2 VirtualMachineSizeTypes = original.StandardF16sV2 - StandardF1s VirtualMachineSizeTypes = original.StandardF1s - StandardF2 VirtualMachineSizeTypes = original.StandardF2 - StandardF2s VirtualMachineSizeTypes = original.StandardF2s - StandardF2sV2 VirtualMachineSizeTypes = original.StandardF2sV2 - StandardF32sV2 VirtualMachineSizeTypes = original.StandardF32sV2 - StandardF4 VirtualMachineSizeTypes = original.StandardF4 - StandardF4s VirtualMachineSizeTypes = original.StandardF4s - StandardF4sV2 VirtualMachineSizeTypes = original.StandardF4sV2 - StandardF64sV2 VirtualMachineSizeTypes = original.StandardF64sV2 - StandardF72sV2 VirtualMachineSizeTypes = original.StandardF72sV2 - StandardF8 VirtualMachineSizeTypes = original.StandardF8 - StandardF8s VirtualMachineSizeTypes = original.StandardF8s - StandardF8sV2 VirtualMachineSizeTypes = original.StandardF8sV2 - StandardG1 VirtualMachineSizeTypes = original.StandardG1 - StandardG2 VirtualMachineSizeTypes = original.StandardG2 - StandardG3 VirtualMachineSizeTypes = original.StandardG3 - StandardG4 VirtualMachineSizeTypes = original.StandardG4 - StandardG5 VirtualMachineSizeTypes = original.StandardG5 - StandardGS1 VirtualMachineSizeTypes = original.StandardGS1 - StandardGS2 VirtualMachineSizeTypes = original.StandardGS2 - StandardGS3 VirtualMachineSizeTypes = original.StandardGS3 - StandardGS4 VirtualMachineSizeTypes = original.StandardGS4 - StandardGS44 VirtualMachineSizeTypes = original.StandardGS44 - StandardGS48 VirtualMachineSizeTypes = original.StandardGS48 - StandardGS5 VirtualMachineSizeTypes = original.StandardGS5 - StandardGS516 VirtualMachineSizeTypes = original.StandardGS516 - StandardGS58 VirtualMachineSizeTypes = original.StandardGS58 - StandardH16 VirtualMachineSizeTypes = original.StandardH16 - StandardH16m VirtualMachineSizeTypes = original.StandardH16m - StandardH16mr VirtualMachineSizeTypes = original.StandardH16mr - StandardH16r VirtualMachineSizeTypes = original.StandardH16r - StandardH8 VirtualMachineSizeTypes = original.StandardH8 - StandardH8m VirtualMachineSizeTypes = original.StandardH8m - StandardL16s VirtualMachineSizeTypes = original.StandardL16s - StandardL32s VirtualMachineSizeTypes = original.StandardL32s - StandardL4s VirtualMachineSizeTypes = original.StandardL4s - StandardL8s VirtualMachineSizeTypes = original.StandardL8s - StandardM12832ms VirtualMachineSizeTypes = original.StandardM12832ms - StandardM12864ms VirtualMachineSizeTypes = original.StandardM12864ms - StandardM128ms VirtualMachineSizeTypes = original.StandardM128ms - StandardM128s VirtualMachineSizeTypes = original.StandardM128s - StandardM6416ms VirtualMachineSizeTypes = original.StandardM6416ms - StandardM6432ms VirtualMachineSizeTypes = original.StandardM6432ms - StandardM64ms VirtualMachineSizeTypes = original.StandardM64ms - StandardM64s VirtualMachineSizeTypes = original.StandardM64s - StandardNC12 VirtualMachineSizeTypes = original.StandardNC12 - StandardNC12sV2 VirtualMachineSizeTypes = original.StandardNC12sV2 - StandardNC12sV3 VirtualMachineSizeTypes = original.StandardNC12sV3 - StandardNC24 VirtualMachineSizeTypes = original.StandardNC24 - StandardNC24r VirtualMachineSizeTypes = original.StandardNC24r - StandardNC24rsV2 VirtualMachineSizeTypes = original.StandardNC24rsV2 - StandardNC24rsV3 VirtualMachineSizeTypes = original.StandardNC24rsV3 - StandardNC24sV2 VirtualMachineSizeTypes = original.StandardNC24sV2 - StandardNC24sV3 VirtualMachineSizeTypes = original.StandardNC24sV3 - StandardNC6 VirtualMachineSizeTypes = original.StandardNC6 - StandardNC6sV2 VirtualMachineSizeTypes = original.StandardNC6sV2 - StandardNC6sV3 VirtualMachineSizeTypes = original.StandardNC6sV3 - StandardND12s VirtualMachineSizeTypes = original.StandardND12s - StandardND24rs VirtualMachineSizeTypes = original.StandardND24rs - StandardND24s VirtualMachineSizeTypes = original.StandardND24s - StandardND6s VirtualMachineSizeTypes = original.StandardND6s - StandardNV12 VirtualMachineSizeTypes = original.StandardNV12 - StandardNV24 VirtualMachineSizeTypes = original.StandardNV24 - StandardNV6 VirtualMachineSizeTypes = original.StandardNV6 -) - -type APIEntityReference = original.APIEntityReference -type APIError = original.APIError -type APIErrorBase = original.APIErrorBase -type AccessURI = original.AccessURI -type AccessURIOutput = original.AccessURIOutput -type AccessURIRaw = original.AccessURIRaw -type AdditionalUnattendContent = original.AdditionalUnattendContent -type AutoOSUpgradePolicy = original.AutoOSUpgradePolicy -type AvailabilitySet = original.AvailabilitySet -type AvailabilitySetListResult = original.AvailabilitySetListResult -type AvailabilitySetListResultIterator = original.AvailabilitySetListResultIterator -type AvailabilitySetListResultPage = original.AvailabilitySetListResultPage -type AvailabilitySetProperties = original.AvailabilitySetProperties -type AvailabilitySetUpdate = original.AvailabilitySetUpdate -type AvailabilitySetsClient = original.AvailabilitySetsClient -type BaseClient = original.BaseClient -type BootDiagnostics = original.BootDiagnostics -type BootDiagnosticsInstanceView = original.BootDiagnosticsInstanceView -type CreationData = original.CreationData -type DataDisk = original.DataDisk -type DataDiskImage = original.DataDiskImage -type DiagnosticsProfile = original.DiagnosticsProfile -type Disk = original.Disk -type DiskEncryptionSettings = original.DiskEncryptionSettings -type DiskInstanceView = original.DiskInstanceView -type DiskList = original.DiskList -type DiskListIterator = original.DiskListIterator -type DiskListPage = original.DiskListPage -type DiskProperties = original.DiskProperties -type DiskSku = original.DiskSku -type DiskUpdate = original.DiskUpdate -type DiskUpdateProperties = original.DiskUpdateProperties -type DisksClient = original.DisksClient -type DisksCreateOrUpdateFuture = original.DisksCreateOrUpdateFuture -type DisksDeleteFuture = original.DisksDeleteFuture -type DisksGrantAccessFuture = original.DisksGrantAccessFuture -type DisksRevokeAccessFuture = original.DisksRevokeAccessFuture -type DisksUpdateFuture = original.DisksUpdateFuture -type EncryptionSettings = original.EncryptionSettings -type GrantAccessData = original.GrantAccessData -type HardwareProfile = original.HardwareProfile -type Image = original.Image -type ImageDataDisk = original.ImageDataDisk -type ImageDiskReference = original.ImageDiskReference -type ImageListResult = original.ImageListResult -type ImageListResultIterator = original.ImageListResultIterator -type ImageListResultPage = original.ImageListResultPage -type ImageOSDisk = original.ImageOSDisk -type ImageProperties = original.ImageProperties -type ImageReference = original.ImageReference -type ImageStorageProfile = original.ImageStorageProfile -type ImageUpdate = original.ImageUpdate -type ImagesClient = original.ImagesClient -type ImagesCreateOrUpdateFuture = original.ImagesCreateOrUpdateFuture -type ImagesDeleteFuture = original.ImagesDeleteFuture -type ImagesUpdateFuture = original.ImagesUpdateFuture -type InnerError = original.InnerError -type InstanceViewStatus = original.InstanceViewStatus -type KeyVaultAndKeyReference = original.KeyVaultAndKeyReference -type KeyVaultAndSecretReference = original.KeyVaultAndSecretReference -type KeyVaultKeyReference = original.KeyVaultKeyReference -type KeyVaultSecretReference = original.KeyVaultSecretReference -type LinuxConfiguration = original.LinuxConfiguration -type ListUsagesResult = original.ListUsagesResult -type ListUsagesResultIterator = original.ListUsagesResultIterator -type ListUsagesResultPage = original.ListUsagesResultPage -type ListVirtualMachineExtensionImage = original.ListVirtualMachineExtensionImage -type ListVirtualMachineImageResource = original.ListVirtualMachineImageResource -type LogAnalyticsClient = original.LogAnalyticsClient -type LogAnalyticsExportRequestRateByIntervalFuture = original.LogAnalyticsExportRequestRateByIntervalFuture -type LogAnalyticsExportThrottledRequestsFuture = original.LogAnalyticsExportThrottledRequestsFuture -type LogAnalyticsInputBase = original.LogAnalyticsInputBase -type LogAnalyticsOperationResult = original.LogAnalyticsOperationResult -type LogAnalyticsOutput = original.LogAnalyticsOutput -type LongRunningOperationProperties = original.LongRunningOperationProperties -type MaintenanceRedeployStatus = original.MaintenanceRedeployStatus -type ManagedDiskParameters = original.ManagedDiskParameters -type NetworkInterfaceReference = original.NetworkInterfaceReference -type NetworkInterfaceReferenceProperties = original.NetworkInterfaceReferenceProperties -type NetworkProfile = original.NetworkProfile -type OSDisk = original.OSDisk -type OSDiskImage = original.OSDiskImage -type OSProfile = original.OSProfile -type OperationListResult = original.OperationListResult -type OperationStatusResponse = original.OperationStatusResponse -type OperationValue = original.OperationValue -type OperationValueDisplay = original.OperationValueDisplay -type OperationsClient = original.OperationsClient -type Plan = original.Plan -type PurchasePlan = original.PurchasePlan -type RecoveryWalkResponse = original.RecoveryWalkResponse -type RequestRateByIntervalInput = original.RequestRateByIntervalInput -type Resource = original.Resource -type ResourceSku = original.ResourceSku -type ResourceSkuCapabilities = original.ResourceSkuCapabilities -type ResourceSkuCapacity = original.ResourceSkuCapacity -type ResourceSkuCosts = original.ResourceSkuCosts -type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo -type ResourceSkuRestrictionInfo = original.ResourceSkuRestrictionInfo -type ResourceSkuRestrictions = original.ResourceSkuRestrictions -type ResourceSkusClient = original.ResourceSkusClient -type ResourceSkusResult = original.ResourceSkusResult -type ResourceSkusResultIterator = original.ResourceSkusResultIterator -type ResourceSkusResultPage = original.ResourceSkusResultPage -type ResourceUpdate = original.ResourceUpdate -type RollbackStatusInfo = original.RollbackStatusInfo -type RollingUpgradePolicy = original.RollingUpgradePolicy -type RollingUpgradeProgressInfo = original.RollingUpgradeProgressInfo -type RollingUpgradeRunningStatus = original.RollingUpgradeRunningStatus -type RollingUpgradeStatusInfo = original.RollingUpgradeStatusInfo -type RollingUpgradeStatusInfoProperties = original.RollingUpgradeStatusInfoProperties -type RunCommandDocument = original.RunCommandDocument -type RunCommandDocumentBase = original.RunCommandDocumentBase -type RunCommandInput = original.RunCommandInput -type RunCommandInputParameter = original.RunCommandInputParameter -type RunCommandListResult = original.RunCommandListResult -type RunCommandListResultIterator = original.RunCommandListResultIterator -type RunCommandListResultPage = original.RunCommandListResultPage -type RunCommandParameterDefinition = original.RunCommandParameterDefinition -type RunCommandResult = original.RunCommandResult -type RunCommandResultProperties = original.RunCommandResultProperties -type SSHConfiguration = original.SSHConfiguration -type SSHPublicKey = original.SSHPublicKey -type Sku = original.Sku -type Snapshot = original.Snapshot -type SnapshotList = original.SnapshotList -type SnapshotListIterator = original.SnapshotListIterator -type SnapshotListPage = original.SnapshotListPage -type SnapshotUpdate = original.SnapshotUpdate -type SnapshotsClient = original.SnapshotsClient -type SnapshotsCreateOrUpdateFuture = original.SnapshotsCreateOrUpdateFuture -type SnapshotsDeleteFuture = original.SnapshotsDeleteFuture -type SnapshotsGrantAccessFuture = original.SnapshotsGrantAccessFuture -type SnapshotsRevokeAccessFuture = original.SnapshotsRevokeAccessFuture -type SnapshotsUpdateFuture = original.SnapshotsUpdateFuture -type SourceVault = original.SourceVault -type StorageProfile = original.StorageProfile -type SubResource = original.SubResource -type SubResourceReadOnly = original.SubResourceReadOnly -type ThrottledRequestsInput = original.ThrottledRequestsInput -type UpdateResource = original.UpdateResource -type UpgradeOperationHistoricalStatusInfo = original.UpgradeOperationHistoricalStatusInfo -type UpgradeOperationHistoricalStatusInfoProperties = original.UpgradeOperationHistoricalStatusInfoProperties -type UpgradeOperationHistoryStatus = original.UpgradeOperationHistoryStatus -type UpgradePolicy = original.UpgradePolicy -type Usage = original.Usage -type UsageClient = original.UsageClient -type UsageName = original.UsageName -type VaultCertificate = original.VaultCertificate -type VaultSecretGroup = original.VaultSecretGroup -type VirtualHardDisk = original.VirtualHardDisk -type VirtualMachine = original.VirtualMachine -type VirtualMachineAgentInstanceView = original.VirtualMachineAgentInstanceView -type VirtualMachineCaptureParameters = original.VirtualMachineCaptureParameters -type VirtualMachineCaptureResult = original.VirtualMachineCaptureResult -type VirtualMachineCaptureResultProperties = original.VirtualMachineCaptureResultProperties -type VirtualMachineExtension = original.VirtualMachineExtension -type VirtualMachineExtensionHandlerInstanceView = original.VirtualMachineExtensionHandlerInstanceView -type VirtualMachineExtensionImage = original.VirtualMachineExtensionImage -type VirtualMachineExtensionImageProperties = original.VirtualMachineExtensionImageProperties -type VirtualMachineExtensionImagesClient = original.VirtualMachineExtensionImagesClient -type VirtualMachineExtensionInstanceView = original.VirtualMachineExtensionInstanceView -type VirtualMachineExtensionProperties = original.VirtualMachineExtensionProperties -type VirtualMachineExtensionUpdate = original.VirtualMachineExtensionUpdate -type VirtualMachineExtensionUpdateProperties = original.VirtualMachineExtensionUpdateProperties -type VirtualMachineExtensionsClient = original.VirtualMachineExtensionsClient -type VirtualMachineExtensionsCreateOrUpdateFuture = original.VirtualMachineExtensionsCreateOrUpdateFuture -type VirtualMachineExtensionsDeleteFuture = original.VirtualMachineExtensionsDeleteFuture -type VirtualMachineExtensionsListResult = original.VirtualMachineExtensionsListResult -type VirtualMachineExtensionsUpdateFuture = original.VirtualMachineExtensionsUpdateFuture -type VirtualMachineHealthStatus = original.VirtualMachineHealthStatus -type VirtualMachineIdentity = original.VirtualMachineIdentity -type VirtualMachineImage = original.VirtualMachineImage -type VirtualMachineImageProperties = original.VirtualMachineImageProperties -type VirtualMachineImageResource = original.VirtualMachineImageResource -type VirtualMachineImagesClient = original.VirtualMachineImagesClient -type VirtualMachineInstanceView = original.VirtualMachineInstanceView -type VirtualMachineListResult = original.VirtualMachineListResult -type VirtualMachineListResultIterator = original.VirtualMachineListResultIterator -type VirtualMachineListResultPage = original.VirtualMachineListResultPage -type VirtualMachineProperties = original.VirtualMachineProperties -type VirtualMachineRunCommandsClient = original.VirtualMachineRunCommandsClient -type VirtualMachineScaleSet = original.VirtualMachineScaleSet -type VirtualMachineScaleSetDataDisk = original.VirtualMachineScaleSetDataDisk -type VirtualMachineScaleSetExtension = original.VirtualMachineScaleSetExtension -type VirtualMachineScaleSetExtensionListResult = original.VirtualMachineScaleSetExtensionListResult -type VirtualMachineScaleSetExtensionListResultIterator = original.VirtualMachineScaleSetExtensionListResultIterator -type VirtualMachineScaleSetExtensionListResultPage = original.VirtualMachineScaleSetExtensionListResultPage -type VirtualMachineScaleSetExtensionProfile = original.VirtualMachineScaleSetExtensionProfile -type VirtualMachineScaleSetExtensionProperties = original.VirtualMachineScaleSetExtensionProperties -type VirtualMachineScaleSetExtensionsClient = original.VirtualMachineScaleSetExtensionsClient -type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture = original.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture -type VirtualMachineScaleSetExtensionsDeleteFuture = original.VirtualMachineScaleSetExtensionsDeleteFuture -type VirtualMachineScaleSetIPConfiguration = original.VirtualMachineScaleSetIPConfiguration -type VirtualMachineScaleSetIPConfigurationProperties = original.VirtualMachineScaleSetIPConfigurationProperties -type VirtualMachineScaleSetIdentity = original.VirtualMachineScaleSetIdentity -type VirtualMachineScaleSetInstanceView = original.VirtualMachineScaleSetInstanceView -type VirtualMachineScaleSetInstanceViewStatusesSummary = original.VirtualMachineScaleSetInstanceViewStatusesSummary -type VirtualMachineScaleSetListOSUpgradeHistory = original.VirtualMachineScaleSetListOSUpgradeHistory -type VirtualMachineScaleSetListOSUpgradeHistoryIterator = original.VirtualMachineScaleSetListOSUpgradeHistoryIterator -type VirtualMachineScaleSetListOSUpgradeHistoryPage = original.VirtualMachineScaleSetListOSUpgradeHistoryPage -type VirtualMachineScaleSetListResult = original.VirtualMachineScaleSetListResult -type VirtualMachineScaleSetListResultIterator = original.VirtualMachineScaleSetListResultIterator -type VirtualMachineScaleSetListResultPage = original.VirtualMachineScaleSetListResultPage -type VirtualMachineScaleSetListSkusResult = original.VirtualMachineScaleSetListSkusResult -type VirtualMachineScaleSetListSkusResultIterator = original.VirtualMachineScaleSetListSkusResultIterator -type VirtualMachineScaleSetListSkusResultPage = original.VirtualMachineScaleSetListSkusResultPage -type VirtualMachineScaleSetListWithLinkResult = original.VirtualMachineScaleSetListWithLinkResult -type VirtualMachineScaleSetListWithLinkResultIterator = original.VirtualMachineScaleSetListWithLinkResultIterator -type VirtualMachineScaleSetListWithLinkResultPage = original.VirtualMachineScaleSetListWithLinkResultPage -type VirtualMachineScaleSetManagedDiskParameters = original.VirtualMachineScaleSetManagedDiskParameters -type VirtualMachineScaleSetNetworkConfiguration = original.VirtualMachineScaleSetNetworkConfiguration -type VirtualMachineScaleSetNetworkConfigurationDNSSettings = original.VirtualMachineScaleSetNetworkConfigurationDNSSettings -type VirtualMachineScaleSetNetworkConfigurationProperties = original.VirtualMachineScaleSetNetworkConfigurationProperties -type VirtualMachineScaleSetNetworkProfile = original.VirtualMachineScaleSetNetworkProfile -type VirtualMachineScaleSetOSDisk = original.VirtualMachineScaleSetOSDisk -type VirtualMachineScaleSetOSProfile = original.VirtualMachineScaleSetOSProfile -type VirtualMachineScaleSetProperties = original.VirtualMachineScaleSetProperties -type VirtualMachineScaleSetPublicIPAddressConfiguration = original.VirtualMachineScaleSetPublicIPAddressConfiguration -type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings = original.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings -type VirtualMachineScaleSetPublicIPAddressConfigurationProperties = original.VirtualMachineScaleSetPublicIPAddressConfigurationProperties -type VirtualMachineScaleSetRollingUpgradesCancelFuture = original.VirtualMachineScaleSetRollingUpgradesCancelFuture -type VirtualMachineScaleSetRollingUpgradesClient = original.VirtualMachineScaleSetRollingUpgradesClient -type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture = original.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture -type VirtualMachineScaleSetSku = original.VirtualMachineScaleSetSku -type VirtualMachineScaleSetSkuCapacity = original.VirtualMachineScaleSetSkuCapacity -type VirtualMachineScaleSetStorageProfile = original.VirtualMachineScaleSetStorageProfile -type VirtualMachineScaleSetUpdate = original.VirtualMachineScaleSetUpdate -type VirtualMachineScaleSetUpdateIPConfiguration = original.VirtualMachineScaleSetUpdateIPConfiguration -type VirtualMachineScaleSetUpdateIPConfigurationProperties = original.VirtualMachineScaleSetUpdateIPConfigurationProperties -type VirtualMachineScaleSetUpdateNetworkConfiguration = original.VirtualMachineScaleSetUpdateNetworkConfiguration -type VirtualMachineScaleSetUpdateNetworkConfigurationProperties = original.VirtualMachineScaleSetUpdateNetworkConfigurationProperties -type VirtualMachineScaleSetUpdateNetworkProfile = original.VirtualMachineScaleSetUpdateNetworkProfile -type VirtualMachineScaleSetUpdateOSDisk = original.VirtualMachineScaleSetUpdateOSDisk -type VirtualMachineScaleSetUpdateOSProfile = original.VirtualMachineScaleSetUpdateOSProfile -type VirtualMachineScaleSetUpdateProperties = original.VirtualMachineScaleSetUpdateProperties -type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration = original.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration -type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = original.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties -type VirtualMachineScaleSetUpdateStorageProfile = original.VirtualMachineScaleSetUpdateStorageProfile -type VirtualMachineScaleSetUpdateVMProfile = original.VirtualMachineScaleSetUpdateVMProfile -type VirtualMachineScaleSetVM = original.VirtualMachineScaleSetVM -type VirtualMachineScaleSetVMExtensionsSummary = original.VirtualMachineScaleSetVMExtensionsSummary -type VirtualMachineScaleSetVMInstanceIDs = original.VirtualMachineScaleSetVMInstanceIDs -type VirtualMachineScaleSetVMInstanceRequiredIDs = original.VirtualMachineScaleSetVMInstanceRequiredIDs -type VirtualMachineScaleSetVMInstanceView = original.VirtualMachineScaleSetVMInstanceView -type VirtualMachineScaleSetVMListResult = original.VirtualMachineScaleSetVMListResult -type VirtualMachineScaleSetVMListResultIterator = original.VirtualMachineScaleSetVMListResultIterator -type VirtualMachineScaleSetVMListResultPage = original.VirtualMachineScaleSetVMListResultPage -type VirtualMachineScaleSetVMProfile = original.VirtualMachineScaleSetVMProfile -type VirtualMachineScaleSetVMProperties = original.VirtualMachineScaleSetVMProperties -type VirtualMachineScaleSetVMsClient = original.VirtualMachineScaleSetVMsClient -type VirtualMachineScaleSetVMsDeallocateFuture = original.VirtualMachineScaleSetVMsDeallocateFuture -type VirtualMachineScaleSetVMsDeleteFuture = original.VirtualMachineScaleSetVMsDeleteFuture -type VirtualMachineScaleSetVMsPerformMaintenanceFuture = original.VirtualMachineScaleSetVMsPerformMaintenanceFuture -type VirtualMachineScaleSetVMsPowerOffFuture = original.VirtualMachineScaleSetVMsPowerOffFuture -type VirtualMachineScaleSetVMsRedeployFuture = original.VirtualMachineScaleSetVMsRedeployFuture -type VirtualMachineScaleSetVMsReimageAllFuture = original.VirtualMachineScaleSetVMsReimageAllFuture -type VirtualMachineScaleSetVMsReimageFuture = original.VirtualMachineScaleSetVMsReimageFuture -type VirtualMachineScaleSetVMsRestartFuture = original.VirtualMachineScaleSetVMsRestartFuture -type VirtualMachineScaleSetVMsStartFuture = original.VirtualMachineScaleSetVMsStartFuture -type VirtualMachineScaleSetVMsUpdateFuture = original.VirtualMachineScaleSetVMsUpdateFuture -type VirtualMachineScaleSetsClient = original.VirtualMachineScaleSetsClient -type VirtualMachineScaleSetsCreateOrUpdateFuture = original.VirtualMachineScaleSetsCreateOrUpdateFuture -type VirtualMachineScaleSetsDeallocateFuture = original.VirtualMachineScaleSetsDeallocateFuture -type VirtualMachineScaleSetsDeleteFuture = original.VirtualMachineScaleSetsDeleteFuture -type VirtualMachineScaleSetsDeleteInstancesFuture = original.VirtualMachineScaleSetsDeleteInstancesFuture -type VirtualMachineScaleSetsPerformMaintenanceFuture = original.VirtualMachineScaleSetsPerformMaintenanceFuture -type VirtualMachineScaleSetsPowerOffFuture = original.VirtualMachineScaleSetsPowerOffFuture -type VirtualMachineScaleSetsRedeployFuture = original.VirtualMachineScaleSetsRedeployFuture -type VirtualMachineScaleSetsReimageAllFuture = original.VirtualMachineScaleSetsReimageAllFuture -type VirtualMachineScaleSetsReimageFuture = original.VirtualMachineScaleSetsReimageFuture -type VirtualMachineScaleSetsRestartFuture = original.VirtualMachineScaleSetsRestartFuture -type VirtualMachineScaleSetsStartFuture = original.VirtualMachineScaleSetsStartFuture -type VirtualMachineScaleSetsUpdateFuture = original.VirtualMachineScaleSetsUpdateFuture -type VirtualMachineScaleSetsUpdateInstancesFuture = original.VirtualMachineScaleSetsUpdateInstancesFuture -type VirtualMachineSize = original.VirtualMachineSize -type VirtualMachineSizeListResult = original.VirtualMachineSizeListResult -type VirtualMachineSizesClient = original.VirtualMachineSizesClient -type VirtualMachineStatusCodeCount = original.VirtualMachineStatusCodeCount -type VirtualMachineUpdate = original.VirtualMachineUpdate -type VirtualMachinesCaptureFuture = original.VirtualMachinesCaptureFuture -type VirtualMachinesClient = original.VirtualMachinesClient -type VirtualMachinesConvertToManagedDisksFuture = original.VirtualMachinesConvertToManagedDisksFuture -type VirtualMachinesCreateOrUpdateFuture = original.VirtualMachinesCreateOrUpdateFuture -type VirtualMachinesDeallocateFuture = original.VirtualMachinesDeallocateFuture -type VirtualMachinesDeleteFuture = original.VirtualMachinesDeleteFuture -type VirtualMachinesPerformMaintenanceFuture = original.VirtualMachinesPerformMaintenanceFuture -type VirtualMachinesPowerOffFuture = original.VirtualMachinesPowerOffFuture -type VirtualMachinesRedeployFuture = original.VirtualMachinesRedeployFuture -type VirtualMachinesRestartFuture = original.VirtualMachinesRestartFuture -type VirtualMachinesRunCommandFuture = original.VirtualMachinesRunCommandFuture -type VirtualMachinesStartFuture = original.VirtualMachinesStartFuture -type VirtualMachinesUpdateFuture = original.VirtualMachinesUpdateFuture -type WinRMConfiguration = original.WinRMConfiguration -type WinRMListener = original.WinRMListener -type WindowsConfiguration = original.WindowsConfiguration - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator { - return original.NewAvailabilitySetListResultIterator(page) -} -func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage { - return original.NewAvailabilitySetListResultPage(cur, getNextPage) -} -func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { - return original.NewAvailabilitySetsClient(subscriptionID) -} -func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { - return original.NewAvailabilitySetsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDiskListIterator(page DiskListPage) DiskListIterator { - return original.NewDiskListIterator(page) -} -func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { - return original.NewDiskListPage(cur, getNextPage) -} -func NewDisksClient(subscriptionID string) DisksClient { - return original.NewDisksClient(subscriptionID) -} -func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { - return original.NewDisksClientWithBaseURI(baseURI, subscriptionID) -} -func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator { - return original.NewImageListResultIterator(page) -} -func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage { - return original.NewImageListResultPage(cur, getNextPage) -} -func NewImagesClient(subscriptionID string) ImagesClient { - return original.NewImagesClient(subscriptionID) -} -func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { - return original.NewImagesClientWithBaseURI(baseURI, subscriptionID) -} -func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { - return original.NewListUsagesResultIterator(page) -} -func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { - return original.NewListUsagesResultPage(cur, getNextPage) -} -func NewLogAnalyticsClient(subscriptionID string) LogAnalyticsClient { - return original.NewLogAnalyticsClient(subscriptionID) -} -func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) LogAnalyticsClient { - return original.NewLogAnalyticsClientWithBaseURI(baseURI, subscriptionID) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { - return original.NewResourceSkusClient(subscriptionID) -} -func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { - return original.NewResourceSkusClientWithBaseURI(baseURI, subscriptionID) -} -func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator { - return original.NewResourceSkusResultIterator(page) -} -func NewResourceSkusResultPage(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage { - return original.NewResourceSkusResultPage(cur, getNextPage) -} -func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator { - return original.NewRunCommandListResultIterator(page) -} -func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage { - return original.NewRunCommandListResultPage(cur, getNextPage) -} -func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator { - return original.NewSnapshotListIterator(page) -} -func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage { - return original.NewSnapshotListPage(cur, getNextPage) -} -func NewSnapshotsClient(subscriptionID string) SnapshotsClient { - return original.NewSnapshotsClient(subscriptionID) -} -func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { - return original.NewSnapshotsClientWithBaseURI(baseURI, subscriptionID) -} -func NewUsageClient(subscriptionID string) UsageClient { - return original.NewUsageClient(subscriptionID) -} -func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient { - return original.NewUsageClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { - return original.NewVirtualMachineExtensionImagesClient(subscriptionID) -} -func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { - return original.NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { - return original.NewVirtualMachineExtensionsClient(subscriptionID) -} -func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { - return original.NewVirtualMachineExtensionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { - return original.NewVirtualMachineImagesClient(subscriptionID) -} -func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { - return original.NewVirtualMachineImagesClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator { - return original.NewVirtualMachineListResultIterator(page) -} -func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage { - return original.NewVirtualMachineListResultPage(cur, getNextPage) -} -func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient { - return original.NewVirtualMachineRunCommandsClient(subscriptionID) -} -func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient { - return original.NewVirtualMachineRunCommandsClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator { - return original.NewVirtualMachineScaleSetExtensionListResultIterator(page) -} -func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage { - return original.NewVirtualMachineScaleSetExtensionListResultPage(cur, getNextPage) -} -func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return original.NewVirtualMachineScaleSetExtensionsClient(subscriptionID) -} -func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient { - return original.NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page VirtualMachineScaleSetListOSUpgradeHistoryPage) VirtualMachineScaleSetListOSUpgradeHistoryIterator { - return original.NewVirtualMachineScaleSetListOSUpgradeHistoryIterator(page) -} -func NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur VirtualMachineScaleSetListOSUpgradeHistory, getNextPage func(context.Context, VirtualMachineScaleSetListOSUpgradeHistory) (VirtualMachineScaleSetListOSUpgradeHistory, error)) VirtualMachineScaleSetListOSUpgradeHistoryPage { - return original.NewVirtualMachineScaleSetListOSUpgradeHistoryPage(cur, getNextPage) -} -func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator { - return original.NewVirtualMachineScaleSetListResultIterator(page) -} -func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage { - return original.NewVirtualMachineScaleSetListResultPage(cur, getNextPage) -} -func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator { - return original.NewVirtualMachineScaleSetListSkusResultIterator(page) -} -func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage { - return original.NewVirtualMachineScaleSetListSkusResultPage(cur, getNextPage) -} -func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator { - return original.NewVirtualMachineScaleSetListWithLinkResultIterator(page) -} -func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage { - return original.NewVirtualMachineScaleSetListWithLinkResultPage(cur, getNextPage) -} -func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return original.NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID) -} -func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { - return original.NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator { - return original.NewVirtualMachineScaleSetVMListResultIterator(page) -} -func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage { - return original.NewVirtualMachineScaleSetVMListResultPage(cur, getNextPage) -} -func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { - return original.NewVirtualMachineScaleSetVMsClient(subscriptionID) -} -func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient { - return original.NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { - return original.NewVirtualMachineScaleSetsClient(subscriptionID) -} -func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { - return original.NewVirtualMachineScaleSetsClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { - return original.NewVirtualMachineSizesClient(subscriptionID) -} -func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { - return original.NewVirtualMachineSizesClientWithBaseURI(baseURI, subscriptionID) -} -func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { - return original.NewVirtualMachinesClient(subscriptionID) -} -func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { - return original.NewVirtualMachinesClientWithBaseURI(baseURI, subscriptionID) -} -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) -} -func PossibleAccessLevelValues() []AccessLevel { - return original.PossibleAccessLevelValues() -} -func PossibleCachingTypesValues() []CachingTypes { - return original.PossibleCachingTypesValues() -} -func PossibleComponentNamesValues() []ComponentNames { - return original.PossibleComponentNamesValues() -} -func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { - return original.PossibleDiskCreateOptionTypesValues() -} -func PossibleDiskCreateOptionValues() []DiskCreateOption { - return original.PossibleDiskCreateOptionValues() -} -func PossibleIPVersionValues() []IPVersion { - return original.PossibleIPVersionValues() -} -func PossibleInstanceViewTypesValues() []InstanceViewTypes { - return original.PossibleInstanceViewTypesValues() -} -func PossibleIntervalInMinsValues() []IntervalInMins { - return original.PossibleIntervalInMinsValues() -} -func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes { - return original.PossibleMaintenanceOperationResultCodeTypesValues() -} -func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes { - return original.PossibleOperatingSystemStateTypesValues() -} -func PossibleOperatingSystemTypesValues() []OperatingSystemTypes { - return original.PossibleOperatingSystemTypesValues() -} -func PossiblePassNamesValues() []PassNames { - return original.PossiblePassNamesValues() -} -func PossibleProtocolTypesValues() []ProtocolTypes { - return original.PossibleProtocolTypesValues() -} -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return original.PossibleResourceIdentityTypeValues() -} -func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return original.PossibleResourceSkuCapacityScaleTypeValues() -} -func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { - return original.PossibleResourceSkuRestrictionsReasonCodeValues() -} -func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { - return original.PossibleResourceSkuRestrictionsTypeValues() -} -func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType { - return original.PossibleRollingUpgradeActionTypeValues() -} -func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode { - return original.PossibleRollingUpgradeStatusCodeValues() -} -func PossibleSettingNamesValues() []SettingNames { - return original.PossibleSettingNamesValues() -} -func PossibleStatusLevelTypesValues() []StatusLevelTypes { - return original.PossibleStatusLevelTypesValues() -} -func PossibleStorageAccountTypesValues() []StorageAccountTypes { - return original.PossibleStorageAccountTypesValues() -} -func PossibleUpgradeModeValues() []UpgradeMode { - return original.PossibleUpgradeModeValues() -} -func PossibleUpgradeOperationInvokerValues() []UpgradeOperationInvoker { - return original.PossibleUpgradeOperationInvokerValues() -} -func PossibleUpgradeStateValues() []UpgradeState { - return original.PossibleUpgradeStateValues() -} -func PossibleVirtualMachineEvictionPolicyTypesValues() []VirtualMachineEvictionPolicyTypes { - return original.PossibleVirtualMachineEvictionPolicyTypesValues() -} -func PossibleVirtualMachinePriorityTypesValues() []VirtualMachinePriorityTypes { - return original.PossibleVirtualMachinePriorityTypesValues() -} -func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType { - return original.PossibleVirtualMachineScaleSetSkuScaleTypeValues() -} -func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes { - return original.PossibleVirtualMachineSizeTypesValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/2019-03-01" -} -func Version() string { - return original.Version() -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources/models.go deleted file mode 100644 index 1fa6e9612..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/resources/mgmt/resources/models.go +++ /dev/null @@ -1,241 +0,0 @@ -//go:build go1.9 -// +build go1.9 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This code was auto-generated by: -// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder - -package resources - -import ( - "context" - - original "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-05-01/resources" -) - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type DeploymentMode = original.DeploymentMode - -const ( - Complete DeploymentMode = original.Complete - Incremental DeploymentMode = original.Incremental -) - -type OnErrorDeploymentType = original.OnErrorDeploymentType - -const ( - LastSuccessful OnErrorDeploymentType = original.LastSuccessful - SpecificDeployment OnErrorDeploymentType = original.SpecificDeployment -) - -type ResourceIdentityType = original.ResourceIdentityType - -const ( - None ResourceIdentityType = original.None - SystemAssigned ResourceIdentityType = original.SystemAssigned - SystemAssignedUserAssigned ResourceIdentityType = original.SystemAssignedUserAssigned - UserAssigned ResourceIdentityType = original.UserAssigned -) - -type AliasPathType = original.AliasPathType -type AliasType = original.AliasType -type BaseClient = original.BaseClient -type BasicDependency = original.BasicDependency -type Client = original.Client -type CloudError = original.CloudError -type CreateOrUpdateByIDFuture = original.CreateOrUpdateByIDFuture -type CreateOrUpdateFuture = original.CreateOrUpdateFuture -type DebugSetting = original.DebugSetting -type DeleteByIDFuture = original.DeleteByIDFuture -type DeleteFuture = original.DeleteFuture -type Dependency = original.Dependency -type Deployment = original.Deployment -type DeploymentExportResult = original.DeploymentExportResult -type DeploymentExtended = original.DeploymentExtended -type DeploymentExtendedFilter = original.DeploymentExtendedFilter -type DeploymentListResult = original.DeploymentListResult -type DeploymentListResultIterator = original.DeploymentListResultIterator -type DeploymentListResultPage = original.DeploymentListResultPage -type DeploymentOperation = original.DeploymentOperation -type DeploymentOperationProperties = original.DeploymentOperationProperties -type DeploymentOperationsClient = original.DeploymentOperationsClient -type DeploymentOperationsListResult = original.DeploymentOperationsListResult -type DeploymentOperationsListResultIterator = original.DeploymentOperationsListResultIterator -type DeploymentOperationsListResultPage = original.DeploymentOperationsListResultPage -type DeploymentProperties = original.DeploymentProperties -type DeploymentPropertiesExtended = original.DeploymentPropertiesExtended -type DeploymentValidateResult = original.DeploymentValidateResult -type DeploymentsClient = original.DeploymentsClient -type DeploymentsCreateOrUpdateAtSubscriptionScopeFuture = original.DeploymentsCreateOrUpdateAtSubscriptionScopeFuture -type DeploymentsCreateOrUpdateFuture = original.DeploymentsCreateOrUpdateFuture -type DeploymentsDeleteAtSubscriptionScopeFuture = original.DeploymentsDeleteAtSubscriptionScopeFuture -type DeploymentsDeleteFuture = original.DeploymentsDeleteFuture -type ErrorAdditionalInfo = original.ErrorAdditionalInfo -type ErrorResponse = original.ErrorResponse -type ExportTemplateRequest = original.ExportTemplateRequest -type GenericResource = original.GenericResource -type GenericResourceExpanded = original.GenericResourceExpanded -type GenericResourceFilter = original.GenericResourceFilter -type Group = original.Group -type GroupExportResult = original.GroupExportResult -type GroupFilter = original.GroupFilter -type GroupListResult = original.GroupListResult -type GroupListResultIterator = original.GroupListResultIterator -type GroupListResultPage = original.GroupListResultPage -type GroupPatchable = original.GroupPatchable -type GroupProperties = original.GroupProperties -type GroupsClient = original.GroupsClient -type GroupsDeleteFuture = original.GroupsDeleteFuture -type HTTPMessage = original.HTTPMessage -type Identity = original.Identity -type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue -type ListResult = original.ListResult -type ListResultIterator = original.ListResultIterator -type ListResultPage = original.ListResultPage -type ManagementErrorWithDetails = original.ManagementErrorWithDetails -type MoveInfo = original.MoveInfo -type MoveResourcesFuture = original.MoveResourcesFuture -type OnErrorDeployment = original.OnErrorDeployment -type OnErrorDeploymentExtended = original.OnErrorDeploymentExtended -type Operation = original.Operation -type OperationDisplay = original.OperationDisplay -type OperationListResult = original.OperationListResult -type OperationListResultIterator = original.OperationListResultIterator -type OperationListResultPage = original.OperationListResultPage -type OperationsClient = original.OperationsClient -type ParametersLink = original.ParametersLink -type Plan = original.Plan -type Provider = original.Provider -type ProviderListResult = original.ProviderListResult -type ProviderListResultIterator = original.ProviderListResultIterator -type ProviderListResultPage = original.ProviderListResultPage -type ProviderOperationDisplayProperties = original.ProviderOperationDisplayProperties -type ProviderResourceType = original.ProviderResourceType -type ProvidersClient = original.ProvidersClient -type Resource = original.Resource -type Sku = original.Sku -type SubResource = original.SubResource -type TagCount = original.TagCount -type TagDetails = original.TagDetails -type TagValue = original.TagValue -type TagsClient = original.TagsClient -type TagsListResult = original.TagsListResult -type TagsListResultIterator = original.TagsListResultIterator -type TagsListResultPage = original.TagsListResultPage -type TargetResource = original.TargetResource -type TemplateHashResult = original.TemplateHashResult -type TemplateLink = original.TemplateLink -type UpdateByIDFuture = original.UpdateByIDFuture -type UpdateFuture = original.UpdateFuture -type ValidateMoveResourcesFuture = original.ValidateMoveResourcesFuture - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewClient(subscriptionID string) Client { - return original.NewClient(subscriptionID) -} -func NewClientWithBaseURI(baseURI string, subscriptionID string) Client { - return original.NewClientWithBaseURI(baseURI, subscriptionID) -} -func NewDeploymentListResultIterator(page DeploymentListResultPage) DeploymentListResultIterator { - return original.NewDeploymentListResultIterator(page) -} -func NewDeploymentListResultPage(cur DeploymentListResult, getNextPage func(context.Context, DeploymentListResult) (DeploymentListResult, error)) DeploymentListResultPage { - return original.NewDeploymentListResultPage(cur, getNextPage) -} -func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient { - return original.NewDeploymentOperationsClient(subscriptionID) -} -func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient { - return original.NewDeploymentOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewDeploymentOperationsListResultIterator(page DeploymentOperationsListResultPage) DeploymentOperationsListResultIterator { - return original.NewDeploymentOperationsListResultIterator(page) -} -func NewDeploymentOperationsListResultPage(cur DeploymentOperationsListResult, getNextPage func(context.Context, DeploymentOperationsListResult) (DeploymentOperationsListResult, error)) DeploymentOperationsListResultPage { - return original.NewDeploymentOperationsListResultPage(cur, getNextPage) -} -func NewDeploymentsClient(subscriptionID string) DeploymentsClient { - return original.NewDeploymentsClient(subscriptionID) -} -func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient { - return original.NewDeploymentsClientWithBaseURI(baseURI, subscriptionID) -} -func NewGroupListResultIterator(page GroupListResultPage) GroupListResultIterator { - return original.NewGroupListResultIterator(page) -} -func NewGroupListResultPage(cur GroupListResult, getNextPage func(context.Context, GroupListResult) (GroupListResult, error)) GroupListResultPage { - return original.NewGroupListResultPage(cur, getNextPage) -} -func NewGroupsClient(subscriptionID string) GroupsClient { - return original.NewGroupsClient(subscriptionID) -} -func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient { - return original.NewGroupsClientWithBaseURI(baseURI, subscriptionID) -} -func NewListResultIterator(page ListResultPage) ListResultIterator { - return original.NewListResultIterator(page) -} -func NewListResultPage(cur ListResult, getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { - return original.NewListResultPage(cur, getNextPage) -} -func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { - return original.NewOperationListResultIterator(page) -} -func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { - return original.NewOperationListResultPage(cur, getNextPage) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewProviderListResultIterator(page ProviderListResultPage) ProviderListResultIterator { - return original.NewProviderListResultIterator(page) -} -func NewProviderListResultPage(cur ProviderListResult, getNextPage func(context.Context, ProviderListResult) (ProviderListResult, error)) ProviderListResultPage { - return original.NewProviderListResultPage(cur, getNextPage) -} -func NewProvidersClient(subscriptionID string) ProvidersClient { - return original.NewProvidersClient(subscriptionID) -} -func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient { - return original.NewProvidersClientWithBaseURI(baseURI, subscriptionID) -} -func NewTagsClient(subscriptionID string) TagsClient { - return original.NewTagsClient(subscriptionID) -} -func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient { - return original.NewTagsClientWithBaseURI(baseURI, subscriptionID) -} -func NewTagsListResultIterator(page TagsListResultPage) TagsListResultIterator { - return original.NewTagsListResultIterator(page) -} -func NewTagsListResultPage(cur TagsListResult, getNextPage func(context.Context, TagsListResult) (TagsListResult, error)) TagsListResultPage { - return original.NewTagsListResultPage(cur, getNextPage) -} -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) -} -func PossibleDeploymentModeValues() []DeploymentMode { - return original.PossibleDeploymentModeValues() -} -func PossibleOnErrorDeploymentTypeValues() []OnErrorDeploymentType { - return original.PossibleOnErrorDeploymentTypeValues() -} -func PossibleResourceIdentityTypeValues() []ResourceIdentityType { - return original.PossibleResourceIdentityTypeValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/2019-03-01" -} -func Version() string { - return original.Version() -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage/models.go deleted file mode 100644 index 37c212b5d..000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/profiles/2019-03-01/storage/mgmt/storage/models.go +++ /dev/null @@ -1,325 +0,0 @@ -//go:build go1.9 -// +build go1.9 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This code was auto-generated by: -// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder - -package storage - -import original "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage" - -const ( - DefaultBaseURI = original.DefaultBaseURI -) - -type AccessTier = original.AccessTier - -const ( - Cool AccessTier = original.Cool - Hot AccessTier = original.Hot -) - -type AccountStatus = original.AccountStatus - -const ( - Available AccountStatus = original.Available - Unavailable AccountStatus = original.Unavailable -) - -type Action = original.Action - -const ( - Allow Action = original.Allow -) - -type Bypass = original.Bypass - -const ( - AzureServices Bypass = original.AzureServices - Logging Bypass = original.Logging - Metrics Bypass = original.Metrics - None Bypass = original.None -) - -type DefaultAction = original.DefaultAction - -const ( - DefaultActionAllow DefaultAction = original.DefaultActionAllow - DefaultActionDeny DefaultAction = original.DefaultActionDeny -) - -type HTTPProtocol = original.HTTPProtocol - -const ( - HTTPS HTTPProtocol = original.HTTPS - Httpshttp HTTPProtocol = original.Httpshttp -) - -type KeyPermission = original.KeyPermission - -const ( - Full KeyPermission = original.Full - Read KeyPermission = original.Read -) - -type KeySource = original.KeySource - -const ( - MicrosoftKeyvault KeySource = original.MicrosoftKeyvault - MicrosoftStorage KeySource = original.MicrosoftStorage -) - -type Kind = original.Kind - -const ( - BlobStorage Kind = original.BlobStorage - Storage Kind = original.Storage - StorageV2 Kind = original.StorageV2 -) - -type Permissions = original.Permissions - -const ( - A Permissions = original.A - C Permissions = original.C - D Permissions = original.D - L Permissions = original.L - P Permissions = original.P - R Permissions = original.R - U Permissions = original.U - W Permissions = original.W -) - -type ProvisioningState = original.ProvisioningState - -const ( - Creating ProvisioningState = original.Creating - ResolvingDNS ProvisioningState = original.ResolvingDNS - Succeeded ProvisioningState = original.Succeeded -) - -type Reason = original.Reason - -const ( - AccountNameInvalid Reason = original.AccountNameInvalid - AlreadyExists Reason = original.AlreadyExists -) - -type ReasonCode = original.ReasonCode - -const ( - NotAvailableForSubscription ReasonCode = original.NotAvailableForSubscription - QuotaID ReasonCode = original.QuotaID -) - -type Services = original.Services - -const ( - B Services = original.B - F Services = original.F - Q Services = original.Q - T Services = original.T -) - -type SignedResource = original.SignedResource - -const ( - SignedResourceB SignedResource = original.SignedResourceB - SignedResourceC SignedResource = original.SignedResourceC - SignedResourceF SignedResource = original.SignedResourceF - SignedResourceS SignedResource = original.SignedResourceS -) - -type SignedResourceTypes = original.SignedResourceTypes - -const ( - SignedResourceTypesC SignedResourceTypes = original.SignedResourceTypesC - SignedResourceTypesO SignedResourceTypes = original.SignedResourceTypesO - SignedResourceTypesS SignedResourceTypes = original.SignedResourceTypesS -) - -type SkuName = original.SkuName - -const ( - PremiumLRS SkuName = original.PremiumLRS - StandardGRS SkuName = original.StandardGRS - StandardLRS SkuName = original.StandardLRS - StandardRAGRS SkuName = original.StandardRAGRS - StandardZRS SkuName = original.StandardZRS -) - -type SkuTier = original.SkuTier - -const ( - Premium SkuTier = original.Premium - Standard SkuTier = original.Standard -) - -type State = original.State - -const ( - StateDeprovisioning State = original.StateDeprovisioning - StateFailed State = original.StateFailed - StateNetworkSourceDeleted State = original.StateNetworkSourceDeleted - StateProvisioning State = original.StateProvisioning - StateSucceeded State = original.StateSucceeded -) - -type UsageUnit = original.UsageUnit - -const ( - Bytes UsageUnit = original.Bytes - BytesPerSecond UsageUnit = original.BytesPerSecond - Count UsageUnit = original.Count - CountsPerSecond UsageUnit = original.CountsPerSecond - Percent UsageUnit = original.Percent - Seconds UsageUnit = original.Seconds -) - -type Account = original.Account -type AccountCheckNameAvailabilityParameters = original.AccountCheckNameAvailabilityParameters -type AccountCreateParameters = original.AccountCreateParameters -type AccountKey = original.AccountKey -type AccountListKeysResult = original.AccountListKeysResult -type AccountListResult = original.AccountListResult -type AccountProperties = original.AccountProperties -type AccountPropertiesCreateParameters = original.AccountPropertiesCreateParameters -type AccountPropertiesUpdateParameters = original.AccountPropertiesUpdateParameters -type AccountRegenerateKeyParameters = original.AccountRegenerateKeyParameters -type AccountSasParameters = original.AccountSasParameters -type AccountUpdateParameters = original.AccountUpdateParameters -type AccountsClient = original.AccountsClient -type AccountsCreateFuture = original.AccountsCreateFuture -type BaseClient = original.BaseClient -type CheckNameAvailabilityResult = original.CheckNameAvailabilityResult -type CustomDomain = original.CustomDomain -type Dimension = original.Dimension -type Encryption = original.Encryption -type EncryptionService = original.EncryptionService -type EncryptionServices = original.EncryptionServices -type Endpoints = original.Endpoints -type IPRule = original.IPRule -type Identity = original.Identity -type KeyVaultProperties = original.KeyVaultProperties -type ListAccountSasResponse = original.ListAccountSasResponse -type ListServiceSasResponse = original.ListServiceSasResponse -type MetricSpecification = original.MetricSpecification -type NetworkRuleSet = original.NetworkRuleSet -type Operation = original.Operation -type OperationDisplay = original.OperationDisplay -type OperationListResult = original.OperationListResult -type OperationProperties = original.OperationProperties -type OperationsClient = original.OperationsClient -type Resource = original.Resource -type Restriction = original.Restriction -type SKUCapability = original.SKUCapability -type ServiceSasParameters = original.ServiceSasParameters -type ServiceSpecification = original.ServiceSpecification -type Sku = original.Sku -type SkuListResult = original.SkuListResult -type SkusClient = original.SkusClient -type Usage = original.Usage -type UsageClient = original.UsageClient -type UsageListResult = original.UsageListResult -type UsageName = original.UsageName -type VirtualNetworkRule = original.VirtualNetworkRule - -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) -} -func NewAccountsClient(subscriptionID string) AccountsClient { - return original.NewAccountsClient(subscriptionID) -} -func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { - return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID) -} -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) -} -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) -} -func NewSkusClient(subscriptionID string) SkusClient { - return original.NewSkusClient(subscriptionID) -} -func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { - return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) -} -func NewUsageClient(subscriptionID string) UsageClient { - return original.NewUsageClient(subscriptionID) -} -func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient { - return original.NewUsageClientWithBaseURI(baseURI, subscriptionID) -} -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) -} -func PossibleAccessTierValues() []AccessTier { - return original.PossibleAccessTierValues() -} -func PossibleAccountStatusValues() []AccountStatus { - return original.PossibleAccountStatusValues() -} -func PossibleActionValues() []Action { - return original.PossibleActionValues() -} -func PossibleBypassValues() []Bypass { - return original.PossibleBypassValues() -} -func PossibleDefaultActionValues() []DefaultAction { - return original.PossibleDefaultActionValues() -} -func PossibleHTTPProtocolValues() []HTTPProtocol { - return original.PossibleHTTPProtocolValues() -} -func PossibleKeyPermissionValues() []KeyPermission { - return original.PossibleKeyPermissionValues() -} -func PossibleKeySourceValues() []KeySource { - return original.PossibleKeySourceValues() -} -func PossibleKindValues() []Kind { - return original.PossibleKindValues() -} -func PossiblePermissionsValues() []Permissions { - return original.PossiblePermissionsValues() -} -func PossibleProvisioningStateValues() []ProvisioningState { - return original.PossibleProvisioningStateValues() -} -func PossibleReasonCodeValues() []ReasonCode { - return original.PossibleReasonCodeValues() -} -func PossibleReasonValues() []Reason { - return original.PossibleReasonValues() -} -func PossibleServicesValues() []Services { - return original.PossibleServicesValues() -} -func PossibleSignedResourceTypesValues() []SignedResourceTypes { - return original.PossibleSignedResourceTypesValues() -} -func PossibleSignedResourceValues() []SignedResource { - return original.PossibleSignedResourceValues() -} -func PossibleSkuNameValues() []SkuName { - return original.PossibleSkuNameValues() -} -func PossibleSkuTierValues() []SkuTier { - return original.PossibleSkuTierValues() -} -func PossibleStateValues() []State { - return original.PossibleStateValues() -} -func PossibleUsageUnitValues() []UsageUnit { - return original.PossibleUsageUnitValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/2019-03-01" -} -func Version() string { - return original.Version() -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go new file mode 100644 index 000000000..c373cc43f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/client.go @@ -0,0 +1,72 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package arm + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing" +) + +// ClientOptions contains configuration settings for a client's pipeline. +type ClientOptions = armpolicy.ClientOptions + +// Client is a HTTP client for use with ARM endpoints. It consists of an endpoint, pipeline, and tracing provider. +type Client struct { + ep string + pl runtime.Pipeline + tr tracing.Tracer +} + +// NewClient creates a new Client instance with the provided values. +// This client is intended to be used with Azure Resource Manager endpoints. +// - moduleName - the fully qualified name of the module where the client is defined; used by the telemetry policy and tracing provider. +// - moduleVersion - the semantic version of the module; used by the telemetry policy and tracing provider. +// - cred - the TokenCredential used to authenticate the request +// - options - optional client configurations; pass nil to accept the default values +func NewClient(moduleName, moduleVersion string, cred azcore.TokenCredential, options *ClientOptions) (*Client, error) { + if options == nil { + options = &ClientOptions{} + } + + if !options.Telemetry.Disabled { + if err := shared.ValidateModVer(moduleVersion); err != nil { + return nil, err + } + } + + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, cred, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + + tr := options.TracingProvider.NewTracer(moduleName, moduleVersion) + return &Client{ep: ep, pl: pl, tr: tr}, nil +} + +// Endpoint returns the service's base URL for this client. +func (c *Client) Endpoint() string { + return c.ep +} + +// Pipeline returns the pipeline for this client. +func (c *Client) Pipeline() runtime.Pipeline { + return c.pl +} + +// Tracer returns the tracer for this client. +func (c *Client) Tracer() tracing.Tracer { + return c.tr +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go new file mode 100644 index 000000000..1bdd16a3d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/doc.go @@ -0,0 +1,9 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright 2017 Microsoft Corporation. All rights reserved. +// Use of this source code is governed by an MIT +// license that can be found in the LICENSE file. + +// Package arm contains functionality specific to Azure Resource Manager clients. +package arm diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go new file mode 100644 index 000000000..187fe82b9 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_identifier.go @@ -0,0 +1,224 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package resource + +import ( + "fmt" + "strings" +) + +const ( + providersKey = "providers" + subscriptionsKey = "subscriptions" + resourceGroupsLowerKey = "resourcegroups" + locationsKey = "locations" + builtInResourceNamespace = "Microsoft.Resources" +) + +// RootResourceID defines the tenant as the root parent of all other ResourceID. +var RootResourceID = &ResourceID{ + Parent: nil, + ResourceType: TenantResourceType, + Name: "", +} + +// ResourceID represents a resource ID such as `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg`. +// Don't create this type directly, use ParseResourceID instead. +type ResourceID struct { + // Parent is the parent ResourceID of this instance. + // Can be nil if there is no parent. + Parent *ResourceID + + // SubscriptionID is the subscription ID in this resource ID. + // The value can be empty if the resource ID does not contain a subscription ID. + SubscriptionID string + + // ResourceGroupName is the resource group name in this resource ID. + // The value can be empty if the resource ID does not contain a resource group name. + ResourceGroupName string + + // Provider represents the provider name in this resource ID. + // This is only valid when the resource ID represents a resource provider. + // Example: `/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Insights` + Provider string + + // Location is the location in this resource ID. + // The value can be empty if the resource ID does not contain a location name. + Location string + + // ResourceType represents the type of this resource ID. + ResourceType ResourceType + + // Name is the resource name of this resource ID. + Name string + + isChild bool + stringValue string +} + +// ParseResourceID parses a string to an instance of ResourceID +func ParseResourceID(id string) (*ResourceID, error) { + if len(id) == 0 { + return nil, fmt.Errorf("invalid resource ID: id cannot be empty") + } + + if !strings.HasPrefix(id, "/") { + return nil, fmt.Errorf("invalid resource ID: resource id '%s' must start with '/'", id) + } + + parts := splitStringAndOmitEmpty(id, "/") + + if len(parts) < 2 { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + if !strings.EqualFold(parts[0], subscriptionsKey) && !strings.EqualFold(parts[0], providersKey) { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + return appendNext(RootResourceID, parts, id) +} + +// String returns the string of the ResourceID +func (id *ResourceID) String() string { + if len(id.stringValue) > 0 { + return id.stringValue + } + + if id.Parent == nil { + return "" + } + + builder := strings.Builder{} + builder.WriteString(id.Parent.String()) + + if id.isChild { + builder.WriteString(fmt.Sprintf("/%s", id.ResourceType.lastType())) + if len(id.Name) > 0 { + builder.WriteString(fmt.Sprintf("/%s", id.Name)) + } + } else { + builder.WriteString(fmt.Sprintf("/providers/%s/%s/%s", id.ResourceType.Namespace, id.ResourceType.Type, id.Name)) + } + + id.stringValue = builder.String() + + return id.stringValue +} + +func newResourceID(parent *ResourceID, resourceTypeName string, resourceName string) *ResourceID { + id := &ResourceID{} + id.init(parent, chooseResourceType(resourceTypeName, parent), resourceName, true) + return id +} + +func newResourceIDWithResourceType(parent *ResourceID, resourceType ResourceType, resourceName string) *ResourceID { + id := &ResourceID{} + id.init(parent, resourceType, resourceName, true) + return id +} + +func newResourceIDWithProvider(parent *ResourceID, providerNamespace, resourceTypeName, resourceName string) *ResourceID { + id := &ResourceID{} + id.init(parent, NewResourceType(providerNamespace, resourceTypeName), resourceName, false) + return id +} + +func chooseResourceType(resourceTypeName string, parent *ResourceID) ResourceType { + if strings.EqualFold(resourceTypeName, resourceGroupsLowerKey) { + return ResourceGroupResourceType + } else if strings.EqualFold(resourceTypeName, subscriptionsKey) && parent != nil && parent.ResourceType.String() == TenantResourceType.String() { + return SubscriptionResourceType + } + + return parent.ResourceType.AppendChild(resourceTypeName) +} + +func (id *ResourceID) init(parent *ResourceID, resourceType ResourceType, name string, isChild bool) { + if parent != nil { + id.Provider = parent.Provider + id.SubscriptionID = parent.SubscriptionID + id.ResourceGroupName = parent.ResourceGroupName + id.Location = parent.Location + } + + if resourceType.String() == SubscriptionResourceType.String() { + id.SubscriptionID = name + } + + if resourceType.lastType() == locationsKey { + id.Location = name + } + + if resourceType.String() == ResourceGroupResourceType.String() { + id.ResourceGroupName = name + } + + if resourceType.String() == ProviderResourceType.String() { + id.Provider = name + } + + if parent == nil { + id.Parent = RootResourceID + } else { + id.Parent = parent + } + id.isChild = isChild + id.ResourceType = resourceType + id.Name = name +} + +func appendNext(parent *ResourceID, parts []string, id string) (*ResourceID, error) { + if len(parts) == 0 { + return parent, nil + } + + if len(parts) == 1 { + // subscriptions and resourceGroups are not valid ids without their names + if strings.EqualFold(parts[0], subscriptionsKey) || strings.EqualFold(parts[0], resourceGroupsLowerKey) { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + // resourceGroup must contain either child or provider resource type + if parent.ResourceType.String() == ResourceGroupResourceType.String() { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + return newResourceID(parent, parts[0], ""), nil + } + + if strings.EqualFold(parts[0], providersKey) && (len(parts) == 2 || strings.EqualFold(parts[2], providersKey)) { + //provider resource can only be on a tenant or a subscription parent + if parent.ResourceType.String() != SubscriptionResourceType.String() && parent.ResourceType.String() != TenantResourceType.String() { + return nil, fmt.Errorf("invalid resource ID: %s", id) + } + + return appendNext(newResourceIDWithResourceType(parent, ProviderResourceType, parts[1]), parts[2:], id) + } + + if len(parts) > 3 && strings.EqualFold(parts[0], providersKey) { + return appendNext(newResourceIDWithProvider(parent, parts[1], parts[2], parts[3]), parts[4:], id) + } + + if len(parts) > 1 && !strings.EqualFold(parts[0], providersKey) { + return appendNext(newResourceID(parent, parts[0], parts[1]), parts[2:], id) + } + + return nil, fmt.Errorf("invalid resource ID: %s", id) +} + +func splitStringAndOmitEmpty(v, sep string) []string { + r := make([]string, 0) + for _, s := range strings.Split(v, sep) { + if len(s) == 0 { + continue + } + r = append(r, s) + } + + return r +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go new file mode 100644 index 000000000..ca03ac971 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource/resource_type.go @@ -0,0 +1,114 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package resource + +import ( + "fmt" + "strings" +) + +// SubscriptionResourceType is the ResourceType of a subscription +var SubscriptionResourceType = NewResourceType(builtInResourceNamespace, "subscriptions") + +// ResourceGroupResourceType is the ResourceType of a resource group +var ResourceGroupResourceType = NewResourceType(builtInResourceNamespace, "resourceGroups") + +// TenantResourceType is the ResourceType of a tenant +var TenantResourceType = NewResourceType(builtInResourceNamespace, "tenants") + +// ProviderResourceType is the ResourceType of a provider +var ProviderResourceType = NewResourceType(builtInResourceNamespace, "providers") + +// ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets". +// Don't create this type directly, use ParseResourceType or NewResourceType instead. +type ResourceType struct { + // Namespace is the namespace of the resource type. + // e.g. "Microsoft.Network" in resource type "Microsoft.Network/virtualNetworks/subnets" + Namespace string + + // Type is the full type name of the resource type. + // e.g. "virtualNetworks/subnets" in resource type "Microsoft.Network/virtualNetworks/subnets" + Type string + + // Types is the slice of all the sub-types of this resource type. + // e.g. ["virtualNetworks", "subnets"] in resource type "Microsoft.Network/virtualNetworks/subnets" + Types []string + + stringValue string +} + +// String returns the string of the ResourceType +func (t ResourceType) String() string { + return t.stringValue +} + +// IsParentOf returns true when the receiver is the parent resource type of the child. +func (t ResourceType) IsParentOf(child ResourceType) bool { + if !strings.EqualFold(t.Namespace, child.Namespace) { + return false + } + if len(t.Types) >= len(child.Types) { + return false + } + for i := range t.Types { + if !strings.EqualFold(t.Types[i], child.Types[i]) { + return false + } + } + + return true +} + +// AppendChild creates an instance of ResourceType using the receiver as the parent with childType appended to it. +func (t ResourceType) AppendChild(childType string) ResourceType { + return NewResourceType(t.Namespace, fmt.Sprintf("%s/%s", t.Type, childType)) +} + +// NewResourceType creates an instance of ResourceType using a provider namespace +// such as "Microsoft.Network" and type such as "virtualNetworks/subnets". +func NewResourceType(providerNamespace, typeName string) ResourceType { + return ResourceType{ + Namespace: providerNamespace, + Type: typeName, + Types: splitStringAndOmitEmpty(typeName, "/"), + stringValue: fmt.Sprintf("%s/%s", providerNamespace, typeName), + } +} + +// ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets) +// or a resource identifier string. +// e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet) +func ParseResourceType(resourceIDOrType string) (ResourceType, error) { + // split the path into segments + parts := splitStringAndOmitEmpty(resourceIDOrType, "/") + + // There must be at least a namespace and type name + if len(parts) < 1 { + return ResourceType{}, fmt.Errorf("invalid resource ID or type: %s", resourceIDOrType) + } + + // if the type is just subscriptions, it is a built-in type in the Microsoft.Resources namespace + if len(parts) == 1 { + // Simple resource type + return NewResourceType(builtInResourceNamespace, parts[0]), nil + } else if strings.Contains(parts[0], ".") { + // Handle resource types (Microsoft.Compute/virtualMachines, Microsoft.Network/virtualNetworks/subnets) + // it is a full type name + return NewResourceType(parts[0], strings.Join(parts[1:], "/")), nil + } else { + // Check if ResourceID + id, err := ParseResourceID(resourceIDOrType) + if err != nil { + return ResourceType{}, err + } + return NewResourceType(id.ResourceType.Namespace, id.ResourceType.Type), nil + } +} + +func (t ResourceType) lastType() string { + return t.Types[len(t.Types)-1] +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go new file mode 100644 index 000000000..83cf91e3e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy/policy.go @@ -0,0 +1,98 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package policy + +import ( + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" +) + +// BearerTokenOptions configures the bearer token policy's behavior. +type BearerTokenOptions struct { + // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests. + // The policy will add a token from each of these tenants to every request. The + // authenticating user or service principal must be a guest in these tenants, and the + // policy's credential must support multitenant authentication. + AuxiliaryTenants []string + + // Scopes contains the list of permission scopes required for the token. + Scopes []string +} + +// RegistrationOptions configures the registration policy's behavior. +// All zero-value fields will be initialized with their default values. +type RegistrationOptions struct { + policy.ClientOptions + + // MaxAttempts is the total number of times to attempt automatic registration + // in the event that an attempt fails. + // The default value is 3. + // Set to a value less than zero to disable the policy. + MaxAttempts int + + // PollingDelay is the amount of time to sleep between polling intervals. + // The default value is 15 seconds. + // A value less than zero means no delay between polling intervals (not recommended). + PollingDelay time.Duration + + // PollingDuration is the amount of time to wait before abandoning polling. + // The default valule is 5 minutes. + // NOTE: Setting this to a small value might cause the policy to prematurely fail. + PollingDuration time.Duration +} + +// ClientOptions contains configuration settings for a client's pipeline. +type ClientOptions struct { + policy.ClientOptions + + // AuxiliaryTenants are additional tenant IDs for authenticating cross-tenant requests. + // The client will add a token from each of these tenants to every request. The + // authenticating user or service principal must be a guest in these tenants, and the + // client's credential must support multitenant authentication. + AuxiliaryTenants []string + + // DisableRPRegistration disables the auto-RP registration policy. Defaults to false. + DisableRPRegistration bool +} + +// Clone return a deep copy of the current options. +func (o *ClientOptions) Clone() *ClientOptions { + if o == nil { + return nil + } + copiedOptions := *o + copiedOptions.Cloud.Services = copyMap(copiedOptions.Cloud.Services) + copiedOptions.Logging.AllowedHeaders = copyArray(copiedOptions.Logging.AllowedHeaders) + copiedOptions.Logging.AllowedQueryParams = copyArray(copiedOptions.Logging.AllowedQueryParams) + copiedOptions.Retry.StatusCodes = copyArray(copiedOptions.Retry.StatusCodes) + copiedOptions.PerRetryPolicies = copyArray(copiedOptions.PerRetryPolicies) + copiedOptions.PerCallPolicies = copyArray(copiedOptions.PerCallPolicies) + return &copiedOptions +} + +// copyMap return a new map with all the key value pair in the src map +func copyMap[K comparable, V any](src map[K]V) map[K]V { + if src == nil { + return nil + } + copiedMap := make(map[K]V) + for k, v := range src { + copiedMap[k] = v + } + return copiedMap +} + +// copyMap return a new array with all the elements in the src array +func copyArray[T any](src []T) []T { + if src == nil { + return nil + } + copiedArray := make([]T, len(src)) + copy(copiedArray, src) + return copiedArray +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go new file mode 100644 index 000000000..d35d6374f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_identifier.go @@ -0,0 +1,23 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package arm + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource" +) + +// RootResourceID defines the tenant as the root parent of all other ResourceID. +var RootResourceID = resource.RootResourceID + +// ResourceID represents a resource ID such as `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg`. +// Don't create this type directly, use ParseResourceID instead. +type ResourceID = resource.ResourceID + +// ParseResourceID parses a string to an instance of ResourceID +func ParseResourceID(id string) (*ResourceID, error) { + return resource.ParseResourceID(id) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go new file mode 100644 index 000000000..fc7fbffd2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/resource_type.go @@ -0,0 +1,40 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package arm + +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource" +) + +// SubscriptionResourceType is the ResourceType of a subscription +var SubscriptionResourceType = resource.SubscriptionResourceType + +// ResourceGroupResourceType is the ResourceType of a resource group +var ResourceGroupResourceType = resource.ResourceGroupResourceType + +// TenantResourceType is the ResourceType of a tenant +var TenantResourceType = resource.TenantResourceType + +// ProviderResourceType is the ResourceType of a provider +var ProviderResourceType = resource.ProviderResourceType + +// ResourceType represents an Azure resource type, e.g. "Microsoft.Network/virtualNetworks/subnets". +// Don't create this type directly, use ParseResourceType or NewResourceType instead. +type ResourceType = resource.ResourceType + +// NewResourceType creates an instance of ResourceType using a provider namespace +// such as "Microsoft.Network" and type such as "virtualNetworks/subnets". +func NewResourceType(providerNamespace, typeName string) ResourceType { + return resource.NewResourceType(providerNamespace, typeName) +} + +// ParseResourceType parses the ResourceType from a resource type string (e.g. Microsoft.Network/virtualNetworks/subsets) +// or a resource identifier string. +// e.g. /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet/subnets/mySubnet) +func ParseResourceType(resourceIDOrType string) (ResourceType, error) { + return resource.ParseResourceType(resourceIDOrType) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go new file mode 100644 index 000000000..302c19cd4 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/pipeline.go @@ -0,0 +1,65 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import ( + "errors" + "reflect" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported" + azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" +) + +// NewPipeline creates a pipeline from connection options. Policies from ClientOptions are +// placed after policies from PipelineOptions. The telemetry policy, when enabled, will +// use the specified module and version info. +func NewPipeline(module, version string, cred azcore.TokenCredential, plOpts azruntime.PipelineOptions, options *armpolicy.ClientOptions) (azruntime.Pipeline, error) { + if options == nil { + options = &armpolicy.ClientOptions{} + } + conf, err := getConfiguration(&options.ClientOptions) + if err != nil { + return azruntime.Pipeline{}, err + } + authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{ + AuxiliaryTenants: options.AuxiliaryTenants, + Scopes: []string{conf.Audience + "/.default"}, + }) + perRetry := make([]azpolicy.Policy, len(plOpts.PerRetry), len(plOpts.PerRetry)+1) + copy(perRetry, plOpts.PerRetry) + plOpts.PerRetry = append(perRetry, authPolicy, exported.PolicyFunc(httpTraceNamespacePolicy)) + if !options.DisableRPRegistration { + regRPOpts := armpolicy.RegistrationOptions{ClientOptions: options.ClientOptions} + regPolicy, err := NewRPRegistrationPolicy(cred, ®RPOpts) + if err != nil { + return azruntime.Pipeline{}, err + } + perCall := make([]azpolicy.Policy, len(plOpts.PerCall), len(plOpts.PerCall)+1) + copy(perCall, plOpts.PerCall) + plOpts.PerCall = append(perCall, regPolicy) + } + if plOpts.APIVersion.Name == "" { + plOpts.APIVersion.Name = "api-version" + } + return azruntime.NewPipeline(module, version, plOpts, &options.ClientOptions), nil +} + +func getConfiguration(o *azpolicy.ClientOptions) (cloud.ServiceConfiguration, error) { + c := cloud.AzurePublic + if !reflect.ValueOf(o.Cloud).IsZero() { + c = o.Cloud + } + if conf, ok := c.Services[cloud.ResourceManager]; ok && conf.Endpoint != "" && conf.Audience != "" { + return conf, nil + } else { + return conf, errors.New("provided Cloud field is missing Azure Resource Manager configuration") + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go new file mode 100644 index 000000000..54b3bb78d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_bearer_token.go @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import ( + "context" + "encoding/base64" + "fmt" + "net/http" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" + azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + azruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/internal/temporal" +) + +const headerAuxiliaryAuthorization = "x-ms-authorization-auxiliary" + +// acquiringResourceState holds data for an auxiliary token request +type acquiringResourceState struct { + ctx context.Context + p *BearerTokenPolicy + tenant string +} + +// acquireAuxToken acquires a token from an auxiliary tenant. Only one thread/goroutine at a time ever calls this function. +func acquireAuxToken(state acquiringResourceState) (newResource azcore.AccessToken, newExpiration time.Time, err error) { + tk, err := state.p.cred.GetToken(state.ctx, azpolicy.TokenRequestOptions{ + EnableCAE: true, + Scopes: state.p.scopes, + TenantID: state.tenant, + }) + if err != nil { + return azcore.AccessToken{}, time.Time{}, err + } + return tk, tk.ExpiresOn, nil +} + +// BearerTokenPolicy authorizes requests with bearer tokens acquired from a TokenCredential. +type BearerTokenPolicy struct { + auxResources map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState] + btp *azruntime.BearerTokenPolicy + cred azcore.TokenCredential + scopes []string +} + +// NewBearerTokenPolicy creates a policy object that authorizes requests with bearer tokens. +// cred: an azcore.TokenCredential implementation such as a credential object from azidentity +// opts: optional settings. Pass nil to accept default values; this is the same as passing a zero-value options. +func NewBearerTokenPolicy(cred azcore.TokenCredential, opts *armpolicy.BearerTokenOptions) *BearerTokenPolicy { + if opts == nil { + opts = &armpolicy.BearerTokenOptions{} + } + p := &BearerTokenPolicy{cred: cred} + p.auxResources = make(map[string]*temporal.Resource[azcore.AccessToken, acquiringResourceState], len(opts.AuxiliaryTenants)) + for _, t := range opts.AuxiliaryTenants { + p.auxResources[t] = temporal.NewResource(acquireAuxToken) + } + p.scopes = make([]string, len(opts.Scopes)) + copy(p.scopes, opts.Scopes) + p.btp = azruntime.NewBearerTokenPolicy(cred, opts.Scopes, &azpolicy.BearerTokenOptions{ + AuthorizationHandler: azpolicy.AuthorizationHandler{ + OnChallenge: p.onChallenge, + OnRequest: p.onRequest, + }, + }) + return p +} + +func (b *BearerTokenPolicy) onChallenge(req *azpolicy.Request, res *http.Response, authNZ func(azpolicy.TokenRequestOptions) error) error { + challenge := res.Header.Get(shared.HeaderWWWAuthenticate) + claims, err := parseChallenge(challenge) + if err != nil { + // the challenge contains claims we can't parse + return err + } else if claims != "" { + // request a new token having the specified claims, send the request again + return authNZ(azpolicy.TokenRequestOptions{Claims: claims, EnableCAE: true, Scopes: b.scopes}) + } + // auth challenge didn't include claims, so this is a simple authorization failure + return azruntime.NewResponseError(res) +} + +// onRequest authorizes requests with one or more bearer tokens +func (b *BearerTokenPolicy) onRequest(req *azpolicy.Request, authNZ func(azpolicy.TokenRequestOptions) error) error { + // authorize the request with a token for the primary tenant + err := authNZ(azpolicy.TokenRequestOptions{EnableCAE: true, Scopes: b.scopes}) + if err != nil || len(b.auxResources) == 0 { + return err + } + // add tokens for auxiliary tenants + as := acquiringResourceState{ + ctx: req.Raw().Context(), + p: b, + } + auxTokens := make([]string, 0, len(b.auxResources)) + for tenant, er := range b.auxResources { + as.tenant = tenant + auxTk, err := er.Get(as) + if err != nil { + return err + } + auxTokens = append(auxTokens, fmt.Sprintf("%s%s", shared.BearerTokenPrefix, auxTk.Token)) + } + req.Raw().Header.Set(headerAuxiliaryAuthorization, strings.Join(auxTokens, ", ")) + return nil +} + +// Do authorizes a request with a bearer token +func (b *BearerTokenPolicy) Do(req *azpolicy.Request) (*http.Response, error) { + return b.btp.Do(req) +} + +// parseChallenge parses claims from an authentication challenge issued by ARM so a client can request a token +// that will satisfy conditional access policies. It returns a non-nil error when the given value contains +// claims it can't parse. If the value contains no claims, it returns an empty string and a nil error. +func parseChallenge(wwwAuthenticate string) (string, error) { + claims := "" + var err error + for _, param := range strings.Split(wwwAuthenticate, ",") { + if _, after, found := strings.Cut(param, "claims="); found { + if claims != "" { + // The header contains multiple challenges, at least two of which specify claims. The specs allow this + // but it's unclear what a client should do in this case and there's as yet no concrete example of it. + err = fmt.Errorf("found multiple claims challenges in %q", wwwAuthenticate) + break + } + // trim stuff that would get an error from RawURLEncoding; claims may or may not be padded + claims = strings.Trim(after, `\"=`) + // we don't return this error because it's something unhelpful like "illegal base64 data at input byte 42" + if b, decErr := base64.RawURLEncoding.DecodeString(claims); decErr == nil { + claims = string(b) + } else { + err = fmt.Errorf("failed to parse claims from %q", wwwAuthenticate) + break + } + } + } + return claims, err +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go new file mode 100644 index 000000000..83e15949a --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_register_rp.go @@ -0,0 +1,347 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/url" + "strings" + "time" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + armpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" + azpolicy "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/internal/log" +) + +const ( + // LogRPRegistration entries contain information specific to the automatic registration of an RP. + // Entries of this classification are written IFF the policy needs to take any action. + LogRPRegistration log.Event = "RPRegistration" +) + +// init sets any default values +func setDefaults(r *armpolicy.RegistrationOptions) { + if r.MaxAttempts == 0 { + r.MaxAttempts = 3 + } else if r.MaxAttempts < 0 { + r.MaxAttempts = 0 + } + if r.PollingDelay == 0 { + r.PollingDelay = 15 * time.Second + } else if r.PollingDelay < 0 { + r.PollingDelay = 0 + } + if r.PollingDuration == 0 { + r.PollingDuration = 5 * time.Minute + } +} + +// NewRPRegistrationPolicy creates a policy object configured using the specified options. +// The policy controls whether an unregistered resource provider should automatically be +// registered. See https://aka.ms/rps-not-found for more information. +func NewRPRegistrationPolicy(cred azcore.TokenCredential, o *armpolicy.RegistrationOptions) (azpolicy.Policy, error) { + if o == nil { + o = &armpolicy.RegistrationOptions{} + } + conf, err := getConfiguration(&o.ClientOptions) + if err != nil { + return nil, err + } + authPolicy := NewBearerTokenPolicy(cred, &armpolicy.BearerTokenOptions{Scopes: []string{conf.Audience + "/.default"}}) + p := &rpRegistrationPolicy{ + endpoint: conf.Endpoint, + pipeline: runtime.NewPipeline(shared.Module, shared.Version, runtime.PipelineOptions{PerRetry: []azpolicy.Policy{authPolicy}}, &o.ClientOptions), + options: *o, + } + // init the copy + setDefaults(&p.options) + return p, nil +} + +type rpRegistrationPolicy struct { + endpoint string + pipeline runtime.Pipeline + options armpolicy.RegistrationOptions +} + +func (r *rpRegistrationPolicy) Do(req *azpolicy.Request) (*http.Response, error) { + if r.options.MaxAttempts == 0 { + // policy is disabled + return req.Next() + } + const registeredState = "Registered" + var rp string + var resp *http.Response + for attempts := 0; attempts < r.options.MaxAttempts; attempts++ { + var err error + // make the original request + resp, err = req.Next() + // getting a 409 is the first indication that the RP might need to be registered, check error response + if err != nil || resp.StatusCode != http.StatusConflict { + return resp, err + } + var reqErr requestError + if err = runtime.UnmarshalAsJSON(resp, &reqErr); err != nil { + return resp, err + } + if reqErr.ServiceError == nil { + // missing service error info. just return the response + // to the caller so its error unmarshalling will kick in + return resp, err + } + if !isUnregisteredRPCode(reqErr.ServiceError.Code) { + // not a 409 due to unregistered RP. just return the response + // to the caller so its error unmarshalling will kick in + return resp, err + } + // RP needs to be registered. start by getting the subscription ID from the original request + subID, err := getSubscription(req.Raw().URL.Path) + if err != nil { + return resp, err + } + // now get the RP from the error + rp, err = getProvider(reqErr) + if err != nil { + return resp, err + } + logRegistrationExit := func(v interface{}) { + log.Writef(LogRPRegistration, "END registration for %s: %v", rp, v) + } + log.Writef(LogRPRegistration, "BEGIN registration for %s", rp) + // create client and make the registration request + // we use the scheme and host from the original request + rpOps := &providersOperations{ + p: r.pipeline, + u: r.endpoint, + subID: subID, + } + if _, err = rpOps.Register(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, rp); err != nil { + logRegistrationExit(err) + return resp, err + } + + // RP was registered, however we need to wait for the registration to complete + pollCtx, pollCancel := context.WithTimeout(&shared.ContextWithDeniedValues{Context: req.Raw().Context()}, r.options.PollingDuration) + var lastRegState string + for { + // get the current registration state + getResp, err := rpOps.Get(pollCtx, rp) + if err != nil { + pollCancel() + logRegistrationExit(err) + return resp, err + } + if getResp.Provider.RegistrationState != nil && !strings.EqualFold(*getResp.Provider.RegistrationState, lastRegState) { + // registration state has changed, or was updated for the first time + lastRegState = *getResp.Provider.RegistrationState + log.Writef(LogRPRegistration, "registration state is %s", lastRegState) + } + if strings.EqualFold(lastRegState, registeredState) { + // registration complete + pollCancel() + logRegistrationExit(lastRegState) + break + } + // wait before trying again + select { + case <-time.After(r.options.PollingDelay): + // continue polling + case <-pollCtx.Done(): + pollCancel() + logRegistrationExit(pollCtx.Err()) + return resp, pollCtx.Err() + } + } + // RP was successfully registered, retry the original request + err = req.RewindBody() + if err != nil { + return resp, err + } + } + // if we get here it means we exceeded the number of attempts + return resp, fmt.Errorf("exceeded attempts to register %s", rp) +} + +var unregisteredRPCodes = []string{ + "MissingSubscriptionRegistration", + "MissingRegistrationForResourceProvider", + "Subscription Not Registered", + "SubscriptionNotRegistered", +} + +func isUnregisteredRPCode(errorCode string) bool { + for _, code := range unregisteredRPCodes { + if strings.EqualFold(errorCode, code) { + return true + } + } + return false +} + +func getSubscription(path string) (string, error) { + parts := strings.Split(path, "/") + for i, v := range parts { + if v == "subscriptions" && (i+1) < len(parts) { + return parts[i+1], nil + } + } + return "", fmt.Errorf("failed to obtain subscription ID from %s", path) +} + +func getProvider(re requestError) (string, error) { + if len(re.ServiceError.Details) > 0 { + return re.ServiceError.Details[0].Target, nil + } + return "", errors.New("unexpected empty Details") +} + +// minimal error definitions to simplify detection +type requestError struct { + ServiceError *serviceError `json:"error"` +} + +type serviceError struct { + Code string `json:"code"` + Details []serviceErrorDetails `json:"details"` +} + +type serviceErrorDetails struct { + Code string `json:"code"` + Target string `json:"target"` +} + +/////////////////////////////////////////////////////////////////////////////////////////////// +// the following code was copied from module armresources, providers.go and models.go +// only the minimum amount of code was copied to get this working and some edits were made. +/////////////////////////////////////////////////////////////////////////////////////////////// + +type providersOperations struct { + p runtime.Pipeline + u string + subID string +} + +// Get - Gets the specified resource provider. +func (client *providersOperations) Get(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) { + req, err := client.getCreateRequest(ctx, resourceProviderNamespace) + if err != nil { + return providerResponse{}, err + } + resp, err := client.p.Do(req) + if err != nil { + return providerResponse{}, err + } + result, err := client.getHandleResponse(resp) + if err != nil { + return providerResponse{}, err + } + return result, nil +} + +// getCreateRequest creates the Get request. +func (client *providersOperations) getCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}" + urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.u, urlPath)) + if err != nil { + return nil, err + } + query := req.Raw().URL.Query() + query.Set("api-version", "2019-05-01") + req.Raw().URL.RawQuery = query.Encode() + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *providersOperations) getHandleResponse(resp *http.Response) (providerResponse, error) { + if !runtime.HasStatusCode(resp, http.StatusOK) { + return providerResponse{}, exported.NewResponseError(resp) + } + result := providerResponse{RawResponse: resp} + err := runtime.UnmarshalAsJSON(resp, &result.Provider) + if err != nil { + return providerResponse{}, err + } + return result, err +} + +// Register - Registers a subscription with a resource provider. +func (client *providersOperations) Register(ctx context.Context, resourceProviderNamespace string) (providerResponse, error) { + req, err := client.registerCreateRequest(ctx, resourceProviderNamespace) + if err != nil { + return providerResponse{}, err + } + resp, err := client.p.Do(req) + if err != nil { + return providerResponse{}, err + } + result, err := client.registerHandleResponse(resp) + if err != nil { + return providerResponse{}, err + } + return result, nil +} + +// registerCreateRequest creates the Register request. +func (client *providersOperations) registerCreateRequest(ctx context.Context, resourceProviderNamespace string) (*azpolicy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register" + urlPath = strings.ReplaceAll(urlPath, "{resourceProviderNamespace}", url.PathEscape(resourceProviderNamespace)) + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.u, urlPath)) + if err != nil { + return nil, err + } + query := req.Raw().URL.Query() + query.Set("api-version", "2019-05-01") + req.Raw().URL.RawQuery = query.Encode() + return req, nil +} + +// registerHandleResponse handles the Register response. +func (client *providersOperations) registerHandleResponse(resp *http.Response) (providerResponse, error) { + if !runtime.HasStatusCode(resp, http.StatusOK) { + return providerResponse{}, exported.NewResponseError(resp) + } + result := providerResponse{RawResponse: resp} + err := runtime.UnmarshalAsJSON(resp, &result.Provider) + if err != nil { + return providerResponse{}, err + } + return result, err +} + +// ProviderResponse is the response envelope for operations that return a Provider type. +type providerResponse struct { + // Resource provider information. + Provider *provider + + // RawResponse contains the underlying HTTP response. + RawResponse *http.Response +} + +// Provider - Resource provider information. +type provider struct { + // The provider ID. + ID *string `json:"id,omitempty"` + + // The namespace of the resource provider. + Namespace *string `json:"namespace,omitempty"` + + // The registration policy of the resource provider. + RegistrationPolicy *string `json:"registrationPolicy,omitempty"` + + // The registration state of the resource provider. + RegistrationState *string `json:"registrationState,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go new file mode 100644 index 000000000..6cea18424 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/policy_trace_namespace.go @@ -0,0 +1,30 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import ( + "net/http" + + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing" +) + +// httpTraceNamespacePolicy is a policy that adds the az.namespace attribute to the current Span +func httpTraceNamespacePolicy(req *policy.Request) (resp *http.Response, err error) { + rawTracer := req.Raw().Context().Value(shared.CtxWithTracingTracer{}) + if tracer, ok := rawTracer.(tracing.Tracer); ok && tracer.Enabled() { + rt, err := resource.ParseResourceType(req.Raw().URL.Path) + if err == nil { + // add the namespace attribute to the current span + span := tracer.SpanFromContext(req.Raw().Context()) + span.SetAttributes(tracing.Attribute{Key: shared.TracingNamespaceAttrName, Value: rt.Namespace}) + } + } + return req.Next() +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go new file mode 100644 index 000000000..1400d4379 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime/runtime.go @@ -0,0 +1,24 @@ +//go:build go1.16 +// +build go1.16 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package runtime + +import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + +func init() { + cloud.AzureChina.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ + Audience: "https://management.core.chinacloudapi.cn", + Endpoint: "https://management.chinacloudapi.cn", + } + cloud.AzureGovernment.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ + Audience: "https://management.core.usgovcloudapi.net", + Endpoint: "https://management.usgovcloudapi.net", + } + cloud.AzurePublic.Services[cloud.ResourceManager] = cloud.ServiceConfiguration{ + Audience: "https://management.core.windows.net/", + Endpoint: "https://management.azure.com", + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md new file mode 100644 index 000000000..7ea119ab3 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/CHANGELOG.md @@ -0,0 +1,457 @@ +# Release History + +## 1.4.0 (2023-10-10) + +### Bugs Fixed +* `ManagedIdentityCredential` will now retry when IMDS responds 410 or 503 + +## 1.4.0-beta.5 (2023-09-12) + +### Features Added +* Service principal credentials can request CAE tokens + +### Breaking Changes +> These changes affect only code written against a beta version such as v1.4.0-beta.4 +* Whether `GetToken` requests a CAE token is now determined by `TokenRequestOptions.EnableCAE`. Azure + SDK clients which support CAE will set this option automatically. Credentials no longer request CAE + tokens by default or observe the environment variable "AZURE_IDENTITY_DISABLE_CP1". + +### Bugs Fixed +* Credential chains such as `DefaultAzureCredential` now try their next credential, if any, when + managed identity authentication fails in a Docker Desktop container + ([#21417](https://github.com/Azure/azure-sdk-for-go/issues/21417)) + +## 1.4.0-beta.4 (2023-08-16) + +### Other Changes +* Upgraded dependencies + +## 1.3.1 (2023-08-16) + +### Other Changes +* Upgraded dependencies + +## 1.4.0-beta.3 (2023-08-08) + +### Bugs Fixed +* One invocation of `AzureCLICredential.GetToken()` and `OnBehalfOfCredential.GetToken()` + can no longer make two authentication attempts + +## 1.4.0-beta.2 (2023-07-14) + +### Other Changes +* `DefaultAzureCredentialOptions.TenantID` applies to workload identity authentication +* Upgraded dependencies + +## 1.4.0-beta.1 (2023-06-06) + +### Other Changes +* Re-enabled CAE support as in v1.3.0-beta.3 + +## 1.3.0 (2023-05-09) + +### Breaking Changes +> These changes affect only code written against a beta version such as v1.3.0-beta.5 +* Renamed `NewOnBehalfOfCredentialFromCertificate` to `NewOnBehalfOfCredentialWithCertificate` +* Renamed `NewOnBehalfOfCredentialFromSecret` to `NewOnBehalfOfCredentialWithSecret` + +### Other Changes +* Upgraded to MSAL v1.0.0 + +## 1.3.0-beta.5 (2023-04-11) + +### Breaking Changes +> These changes affect only code written against a beta version such as v1.3.0-beta.4 +* Moved `NewWorkloadIdentityCredential()` parameters into `WorkloadIdentityCredentialOptions`. + The constructor now reads default configuration from environment variables set by the Azure + workload identity webhook by default. + ([#20478](https://github.com/Azure/azure-sdk-for-go/pull/20478)) +* Removed CAE support. It will return in v1.4.0-beta.1 + ([#20479](https://github.com/Azure/azure-sdk-for-go/pull/20479)) + +### Bugs Fixed +* Fixed an issue in `DefaultAzureCredential` that could cause the managed identity endpoint check to fail in rare circumstances. + +## 1.3.0-beta.4 (2023-03-08) + +### Features Added +* Added `WorkloadIdentityCredentialOptions.AdditionallyAllowedTenants` and `.DisableInstanceDiscovery` + +### Bugs Fixed +* Credentials now synchronize within `GetToken()` so a single instance can be shared among goroutines + ([#20044](https://github.com/Azure/azure-sdk-for-go/issues/20044)) + +### Other Changes +* Upgraded dependencies + +## 1.2.2 (2023-03-07) + +### Other Changes +* Upgraded dependencies + +## 1.3.0-beta.3 (2023-02-07) + +### Features Added +* By default, credentials set client capability "CP1" to enable support for + [Continuous Access Evaluation (CAE)](https://docs.microsoft.com/azure/active-directory/develop/app-resilience-continuous-access-evaluation). + This indicates to Azure Active Directory that your application can handle CAE claims challenges. + You can disable this behavior by setting the environment variable "AZURE_IDENTITY_DISABLE_CP1" to "true". +* `InteractiveBrowserCredentialOptions.LoginHint` enables pre-populating the login + prompt with a username ([#15599](https://github.com/Azure/azure-sdk-for-go/pull/15599)) +* Service principal and user credentials support ADFS authentication on Azure Stack. + Specify "adfs" as the credential's tenant. +* Applications running in private or disconnected clouds can prevent credentials from + requesting Azure AD instance metadata by setting the `DisableInstanceDiscovery` + field on credential options. +* Many credentials can now be configured to authenticate in multiple tenants. The + options types for these credentials have an `AdditionallyAllowedTenants` field + that specifies additional tenants in which the credential may authenticate. + +## 1.3.0-beta.2 (2023-01-10) + +### Features Added +* Added `OnBehalfOfCredential` to support the on-behalf-of flow + ([#16642](https://github.com/Azure/azure-sdk-for-go/issues/16642)) + +### Bugs Fixed +* `AzureCLICredential` reports token expiration in local time (should be UTC) + +### Other Changes +* `AzureCLICredential` imposes its default timeout only when the `Context` + passed to `GetToken()` has no deadline +* Added `NewCredentialUnavailableError()`. This function constructs an error indicating + a credential can't authenticate and an encompassing `ChainedTokenCredential` should + try its next credential, if any. + +## 1.3.0-beta.1 (2022-12-13) + +### Features Added +* `WorkloadIdentityCredential` and `DefaultAzureCredential` support + Workload Identity Federation on Kubernetes. `DefaultAzureCredential` + support requires environment variable configuration as set by the + Workload Identity webhook. + ([#15615](https://github.com/Azure/azure-sdk-for-go/issues/15615)) + +## 1.2.0 (2022-11-08) + +### Other Changes +* This version includes all fixes and features from 1.2.0-beta.* + +## 1.2.0-beta.3 (2022-10-11) + +### Features Added +* `ManagedIdentityCredential` caches tokens in memory + +### Bugs Fixed +* `ClientCertificateCredential` sends only the leaf cert for SNI authentication + +## 1.2.0-beta.2 (2022-08-10) + +### Features Added +* Added `ClientAssertionCredential` to enable applications to authenticate + with custom client assertions + +### Other Changes +* Updated AuthenticationFailedError with links to TROUBLESHOOTING.md for relevant errors +* Upgraded `microsoft-authentication-library-for-go` requirement to v0.6.0 + +## 1.2.0-beta.1 (2022-06-07) + +### Features Added +* `EnvironmentCredential` reads certificate passwords from `AZURE_CLIENT_CERTIFICATE_PASSWORD` + ([#17099](https://github.com/Azure/azure-sdk-for-go/pull/17099)) + +## 1.1.0 (2022-06-07) + +### Features Added +* `ClientCertificateCredential` and `ClientSecretCredential` support ESTS-R. First-party + applications can set environment variable `AZURE_REGIONAL_AUTHORITY_NAME` with a + region name. + ([#15605](https://github.com/Azure/azure-sdk-for-go/issues/15605)) + +## 1.0.1 (2022-06-07) + +### Other Changes +* Upgrade `microsoft-authentication-library-for-go` requirement to v0.5.1 + ([#18176](https://github.com/Azure/azure-sdk-for-go/issues/18176)) + +## 1.0.0 (2022-05-12) + +### Features Added +* `DefaultAzureCredential` reads environment variable `AZURE_CLIENT_ID` for the + client ID of a user-assigned managed identity + ([#17293](https://github.com/Azure/azure-sdk-for-go/pull/17293)) + +### Breaking Changes +* Removed `AuthorizationCodeCredential`. Use `InteractiveBrowserCredential` instead + to authenticate a user with the authorization code flow. +* Instances of `AuthenticationFailedError` are now returned by pointer. +* `GetToken()` returns `azcore.AccessToken` by value + +### Bugs Fixed +* `AzureCLICredential` panics after receiving an unexpected error type + ([#17490](https://github.com/Azure/azure-sdk-for-go/issues/17490)) + +### Other Changes +* `GetToken()` returns an error when the caller specifies no scope +* Updated to the latest versions of `golang.org/x/crypto`, `azcore` and `internal` + +## 0.14.0 (2022-04-05) + +### Breaking Changes +* This module now requires Go 1.18 +* Removed `AuthorityHost`. Credentials are now configured for sovereign or private + clouds with the API in `azcore/cloud`, for example: + ```go + // before + opts := azidentity.ClientSecretCredentialOptions{AuthorityHost: azidentity.AzureGovernment} + cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts) + + // after + import "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + + opts := azidentity.ClientSecretCredentialOptions{} + opts.Cloud = cloud.AzureGovernment + cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, &opts) + ``` + +## 0.13.2 (2022-03-08) + +### Bugs Fixed +* Prevented a data race in `DefaultAzureCredential` and `ChainedTokenCredential` + ([#17144](https://github.com/Azure/azure-sdk-for-go/issues/17144)) + +### Other Changes +* Upgraded App Service managed identity version from 2017-09-01 to 2019-08-01 + ([#17086](https://github.com/Azure/azure-sdk-for-go/pull/17086)) + +## 0.13.1 (2022-02-08) + +### Features Added +* `EnvironmentCredential` supports certificate SNI authentication when + `AZURE_CLIENT_SEND_CERTIFICATE_CHAIN` is "true". + ([#16851](https://github.com/Azure/azure-sdk-for-go/pull/16851)) + +### Bugs Fixed +* `ManagedIdentityCredential.GetToken()` now returns an error when configured for + a user assigned identity in Azure Cloud Shell (which doesn't support such identities) + ([#16946](https://github.com/Azure/azure-sdk-for-go/pull/16946)) + +### Other Changes +* `NewDefaultAzureCredential()` logs non-fatal errors. These errors are also included in the + error returned by `DefaultAzureCredential.GetToken()` when it's unable to acquire a token + from any source. ([#15923](https://github.com/Azure/azure-sdk-for-go/issues/15923)) + +## 0.13.0 (2022-01-11) + +### Breaking Changes +* Replaced `AuthenticationFailedError.RawResponse()` with a field having the same name +* Unexported `CredentialUnavailableError` +* Instances of `ChainedTokenCredential` will now skip looping through the list of source credentials and re-use the first successful credential on subsequent calls to `GetToken`. + * If `ChainedTokenCredentialOptions.RetrySources` is true, `ChainedTokenCredential` will continue to try all of the originally provided credentials each time the `GetToken` method is called. + * `ChainedTokenCredential.successfulCredential` will contain a reference to the last successful credential. + * `DefaultAzureCredenial` will also re-use the first successful credential on subsequent calls to `GetToken`. + * `DefaultAzureCredential.chain.successfulCredential` will also contain a reference to the last successful credential. + +### Other Changes +* `ManagedIdentityCredential` no longer probes IMDS before requesting a token + from it. Also, an error response from IMDS no longer disables a credential + instance. Following an error, a credential instance will continue to send + requests to IMDS as necessary. +* Adopted MSAL for user and service principal authentication +* Updated `azcore` requirement to 0.21.0 + +## 0.12.0 (2021-11-02) +### Breaking Changes +* Raised minimum go version to 1.16 +* Removed `NewAuthenticationPolicy()` from credentials. Clients should instead use azcore's + `runtime.NewBearerTokenPolicy()` to construct a bearer token authorization policy. +* The `AuthorityHost` field in credential options structs is now a custom type, + `AuthorityHost`, with underlying type `string` +* `NewChainedTokenCredential` has a new signature to accommodate a placeholder + options struct: + ```go + // before + cred, err := NewChainedTokenCredential(credA, credB) + + // after + cred, err := NewChainedTokenCredential([]azcore.TokenCredential{credA, credB}, nil) + ``` +* Removed `ExcludeAzureCLICredential`, `ExcludeEnvironmentCredential`, and `ExcludeMSICredential` + from `DefaultAzureCredentialOptions` +* `NewClientCertificateCredential` requires a `[]*x509.Certificate` and `crypto.PrivateKey` instead of + a path to a certificate file. Added `ParseCertificates` to simplify getting these in common cases: + ```go + // before + cred, err := NewClientCertificateCredential("tenant", "client-id", "/cert.pem", nil) + + // after + certData, err := os.ReadFile("/cert.pem") + certs, key, err := ParseCertificates(certData, password) + cred, err := NewClientCertificateCredential(tenantID, clientID, certs, key, nil) + ``` +* Removed `InteractiveBrowserCredentialOptions.ClientSecret` and `.Port` +* Removed `AADAuthenticationFailedError` +* Removed `id` parameter of `NewManagedIdentityCredential()`. User assigned identities are now + specified by `ManagedIdentityCredentialOptions.ID`: + ```go + // before + cred, err := NewManagedIdentityCredential("client-id", nil) + // or, for a resource ID + opts := &ManagedIdentityCredentialOptions{ID: ResourceID} + cred, err := NewManagedIdentityCredential("/subscriptions/...", opts) + + // after + clientID := ClientID("7cf7db0d-...") + opts := &ManagedIdentityCredentialOptions{ID: clientID} + // or, for a resource ID + resID: ResourceID("/subscriptions/...") + opts := &ManagedIdentityCredentialOptions{ID: resID} + cred, err := NewManagedIdentityCredential(opts) + ``` +* `DeviceCodeCredentialOptions.UserPrompt` has a new type: `func(context.Context, DeviceCodeMessage) error` +* Credential options structs now embed `azcore.ClientOptions`. In addition to changing literal initialization + syntax, this change renames `HTTPClient` fields to `Transport`. +* Renamed `LogCredential` to `EventCredential` +* `AzureCLICredential` no longer reads the environment variable `AZURE_CLI_PATH` +* `NewManagedIdentityCredential` no longer reads environment variables `AZURE_CLIENT_ID` and + `AZURE_RESOURCE_ID`. Use `ManagedIdentityCredentialOptions.ID` instead. +* Unexported `AuthenticationFailedError` and `CredentialUnavailableError` structs. In their place are two + interfaces having the same names. + +### Bugs Fixed +* `AzureCLICredential.GetToken` no longer mutates its `opts.Scopes` + +### Features Added +* Added connection configuration options to `DefaultAzureCredentialOptions` +* `AuthenticationFailedError.RawResponse()` returns the HTTP response motivating the error, + if available + +### Other Changes +* `NewDefaultAzureCredential()` returns `*DefaultAzureCredential` instead of `*ChainedTokenCredential` +* Added `TenantID` field to `DefaultAzureCredentialOptions` and `AzureCLICredentialOptions` + +## 0.11.0 (2021-09-08) +### Breaking Changes +* Unexported `AzureCLICredentialOptions.TokenProvider` and its type, + `AzureCLITokenProvider` + +### Bug Fixes +* `ManagedIdentityCredential.GetToken` returns `CredentialUnavailableError` + when IMDS has no assigned identity, signaling `DefaultAzureCredential` to + try other credentials + + +## 0.10.0 (2021-08-30) +### Breaking Changes +* Update based on `azcore` refactor [#15383](https://github.com/Azure/azure-sdk-for-go/pull/15383) + +## 0.9.3 (2021-08-20) + +### Bugs Fixed +* `ManagedIdentityCredential.GetToken` no longer mutates its `opts.Scopes` + +### Other Changes +* Bumps version of `azcore` to `v0.18.1` + + +## 0.9.2 (2021-07-23) +### Features Added +* Adding support for Service Fabric environment in `ManagedIdentityCredential` +* Adding an option for using a resource ID instead of client ID in `ManagedIdentityCredential` + + +## 0.9.1 (2021-05-24) +### Features Added +* Add LICENSE.txt and bump version information + + +## 0.9.0 (2021-05-21) +### Features Added +* Add support for authenticating in Azure Stack environments +* Enable user assigned identities for the IMDS scenario in `ManagedIdentityCredential` +* Add scope to resource conversion in `GetToken()` on `ManagedIdentityCredential` + + +## 0.8.0 (2021-01-20) +### Features Added +* Updating documentation + + +## 0.7.1 (2021-01-04) +### Features Added +* Adding port option to `InteractiveBrowserCredential` + + +## 0.7.0 (2020-12-11) +### Features Added +* Add `redirectURI` parameter back to authentication code flow + + +## 0.6.1 (2020-12-09) +### Features Added +* Updating query parameter in `ManagedIdentityCredential` and updating datetime string for parsing managed identity access tokens. + + +## 0.6.0 (2020-11-16) +### Features Added +* Remove `RedirectURL` parameter from auth code flow to align with the MSAL implementation which relies on the native client redirect URL. + + +## 0.5.0 (2020-10-30) +### Features Added +* Flattening credential options + + +## 0.4.3 (2020-10-21) +### Features Added +* Adding Azure Arc support in `ManagedIdentityCredential` + + +## 0.4.2 (2020-10-16) +### Features Added +* Typo fixes + + +## 0.4.1 (2020-10-16) +### Features Added +* Ensure authority hosts are only HTTPs + + +## 0.4.0 (2020-10-16) +### Features Added +* Adding options structs for credentials + + +## 0.3.0 (2020-10-09) +### Features Added +* Update `DeviceCodeCredential` callback + + +## 0.2.2 (2020-10-09) +### Features Added +* Add `AuthorizationCodeCredential` + + +## 0.2.1 (2020-10-06) +### Features Added +* Add `InteractiveBrowserCredential` + + +## 0.2.0 (2020-09-11) +### Features Added +* Refactor `azidentity` on top of `azcore` refactor +* Updated policies to conform to `policy.Policy` interface changes. +* Updated non-retriable errors to conform to `azcore.NonRetriableError`. +* Fixed calls to `Request.SetBody()` to include content type. +* Switched endpoints to string types and removed extra parsing code. + + +## 0.1.1 (2020-09-02) +### Features Added +* Add `AzureCLICredential` to `DefaultAzureCredential` chain + + +## 0.1.0 (2020-07-23) +### Features Added +* Initial Release. Azure Identity library that provides Azure Active Directory token authentication support for the SDK. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt new file mode 100644 index 000000000..48ea6616b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Microsoft Corporation. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md new file mode 100644 index 000000000..4ac53eb7b --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/MIGRATION.md @@ -0,0 +1,307 @@ +# Migrating from autorest/adal to azidentity + +`azidentity` provides Azure Active Directory (Azure AD) authentication for the newest Azure SDK modules (`github.com/azure-sdk-for-go/sdk/...`). Older Azure SDK packages (`github.com/azure-sdk-for-go/services/...`) use types from `github.com/go-autorest/autorest/adal` instead. + +This guide shows common authentication code using `autorest/adal` and its equivalent using `azidentity`. + +## Table of contents + +- [Acquire a token](#acquire-a-token) +- [Client certificate authentication](#client-certificate-authentication) +- [Client secret authentication](#client-secret-authentication) +- [Configuration](#configuration) +- [Device code authentication](#device-code-authentication) +- [Managed identity](#managed-identity) +- [Use azidentity credentials with older packages](#use-azidentity-credentials-with-older-packages) + +## Configuration + +### `autorest/adal` + +Token providers require a token audience (resource identifier) and an instance of `adal.OAuthConfig`, which requires an Azure AD endpoint and tenant: + +```go +import "github.com/Azure/go-autorest/autorest/adal" + +oauthCfg, err := adal.NewOAuthConfig("https://login.chinacloudapi.cn", tenantID) +handle(err) + +spt, err := adal.NewServicePrincipalTokenWithSecret( + *oauthCfg, clientID, "https://management.chinacloudapi.cn/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret}, +) +``` + +### `azidentity` + +A credential instance can acquire tokens for any audience. The audience for each token is determined by the client requesting it. Credentials require endpoint configuration only for sovereign or private clouds. The `azcore/cloud` package has predefined configuration for sovereign clouds such as Azure China: + +```go +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" +) + +clientOpts := azcore.ClientOptions{Cloud: cloud.AzureChina} + +cred, err := azidentity.NewClientSecretCredential( + tenantID, clientID, secret, &azidentity.ClientSecretCredentialOptions{ClientOptions: clientOpts}, +) +handle(err) +``` + +## Client secret authentication + +### `autorest/adal` + +```go +import ( + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/adal" +) + +oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) +handle(err) +spt, err := adal.NewServicePrincipalTokenWithSecret( + *oauthCfg, clientID, "https://management.azure.com/", &adal.ServicePrincipalTokenSecret{ClientSecret: secret}, +) +handle(err) + +client := subscriptions.NewClient() +client.Authorizer = autorest.NewBearerAuthorizer(spt) +``` + +### `azidentity` + +```go +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" +) + +cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil) +handle(err) + +client, err := armsubscriptions.NewClient(cred, nil) +handle(err) +``` + +## Client certificate authentication + +### `autorest/adal` + +```go +import ( + "os" + + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/adal" +) +certData, err := os.ReadFile("./example.pfx") +handle(err) + +certificate, rsaPrivateKey, err := decodePkcs12(certData, "") +handle(err) + +oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) +handle(err) + +spt, err := adal.NewServicePrincipalTokenFromCertificate( + *oauthConfig, clientID, certificate, rsaPrivateKey, "https://management.azure.com/", +) + +client := subscriptions.NewClient() +client.Authorizer = autorest.NewBearerAuthorizer(spt) +``` + +### `azidentity` + +```go +import ( + "os" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" +) + +certData, err := os.ReadFile("./example.pfx") +handle(err) + +certs, key, err := azidentity.ParseCertificates(certData, nil) +handle(err) + +cred, err = azidentity.NewClientCertificateCredential(tenantID, clientID, certs, key, nil) +handle(err) + +client, err := armsubscriptions.NewClient(cred, nil) +handle(err) +``` + +## Managed identity + +### `autorest/adal` + +```go +import ( + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/adal" +) + +spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/", nil) +handle(err) + +client := subscriptions.NewClient() +client.Authorizer = autorest.NewBearerAuthorizer(spt) +``` + +### `azidentity` + +```go +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" +) + +cred, err := azidentity.NewManagedIdentityCredential(nil) +handle(err) + +client, err := armsubscriptions.NewClient(cred, nil) +handle(err) +``` + +### User-assigned identities + +`autorest/adal`: + +```go +import "github.com/Azure/go-autorest/autorest/adal" + +opts := &adal.ManagedIdentityOptions{ClientID: "..."} +spt, err := adal.NewServicePrincipalTokenFromManagedIdentity("https://management.azure.com/") +handle(err) +``` + +`azidentity`: + +```go +import "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + +opts := azidentity.ManagedIdentityCredentialOptions{ID: azidentity.ClientID("...")} +cred, err := azidentity.NewManagedIdentityCredential(&opts) +handle(err) +``` + +## Device code authentication + +### `autorest/adal` + +```go +import ( + "fmt" + "net/http" + + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/adal" +) + +oauthClient := &http.Client{} +oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) +handle(err) +resource := "https://management.azure.com/" +deviceCode, err := adal.InitiateDeviceAuth(oauthClient, *oauthCfg, clientID, resource) +handle(err) + +// display instructions, wait for the user to authenticate +fmt.Println(*deviceCode.Message) +token, err := adal.WaitForUserCompletion(oauthClient, deviceCode) +handle(err) + +spt, err := adal.NewServicePrincipalTokenFromManualToken(*oauthCfg, clientID, resource, *token) +handle(err) + +client := subscriptions.NewClient() +client.Authorizer = autorest.NewBearerAuthorizer(spt) +``` + +### `azidentity` + +```go +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions" +) + +cred, err := azidentity.NewDeviceCodeCredential(nil) +handle(err) + +client, err := armsubscriptions.NewSubscriptionsClient(cred, nil) +handle(err) +``` + +`azidentity.DeviceCodeCredential` will guide a user through authentication, printing instructions to the console by default. The user prompt is customizable. For more information, see the [package documentation](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential). + +## Acquire a token + +### `autorest/adal` + +```go +import "github.com/Azure/go-autorest/autorest/adal" + +oauthCfg, err := adal.NewOAuthConfig("https://login.microsoftonline.com", tenantID) +handle(err) + +spt, err := adal.NewServicePrincipalTokenWithSecret( + *oauthCfg, clientID, "https://vault.azure.net", &adal.ServicePrincipalTokenSecret{ClientSecret: secret}, +) + +err = spt.Refresh() +if err == nil { + token := spt.Token +} +``` + +### `azidentity` + +In ordinary usage, application code doesn't need to request tokens from credentials directly. Azure SDK clients handle token acquisition and refreshing internally. However, applications may call `GetToken()` to do so. All credential types have this method. + +```go +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" +) + +cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil) +handle(err) + +tk, err := cred.GetToken( + context.TODO(), policy.TokenRequestOptions{Scopes: []string{"https://vault.azure.net/.default"}}, +) +if err == nil { + token := tk.Token +} +``` + +Note that `azidentity` credentials use the Azure AD v2.0 endpoint, which requires OAuth 2 scopes instead of the resource identifiers `autorest/adal` expects. For more information, see [Azure AD documentation](https://docs.microsoft.com/azure/active-directory/develop/v2-permissions-and-consent). + +## Use azidentity credentials with older packages + +The [azidext module](https://pkg.go.dev/github.com/jongio/azidext/go/azidext) provides an adapter for `azidentity` credential types. The adapter enables using the credential types with older Azure SDK clients. For example: + +```go +import ( + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2018-06-01/subscriptions" + "github.com/jongio/azidext/go/azidext" +) + +cred, err := azidentity.NewClientSecretCredential(tenantID, clientID, secret, nil) +handle(err) + +client := subscriptions.NewClient() +client.Authorizer = azidext.NewTokenCredentialAdapter(cred, []string{"https://management.azure.com//.default"}) +``` + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fazidentity%2FMIGRATION.png) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md new file mode 100644 index 000000000..da0baa9ad --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/README.md @@ -0,0 +1,243 @@ +# Azure Identity Client Module for Go + +The Azure Identity module provides Azure Active Directory (Azure AD) token authentication support across the Azure SDK. It includes a set of `TokenCredential` implementations, which can be used with Azure SDK clients supporting token authentication. + +[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/azidentity)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) +| [Azure Active Directory documentation](https://docs.microsoft.com/azure/active-directory/) +| [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/azidentity) + +# Getting started + +## Install the module + +This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for versioning and dependency management. + +Install the Azure Identity module: + +```sh +go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity +``` + +## Prerequisites + +- an [Azure subscription](https://azure.microsoft.com/free/) +- Go 1.18 + +### Authenticating during local development + +When debugging and executing code locally, developers typically use their own accounts to authenticate calls to Azure services. The `azidentity` module supports authenticating through developer tools to simplify local development. + +#### Authenticating via the Azure CLI + +`DefaultAzureCredential` and `AzureCLICredential` can authenticate as the user +signed in to the [Azure CLI](https://docs.microsoft.com/cli/azure). To sign in to the Azure CLI, run `az login`. On a system with a default web browser, the Azure CLI will launch the browser to authenticate a user. + +When no default browser is available, `az login` will use the device code +authentication flow. This can also be selected manually by running `az login --use-device-code`. + +## Key concepts + +### Credentials + +A credential is a type which contains or can obtain the data needed for a +service client to authenticate requests. Service clients across the Azure SDK +accept a credential instance when they are constructed, and use that credential +to authenticate requests. + +The `azidentity` module focuses on OAuth authentication with Azure Active +Directory (AAD). It offers a variety of credential types capable of acquiring +an Azure AD access token. See [Credential Types](#credential-types "Credential Types") for a list of this module's credential types. + +### DefaultAzureCredential + +`DefaultAzureCredential` is appropriate for most apps that will be deployed to Azure. It combines common production credentials with development credentials. It attempts to authenticate via the following mechanisms in this order, stopping when one succeeds: + +![DefaultAzureCredential authentication flow](img/mermaidjs/DefaultAzureCredentialAuthFlow.svg) + +1. **Environment** - `DefaultAzureCredential` will read account information specified via [environment variables](#environment-variables) and use it to authenticate. +1. **Workload Identity** - If the app is deployed on Kubernetes with environment variables set by the workload identity webhook, `DefaultAzureCredential` will authenticate the configured identity. +1. **Managed Identity** - If the app is deployed to an Azure host with managed identity enabled, `DefaultAzureCredential` will authenticate with it. +1. **Azure CLI** - If a user or service principal has authenticated via the Azure CLI `az login` command, `DefaultAzureCredential` will authenticate that identity. + +> Note: `DefaultAzureCredential` is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types. + +## Managed Identity + +`DefaultAzureCredential` and `ManagedIdentityCredential` support +[managed identity authentication](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/overview) +in any hosting environment which supports managed identities, such as (this list is not exhaustive): +* [Azure App Service](https://docs.microsoft.com/azure/app-service/overview-managed-identity) +* [Azure Arc](https://docs.microsoft.com/azure/azure-arc/servers/managed-identity-authentication) +* [Azure Cloud Shell](https://docs.microsoft.com/azure/cloud-shell/msi-authorization) +* [Azure Kubernetes Service](https://docs.microsoft.com/azure/aks/use-managed-identity) +* [Azure Service Fabric](https://docs.microsoft.com/azure/service-fabric/concepts-managed-identity) +* [Azure Virtual Machines](https://docs.microsoft.com/azure/active-directory/managed-identities-azure-resources/how-to-use-vm-token) + +## Examples + +- [Authenticate with DefaultAzureCredential](#authenticate-with-defaultazurecredential "Authenticate with DefaultAzureCredential") +- [Define a custom authentication flow with ChainedTokenCredential](#define-a-custom-authentication-flow-with-chainedtokencredential "Define a custom authentication flow with ChainedTokenCredential") +- [Specify a user-assigned managed identity for DefaultAzureCredential](#specify-a-user-assigned-managed-identity-for-defaultazurecredential) + +### Authenticate with DefaultAzureCredential + +This example demonstrates authenticating a client from the `armresources` module with `DefaultAzureCredential`. + +```go +cred, err := azidentity.NewDefaultAzureCredential(nil) +if err != nil { + // handle error +} + +client := armresources.NewResourceGroupsClient("subscription ID", cred, nil) +``` + +### Specify a user-assigned managed identity for DefaultAzureCredential + +To configure `DefaultAzureCredential` to authenticate a user-assigned managed identity, set the environment variable `AZURE_CLIENT_ID` to the identity's client ID. + +### Define a custom authentication flow with `ChainedTokenCredential` + +`DefaultAzureCredential` is generally the quickest way to get started developing apps for Azure. For more advanced scenarios, `ChainedTokenCredential` links multiple credential instances to be tried sequentially when authenticating. It will try each chained credential in turn until one provides a token or fails to authenticate due to an error. + +The following example demonstrates creating a credential, which will attempt to authenticate using managed identity. It will fall back to authenticating via the Azure CLI when a managed identity is unavailable. + +```go +managed, err := azidentity.NewManagedIdentityCredential(nil) +if err != nil { + // handle error +} +azCLI, err := azidentity.NewAzureCLICredential(nil) +if err != nil { + // handle error +} +chain, err := azidentity.NewChainedTokenCredential([]azcore.TokenCredential{managed, azCLI}, nil) +if err != nil { + // handle error +} + +client := armresources.NewResourceGroupsClient("subscription ID", chain, nil) +``` + +## Credential Types + +### Authenticating Azure Hosted Applications + +|Credential|Usage +|-|- +|[DefaultAzureCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DefaultAzureCredential)|Simplified authentication experience for getting started developing Azure apps +|[ChainedTokenCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ChainedTokenCredential)|Define custom authentication flows, composing multiple credentials +|[EnvironmentCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#EnvironmentCredential)|Authenticate a service principal or user configured by environment variables +|[ManagedIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ManagedIdentityCredential)|Authenticate the managed identity of an Azure resource +|[WorkloadIdentityCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#WorkloadIdentityCredential)|Authenticate a workload identity on Kubernetes + +### Authenticating Service Principals + +|Credential|Usage +|-|- +|[ClientAssertionCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientAssertionCredential)|Authenticate a service principal with a signed client assertion +|[ClientCertificateCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientCertificateCredential)|Authenticate a service principal with a certificate +|[ClientSecretCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#ClientSecretCredential)|Authenticate a service principal with a secret + +### Authenticating Users + +|Credential|Usage +|-|- +|[InteractiveBrowserCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#InteractiveBrowserCredential)|Interactively authenticate a user with the default web browser +|[DeviceCodeCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#DeviceCodeCredential)|Interactively authenticate a user on a device with limited UI +|[UsernamePasswordCredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#UsernamePasswordCredential)|Authenticate a user with a username and password + +### Authenticating via Development Tools + +|Credential|Usage +|-|- +|[AzureCLICredential](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity#AzureCLICredential)|Authenticate as the user signed in to the Azure CLI + +## Environment Variables + +`DefaultAzureCredential` and `EnvironmentCredential` can be configured with environment variables. Each type of authentication requires values for specific variables: + +#### Service principal with secret + +|variable name|value +|-|- +|`AZURE_CLIENT_ID`|ID of an Azure Active Directory application +|`AZURE_TENANT_ID`|ID of the application's Azure Active Directory tenant +|`AZURE_CLIENT_SECRET`|one of the application's client secrets + +#### Service principal with certificate + +|variable name|value +|-|- +|`AZURE_CLIENT_ID`|ID of an Azure Active Directory application +|`AZURE_TENANT_ID`|ID of the application's Azure Active Directory tenant +|`AZURE_CLIENT_CERTIFICATE_PATH`|path to a certificate file including private key +|`AZURE_CLIENT_CERTIFICATE_PASSWORD`|password of the certificate file, if any + +#### Username and password + +|variable name|value +|-|- +|`AZURE_CLIENT_ID`|ID of an Azure Active Directory application +|`AZURE_USERNAME`|a username (usually an email address) +|`AZURE_PASSWORD`|that user's password + +Configuration is attempted in the above order. For example, if values for a +client secret and certificate are both present, the client secret will be used. + +## Troubleshooting + +### Error Handling + +Credentials return an `error` when they fail to authenticate or lack data they require to authenticate. For guidance on resolving errors from specific credential types, see the [troubleshooting guide](https://aka.ms/azsdk/go/identity/troubleshoot). + +For more details on handling specific Azure Active Directory errors please refer to the +Azure Active Directory +[error code documentation](https://docs.microsoft.com/azure/active-directory/develop/reference-aadsts-error-codes). + +### Logging + +This module uses the classification-based logging implementation in `azcore`. To enable console logging for all SDK modules, set `AZURE_SDK_GO_LOGGING` to `all`. Use the `azcore/log` package to control log event output or to enable logs for `azidentity` only. For example: +```go +import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log" + +// print log output to stdout +azlog.SetListener(func(event azlog.Event, s string) { + fmt.Println(s) +}) + +// include only azidentity credential logs +azlog.SetEvents(azidentity.EventAuthentication) +``` + +Credentials log basic information only, such as `GetToken` success or failure and errors. These log entries don't contain authentication secrets but may contain sensitive information. + +## Next steps + +Client and management modules listed on the [Azure SDK releases page](https://azure.github.io/azure-sdk/releases/latest/go.html) support authenticating with `azidentity` credential types. You can learn more about using these libraries in their documentation, which is linked from the release page. + +## Provide Feedback + +If you encounter bugs or have suggestions, please +[open an issue](https://github.com/Azure/azure-sdk-for-go/issues). + +## Contributing + +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information, see the +[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fazidentity%2FREADME.png) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md new file mode 100644 index 000000000..fef099813 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TROUBLESHOOTING.md @@ -0,0 +1,207 @@ +# Troubleshoot Azure Identity authentication issues + +This troubleshooting guide covers failure investigation techniques, common errors for the credential types in the `azidentity` module, and mitigation steps to resolve these errors. + +## Table of contents + +- [Handle azidentity errors](#handle-azidentity-errors) + - [Permission issues](#permission-issues) +- [Find relevant information in errors](#find-relevant-information-in-errors) +- [Enable and configure logging](#enable-and-configure-logging) +- [Troubleshoot AzureCliCredential authentication issues](#troubleshoot-azureclicredential-authentication-issues) +- [Troubleshoot ClientCertificateCredential authentication issues](#troubleshoot-clientcertificatecredential-authentication-issues) +- [Troubleshoot ClientSecretCredential authentication issues](#troubleshoot-clientsecretcredential-authentication-issues) +- [Troubleshoot DefaultAzureCredential authentication issues](#troubleshoot-defaultazurecredential-authentication-issues) +- [Troubleshoot EnvironmentCredential authentication issues](#troubleshoot-environmentcredential-authentication-issues) +- [Troubleshoot ManagedIdentityCredential authentication issues](#troubleshoot-managedidentitycredential-authentication-issues) + - [Azure App Service and Azure Functions managed identity](#azure-app-service-and-azure-functions-managed-identity) + - [Azure Kubernetes Service managed identity](#azure-kubernetes-service-managed-identity) + - [Azure Virtual Machine managed identity](#azure-virtual-machine-managed-identity) +- [Troubleshoot UsernamePasswordCredential authentication issues](#troubleshoot-usernamepasswordcredential-authentication-issues) +- [Troubleshoot WorkloadIdentityCredential authentication issues](#troubleshoot-workloadidentitycredential-authentication-issues) +- [Get additional help](#get-additional-help) + +## Handle azidentity errors + +Any service client method that makes a request to the service may return an error due to authentication failure. This is because the credential authenticates on the first call to the service and on any subsequent call that needs to refresh an access token. Authentication errors include a description of the failure and possibly an error message from Azure Active Directory (Azure AD). Depending on the application, these errors may or may not be recoverable. + +### Permission issues + +Service client errors with a status code of 401 or 403 often indicate that authentication succeeded but the caller doesn't have permission to access the specified API. Check the service documentation to determine which RBAC roles are needed for the request, and ensure the authenticated user or service principal has the appropriate role assignments. + +## Find relevant information in errors + +Authentication errors can include responses from Azure AD and often contain information helpful in diagnosis. Consider the following error message: + +``` +ClientSecretCredential authentication failed +POST https://login.microsoftonline.com/3c631bb7-a9f7-4343-a5ba-a615913/oauth2/v2.0/token +-------------------------------------------------------------------------------- +RESPONSE 401 Unauthorized +-------------------------------------------------------------------------------- +{ + "error": "invalid_client", + "error_description": "AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '86be4c01-505b-45e9-bfc0-9b825fd84'.\r\nTrace ID: 03da4b8e-5ffe-48ca-9754-aff4276f0100\r\nCorrelation ID: 7b12f9bb-2eef-42e3-ad75-eee69ec9088d\r\nTimestamp: 2022-03-02 18:25:26Z", + "error_codes": [ + 7000215 + ], + "timestamp": "2022-03-02 18:25:26Z", + "trace_id": "03da4b8e-5ffe-48ca-9754-aff4276f0100", + "correlation_id": "7b12f9bb-2eef-42e3-ad75-eee69ec9088d", + "error_uri": "https://login.microsoftonline.com/error?code=7000215" +} +-------------------------------------------------------------------------------- +``` + +This error contains several pieces of information: + +- __Failing Credential Type__: The type of credential that failed to authenticate. This can be helpful when diagnosing issues with chained credential types such as `DefaultAzureCredential` or `ChainedTokenCredential`. + +- __Azure AD Error Code and Message__: The error code and message returned by Azure AD. This can give insight into the specific reason the request failed. For instance, in this case authentication failed because the provided client secret is incorrect. [Azure AD documentation](https://docs.microsoft.com/azure/active-directory/develop/reference-aadsts-error-codes#aadsts-error-codes) has more information on AADSTS error codes. + +- __Correlation ID and Timestamp__: The correlation ID and timestamp identify the request in server-side logs. This information can be useful to support engineers diagnosing unexpected Azure AD failures. + +### Enable and configure logging + +`azidentity` provides the same logging capabilities as the rest of the Azure SDK. The simplest way to see the logs to help debug authentication issues is to print credential logs to the console. +```go +import azlog "github.com/Azure/azure-sdk-for-go/sdk/azcore/log" + +// print log output to stdout +azlog.SetListener(func(event azlog.Event, s string) { + fmt.Println(s) +}) + +// include only azidentity credential logs +azlog.SetEvents(azidentity.EventAuthentication) +``` + + +## Troubleshoot DefaultAzureCredential authentication issues + +| Error |Description| Mitigation | +|---|---|---| +|"DefaultAzureCredential failed to acquire a token"|No credential in the `DefaultAzureCredential` chain provided a token|