diff --git a/go.mod b/go.mod index 28989a1ce8..f1da61c463 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,19 @@ module github.com/openshift/cluster-image-registry-operator go 1.22.0 +toolchain go1.24.1 require ( cloud.google.com/go/resourcemanager v1.9.6 cloud.google.com/go/storage v1.40.0 github.com/Azure/azure-pipeline-go v0.2.3 github.com/Azure/azure-sdk-for-go v55.6.0+incompatible - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.1.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 - github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.0 + github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 github.com/Azure/azure-storage-blob-go v0.7.0 github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/mocks v0.4.2 @@ -41,7 +42,7 @@ require ( github.com/prometheus/client_model v0.6.1 github.com/prometheus/common v0.55.0 github.com/spf13/cobra v1.8.1 - golang.org/x/net v0.35.0 + golang.org/x/net v0.39.0 golang.org/x/oauth2 v0.21.0 golang.org/x/time v0.5.0 google.golang.org/api v0.172.0 @@ -58,7 +59,7 @@ require ( cloud.google.com/go/compute/metadata v0.3.0 // indirect cloud.google.com/go/iam v1.1.7 // indirect cloud.google.com/go/longrunning v0.5.5 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.1 // indirect github.com/Azure/go-autorest v14.2.0+incompatible // indirect @@ -67,7 +68,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.3.3 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/PuerkitoBio/purell v1.1.1 // indirect github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect @@ -98,7 +99,7 @@ require ( github.com/gofrs/uuid/v5 v5.2.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/golang-jwt/jwt/v5 v5.2.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.4 // indirect github.com/google/cel-go v0.20.1 // indirect @@ -151,12 +152,12 @@ require ( go.opentelemetry.io/proto/otlp v1.3.1 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.33.0 // indirect + golang.org/x/crypto v0.37.0 // indirect golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect - golang.org/x/sync v0.11.0 // indirect - golang.org/x/sys v0.30.0 // indirect - golang.org/x/term v0.29.0 // indirect - golang.org/x/text v0.22.0 // indirect + golang.org/x/sync v0.13.0 // indirect + golang.org/x/sys v0.32.0 // indirect + golang.org/x/term v0.31.0 // indirect + golang.org/x/text v0.24.0 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240701130421-f6361c86f094 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect diff --git a/go.sum b/go.sum index 1f6df5869f..76c6eac917 100644 --- a/go.sum +++ b/go.sum @@ -16,32 +16,32 @@ github.com/Azure/azure-pipeline-go v0.2.3 h1:7U9HBg1JFK3jHl5qmo4CTZKFTVgMwdFHMVt github.com/Azure/azure-pipeline-go v0.2.3/go.mod h1:x841ezTBIMG6O3lAcl8ATHnsOPVl2bqk7S3ta6S6u4k= github.com/Azure/azure-sdk-for-go v55.6.0+incompatible h1:SDeTdsn7/wiCDVLiKR1VFDCPURKKEg59bP7ewi7kUJc= github.com/Azure/azure-sdk-for-go v55.6.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 h1:g0EZJwz7xkXQiZAI5xi9f3WWFYBlX1CPTrR+NDToRkQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0/go.mod h1:XCW7KnZet0Opnr7HccfUw1PLc4CjHqpcaxW8DHklNkQ= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0 h1:Gt0j3wceWMwPmiazCa8MzMA0MfhmPIz0Qp0FJ6qcM0U= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0/go.mod h1:Ot/6aikWnKWi4l9QB7qVSwa8iMphQNqkWALMoNT3rzM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0 h1:OVoM452qUFBrX+URdH3VpR299ma4kfom0yB0URYky9g= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0/go.mod h1:kUjrAo8bgEwLeZ/CmHqNl3Z/kPm7y6FKfxxK0izYUg4= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 h1:FPKJS1T+clwv+OLGt13a8UjqeRuh0O4SJ3lUriThc+4= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1/go.mod h1:j2chePtV91HrC22tGoRX3sGY42uF13WzmmV80/OdVAA= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.0.0 h1:Kb8eVvjdP6kZqYnER5w/PiGCFp91yVgaxve3d7kCEpY= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.0.0/go.mod h1:lYq15QkJyEsNegz5EhI/0SXQ6spvGfgwBH/Qyzkoc/s= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 h1:2qsIIvxVT+uE6yrNldntJKlLRgxGbZ85kgtz5SNBhMw= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0/go.mod h1:AW8VEadnhw9xox+VaVd9sP7NjzOAnaZBLRH6Tq3cJ38= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0 h1:QM6sE5k2ZT/vI5BEe0r7mqjsUSnhVBFbOsVkEuaEfiA= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork v1.1.0/go.mod h1:243D9iHbcQXoFUtgHJwL7gl2zx1aDuDMjvBZVGr2uW0= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.1.0 h1:rR8ZW79lE/ppfXTfiYSnMFv5EzmVuY4pfZWIkscIJ64= github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.1.0/go.mod h1:y2zXtLSMM/X5Mfawq0lOftpWn3f4V6OCsRdINsvWBPI= 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.6.0 h1:PiSrjRPpkQNjrM8H0WwKMnZUdu1RGMtd/LdGKUrOo+c= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0/go.mod h1:oDrbWx4ewMylP7xHivfgixbfGBT6APAwsSoHRKotnIc= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.0 h1:LR0kAX9ykz8G4YgLCaRDVJ3+n43R8MneB5dTy2konZo= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.0/go.mod h1:DWAciXemNf++PQJLeXUB4HHH5OpsAh12HZnu2wXE1jA= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.1 h1:mrkDCdkMsD4l9wjFGhofFHFrV43Y3c53RSLKOCJ5+Ow= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.1/go.mod h1:hPv41DbqMmnxcGralanA/kVlfdH5jv3T4LxGku2E1BY= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.1 h1:bFWuoEKg+gImo7pvkiQEFAc8ocibADgXeiLAxWhWmkI= github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.1/go.mod h1:Vih/3yc6yac2JzU4hzpaDupBJP0Flaia9rXXrU8xyww= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 h1:Be6KInmFEKV81c0pOAEbRYehLMwmmGI1exuFj248AMk= -github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0/go.mod h1:WCPBHsOXfBVnivScjs2ypRfimjEW0qPVLGgJkZlrIOA= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 h1:lhZdRq7TIx0GJQvSyX2Si406vrYsov2FXGp/RnSEtcs= +github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1/go.mod h1:8cl44BDmi+effbARHMQjgOKA2AYvcohNm7KEt42mSV8= github.com/Azure/azure-storage-blob-go v0.7.0 h1:MuueVOYkufCxJw5YZzF842DY2MBsp+hLuh2apKY0mck= github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -68,8 +68,8 @@ github.com/Azure/msi-dataplane v0.4.3 h1:dWPWzY4b54tLIR9T1Q014Xxd/1DxOsMIp6EjRFA github.com/Azure/msi-dataplane v0.4.3/go.mod h1:yAfxdJyvcnvSDfSyOFV9qm4fReEQDl+nZLGeH2ZWSmw= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3 h1:H5xDQaE3XowWfhZRUpnfC+rGZMEVoSiji+b+/HFAPU4= -github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= +github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= +github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/IBM/go-sdk-core/v5 v5.14.1 h1:WR1r0zz+gDW++xzZjF41r9ueY4JyjS2vgZjiYs8lO3c= github.com/IBM/go-sdk-core/v5 v5.14.1/go.mod h1:MUvIr/1mgGh198ZXL+ByKz9Qs1JoEh80v/96x8jPXNY= @@ -188,8 +188,8 @@ github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzq github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= 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.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= -github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= +github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -284,8 +284,8 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= +github.com/keybase/go-keychain v0.0.1 h1:way+bWYa6lDppZoZcgMbYsvC7GxljxrskdNInRtuthU= +github.com/keybase/go-keychain v0.0.1/go.mod h1:PdEILRW3i9D8JcdM+FmY6RwkHGnhHxXwkPPMeUgOK1k= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= @@ -366,8 +366,8 @@ github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= -github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= -github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= +github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= +github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ= github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= @@ -463,8 +463,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/crypto v0.33.0 h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus= -golang.org/x/crypto v0.33.0/go.mod h1:bVdXmD7IV/4GdElGPozy6U7lWdRXA4qyRVGJV57uQ5M= +golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= +golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= @@ -490,8 +490,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= -golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY= +golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs= golang.org/x/oauth2 v0.21.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= @@ -503,8 +503,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= -golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -521,14 +521,14 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.29.0 h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU= -golang.org/x/term v0.29.0/go.mod h1:6bl4lRlvVuDgSf3179VpIxBF0o10JUpXWOnI7nErv7s= +golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o= +golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -536,8 +536,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= -golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md index cf422304e7..926ed3882c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 1.18.0 (2025-04-03) + +### Features Added + +* Added `AccessToken.RefreshOn` and updated `BearerTokenPolicy` to consider nonzero values of it when deciding whether to request a new token + + +## 1.17.1 (2025-03-20) + +### Other Changes + +* Upgraded to Go 1.23 +* Upgraded dependencies + ## 1.17.0 (2025-01-07) ### Features Added diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go index f2b296b6dc..460170034a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/exported/exported.go @@ -47,8 +47,13 @@ func HasStatusCode(resp *http.Response, statusCodes ...int) bool { // AccessToken represents an Azure service bearer access token with expiry information. // Exported as azcore.AccessToken. type AccessToken struct { - Token string + // Token is the access token + Token string + // ExpiresOn indicates when the token expires ExpiresOn time.Time + // RefreshOn is a suggested time to refresh the token. + // Clients should ignore this value when it's zero. + RefreshOn time.Time } // TokenRequestOptions contain specific parameter that may be used by credentials types when attempting to get a token. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go index 44ab00d400..85514db3b8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared/constants.go @@ -40,5 +40,5 @@ const ( Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. - Version = "v1.17.0" + Version = "v1.18.0" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go index b26db920b0..1950a2e5b3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/policy_bearer_token.go @@ -51,6 +51,15 @@ func acquire(state acquiringResourceState) (newResource exported.AccessToken, ne return tk, tk.ExpiresOn, nil } +// shouldRefresh determines whether the token should be refreshed. It's a variable so tests can replace it. +var shouldRefresh = func(tk exported.AccessToken, _ acquiringResourceState) bool { + if tk.RefreshOn.IsZero() { + return tk.ExpiresOn.Add(-5 * time.Minute).Before(time.Now()) + } + // no offset in this case because the authority suggested a refresh window--between RefreshOn and ExpiresOn + return tk.RefreshOn.Before(time.Now()) +} + // NewBearerTokenPolicy creates a policy object that authorizes requests with bearer tokens. // cred: an azcore.TokenCredential implementation such as a credential object from azidentity // scopes: the list of permission scopes required for the token. @@ -69,11 +78,14 @@ func NewBearerTokenPolicy(cred exported.TokenCredential, scopes []string, opts * return authNZ(policy.TokenRequestOptions{Scopes: scopes}) } } + mr := temporal.NewResourceWithOptions(acquire, temporal.ResourceOptions[exported.AccessToken, acquiringResourceState]{ + ShouldRefresh: shouldRefresh, + }) return &BearerTokenPolicy{ authzHandler: ah, cred: cred, scopes: scopes, - mainResource: temporal.NewResource(acquire), + mainResource: mr, allowHTTP: opts.InsecureAllowCredentialWithHTTP, } } 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 index 11c64eb294..485224197e 100644 --- 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 @@ -1,5 +1,17 @@ # Release History +## 1.9.0 (2025-04-08) + +### Features Added +* `GetToken()` sets `AccessToken.RefreshOn` when the token provider specifies a value + +### Other Changes +* `NewManagedIdentityCredential` logs the configured user-assigned identity, if any +* Deprecated `UsernamePasswordCredential` because it can't support multifactor + authentication (MFA), which Microsoft Entra ID requires for most tenants. See + https://aka.ms/azsdk/identity/mfa for migration guidance. +* Updated dependencies + ## 1.8.2 (2025-02-12) ### Other Changes 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 index 5cc64c08f2..069bc688d5 100644 --- 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 @@ -21,7 +21,7 @@ go get -u github.com/Azure/azure-sdk-for-go/sdk/azidentity ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.18 +- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go ### Authenticating during local development @@ -146,7 +146,6 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil) |-|- |[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 @@ -159,7 +158,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil) `DefaultAzureCredential` and `EnvironmentCredential` can be configured with environment variables. Each type of authentication requires values for specific variables: -#### Service principal with secret +### Service principal with secret |variable name|value |-|- @@ -167,7 +166,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil) |`AZURE_TENANT_ID`|ID of the application's Microsoft Entra tenant |`AZURE_CLIENT_SECRET`|one of the application's client secrets -#### Service principal with certificate +### Service principal with certificate |variable name|value |-|- @@ -176,16 +175,7 @@ client := armresources.NewResourceGroupsClient("subscription ID", chain, nil) |`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 a Microsoft Entra 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. +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. ## Token caching diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD index 8fc7c64aa3..dd3f8e5b21 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/TOKEN_CACHING.MD @@ -22,12 +22,11 @@ Some credential types support opt-in persistent token caching (see [the below ta Persistent caches are encrypted at rest using a mechanism that depends on the operating system: -| Operating system | Encryption facility | -| ---------------- | ---------------------------------------------- | -| Linux | kernel key retention service (keyctl) | -| macOS | Keychain (requires cgo and native build tools) | -| Windows | Data Protection API (DPAPI) | - +| Operating system | Encryption facility | Limitations | +| ---------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Linux | kernel key retention service (keyctl) | Cache data is lost on system shutdown because kernel keys are stored in memory. Depending on kernel compile options, data may also be lost on logout, or storage may be impossible because the key retention service isn't available. | +| macOS | Keychain | Building requires cgo and native build tools. Keychain access requires a graphical session, so persistent caching isn't possible in a headless environment such as an SSH session (macOS as host). | +| Windows | Data Protection API (DPAPI) | No specific limitations. | Persistent caching requires encryption. When the required encryption facility is unuseable, or the application is running on an unsupported OS, the persistent cache constructor returns an error. This doesn't mean that authentication is impossible, only that credentials can't persist authentication data and the application will need to reauthenticate the next time it runs. See the package documentation for examples showing how to configure persistent caching and access cached data for [users][user_example] and [service principals][sp_example]. ### Credentials supporting token caching diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json index 045f87acd5..4118f99ef2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/azidentity", - "Tag": "go/azidentity_c55452bbf6" + "Tag": "go/azidentity_191110b0dd" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go index 40a94154c6..bd196ddd32 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/azidentity.go @@ -22,6 +22,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming" "github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public" ) @@ -208,6 +209,10 @@ type msalConfidentialClient interface { AcquireTokenOnBehalfOf(ctx context.Context, userAssertion string, scopes []string, options ...confidential.AcquireOnBehalfOfOption) (confidential.AuthResult, error) } +type msalManagedIdentityClient interface { + AcquireToken(context.Context, string, ...managedidentity.AcquireTokenOption) (managedidentity.AuthResult, error) +} + // enables fakes for test scenarios type msalPublicClient interface { AcquireTokenSilent(ctx context.Context, scopes []string, options ...public.AcquireSilentOption) (public.AuthResult, error) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go index 92f508094d..58c4b585c1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/confidential_client.go @@ -118,7 +118,7 @@ func (c *confidentialClient) GetToken(ctx context.Context, tro policy.TokenReque msg := fmt.Sprintf(scopeLogFmt, c.name, strings.Join(ar.GrantedScopes, ", ")) log.Write(EventAuthentication, msg) } - return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err + return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC(), RefreshOn: ar.Metadata.RefreshOn.UTC()}, err } func (c *confidentialClient) client(tro policy.TokenRequestOptions) (msalConfidentialClient, *sync.Mutex, error) { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go index b30f5474f5..ec1eab05c5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/environment_credential.go @@ -60,7 +60,10 @@ type EnvironmentCredentialOptions struct { // Note that this credential uses [ParseCertificates] to load the certificate and key from the file. If this // function isn't able to parse your certificate, use [ClientCertificateCredential] instead. // -// # User with username and password +// # Deprecated: User with username and password +// +// User password authentication is deprecated because it can't support multifactor authentication. See +// [Entra ID documentation] for migration guidance. // // AZURE_TENANT_ID: (optional) tenant to authenticate in. Defaults to "organizations". // @@ -75,6 +78,8 @@ type EnvironmentCredentialOptions struct { // To enable multitenant authentication, set AZURE_ADDITIONALLY_ALLOWED_TENANTS with a semicolon delimited list of tenants // the credential may request tokens from in addition to the tenant specified by AZURE_TENANT_ID. Set // AZURE_ADDITIONALLY_ALLOWED_TENANTS to "*" to enable the credential to request a token from any tenant. +// +// [Entra ID documentation]: https://aka.ms/azsdk/identity/mfa type EnvironmentCredential struct { cred azcore.TokenCredential } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work index 04ea962b42..6dd5b3d64d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/go.work @@ -1,4 +1,4 @@ -go 1.18 +go 1.23.0 use ( . diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json index 1c3791777a..edd56f9d57 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed-identity-matrix.json @@ -9,7 +9,7 @@ } }, "GoVersion": [ - "1.22.1" + "env:GO_VERSION_PREVIOUS" ], "IDENTITY_IMDS_AVAILABLE": "1" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go index cc07fd7015..b3a0f85883 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_client.go @@ -8,24 +8,18 @@ package azidentity import ( "context" - "encoding/json" "errors" "fmt" "net/http" - "net/url" - "os" - "path/filepath" - "runtime" - "strconv" "strings" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "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/azcore/streaming" "github.com/Azure/azure-sdk-for-go/sdk/internal/log" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" + msalerrors "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity" ) const ( @@ -41,59 +35,20 @@ const ( msiResID = "msi_res_id" msiSecret = "MSI_SECRET" imdsAPIVersion = "2018-02-01" - azureArcAPIVersion = "2019-08-15" + azureArcAPIVersion = "2020-06-01" qpClientID = "client_id" serviceFabricAPIVersion = "2019-07-01-preview" ) var imdsProbeTimeout = time.Second -type msiType int - -const ( - msiTypeAppService msiType = iota - msiTypeAzureArc - msiTypeAzureML - msiTypeCloudShell - msiTypeIMDS - msiTypeServiceFabric -) - type managedIdentityClient struct { - azClient *azcore.Client - endpoint string - id ManagedIDKind - msiType msiType - probeIMDS bool + azClient *azcore.Client + imds, probeIMDS, userAssigned bool // chained indicates whether the client is part of a credential chain. If true, the client will return // a credentialUnavailableError instead of an AuthenticationFailedError for an unexpected IMDS response. - chained bool -} - -// arcKeyDirectory returns the directory expected to contain Azure Arc keys -var arcKeyDirectory = func() (string, error) { - switch runtime.GOOS { - case "linux": - return "/var/opt/azcmagent/tokens", nil - case "windows": - pd := os.Getenv("ProgramData") - if pd == "" { - return "", errors.New("environment variable ProgramData has no value") - } - return filepath.Join(pd, "AzureConnectedMachineAgent", "Tokens"), nil - default: - return "", fmt.Errorf("unsupported OS %q", runtime.GOOS) - } -} - -type wrappedNumber json.Number - -func (n *wrappedNumber) UnmarshalJSON(b []byte) error { - c := string(b) - if c == "\"\"" { - return nil - } - return json.Unmarshal(b, (*json.Number)(n)) + chained bool + msalClient msalManagedIdentityClient } // setIMDSRetryOptionDefaults sets zero-valued fields to default values appropriate for IMDS @@ -141,51 +96,20 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag options = &ManagedIdentityCredentialOptions{} } cp := options.ClientOptions - c := managedIdentityClient{id: options.ID, endpoint: imdsEndpoint, msiType: msiTypeIMDS} - env := "IMDS" - if endpoint, ok := os.LookupEnv(identityEndpoint); ok { - if _, ok := os.LookupEnv(identityHeader); ok { - if _, ok := os.LookupEnv(identityServerThumbprint); ok { - if options.ID != nil { - return nil, errors.New("the Service Fabric API doesn't support specifying a user-assigned identity at runtime. The identity is determined by cluster resource configuration. See https://aka.ms/servicefabricmi") - } - env = "Service Fabric" - c.endpoint = endpoint - c.msiType = msiTypeServiceFabric - } else { - env = "App Service" - c.endpoint = endpoint - c.msiType = msiTypeAppService - } - } else if _, ok := os.LookupEnv(arcIMDSEndpoint); ok { - if options.ID != nil { - return nil, errors.New("the Azure Arc API doesn't support specifying a user-assigned managed identity at runtime") - } - env = "Azure Arc" - c.endpoint = endpoint - c.msiType = msiTypeAzureArc - } - } else if endpoint, ok := os.LookupEnv(msiEndpoint); ok { - c.endpoint = endpoint - if _, ok := os.LookupEnv(msiSecret); ok { - if options.ID != nil && options.ID.idKind() != miClientID { - return nil, errors.New("the Azure ML API supports specifying a user-assigned managed identity by client ID only") - } - env = "Azure ML" - c.msiType = msiTypeAzureML - } else { - if options.ID != nil { - return nil, errors.New("the Cloud Shell API doesn't support user-assigned managed identities") - } - env = "Cloud Shell" - c.msiType = msiTypeCloudShell - } - } else { + c := managedIdentityClient{} + source, err := managedidentity.GetSource() + if err != nil { + return nil, err + } + env := string(source) + if source == managedidentity.DefaultToIMDS { + env = "IMDS" + c.imds = true c.probeIMDS = options.dac setIMDSRetryOptionDefaults(&cp.Retry) } - client, err := azcore.NewClient(module, version, azruntime.PipelineOptions{ + c.azClient, err = azcore.NewClient(module, version, azruntime.PipelineOptions{ Tracing: azruntime.TracingOptions{ Namespace: traceNamespace, }, @@ -193,28 +117,53 @@ func newManagedIdentityClient(options *ManagedIdentityCredentialOptions) (*manag if err != nil { return nil, err } - c.azClient = client + + id := managedidentity.SystemAssigned() + if options.ID != nil { + c.userAssigned = true + switch s := options.ID.String(); options.ID.idKind() { + case miClientID: + id = managedidentity.UserAssignedClientID(s) + case miObjectID: + id = managedidentity.UserAssignedObjectID(s) + case miResourceID: + id = managedidentity.UserAssignedResourceID(s) + } + } + msalClient, err := managedidentity.New(id, managedidentity.WithHTTPClient(&c), managedidentity.WithRetryPolicyDisabled()) + if err != nil { + return nil, err + } + c.msalClient = &msalClient if log.Should(EventAuthentication) { - log.Writef(EventAuthentication, "Managed Identity Credential will use %s managed identity", env) + msg := fmt.Sprintf("%s will use %s managed identity", credNameManagedIdentity, env) + if options.ID != nil { + kind := "client" + switch options.ID.(type) { + case ObjectID: + kind = "object" + case ResourceID: + kind = "resource" + } + msg += fmt.Sprintf(" with %s ID %q", kind, options.ID.String()) + } + log.Write(EventAuthentication, msg) } return &c, nil } -// provideToken acquires a token for MSAL's confidential.Client, which caches the token -func (c *managedIdentityClient) provideToken(ctx context.Context, params confidential.TokenProviderParameters) (confidential.TokenProviderResult, error) { - result := confidential.TokenProviderResult{} - tk, err := c.authenticate(ctx, c.id, params.Scopes) - if err == nil { - result.AccessToken = tk.Token - result.ExpiresInSeconds = int(time.Until(tk.ExpiresOn).Seconds()) - } - return result, err +func (*managedIdentityClient) CloseIdleConnections() { + // do nothing +} + +func (c *managedIdentityClient) Do(r *http.Request) (*http.Response, error) { + return doForClient(c.azClient, r) } // authenticate acquires an access token -func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKind, scopes []string) (azcore.AccessToken, error) { +func (c *managedIdentityClient) GetToken(ctx context.Context, tro policy.TokenRequestOptions) (azcore.AccessToken, error) { // no need to synchronize around this value because it's true only when DefaultAzureCredential constructed the client, // and in that case ChainedTokenCredential.GetToken synchronizes goroutines that would execute this block if c.probeIMDS { @@ -222,7 +171,7 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi cx, cancel := context.WithTimeout(ctx, imdsProbeTimeout) defer cancel() cx = policy.WithRetryOptions(cx, policy.RetryOptions{MaxRetries: -1}) - req, err := azruntime.NewRequest(cx, http.MethodGet, c.endpoint) + req, err := azruntime.NewRequest(cx, http.MethodGet, imdsEndpoint) if err != nil { return azcore.AccessToken{}, fmt.Errorf("failed to create IMDS probe request: %s", err) } @@ -237,32 +186,26 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi c.probeIMDS = false } - msg, err := c.createAuthRequest(ctx, id, scopes) - if err != nil { - return azcore.AccessToken{}, err - } - - resp, err := c.azClient.Pipeline().Do(msg) - if err != nil { - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, err.Error(), nil) - } - - if azruntime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - tk, err := c.createAccessToken(resp) - if err != nil && c.chained && c.msiType == msiTypeIMDS { - // failure to unmarshal a 2xx implies the response is from something other than IMDS such as a proxy listening at + ar, err := c.msalClient.AcquireToken(ctx, tro.Scopes[0], managedidentity.WithClaims(tro.Claims)) + if err == nil { + msg := fmt.Sprintf(scopeLogFmt, credNameManagedIdentity, strings.Join(ar.GrantedScopes, ", ")) + log.Write(EventAuthentication, msg) + return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC(), RefreshOn: ar.Metadata.RefreshOn.UTC()}, err + } + if c.imds { + var ije msalerrors.InvalidJsonErr + if c.chained && errors.As(err, &ije) { + // an unmarshaling error implies the response is from something other than IMDS such as a proxy listening at // the same address. Return a credentialUnavailableError so credential chains continue to their next credential - err = newCredentialUnavailableError(credNameManagedIdentity, err.Error()) + return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, err.Error()) + } + resp := getResponseFromError(err) + if resp == nil { + return azcore.AccessToken{}, newAuthenticationFailedErrorFromMSAL(credNameManagedIdentity, err) } - return tk, err - } - - if c.msiType == msiTypeIMDS { switch resp.StatusCode { case http.StatusBadRequest: - if id != nil { - // return authenticationFailedError, halting any encompassing credential chain, - // because the explicit user-assigned identity implies the developer expected this to work + if c.userAssigned { return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "the requested identity isn't assigned to this resource", resp) } msg := "failed to authenticate a system assigned identity" @@ -278,237 +221,7 @@ func (c *managedIdentityClient) authenticate(ctx context.Context, id ManagedIDKi return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, fmt.Sprintf("unexpected response %q", string(body))) } } - if c.chained { - // the response may be from something other than IMDS, for example a proxy returning - // 404. Return credentialUnavailableError so credential chains continue to their - // next credential, include the response in the error message to help debugging - err = newAuthenticationFailedError(credNameManagedIdentity, "", resp) - return azcore.AccessToken{}, newCredentialUnavailableError(credNameManagedIdentity, err.Error()) - } - } - - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "", resp) -} - -func (c *managedIdentityClient) createAccessToken(res *http.Response) (azcore.AccessToken, error) { - value := struct { - // these are the only fields that we use - Token string `json:"access_token,omitempty"` - RefreshToken string `json:"refresh_token,omitempty"` - ExpiresIn wrappedNumber `json:"expires_in,omitempty"` // this field should always return the number of seconds for which a token is valid - ExpiresOn interface{} `json:"expires_on,omitempty"` // the value returned in this field varies between a number and a date string - }{} - if err := azruntime.UnmarshalAsJSON(res, &value); err != nil { - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "Unexpected response content", res) - } - if value.ExpiresIn != "" { - expiresIn, err := json.Number(value.ExpiresIn).Int64() - if err != nil { - return azcore.AccessToken{}, err - } - return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Now().Add(time.Second * time.Duration(expiresIn)).UTC()}, nil - } - switch v := value.ExpiresOn.(type) { - case float64: - return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(v), 0).UTC()}, nil - case string: - if expiresOn, err := strconv.Atoi(v); err == nil { - return azcore.AccessToken{Token: value.Token, ExpiresOn: time.Unix(int64(expiresOn), 0).UTC()}, nil - } - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, "unexpected expires_on value: "+v, res) - default: - msg := fmt.Sprintf("unsupported type received in expires_on: %T, %v", v, v) - return azcore.AccessToken{}, newAuthenticationFailedError(credNameManagedIdentity, msg, res) - } -} - -func (c *managedIdentityClient) createAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - switch c.msiType { - case msiTypeIMDS: - return c.createIMDSAuthRequest(ctx, id, scopes) - case msiTypeAppService: - return c.createAppServiceAuthRequest(ctx, id, scopes) - case msiTypeAzureArc: - // need to perform preliminary request to retreive the secret key challenge provided by the HIMDS service - key, err := c.getAzureArcSecretKey(ctx, scopes) - if err != nil { - msg := fmt.Sprintf("failed to retreive secret key from the identity endpoint: %v", err) - return nil, newAuthenticationFailedError(credNameManagedIdentity, msg, nil) - } - return c.createAzureArcAuthRequest(ctx, scopes, key) - case msiTypeAzureML: - return c.createAzureMLAuthRequest(ctx, id, scopes) - case msiTypeServiceFabric: - return c.createServiceFabricAuthRequest(ctx, scopes) - case msiTypeCloudShell: - return c.createCloudShellAuthRequest(ctx, scopes) - default: - return nil, newCredentialUnavailableError(credNameManagedIdentity, "managed identity isn't supported in this environment") - } -} - -func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set(headerMetadata, "true") - q := request.Raw().URL.Query() - q.Set("api-version", imdsAPIVersion) - q.Set("resource", strings.Join(scopes, " ")) - if id != nil { - switch id.idKind() { - case miClientID: - q.Set(qpClientID, id.String()) - case miObjectID: - q.Set("object_id", id.String()) - case miResourceID: - q.Set(msiResID, id.String()) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set("X-IDENTITY-HEADER", os.Getenv(identityHeader)) - q := request.Raw().URL.Query() - q.Set("api-version", "2019-08-01") - q.Set("resource", scopes[0]) - if id != nil { - switch id.idKind() { - case miClientID: - q.Set(qpClientID, id.String()) - case miObjectID: - q.Set("principal_id", id.String()) - case miResourceID: - q.Set(miResID, id.String()) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id ManagedIDKind, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set("secret", os.Getenv(msiSecret)) - q := request.Raw().URL.Query() - q.Set("api-version", "2017-09-01") - q.Set("resource", strings.Join(scopes, " ")) - q.Set("clientid", os.Getenv(defaultIdentityClientID)) - if id != nil { - switch id.idKind() { - case miClientID: - q.Set("clientid", id.String()) - case miObjectID: - return nil, newAuthenticationFailedError(credNameManagedIdentity, "Azure ML doesn't support specifying a managed identity by object ID", nil) - case miResourceID: - return nil, newAuthenticationFailedError(credNameManagedIdentity, "Azure ML doesn't support specifying a managed identity by resource ID", nil) - } - } - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Context, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - q := request.Raw().URL.Query() - request.Raw().Header.Set("Accept", "application/json") - request.Raw().Header.Set("Secret", os.Getenv(identityHeader)) - q.Set("api-version", serviceFabricAPIVersion) - q.Set("resource", strings.Join(scopes, " ")) - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) getAzureArcSecretKey(ctx context.Context, resources []string) (string, error) { - // create the request to retreive the secret key challenge provided by the HIMDS service - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return "", err - } - request.Raw().Header.Set(headerMetadata, "true") - q := request.Raw().URL.Query() - q.Set("api-version", azureArcAPIVersion) - q.Set("resource", strings.Join(resources, " ")) - request.Raw().URL.RawQuery = q.Encode() - // send the initial request to get the short-lived secret key - response, err := c.azClient.Pipeline().Do(request) - if err != nil { - return "", err - } - // the endpoint is expected to return a 401 with the WWW-Authenticate header set to the location - // of the secret key file. Any other status code indicates an error in the request. - if response.StatusCode != 401 { - msg := fmt.Sprintf("expected a 401 response, received %d", response.StatusCode) - return "", newAuthenticationFailedError(credNameManagedIdentity, msg, response) - } - header := response.Header.Get("WWW-Authenticate") - if len(header) == 0 { - return "", newAuthenticationFailedError(credNameManagedIdentity, "HIMDS response has no WWW-Authenticate header", nil) - } - // the WWW-Authenticate header is expected in the following format: Basic realm=/some/file/path.key - _, p, found := strings.Cut(header, "=") - if !found { - return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected WWW-Authenticate header from HIMDS: "+header, nil) - } - expected, err := arcKeyDirectory() - if err != nil { - return "", err - } - if filepath.Dir(p) != expected || !strings.HasSuffix(p, ".key") { - return "", newAuthenticationFailedError(credNameManagedIdentity, "unexpected file path from HIMDS service: "+p, nil) - } - f, err := os.Stat(p) - if err != nil { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not stat %q: %v", p, err), nil) - } - if s := f.Size(); s > 4096 { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("key is too large (%d bytes)", s), nil) - } - key, err := os.ReadFile(p) - if err != nil { - return "", newAuthenticationFailedError(credNameManagedIdentity, fmt.Sprintf("could not read %q: %v", p, err), nil) - } - return string(key), nil -} - -func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, resources []string, key string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodGet, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set(headerMetadata, "true") - request.Raw().Header.Set("Authorization", fmt.Sprintf("Basic %s", key)) - q := request.Raw().URL.Query() - q.Set("api-version", azureArcAPIVersion) - q.Set("resource", strings.Join(resources, " ")) - request.Raw().URL.RawQuery = q.Encode() - return request, nil -} - -func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context, scopes []string) (*policy.Request, error) { - request, err := azruntime.NewRequest(ctx, http.MethodPost, c.endpoint) - if err != nil { - return nil, err - } - request.Raw().Header.Set(headerMetadata, "true") - data := url.Values{} - data.Set("resource", strings.Join(scopes, " ")) - dataEncoded := data.Encode() - body := streaming.NopCloser(strings.NewReader(dataEncoded)) - if err := request.SetBody(body, "application/x-www-form-urlencoded"); err != nil { - return nil, err } - return request, nil + err = newAuthenticationFailedErrorFromMSAL(credNameManagedIdentity, err) + return azcore.AccessToken{}, err } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go index 1d53579cf3..11b686ccda 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/managed_identity_credential.go @@ -14,7 +14,6 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential" ) const credNameManagedIdentity = "ManagedIdentityCredential" @@ -110,8 +109,7 @@ type ManagedIdentityCredentialOptions struct { // // [Azure managed identity]: https://learn.microsoft.com/entra/identity/managed-identities-azure-resources/overview type ManagedIdentityCredential struct { - client *confidentialClient - mic *managedIdentityClient + mic *managedIdentityClient } // NewManagedIdentityCredential creates a ManagedIdentityCredential. Pass nil to accept default options. @@ -123,38 +121,22 @@ func NewManagedIdentityCredential(options *ManagedIdentityCredentialOptions) (*M if err != nil { return nil, err } - cred := confidential.NewCredFromTokenProvider(mic.provideToken) - - // It's okay to give MSAL an invalid client ID because MSAL will use it only as part of a cache key. - // ManagedIdentityClient handles all the details of authentication and won't receive this value from MSAL. - clientID := "SYSTEM-ASSIGNED-MANAGED-IDENTITY" - if options.ID != nil { - clientID = options.ID.String() - } - // similarly, it's okay to give MSAL an incorrect tenant because MSAL won't use the value - c, err := newConfidentialClient("common", clientID, credNameManagedIdentity, cred, confidentialClientOptions{ - ClientOptions: options.ClientOptions, - }) - if err != nil { - return nil, err - } - return &ManagedIdentityCredential{client: c, mic: mic}, nil + return &ManagedIdentityCredential{mic: mic}, nil } // GetToken requests an access token from the hosting environment. This method is called automatically by Azure SDK clients. func (c *ManagedIdentityCredential) GetToken(ctx context.Context, opts policy.TokenRequestOptions) (azcore.AccessToken, error) { var err error - ctx, endSpan := runtime.StartSpan(ctx, credNameManagedIdentity+"."+traceOpGetToken, c.client.azClient.Tracer(), nil) + ctx, endSpan := runtime.StartSpan(ctx, credNameManagedIdentity+"."+traceOpGetToken, c.mic.azClient.Tracer(), nil) defer func() { endSpan(err) }() if len(opts.Scopes) != 1 { err = fmt.Errorf("%s.GetToken() requires exactly one scope", credNameManagedIdentity) return azcore.AccessToken{}, err } - // managed identity endpoints require a Microsoft Entra ID v1 resource (i.e. token audience), not a v2 scope, so we remove "/.default" here + // managed identity endpoints require a v1 resource (i.e. token audience), not a v2 scope, so we remove "/.default" here opts.Scopes = []string{strings.TrimSuffix(opts.Scopes[0], defaultSuffix)} - tk, err := c.client.GetToken(ctx, opts) - return tk, err + return c.mic.GetToken(ctx, opts) } var _ azcore.TokenCredential = (*ManagedIdentityCredential)(nil) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go index ef5e4d7212..053d1785f8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/public_client.go @@ -243,7 +243,7 @@ func (p *publicClient) token(ar public.AuthResult, err error) (azcore.AccessToke } else { err = newAuthenticationFailedErrorFromMSAL(p.name, err) } - return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC()}, err + return azcore.AccessToken{Token: ar.AccessToken, ExpiresOn: ar.ExpiresOn.UTC(), RefreshOn: ar.Metadata.RefreshOn.UTC()}, err } // resolveTenant returns the correct WithTenantID() argument for a token request given the client's diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 index efa8c6d3eb..67f97fbb2b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/test-resources-post.ps1 @@ -72,6 +72,7 @@ az container create -g $rg -n $aciName --image $image ` --acr-identity $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` --assign-identity [system] $($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY']) ` --cpu 1 ` + --ip-address Public ` --memory 1.0 ` --os-type Linux ` --role "Storage Blob Data Reader" ` @@ -82,7 +83,8 @@ az container create -g $rg -n $aciName --image $image ` AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_CLIENT_ID']) ` AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID=$($DeploymentOutputs['AZIDENTITY_USER_ASSIGNED_IDENTITY_OBJECT_ID']) ` FUNCTIONS_CUSTOMHANDLER_PORT=80 -Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_NAME;]$aciName" +$aciIP = az container show -g $rg -n $aciName --query ipAddress.ip --output tsv +Write-Host "##vso[task.setvariable variable=AZIDENTITY_ACI_IP;]$aciIP" # Azure Functions deployment: copy the Windows binary from the Docker image, deploy it in a zip Write-Host "Deploying to Azure Functions" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go index 740abd4709..5791e7d224 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/username_password_credential.go @@ -17,6 +17,11 @@ import ( const credNameUserPassword = "UsernamePasswordCredential" // UsernamePasswordCredentialOptions contains optional parameters for UsernamePasswordCredential. +// +// Deprecated: UsernamePasswordCredential is deprecated because it can't support multifactor +// authentication. See [Entra ID documentation] for migration guidance. +// +// [Entra ID documentation]: https://aka.ms/azsdk/identity/mfa type UsernamePasswordCredentialOptions struct { azcore.ClientOptions @@ -43,8 +48,13 @@ type UsernamePasswordCredentialOptions struct { // UsernamePasswordCredential authenticates a user with a password. Microsoft doesn't recommend this kind of authentication, // because it's less secure than other authentication flows. This credential is not interactive, so it isn't compatible -// with any form of multi-factor authentication, and the application must already have user or admin consent. +// with any form of multifactor authentication, and the application must already have user or admin consent. // This credential can only authenticate work and school accounts; it can't authenticate Microsoft accounts. +// +// Deprecated: this credential is deprecated because it can't support multifactor authentication. See [Entra ID documentation] +// for migration guidance. +// +// [Entra ID documentation]: https://aka.ms/azsdk/identity/mfa type UsernamePasswordCredential struct { client *publicClient } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go index fec0419ca7..584aabe1cb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/azidentity/version.go @@ -14,5 +14,5 @@ const ( module = "github.com/Azure/azure-sdk-for-go/sdk/" + component // Version is the semantic version (see http://semver.org) of this module. - version = "v1.8.2" + version = "v1.9.0" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go index 4f1dcf1b78..76dadf7d35 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/log/log.go @@ -44,7 +44,7 @@ func Should(cls Event) bool { if log.lst == nil { return false } - if log.cls == nil || len(log.cls) == 0 { + if len(log.cls) == 0 { return true } for _, c := range log.cls { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go index 238ef42ed0..02aa1fb3bc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/internal/temporal/resource.go @@ -11,9 +11,17 @@ import ( "time" ) +// backoff sets a minimum wait time between eager update attempts. It's a variable so tests can manipulate it. +var backoff = func(now, lastAttempt time.Time) bool { + return lastAttempt.Add(30 * time.Second).After(now) +} + // AcquireResource abstracts a method for refreshing a temporal resource. type AcquireResource[TResource, TState any] func(state TState) (newResource TResource, newExpiration time.Time, err error) +// ShouldRefresh abstracts a method for indicating whether a resource should be refreshed before expiration. +type ShouldRefresh[TResource, TState any] func(TResource, TState) bool + // Resource is a temporal resource (usually a credential) that requires periodic refreshing. type Resource[TResource, TState any] struct { // cond is used to synchronize access to the shared resource embodied by the remaining fields @@ -31,24 +39,43 @@ type Resource[TResource, TState any] struct { // lastAttempt indicates when a thread/goroutine last attempted to acquire/update the resource lastAttempt time.Time + // shouldRefresh indicates whether the resource should be refreshed before expiration + shouldRefresh ShouldRefresh[TResource, TState] + // acquireResource is the callback function that actually acquires the resource acquireResource AcquireResource[TResource, TState] } // NewResource creates a new Resource that uses the specified AcquireResource for refreshing. func NewResource[TResource, TState any](ar AcquireResource[TResource, TState]) *Resource[TResource, TState] { - return &Resource[TResource, TState]{cond: sync.NewCond(&sync.Mutex{}), acquireResource: ar} + r := &Resource[TResource, TState]{acquireResource: ar, cond: sync.NewCond(&sync.Mutex{})} + r.shouldRefresh = r.expiringSoon + return r +} + +// ResourceOptions contains optional configuration for Resource +type ResourceOptions[TResource, TState any] struct { + // ShouldRefresh indicates whether [Resource.Get] should acquire an updated resource despite + // the currently held resource not having expired. [Resource.Get] ignores all errors from + // refresh attempts triggered by ShouldRefresh returning true, and doesn't call ShouldRefresh + // when the resource has expired (it unconditionally updates expired resources). When + // ShouldRefresh is nil, [Resource.Get] refreshes the resource if it will expire within 5 + // minutes. + ShouldRefresh ShouldRefresh[TResource, TState] +} + +// NewResourceWithOptions creates a new Resource that uses the specified AcquireResource for refreshing. +func NewResourceWithOptions[TResource, TState any](ar AcquireResource[TResource, TState], opts ResourceOptions[TResource, TState]) *Resource[TResource, TState] { + r := NewResource(ar) + if opts.ShouldRefresh != nil { + r.shouldRefresh = opts.ShouldRefresh + } + return r } // Get returns the underlying resource. // If the resource is fresh, no refresh is performed. func (er *Resource[TResource, TState]) Get(state TState) (TResource, error) { - // If the resource is expiring within this time window, update it eagerly. - // This allows other threads/goroutines to keep running by using the not-yet-expired - // resource value while one thread/goroutine updates the resource. - const window = 5 * time.Minute // This example updates the resource 5 minutes prior to expiration - const backoff = 30 * time.Second // Minimum wait time between eager update attempts - now, acquire, expired := time.Now(), false, false // acquire exclusive lock @@ -65,9 +92,8 @@ func (er *Resource[TResource, TState]) Get(state TState) (TResource, error) { break } // Getting here means that this thread/goroutine will wait for the updated resource - } else if er.expiration.Add(-window).Before(now) { - // The resource is valid but is expiring within the time window - if !er.acquiring && er.lastAttempt.Add(backoff).Before(now) { + } else if er.shouldRefresh(resource, state) { + if !(er.acquiring || backoff(now, er.lastAttempt)) { // If another thread/goroutine is not acquiring/renewing the resource, and none has attempted // to do so within the last 30 seconds, this thread/goroutine will do it er.acquiring, acquire = true, true @@ -121,3 +147,8 @@ func (er *Resource[TResource, TState]) Expire() { // Reset the expiration as if we never got this resource to begin with er.expiration = time.Time{} } + +func (er *Resource[TResource, TState]) expiringSoon(TResource, TState) bool { + // call time.Now() instead of using Get's value so ShouldRefresh doesn't need a time.Time parameter + return er.expiration.Add(-5 * time.Minute).Before(time.Now()) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md index 5faf165f4a..625e3b739e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/CHANGELOG.md @@ -1,5 +1,32 @@ # Release History +## 1.8.0 (2025-04-08) +### Features Added + +- New value `ProvisioningStateAccepted` added to enum type `ProvisioningState` + + +## 1.7.0 (2025-02-27) +### Features Added + +- New value `SKUNamePremiumV2LRS`, `SKUNamePremiumV2ZRS`, `SKUNameStandardV2GRS`, `SKUNameStandardV2GZRS`, `SKUNameStandardV2LRS`, `SKUNameStandardV2ZRS` added to enum type `SKUName` +- New function `*FileServicesClient.GetServiceUsage(context.Context, string, string, *FileServicesClientGetServiceUsageOptions) (FileServicesClientGetServiceUsageResponse, error)` +- New function `*FileServicesClient.NewListServiceUsagesPager(string, string, *FileServicesClientListServiceUsagesOptions) *runtime.Pager[FileServicesClientListServiceUsagesResponse]` +- New struct `AccountLimits` +- New struct `AccountUsage` +- New struct `AccountUsageElements` +- New struct `BurstingConstants` +- New struct `FileServiceUsage` +- New struct `FileServiceUsageProperties` +- New struct `FileServiceUsages` +- New struct `FileShareLimits` +- New struct `FileSharePropertiesFileSharePaidBursting` +- New struct `FileShareRecommendations` +- New struct `ObjectReplicationPolicyPropertiesMetrics` +- New field `FileSharePaidBursting`, `IncludedBurstIops`, `MaxBurstCreditsForIops`, `NextAllowedProvisionedBandwidthDowngradeTime`, `NextAllowedProvisionedIopsDowngradeTime`, `NextAllowedQuotaDowngradeTime`, `ProvisionedBandwidthMibps`, `ProvisionedIops` in struct `FileShareProperties` +- New field `Metrics` in struct `ObjectReplicationPolicyProperties` + + ## 1.6.0 (2024-06-28) ### Features Added diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md index 9f7fe2b72e..9724799d24 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/README.md @@ -1,7 +1,5 @@ # Azure Storage Module for Go -[![PkgGoDev](https://pkg.go.dev/badge/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage)](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage) - The `armstorage` module provides operations for working with Azure Storage. [Source code](https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/resourcemanager/storage/armstorage) @@ -11,7 +9,7 @@ The `armstorage` module provides operations for working with Azure Storage. ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.18 or above (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) +- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go (You could download and install the latest version of Go from [here](https://go.dev/doc/install). It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this [doc](https://go.dev/doc/manage-install).) ## Install the package @@ -25,7 +23,7 @@ go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage ## Authorization -When creating a client, you will need to provide a credential for authenticating with Azure Storage. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. +When creating a client, you will need to provide a credential for authenticating with Azure Storage. The `azidentity` module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more. ```go cred, err := azidentity.NewDefaultAzureCredential(nil) @@ -54,7 +52,7 @@ clientFactory, err := armstorage.NewClientFactory(, cred, &opti ## Clients -A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. +A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go client := clientFactory.NewAccountsClient() @@ -99,4 +97,4 @@ This project has adopted the 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. \ No newline at end of file +additional questions or comments. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go index fe5f1fc989..4597afadec 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/accounts_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, // BeginAbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -73,7 +70,7 @@ func (client *AccountsClient) BeginAbortHierarchicalNamespaceMigration(ctx conte // AbortHierarchicalNamespaceMigration - Abort live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *AccountsClient) abortHierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginAbortHierarchicalNamespaceMigration" @@ -96,7 +93,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigration(ctx context.Co } // abortHierarchicalNamespaceMigrationCreateRequest creates the AbortHierarchicalNamespaceMigration request. -func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*policy.Request, error) { +func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -115,7 +112,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +121,7 @@ func (client *AccountsClient) abortHierarchicalNamespaceMigrationCreateRequest(c // CheckNameAvailability - Checks that the storage account name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // - options - AccountsClientCheckNameAvailabilityOptions contains the optional parameters for the AccountsClient.CheckNameAvailability @@ -152,7 +149,7 @@ func (client *AccountsClient) CheckNameAvailability(ctx context.Context, account } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, options *AccountsClientCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Context, accountName AccountCheckNameAvailabilityParameters, _ *AccountsClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -163,7 +160,7 @@ func (client *AccountsClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, accountName); err != nil { @@ -187,7 +184,7 @@ func (client *AccountsClient) checkNameAvailabilityHandleResponse(resp *http.Res // set of properties, the request will succeed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -216,7 +213,7 @@ func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName // set of properties, the request will succeed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *AccountsClient) create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginCreate" @@ -239,7 +236,7 @@ func (client *AccountsClient) create(ctx context.Context, resourceGroupName stri } // createCreateRequest creates the Create request. -func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, options *AccountsClientBeginCreateOptions) (*policy.Request, error) { +func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters, _ *AccountsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -258,7 +255,7 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -273,7 +270,7 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG // synchronously across three Azure availability zones in the primary region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -304,7 +301,7 @@ func (client *AccountsClient) BeginCustomerInitiatedMigration(ctx context.Contex // synchronously across three Azure availability zones in the primary region. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *AccountsClient) customerInitiatedMigration(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginCustomerInitiatedMigration" @@ -327,7 +324,7 @@ func (client *AccountsClient) customerInitiatedMigration(ctx context.Context, re } // customerInitiatedMigrationCreateRequest creates the CustomerInitiatedMigration request. -func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, options *AccountsClientBeginCustomerInitiatedMigrationOptions) (*policy.Request, error) { +func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountMigration, _ *AccountsClientBeginCustomerInitiatedMigrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -346,7 +343,7 @@ func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -358,7 +355,7 @@ func (client *AccountsClient) customerInitiatedMigrationCreateRequest(ctx contex // Delete - Deletes a storage account in Microsoft Azure. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -385,7 +382,7 @@ func (client *AccountsClient) Delete(ctx context.Context, resourceGroupName stri } // deleteCreateRequest creates the Delete request. -func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientDeleteOptions) (*policy.Request, error) { +func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -404,7 +401,7 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -417,10 +414,10 @@ func (client *AccountsClient) deleteCreateRequest(ctx context.Context, resourceG // event of availability issues as Planned failover is only available while the // primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing // drills. This type of failover is invoked by setting FailoverType parameter to -// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance +// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -451,10 +448,10 @@ func (client *AccountsClient) BeginFailover(ctx context.Context, resourceGroupNa // event of availability issues as Planned failover is only available while the // primary and secondary endpoints are available. The primary use case of a Planned Failover is disaster recovery testing // drills. This type of failover is invoked by setting FailoverType parameter to -// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/en-us/azure/storage/common/storage-disaster-recovery-guidance +// 'Planned'. Learn more about the failover options here- https://learn.microsoft.com/azure/storage/common/storage-disaster-recovery-guidance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *AccountsClient) failover(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginFailoverOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginFailover" @@ -496,7 +493,7 @@ func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") if options != nil && options.FailoverType != nil { reqQP.Set("failoverType", "Planned") } @@ -507,7 +504,7 @@ func (client *AccountsClient) failoverCreateRequest(ctx context.Context, resourc // GetCustomerInitiatedMigration - Gets the status of the ongoing migration for the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -537,7 +534,7 @@ func (client *AccountsClient) GetCustomerInitiatedMigration(ctx context.Context, } // getCustomerInitiatedMigrationCreateRequest creates the GetCustomerInitiatedMigration request. -func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, options *AccountsClientGetCustomerInitiatedMigrationOptions) (*policy.Request, error) { +func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, migrationName MigrationName, _ *AccountsClientGetCustomerInitiatedMigrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/accountMigrations/{migrationName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -560,7 +557,7 @@ func (client *AccountsClient) getCustomerInitiatedMigrationCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -579,7 +576,7 @@ func (client *AccountsClient) getCustomerInitiatedMigrationHandleResponse(resp * // and account status. The ListKeys operation should be used to retrieve storage keys. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -629,7 +626,7 @@ func (client *AccountsClient) getPropertiesCreateRequest(ctx context.Context, re if options != nil && options.Expand != nil { reqQP.Set("$expand", string(*options.Expand)) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -647,7 +644,7 @@ func (client *AccountsClient) getPropertiesHandleResponse(resp *http.Response) ( // BeginHierarchicalNamespaceMigration - Live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -677,7 +674,7 @@ func (client *AccountsClient) BeginHierarchicalNamespaceMigration(ctx context.Co // HierarchicalNamespaceMigration - Live Migration of storage account to enable Hns // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *AccountsClient) hierarchicalNamespaceMigration(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginHierarchicalNamespaceMigration" @@ -700,7 +697,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigration(ctx context.Context } // hierarchicalNamespaceMigrationCreateRequest creates the HierarchicalNamespaceMigration request. -func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, requestType string, options *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*policy.Request, error) { +func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, requestType string, _ *AccountsClientBeginHierarchicalNamespaceMigrationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -719,7 +716,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") reqQP.Set("requestType", requestType) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -729,7 +726,7 @@ func (client *AccountsClient) hierarchicalNamespaceMigrationCreateRequest(ctx co // NewListPager - Lists all the storage accounts available under the subscription. Note that storage keys are not returned; // use the ListKeys operation for this. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - options - AccountsClientListOptions contains the optional parameters for the AccountsClient.NewListPager method. func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) *runtime.Pager[AccountsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountsClientListResponse]{ @@ -755,7 +752,7 @@ func (client *AccountsClient) NewListPager(options *AccountsClientListOptions) * } // listCreateRequest creates the List request. -func (client *AccountsClient) listCreateRequest(ctx context.Context, options *AccountsClientListOptions) (*policy.Request, error) { +func (client *AccountsClient) listCreateRequest(ctx context.Context, _ *AccountsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -766,7 +763,7 @@ func (client *AccountsClient) listCreateRequest(ctx context.Context, options *Ac return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -784,7 +781,7 @@ func (client *AccountsClient) listHandleResponse(resp *http.Response) (AccountsC // ListAccountSAS - List SAS credentials of a storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -813,7 +810,7 @@ func (client *AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupN } // listAccountSASCreateRequest creates the ListAccountSAS request. -func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, options *AccountsClientListAccountSASOptions) (*policy.Request, error) { +func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters, _ *AccountsClientListAccountSASOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -832,7 +829,7 @@ func (client *AccountsClient) listAccountSASCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -853,7 +850,7 @@ func (client *AccountsClient) listAccountSASHandleResponse(resp *http.Response) // NewListByResourceGroupPager - Lists all the storage accounts available under the given resource group. Note that storage // keys are not returned; use the ListKeys operation for this. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.NewListByResourceGroupPager // method. @@ -881,7 +878,7 @@ func (client *AccountsClient) NewListByResourceGroupPager(resourceGroupName stri } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AccountsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AccountsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -896,7 +893,7 @@ func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -914,7 +911,7 @@ func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Respo // ListKeys - Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -964,7 +961,7 @@ func (client *AccountsClient) listKeysCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", "kerb") } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -982,7 +979,7 @@ func (client *AccountsClient) listKeysHandleResponse(resp *http.Response) (Accou // ListServiceSAS - List service SAS credentials of a specific resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1011,7 +1008,7 @@ func (client *AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupN } // listServiceSASCreateRequest creates the ListServiceSAS request. -func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, options *AccountsClientListServiceSASOptions) (*policy.Request, error) { +func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters, _ *AccountsClientListServiceSASOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1030,7 +1027,7 @@ func (client *AccountsClient) listServiceSASCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1051,7 +1048,7 @@ func (client *AccountsClient) listServiceSASHandleResponse(resp *http.Response) // RegenerateKey - Regenerates one of the access keys or Kerberos keys for the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1080,7 +1077,7 @@ func (client *AccountsClient) RegenerateKey(ctx context.Context, resourceGroupNa } // regenerateKeyCreateRequest creates the RegenerateKey request. -func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, options *AccountsClientRegenerateKeyOptions) (*policy.Request, error) { +func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters, _ *AccountsClientRegenerateKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1099,7 +1096,7 @@ func (client *AccountsClient) regenerateKeyCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, regenerateKey); err != nil { @@ -1120,7 +1117,7 @@ func (client *AccountsClient) regenerateKeyHandleResponse(resp *http.Response) ( // BeginRestoreBlobRanges - Restore blobs in the specified blob ranges // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1148,7 +1145,7 @@ func (client *AccountsClient) BeginRestoreBlobRanges(ctx context.Context, resour // RestoreBlobRanges - Restore blobs in the specified blob ranges // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *AccountsClient) restoreBlobRanges(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*http.Response, error) { var err error const operationName = "AccountsClient.BeginRestoreBlobRanges" @@ -1171,7 +1168,7 @@ func (client *AccountsClient) restoreBlobRanges(ctx context.Context, resourceGro } // restoreBlobRangesCreateRequest creates the RestoreBlobRanges request. -func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, options *AccountsClientBeginRestoreBlobRangesOptions) (*policy.Request, error) { +func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobRestoreParameters, _ *AccountsClientBeginRestoreBlobRangesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1190,7 +1187,7 @@ func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1202,7 +1199,7 @@ func (client *AccountsClient) restoreBlobRangesCreateRequest(ctx context.Context // RevokeUserDelegationKeys - Revoke user delegation keys. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1230,7 +1227,7 @@ func (client *AccountsClient) RevokeUserDelegationKeys(ctx context.Context, reso } // revokeUserDelegationKeysCreateRequest creates the RevokeUserDelegationKeys request. -func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientRevokeUserDelegationKeysOptions) (*policy.Request, error) { +func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *AccountsClientRevokeUserDelegationKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1249,7 +1246,7 @@ func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -1263,7 +1260,7 @@ func (client *AccountsClient) revokeUserDelegationKeysCreateRequest(ctx context. // location and name of the storage account cannot be changed after creation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1292,7 +1289,7 @@ func (client *AccountsClient) Update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, options *AccountsClientUpdateOptions) (*policy.Request, error) { +func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters, _ *AccountsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1311,7 +1308,7 @@ func (client *AccountsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json index 152c3b451e..00fd5e2b2a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/storage/armstorage", - "Tag": "go/resourcemanager/storage/armstorage_a26d68f572" + "Tag": "go/resourcemanager/storage/armstorage_0044a0eabf" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md index ae18e9939d..0ea982589b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/autorest.md @@ -5,11 +5,11 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/97ee23a6db6078abcbec7b75bf9af8c503e9bb8b/specification/storage/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/97ee23a6db6078abcbec7b75bf9af8c503e9bb8b/specification/storage/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.6.0 +module-version: 1.8.0 modelerfour: seal-single-value-enum-by-default: true -tag: package-2023-05 +tag: package-2024-01 ``` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go index 286c363e7f..b01dc92d1b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobcontainers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewBlobContainersClient(subscriptionID string, credential azcore.TokenCrede // clears out only the specified tags in the request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -80,7 +77,7 @@ func (client *BlobContainersClient) ClearLegalHold(ctx context.Context, resource } // clearLegalHoldCreateRequest creates the ClearLegalHold request. -func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientClearLegalHoldOptions) (*policy.Request, error) { +func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, _ *BlobContainersClientClearLegalHoldOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -103,7 +100,7 @@ func (client *BlobContainersClient) clearLegalHoldCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, legalHold); err != nil { @@ -126,7 +123,7 @@ func (client *BlobContainersClient) clearLegalHoldHandleResponse(resp *http.Resp // contained by the container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -158,7 +155,7 @@ func (client *BlobContainersClient) Create(ctx context.Context, resourceGroupNam } // createCreateRequest creates the Create request. -func (client *BlobContainersClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientCreateOptions) (*policy.Request, error) { +func (client *BlobContainersClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, _ *BlobContainersClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -181,7 +178,7 @@ func (client *BlobContainersClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, blobContainer); err != nil { @@ -203,7 +200,7 @@ func (client *BlobContainersClient) createHandleResponse(resp *http.Response) (B // but not required for this operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -259,7 +256,7 @@ func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -289,7 +286,7 @@ func (client *BlobContainersClient) createOrUpdateImmutabilityPolicyHandleRespon // Delete - Deletes specified container under its account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -319,7 +316,7 @@ func (client *BlobContainersClient) Delete(ctx context.Context, resourceGroupNam } // deleteCreateRequest creates the Delete request. -func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientDeleteOptions) (*policy.Request, error) { +func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -342,7 +339,7 @@ func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -353,16 +350,16 @@ func (client *BlobContainersClient) deleteCreateRequest(ctx context.Context, res // container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // - containerName - The name of the blob container within the specified storage account. Blob container names must be between // 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every // dash (-) character must be immediately preceded and followed by a letter or number. -// - ifMatch - The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the -// operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. +// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update +// operations. The ETag value must include the leading and trailing double quotes as +// returned by the service. // - options - BlobContainersClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.DeleteImmutabilityPolicy // method. func (client *BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientDeleteImmutabilityPolicyOptions) (BlobContainersClientDeleteImmutabilityPolicyResponse, error) { @@ -388,7 +385,7 @@ func (client *BlobContainersClient) DeleteImmutabilityPolicy(ctx context.Context } // deleteImmutabilityPolicyCreateRequest creates the DeleteImmutabilityPolicy request. -func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientDeleteImmutabilityPolicyOptions) (*policy.Request, error) { +func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, _ *BlobContainersClientDeleteImmutabilityPolicyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -412,7 +409,7 @@ func (client *BlobContainersClient) deleteImmutabilityPolicyCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["If-Match"] = []string{ifMatch} @@ -435,16 +432,16 @@ func (client *BlobContainersClient) deleteImmutabilityPolicyHandleResponse(resp // allowed on a Locked policy will be this action. ETag in If-Match is required for this operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // - containerName - The name of the blob container within the specified storage account. Blob container names must be between // 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every // dash (-) character must be immediately preceded and followed by a letter or number. -// - ifMatch - The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the -// operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. +// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update +// operations. The ETag value must include the leading and trailing double quotes as +// returned by the service. // - options - BlobContainersClientExtendImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.ExtendImmutabilityPolicy // method. func (client *BlobContainersClient) ExtendImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientExtendImmutabilityPolicyOptions) (BlobContainersClientExtendImmutabilityPolicyResponse, error) { @@ -493,7 +490,7 @@ func (client *BlobContainersClient) extendImmutabilityPolicyCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["If-Match"] = []string{ifMatch} @@ -521,7 +518,7 @@ func (client *BlobContainersClient) extendImmutabilityPolicyHandleResponse(resp // Get - Gets properties of a specified container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -552,7 +549,7 @@ func (client *BlobContainersClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientGetOptions) (*policy.Request, error) { +func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -575,7 +572,7 @@ func (client *BlobContainersClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -594,7 +591,7 @@ func (client *BlobContainersClient) getHandleResponse(resp *http.Response) (Blob // body. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -650,7 +647,7 @@ func (client *BlobContainersClient) getImmutabilityPolicyCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.IfMatch != nil { @@ -675,7 +672,7 @@ func (client *BlobContainersClient) getImmutabilityPolicyHandleResponse(resp *ht // can be 15 to 60 seconds, or can be infinite. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -729,7 +726,7 @@ func (client *BlobContainersClient) leaseCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -753,7 +750,7 @@ func (client *BlobContainersClient) leaseHandleResponse(resp *http.Response) (Bl // NewListPager - Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation // token. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -810,7 +807,7 @@ func (client *BlobContainersClient) listCreateRequest(ctx context.Context, resou if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", *options.Maxpagesize) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -829,16 +826,16 @@ func (client *BlobContainersClient) listHandleResponse(resp *http.Response) (Blo // action. ETag in If-Match is required for this operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. // - containerName - The name of the blob container within the specified storage account. Blob container names must be between // 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every // dash (-) character must be immediately preceded and followed by a letter or number. -// - ifMatch - The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the -// operation only if the immutability policy already exists. If omitted, this operation will -// always be applied. +// - ifMatch - The entity state (ETag) version of the immutability policy to update must be returned to the server for all update +// operations. The ETag value must include the leading and trailing double quotes as +// returned by the service. // - options - BlobContainersClientLockImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.LockImmutabilityPolicy // method. func (client *BlobContainersClient) LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientLockImmutabilityPolicyOptions) (BlobContainersClientLockImmutabilityPolicyResponse, error) { @@ -864,7 +861,7 @@ func (client *BlobContainersClient) LockImmutabilityPolicy(ctx context.Context, } // lockImmutabilityPolicyCreateRequest creates the LockImmutabilityPolicy request. -func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, options *BlobContainersClientLockImmutabilityPolicyOptions) (*policy.Request, error) { +func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string, _ *BlobContainersClientLockImmutabilityPolicyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -887,7 +884,7 @@ func (client *BlobContainersClient) lockImmutabilityPolicyCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} req.Raw().Header["If-Match"] = []string{ifMatch} @@ -911,7 +908,7 @@ func (client *BlobContainersClient) lockImmutabilityPolicyHandleResponse(resp *h // unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -943,7 +940,7 @@ func (client *BlobContainersClient) BeginObjectLevelWorm(ctx context.Context, re // unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *BlobContainersClient) objectLevelWorm(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*http.Response, error) { var err error const operationName = "BlobContainersClient.BeginObjectLevelWorm" @@ -966,7 +963,7 @@ func (client *BlobContainersClient) objectLevelWorm(ctx context.Context, resourc } // objectLevelWormCreateRequest creates the ObjectLevelWorm request. -func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, options *BlobContainersClientBeginObjectLevelWormOptions) (*policy.Request, error) { +func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, _ *BlobContainersClientBeginObjectLevelWormOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -989,7 +986,7 @@ func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -999,7 +996,7 @@ func (client *BlobContainersClient) objectLevelWormCreateRequest(ctx context.Con // pattern and does not clear out the existing tags that are not specified in the request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1032,7 +1029,7 @@ func (client *BlobContainersClient) SetLegalHold(ctx context.Context, resourceGr } // setLegalHoldCreateRequest creates the SetLegalHold request. -func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, options *BlobContainersClientSetLegalHoldOptions) (*policy.Request, error) { +func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold LegalHold, _ *BlobContainersClientSetLegalHoldOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1055,7 +1052,7 @@ func (client *BlobContainersClient) setLegalHoldCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, legalHold); err != nil { @@ -1077,7 +1074,7 @@ func (client *BlobContainersClient) setLegalHoldHandleResponse(resp *http.Respon // Update fails if the specified container doesn't already exist. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -1109,7 +1106,7 @@ func (client *BlobContainersClient) Update(ctx context.Context, resourceGroupNam } // updateCreateRequest creates the Update request. -func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, options *BlobContainersClientUpdateOptions) (*policy.Request, error) { +func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer BlobContainer, _ *BlobContainersClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -1132,7 +1129,7 @@ func (client *BlobContainersClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, blobContainer); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go index a0e56a472c..d8cd8d27eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobinventorypolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewBlobInventoryPoliciesClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Sets the blob inventory policy to the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -77,7 +74,7 @@ func (client *BlobInventoryPoliciesClient) CreateOrUpdate(ctx context.Context, r } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, options *BlobInventoryPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, properties BlobInventoryPolicy, _ *BlobInventoryPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -100,7 +97,7 @@ func (client *BlobInventoryPoliciesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -121,7 +118,7 @@ func (client *BlobInventoryPoliciesClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes the blob inventory policy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -150,7 +147,7 @@ func (client *BlobInventoryPoliciesClient) Delete(ctx context.Context, resourceG } // deleteCreateRequest creates the Delete request. -func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientDeleteOptions) (*policy.Request, error) { +func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, _ *BlobInventoryPoliciesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +170,7 @@ func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +179,7 @@ func (client *BlobInventoryPoliciesClient) deleteCreateRequest(ctx context.Conte // Get - Gets the blob inventory policy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -212,7 +209,7 @@ func (client *BlobInventoryPoliciesClient) Get(ctx context.Context, resourceGrou } // getCreateRequest creates the Get request. -func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, options *BlobInventoryPoliciesClientGetOptions) (*policy.Request, error) { +func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, blobInventoryPolicyName BlobInventoryPolicyName, _ *BlobInventoryPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -235,7 +232,7 @@ func (client *BlobInventoryPoliciesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +249,7 @@ func (client *BlobInventoryPoliciesClient) getHandleResponse(resp *http.Response // NewListPager - Gets the blob inventory policy associated with the specified storage account. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -283,7 +280,7 @@ func (client *BlobInventoryPoliciesClient) NewListPager(resourceGroupName string } // listCreateRequest creates the List request. -func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobInventoryPoliciesClientListOptions) (*policy.Request, error) { +func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobInventoryPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -302,7 +299,7 @@ func (client *BlobInventoryPoliciesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go index 8ccf18a9c4..21a7346bc3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/blobservices_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewBlobServicesClient(subscriptionID string, credential azcore.TokenCredent // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -76,7 +73,7 @@ func (client *BlobServicesClient) GetServiceProperties(ctx context.Context, reso } // getServicePropertiesCreateRequest creates the GetServiceProperties request. -func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientGetServicePropertiesOptions) (*policy.Request, error) { +func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobServicesClientGetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -96,7 +93,7 @@ func (client *BlobServicesClient) getServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +110,7 @@ func (client *BlobServicesClient) getServicePropertiesHandleResponse(resp *http. // NewListPager - List blob services of storage account. It returns a collection of one object named default. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -143,7 +140,7 @@ func (client *BlobServicesClient) NewListPager(resourceGroupName string, account } // listCreateRequest creates the List request. -func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *BlobServicesClientListOptions) (*policy.Request, error) { +func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *BlobServicesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -162,7 +159,7 @@ func (client *BlobServicesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +178,7 @@ func (client *BlobServicesClient) listHandleResponse(resp *http.Response) (BlobS // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -212,7 +209,7 @@ func (client *BlobServicesClient) SetServiceProperties(ctx context.Context, reso } // setServicePropertiesCreateRequest creates the SetServiceProperties request. -func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, options *BlobServicesClientSetServicePropertiesOptions) (*policy.Request, error) { +func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters BlobServiceProperties, _ *BlobServicesClientSetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -232,7 +229,7 @@ func (client *BlobServicesClient) setServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml index 674a186be8..f65cf92472 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/ci.yml @@ -24,6 +24,5 @@ pr: extends: template: /eng/pipelines/templates/jobs/archetype-sdk-client.yml parameters: - IncludeRelease: true ServiceDirectory: 'resourcemanager/storage/armstorage' UsePipelineProxy: false diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go index 027e030f6d..5cb8306294 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/client_factory.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go index 48f5295768..f6160c2e16 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/constants.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -10,7 +7,7 @@ package armstorage const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage" - moduleVersion = "v1.6.0" + moduleVersion = "v1.8.0" ) // AccessTier - Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' @@ -994,6 +991,7 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer type ProvisioningState string const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" ProvisioningStateCanceled ProvisioningState = "Canceled" ProvisioningStateCreating ProvisioningState = "Creating" ProvisioningStateDeleting ProvisioningState = "Deleting" @@ -1007,6 +1005,7 @@ const ( // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ + ProvisioningStateAccepted, ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, @@ -1213,12 +1212,18 @@ type SKUName string const ( SKUNamePremiumLRS SKUName = "Premium_LRS" + SKUNamePremiumV2LRS SKUName = "PremiumV2_LRS" + SKUNamePremiumV2ZRS SKUName = "PremiumV2_ZRS" SKUNamePremiumZRS SKUName = "Premium_ZRS" SKUNameStandardGRS SKUName = "Standard_GRS" SKUNameStandardGZRS SKUName = "Standard_GZRS" SKUNameStandardLRS SKUName = "Standard_LRS" SKUNameStandardRAGRS SKUName = "Standard_RAGRS" SKUNameStandardRAGZRS SKUName = "Standard_RAGZRS" + SKUNameStandardV2GRS SKUName = "StandardV2_GRS" + SKUNameStandardV2GZRS SKUName = "StandardV2_GZRS" + SKUNameStandardV2LRS SKUName = "StandardV2_LRS" + SKUNameStandardV2ZRS SKUName = "StandardV2_ZRS" SKUNameStandardZRS SKUName = "Standard_ZRS" ) @@ -1226,12 +1231,18 @@ const ( func PossibleSKUNameValues() []SKUName { return []SKUName{ SKUNamePremiumLRS, + SKUNamePremiumV2LRS, + SKUNamePremiumV2ZRS, SKUNamePremiumZRS, SKUNameStandardGRS, SKUNameStandardGZRS, SKUNameStandardLRS, SKUNameStandardRAGRS, SKUNameStandardRAGZRS, + SKUNameStandardV2GRS, + SKUNameStandardV2GZRS, + SKUNameStandardV2LRS, + SKUNameStandardV2ZRS, SKUNameStandardZRS, } } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go index 6602acba4c..ec49f13858 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/deletedaccounts_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDeletedAccountsClient(subscriptionID string, credential azcore.TokenCred // Get - Get properties of specified deleted account resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - deletedAccountName - Name of the deleted storage account. // - location - The location of the deleted storage account. // - options - DeletedAccountsClientGetOptions contains the optional parameters for the DeletedAccountsClient.Get method. @@ -73,7 +70,7 @@ func (client *DeletedAccountsClient) Get(ctx context.Context, deletedAccountName } // getCreateRequest creates the Get request. -func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, deletedAccountName string, location string, options *DeletedAccountsClientGetOptions) (*policy.Request, error) { +func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, deletedAccountName string, location string, _ *DeletedAccountsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}" if deletedAccountName == "" { return nil, errors.New("parameter deletedAccountName cannot be empty") @@ -92,7 +89,7 @@ func (client *DeletedAccountsClient) getCreateRequest(ctx context.Context, delet return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +106,7 @@ func (client *DeletedAccountsClient) getHandleResponse(resp *http.Response) (Del // NewListPager - Lists deleted accounts under the subscription. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - options - DeletedAccountsClientListOptions contains the optional parameters for the DeletedAccountsClient.NewListPager // method. func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClientListOptions) *runtime.Pager[DeletedAccountsClientListResponse] { @@ -136,7 +133,7 @@ func (client *DeletedAccountsClient) NewListPager(options *DeletedAccountsClient } // listCreateRequest creates the List request. -func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, options *DeletedAccountsClientListOptions) (*policy.Request, error) { +func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, _ *DeletedAccountsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -147,7 +144,7 @@ func (client *DeletedAccountsClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go index d757bde916..71e7985153 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/encryptionscopes_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewEncryptionScopesClient(subscriptionID string, credential azcore.TokenCre // Get - Returns the properties for the specified encryption scope. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -78,7 +75,7 @@ func (client *EncryptionScopesClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, options *EncryptionScopesClientGetOptions) (*policy.Request, error) { +func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, _ *EncryptionScopesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -101,7 +98,7 @@ func (client *EncryptionScopesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +115,7 @@ func (client *EncryptionScopesClient) getHandleResponse(resp *http.Response) (En // NewListPager - Lists all the encryption scopes available under the specified storage account. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -176,7 +173,7 @@ func (client *EncryptionScopesClient) listCreateRequest(ctx context.Context, res if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10)) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +192,7 @@ func (client *EncryptionScopesClient) listHandleResponse(resp *http.Response) (E // does not already exist. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -227,7 +224,7 @@ func (client *EncryptionScopesClient) Patch(ctx context.Context, resourceGroupNa } // patchCreateRequest creates the Patch request. -func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPatchOptions) (*policy.Request, error) { +func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, _ *EncryptionScopesClientPatchOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -250,7 +247,7 @@ func (client *EncryptionScopesClient) patchCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil { @@ -273,7 +270,7 @@ func (client *EncryptionScopesClient) patchHandleResponse(resp *http.Response) ( // encryption scope properties will be updated per the specified request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -305,7 +302,7 @@ func (client *EncryptionScopesClient) Put(ctx context.Context, resourceGroupName } // putCreateRequest creates the Put request. -func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, options *EncryptionScopesClientPutOptions) (*policy.Request, error) { +func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, encryptionScopeName string, encryptionScope EncryptionScope, _ *EncryptionScopesClientPutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -328,7 +325,7 @@ func (client *EncryptionScopesClient) putCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, encryptionScope); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go index c7d4dcc5ee..0ce4ce5441 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileservices_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -17,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" "net/url" + "strconv" "strings" ) @@ -47,7 +45,7 @@ func NewFileServicesClient(subscriptionID string, credential azcore.TokenCredent // Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -76,7 +74,7 @@ func (client *FileServicesClient) GetServiceProperties(ctx context.Context, reso } // getServicePropertiesCreateRequest creates the GetServiceProperties request. -func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServicePropertiesOptions) (*policy.Request, error) { +func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientGetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -96,7 +94,7 @@ func (client *FileServicesClient) getServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,10 +109,79 @@ func (client *FileServicesClient) getServicePropertiesHandleResponse(resp *http. return result, nil } +// GetServiceUsage - Gets the usage of file service in storage account including account limits, file share limits and constants +// used in recommendations and bursting formula. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - accountName - The name of the storage account within the specified resource group. Storage account names must be between +// 3 and 24 characters in length and use numbers and lower-case letters only. +// - options - FileServicesClientGetServiceUsageOptions contains the optional parameters for the FileServicesClient.GetServiceUsage +// method. +func (client *FileServicesClient) GetServiceUsage(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientGetServiceUsageOptions) (FileServicesClientGetServiceUsageResponse, error) { + var err error + const operationName = "FileServicesClient.GetServiceUsage" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getServiceUsageCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return FileServicesClientGetServiceUsageResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FileServicesClientGetServiceUsageResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FileServicesClientGetServiceUsageResponse{}, err + } + resp, err := client.getServiceUsageHandleResponse(httpResp) + return resp, err +} + +// getServiceUsageCreateRequest creates the GetServiceUsage request. +func (client *FileServicesClient) getServiceUsageCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientGetServiceUsageOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages/{fileServiceUsagesName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default")) + urlPath = strings.ReplaceAll(urlPath, "{fileServiceUsagesName}", url.PathEscape("default")) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getServiceUsageHandleResponse handles the GetServiceUsage response. +func (client *FileServicesClient) getServiceUsageHandleResponse(resp *http.Response) (FileServicesClientGetServiceUsageResponse, error) { + result := FileServicesClientGetServiceUsageResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceUsage); err != nil { + return FileServicesClientGetServiceUsageResponse{}, err + } + return result, nil +} + // List - List all file services in storage accounts // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -142,7 +209,7 @@ func (client *FileServicesClient) List(ctx context.Context, resourceGroupName st } // listCreateRequest creates the List request. -func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListOptions) (*policy.Request, error) { +func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *FileServicesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -161,7 +228,7 @@ func (client *FileServicesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,11 +243,81 @@ func (client *FileServicesClient) listHandleResponse(resp *http.Response) (FileS return result, nil } +// NewListServiceUsagesPager - Gets the usages of file service in storage account. +// +// Generated from API version 2024-01-01 +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - accountName - The name of the storage account within the specified resource group. Storage account names must be between +// 3 and 24 characters in length and use numbers and lower-case letters only. +// - options - FileServicesClientListServiceUsagesOptions contains the optional parameters for the FileServicesClient.NewListServiceUsagesPager +// method. +func (client *FileServicesClient) NewListServiceUsagesPager(resourceGroupName string, accountName string, options *FileServicesClientListServiceUsagesOptions) *runtime.Pager[FileServicesClientListServiceUsagesResponse] { + return runtime.NewPager(runtime.PagingHandler[FileServicesClientListServiceUsagesResponse]{ + More: func(page FileServicesClientListServiceUsagesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FileServicesClientListServiceUsagesResponse) (FileServicesClientListServiceUsagesResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FileServicesClient.NewListServiceUsagesPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listServiceUsagesCreateRequest(ctx, resourceGroupName, accountName, options) + }, nil) + if err != nil { + return FileServicesClientListServiceUsagesResponse{}, err + } + return client.listServiceUsagesHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listServiceUsagesCreateRequest creates the ListServiceUsages request. +func (client *FileServicesClient) listServiceUsagesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *FileServicesClientListServiceUsagesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}/usages" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{FileServicesName}", url.PathEscape("default")) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Maxpagesize != nil { + reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10)) + } + reqQP.Set("api-version", "2024-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listServiceUsagesHandleResponse handles the ListServiceUsages response. +func (client *FileServicesClient) listServiceUsagesHandleResponse(resp *http.Response) (FileServicesClientListServiceUsagesResponse, error) { + result := FileServicesClientListServiceUsagesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.FileServiceUsages); err != nil { + return FileServicesClientListServiceUsagesResponse{}, err + } + return result, nil +} + // SetServiceProperties - Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource // Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -210,7 +347,7 @@ func (client *FileServicesClient) SetServiceProperties(ctx context.Context, reso } // setServicePropertiesCreateRequest creates the SetServiceProperties request. -func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, options *FileServicesClientSetServicePropertiesOptions) (*policy.Request, error) { +func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters FileServiceProperties, _ *FileServicesClientSetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -230,7 +367,7 @@ func (client *FileServicesClient) setServicePropertiesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go index 16823750e3..a063e282ff 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/fileshares_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewFileSharesClient(subscriptionID string, credential azcore.TokenCredentia // the share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -106,7 +103,7 @@ func (client *FileSharesClient) createCreateRequest(ctx context.Context, resourc if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, fileShare); err != nil { @@ -127,7 +124,7 @@ func (client *FileSharesClient) createHandleResponse(resp *http.Response) (FileS // Delete - Deletes specified share under its account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -183,7 +180,7 @@ func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourc if options != nil && options.Include != nil { reqQP.Set("$include", *options.Include) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSSnapshot != nil { @@ -195,7 +192,7 @@ func (client *FileSharesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets properties of a specified share. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -252,7 +249,7 @@ func (client *FileSharesClient) getCreateRequest(ctx context.Context, resourceGr if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSSnapshot != nil { @@ -274,7 +271,7 @@ func (client *FileSharesClient) getHandleResponse(resp *http.Response) (FileShar // be 15 to 60 seconds, or can be infinite. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -328,7 +325,7 @@ func (client *FileSharesClient) leaseCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.XMSSnapshot != nil { @@ -357,7 +354,7 @@ func (client *FileSharesClient) leaseHandleResponse(resp *http.Response) (FileSh // NewListPager - Lists all shares. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -414,7 +411,7 @@ func (client *FileSharesClient) listCreateRequest(ctx context.Context, resourceG if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", *options.Maxpagesize) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -432,7 +429,7 @@ func (client *FileSharesClient) listHandleResponse(resp *http.Response) (FileSha // Restore - Restore a file share within a valid retention days if share soft delete is enabled // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -462,7 +459,7 @@ func (client *FileSharesClient) Restore(ctx context.Context, resourceGroupName s } // restoreCreateRequest creates the Restore request. -func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, options *FileSharesClientRestoreOptions) (*policy.Request, error) { +func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, deletedShare DeletedShare, _ *FileSharesClientRestoreOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -485,7 +482,7 @@ func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, deletedShare); err != nil { @@ -498,7 +495,7 @@ func (client *FileSharesClient) restoreCreateRequest(ctx context.Context, resour // Update fails if the specified share does not already exist. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -530,7 +527,7 @@ func (client *FileSharesClient) Update(ctx context.Context, resourceGroupName st } // updateCreateRequest creates the Update request. -func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, options *FileSharesClientUpdateOptions) (*policy.Request, error) { +func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, shareName string, fileShare FileShare, _ *FileSharesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -553,7 +550,7 @@ func (client *FileSharesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, fileShare); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go index 00586070b4..35c35f50f0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/localusers_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -48,7 +45,7 @@ func NewLocalUsersClient(subscriptionID string, credential azcore.TokenCredentia // enablement and extended groups cannot be set with other properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -80,7 +77,7 @@ func (client *LocalUsersClient) CreateOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, options *LocalUsersClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, properties LocalUser, _ *LocalUsersClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -103,7 +100,7 @@ func (client *LocalUsersClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -124,7 +121,7 @@ func (client *LocalUsersClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the local user associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -153,7 +150,7 @@ func (client *LocalUsersClient) Delete(ctx context.Context, resourceGroupName st } // deleteCreateRequest creates the Delete request. -func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientDeleteOptions) (*policy.Request, error) { +func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -176,7 +173,7 @@ func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,7 +182,7 @@ func (client *LocalUsersClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get the local user of the storage account by username. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -215,7 +212,7 @@ func (client *LocalUsersClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientGetOptions) (*policy.Request, error) { +func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -238,7 +235,7 @@ func (client *LocalUsersClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +252,7 @@ func (client *LocalUsersClient) getHandleResponse(resp *http.Response) (LocalUse // NewListPager - List the local users associated with the storage account. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -313,7 +310,7 @@ func (client *LocalUsersClient) listCreateRequest(ctx context.Context, resourceG if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10)) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +328,7 @@ func (client *LocalUsersClient) listHandleResponse(resp *http.Response) (LocalUs // ListKeys - List SSH authorized keys and shared key of the local user. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -361,7 +358,7 @@ func (client *LocalUsersClient) ListKeys(ctx context.Context, resourceGroupName } // listKeysCreateRequest creates the ListKeys request. -func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientListKeysOptions) (*policy.Request, error) { +func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -384,7 +381,7 @@ func (client *LocalUsersClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +399,7 @@ func (client *LocalUsersClient) listKeysHandleResponse(resp *http.Response) (Loc // RegeneratePassword - Regenerate the local user SSH password. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -433,7 +430,7 @@ func (client *LocalUsersClient) RegeneratePassword(ctx context.Context, resource } // regeneratePasswordCreateRequest creates the RegeneratePassword request. -func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, options *LocalUsersClientRegeneratePasswordOptions) (*policy.Request, error) { +func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Context, resourceGroupName string, accountName string, username string, _ *LocalUsersClientRegeneratePasswordOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -456,7 +453,7 @@ func (client *LocalUsersClient) regeneratePasswordCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go index 0c81745400..ca9da9f0a7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/managementpolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewManagementPoliciesClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Sets the managementpolicy to the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -77,7 +74,7 @@ func (client *ManagementPoliciesClient) CreateOrUpdate(ctx context.Context, reso } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, options *ManagementPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, properties ManagementPolicy, _ *ManagementPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -100,7 +97,7 @@ func (client *ManagementPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -121,7 +118,7 @@ func (client *ManagementPoliciesClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes the managementpolicy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -150,7 +147,7 @@ func (client *ManagementPoliciesClient) Delete(ctx context.Context, resourceGrou } // deleteCreateRequest creates the Delete request. -func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientDeleteOptions) (*policy.Request, error) { +func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, _ *ManagementPoliciesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -173,7 +170,7 @@ func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -181,7 +178,7 @@ func (client *ManagementPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Gets the managementpolicy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -210,7 +207,7 @@ func (client *ManagementPoliciesClient) Get(ctx context.Context, resourceGroupNa } // getCreateRequest creates the Get request. -func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, options *ManagementPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, managementPolicyName ManagementPolicyName, _ *ManagementPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -233,7 +230,7 @@ func (client *ManagementPoliciesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go index a893299da6..ed3c8e58af 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -143,6 +140,21 @@ type AccountKey struct { Value *string } +// AccountLimits - Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account. +type AccountLimits struct { + // READ-ONLY; The maximum number of file shares limit for the storage account. + MaxFileShares *int32 + + // READ-ONLY; The maximum provisioned bandwidth limit in mebibytes per second for the storage account. + MaxProvisionedBandwidthMiBPerSec *int32 + + // READ-ONLY; The maximum provisioned IOPS limit for the storage account. + MaxProvisionedIOPS *int32 + + // READ-ONLY; The maximum provisioned storage quota limit in gibibytes for the storage account. + MaxProvisionedStorageGiB *int32 +} + // AccountListKeysResult - The response from the ListKeys operation. type AccountListKeysResult struct { // READ-ONLY; Gets the list of storage account keys and their properties for the specified storage account. @@ -602,6 +614,34 @@ type AccountUpdateParameters struct { Tags map[string]*string } +// AccountUsage - Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted +// shares in the account. +type AccountUsage struct { + // READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted + // shares in the account. + LiveShares *AccountUsageElements + + // READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or soft-deleted + // shares in the account. + SoftDeletedShares *AccountUsageElements +} + +// AccountUsageElements - Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares or +// soft-deleted shares in the account. +type AccountUsageElements struct { + // READ-ONLY; The total number of file shares. + FileShareCount *int32 + + // READ-ONLY; The total provisioned bandwidth in mebibytes per second. + ProvisionedBandwidthMiBPerSec *int32 + + // READ-ONLY; The total provisioned IOPS. + ProvisionedIOPS *int32 + + // READ-ONLY; The total provisioned storage quota in gibibytes. + ProvisionedStorageGiB *int32 +} + // ActiveDirectoryProperties - Settings properties for Active Directory (AD). type ActiveDirectoryProperties struct { // REQUIRED; Specifies the domain GUID. @@ -902,6 +942,19 @@ type BlobServicePropertiesProperties struct { RestorePolicy *RestorePolicyProperties } +// BurstingConstants - Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share +// in the storage account. +type BurstingConstants struct { + // READ-ONLY; The guaranteed floor of burst IOPS for small file shares. + BurstFloorIOPS *int32 + + // READ-ONLY; The scalar against provisioned IOPS in the file share included burst IOPS formula. + BurstIOScalar *float64 + + // READ-ONLY; The time frame for bursting in seconds in the file share maximum burst credits for IOPS formula. + BurstTimeframeSeconds *int32 +} + // ChangeFeed - The blob service properties for change feed events. type ChangeFeed struct { // Indicates whether change feed event logging is enabled for the Blob service. @@ -1408,6 +1461,53 @@ type FileServicePropertiesProperties struct { ShareDeleteRetentionPolicy *DeleteRetentionPolicy } +// FileServiceUsage - The usage of file service in storage account. +type FileServiceUsage struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; File service usage in storage account including account limits, file share limits and constants used in recommendations + // and bursting formula. + Properties *FileServiceUsageProperties + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// FileServiceUsageProperties - File service usage in storage account including account limits, file share limits and constants +// used in recommendations and bursting formula. +type FileServiceUsageProperties struct { + // READ-ONLY; Constants used for calculating included burst IOPS and maximum burst credits for IOPS for a file share in the + // storage account. + BurstingConstants *BurstingConstants + + // READ-ONLY; Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account. + FileShareLimits *FileShareLimits + + // READ-ONLY; Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in the storage account. + FileShareRecommendations *FileShareRecommendations + + // READ-ONLY; Maximum provisioned storage, IOPS, bandwidth and number of file shares limits for the storage account. + StorageAccountLimits *AccountLimits + + // READ-ONLY; Usage of provisioned storage, IOPS, bandwidth and number of file shares across all live shares and soft-deleted + // shares in the account. + StorageAccountUsage *AccountUsage +} + +// FileServiceUsages - List file service usages schema. +type FileServiceUsages struct { + // READ-ONLY; Request URL that can be used to query next page of file service usages. Returned when total number of requested + // file service usages exceed maximum page size. + NextLink *string + + // READ-ONLY; List of file service usages returned. + Value []*FileServiceUsage +} + // FileShare - Properties of the file share, including Id, resource name, resource type, Etag. type FileShare struct { // Properties of the file share. @@ -1455,6 +1555,27 @@ type FileShareItems struct { Value []*FileShareItem } +// FileShareLimits - Minimum and maximum provisioned storage, IOPS and bandwidth limits for a file share in the storage account. +type FileShareLimits struct { + // READ-ONLY; The maximum provisioned bandwidth limit in mebibytes per second for a file share in the storage account. + MaxProvisionedBandwidthMiBPerSec *int32 + + // READ-ONLY; The maximum provisioned IOPS limit for a file share in the storage account. + MaxProvisionedIOPS *int32 + + // READ-ONLY; The maximum provisioned storage quota limit in gibibytes for a file share in the storage account. + MaxProvisionedStorageGiB *int32 + + // READ-ONLY; The minimum provisioned bandwidth limit in mebibytes per second for a file share in the storage account. + MinProvisionedBandwidthMiBPerSec *int32 + + // READ-ONLY; The minimum provisioned IOPS limit for a file share in the storage account. + MinProvisionedIOPS *int32 + + // READ-ONLY; The minimum provisioned storage quota limit in gibibytes for a file share in the storage account. + MinProvisionedStorageGiB *int32 +} + // FileShareProperties - The properties of the file share. type FileShareProperties struct { // Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage @@ -1464,14 +1585,29 @@ type FileShareProperties struct { // The authentication protocol that is used for the file share. Can only be specified when creating a share. EnabledProtocols *EnabledProtocols + // File Share Paid Bursting properties. + FileSharePaidBursting *FileSharePropertiesFileSharePaidBursting + // A name-value pair to associate with the share as metadata. Metadata map[string]*string + // The provisioned bandwidth of the share, in mebibytes per second. This property is only for file shares created under Files + // Provisioned v2 account type. Please refer to the GetFileServiceUsage API + // response for the minimum and maximum allowed value for provisioned bandwidth. + ProvisionedBandwidthMibps *int32 + + // The provisioned IOPS of the share. This property is only for file shares created under Files Provisioned v2 account type. + // Please refer to the GetFileServiceUsage API response for the minimum and + // maximum allowed value for provisioned IOPS. + ProvisionedIops *int32 + // The property is for NFS share only. The default is NoRootSquash. RootSquash *RootSquashType - // The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File - // Shares, the maximum size is 102400. + // The provisioned size of the share, in gibibytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large + // File Shares, the maximum size is 102400. For file shares created under Files + // Provisioned v2 account type, please refer to the GetFileServiceUsage API response for the minimum and maximum allowed provisioned + // storage size. ShareQuota *int32 // List of stored access policies specified on the share. @@ -1489,6 +1625,10 @@ type FileShareProperties struct { // READ-ONLY; The deleted time if the share was deleted. DeletedTime *time.Time + // READ-ONLY; The calculated burst IOPS of the share. This property is only for file shares created under Files Provisioned + // v2 account type. + IncludedBurstIops *int32 + // READ-ONLY; Returns the date and time the share was last modified. LastModifiedTime *time.Time @@ -1501,6 +1641,22 @@ type FileShareProperties struct { // READ-ONLY; The lease status of the share. LeaseStatus *LeaseStatus + // READ-ONLY; The calculated maximum burst credits for the share. This property is only for file shares created under Files + // Provisioned v2 account type. + MaxBurstCreditsForIops *int64 + + // READ-ONLY; Returns the next allowed provisioned bandwidth downgrade time for the share. This property is only for file + // shares created under Files Provisioned v2 account type. + NextAllowedProvisionedBandwidthDowngradeTime *time.Time + + // READ-ONLY; Returns the next allowed provisioned IOPS downgrade time for the share. This property is only for file shares + // created under Files Provisioned v2 account type. + NextAllowedProvisionedIopsDowngradeTime *time.Time + + // READ-ONLY; Returns the next allowed provisioned storage size downgrade time for the share. This property is only for file + // shares created under Files Provisioned v1 SSD and Files Provisioned v2 account type + NextAllowedQuotaDowngradeTime *time.Time + // READ-ONLY; Remaining retention days for share that was soft deleted. RemainingRetentionDays *int32 @@ -1515,6 +1671,39 @@ type FileShareProperties struct { Version *string } +// FileSharePropertiesFileSharePaidBursting - File Share Paid Bursting properties. +type FileSharePropertiesFileSharePaidBursting struct { + // Indicates whether paid bursting is enabled for the share. This property is only for file shares created under Files Provisioned + // v1 SSD account type. + PaidBurstingEnabled *bool + + // The maximum paid bursting bandwidth for the share, in mebibytes per second. This property is only for file shares created + // under Files Provisioned v1 SSD account type. The maximum allowed value is + // 10340 which is the maximum allowed bandwidth for a share. + PaidBurstingMaxBandwidthMibps *int32 + + // The maximum paid bursting IOPS for the share. This property is only for file shares created under Files Provisioned v1 + // SSD account type. The maximum allowed value is 102400 which is the maximum + // allowed IOPS for a share. + PaidBurstingMaxIops *int32 +} + +// FileShareRecommendations - Constants used for calculating recommended provisioned IOPS and bandwidth for a file share in +// the storage account. +type FileShareRecommendations struct { + // READ-ONLY; The scalar for bandwidth in the file share provisioned bandwidth recommendation formula. + BandwidthScalar *float64 + + // READ-ONLY; The base bandwidth in the file share provisioned bandwidth recommendation formula. + BaseBandwidthMiBPerSec *int32 + + // READ-ONLY; The base IOPS in the file share provisioned IOPS recommendation formula. + BaseIOPS *int32 + + // READ-ONLY; The scalar for IO in the file share provisioned IOPS recommendation formula. + IoScalar *float64 +} + // GeoReplicationStats - Statistics related to replication for storage account's Blob, Table, Queue and File services. It // is only available when geo-redundant replication is enabled for the storage account. type GeoReplicationStats struct { @@ -1544,11 +1733,12 @@ type GeoReplicationStats struct { // IPRule - IP rule with specific IP or IP range in CIDR format. type IPRule struct { + // CONSTANT; The action of IP ACL rule. + // Field has constant value "Allow", any specified value is ignored. + Action *string + // REQUIRED; Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. IPAddressOrRange *string - - // The action of IP ACL rule. - Action *string } // Identity for the resource. @@ -2035,7 +2225,7 @@ type ManagementPolicyFilter struct { // ManagementPolicyProperties - The Storage Account ManagementPolicy properties. type ManagementPolicyProperties struct { - // REQUIRED; The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + // REQUIRED; The Storage Account ManagementPolicy, in JSON format. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview. Policy *ManagementPolicySchema // READ-ONLY; Returns the date and time the ManagementPolicies was last modified. @@ -2058,9 +2248,9 @@ type ManagementPolicyRule struct { Enabled *bool } -// ManagementPolicySchema - The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. +// ManagementPolicySchema - The Storage Account ManagementPolicies Rules. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview. type ManagementPolicySchema struct { - // REQUIRED; The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + // REQUIRED; The Storage Account ManagementPolicies Rules. See more details in: https://learn.microsoft.com/azure/storage/blobs/lifecycle-management-overview. Rules []*ManagementPolicyRule } @@ -2314,6 +2504,9 @@ type ObjectReplicationPolicyProperties struct { // REQUIRED; Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. SourceAccount *string + // Optional. The object replication policy metrics feature options. + Metrics *ObjectReplicationPolicyPropertiesMetrics + // The storage account object replication rules. Rules []*ObjectReplicationPolicyRule @@ -2324,6 +2517,12 @@ type ObjectReplicationPolicyProperties struct { PolicyID *string } +// ObjectReplicationPolicyPropertiesMetrics - Optional. The object replication policy metrics feature options. +type ObjectReplicationPolicyPropertiesMetrics struct { + // Indicates whether object replication metrics feature is enabled for the policy. + Enabled *bool +} + // ObjectReplicationPolicyRule - The replication policy rule between two containers. type ObjectReplicationPolicyRule struct { // REQUIRED; Required. Destination container name. @@ -3087,27 +3286,27 @@ type TaskReportInstance struct { type TaskReportProperties struct { // READ-ONLY; End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison // operators can be used as described for DateTime properties in - // https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + // https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators FinishTime *string // READ-ONLY; Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount // eq 0 and other comparison operators can be used as described for Numerical properties - // in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + // in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectFailedCount *string // READ-ONLY; Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as // objectsOperatedOnCount ge 100 and other comparison operators can be used as described for - // Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + // Numerical properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectsOperatedOnCount *string // READ-ONLY; Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount // gt 150 and other comparison operators can be used as described for Numerical - // properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + // properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectsSucceededCount *string // READ-ONLY; Total number of objects that meet the condition as defined in the storage task assignment execution context. // Filter options such as objectsTargetedCount gt 50 and other comparison operators can be - // used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + // used as described for Numerical properties in https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators ObjectsTargetedCount *string // READ-ONLY; Represents the overall result of the execution for the run instance @@ -3121,7 +3320,7 @@ type TaskReportProperties struct { // READ-ONLY; Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other // comparison operators can be used as described for DateTime properties in - // https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators + // https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators StartTime *string // READ-ONLY; Represents the Storage Account Id where the storage task definition was applied and executed. @@ -3172,6 +3371,12 @@ type TrackedResource struct { // TriggerParameters - The trigger parameters update for the storage task assignment execution type TriggerParameters struct { + // CONSTANT; Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; + // this property should not be present when ExecutionTrigger.properties.type is + // 'RunOnce' + // Field has constant value "Days", any specified value is ignored. + IntervalUnit *string + // When to end task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property // should not be present when ExecutionTrigger.properties.type is 'RunOnce' EndBy *time.Time @@ -3180,11 +3385,6 @@ type TriggerParameters struct { // should not be present when ExecutionTrigger.properties.type is 'RunOnce' Interval *int32 - // Run interval unit of task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this - // property should not be present when ExecutionTrigger.properties.type is - // 'RunOnce' - IntervalUnit *string - // When to start task execution. This is a required field when ExecutionTrigger.properties.type is 'OnSchedule'; this property // should not be present when ExecutionTrigger.properties.type is 'RunOnce' StartFrom *time.Time @@ -3196,6 +3396,12 @@ type TriggerParameters struct { // TriggerParametersUpdate - The trigger parameters update for the storage task assignment execution type TriggerParametersUpdate struct { + // CONSTANT; Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; + // this property should not be present when ExecutionTrigger.properties.type is + // 'RunOnce' + // Field has constant value "Days", any specified value is ignored. + IntervalUnit *string + // When to end task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property // should not be present when ExecutionTrigger.properties.type is 'RunOnce' EndBy *time.Time @@ -3204,11 +3410,6 @@ type TriggerParametersUpdate struct { // should not be present when ExecutionTrigger.properties.type is 'RunOnce' Interval *int32 - // Run interval unit of task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this - // property should not be present when ExecutionTrigger.properties.type is - // 'RunOnce' - IntervalUnit *string - // When to start task execution. This is a mutable field when ExecutionTrigger.properties.type is 'OnSchedule'; this property // should not be present when ExecutionTrigger.properties.type is 'RunOnce' StartFrom *time.Time @@ -3293,12 +3494,13 @@ type UserAssignedIdentity struct { // VirtualNetworkRule - Virtual Network rule. type VirtualNetworkRule struct { + // CONSTANT; The action of virtual network rule. + // Field has constant value "Allow", any specified value is ignored. + Action *string + // REQUIRED; Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. VirtualNetworkResourceID *string - // The action of virtual network rule. - Action *string - // Gets the state of virtual network rule. State *State } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go index ac6d6f1801..3840973eea 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/models_serde.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -308,6 +305,45 @@ func (a *AccountKey) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AccountLimits. +func (a AccountLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxFileShares", a.MaxFileShares) + populate(objectMap, "maxProvisionedBandwidthMiBPerSec", a.MaxProvisionedBandwidthMiBPerSec) + populate(objectMap, "maxProvisionedIOPS", a.MaxProvisionedIOPS) + populate(objectMap, "maxProvisionedStorageGiB", a.MaxProvisionedStorageGiB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountLimits. +func (a *AccountLimits) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxFileShares": + err = unpopulate(val, "MaxFileShares", &a.MaxFileShares) + delete(rawMsg, key) + case "maxProvisionedBandwidthMiBPerSec": + err = unpopulate(val, "MaxProvisionedBandwidthMiBPerSec", &a.MaxProvisionedBandwidthMiBPerSec) + delete(rawMsg, key) + case "maxProvisionedIOPS": + err = unpopulate(val, "MaxProvisionedIOPS", &a.MaxProvisionedIOPS) + delete(rawMsg, key) + case "maxProvisionedStorageGiB": + err = unpopulate(val, "MaxProvisionedStorageGiB", &a.MaxProvisionedStorageGiB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AccountListKeysResult. func (a AccountListKeysResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1072,6 +1108,76 @@ func (a *AccountUpdateParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AccountUsage. +func (a AccountUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "liveShares", a.LiveShares) + populate(objectMap, "softDeletedShares", a.SoftDeletedShares) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUsage. +func (a *AccountUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "liveShares": + err = unpopulate(val, "LiveShares", &a.LiveShares) + delete(rawMsg, key) + case "softDeletedShares": + err = unpopulate(val, "SoftDeletedShares", &a.SoftDeletedShares) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountUsageElements. +func (a AccountUsageElements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fileShareCount", a.FileShareCount) + populate(objectMap, "provisionedBandwidthMiBPerSec", a.ProvisionedBandwidthMiBPerSec) + populate(objectMap, "provisionedIOPS", a.ProvisionedIOPS) + populate(objectMap, "provisionedStorageGiB", a.ProvisionedStorageGiB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountUsageElements. +func (a *AccountUsageElements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "fileShareCount": + err = unpopulate(val, "FileShareCount", &a.FileShareCount) + delete(rawMsg, key) + case "provisionedBandwidthMiBPerSec": + err = unpopulate(val, "ProvisionedBandwidthMiBPerSec", &a.ProvisionedBandwidthMiBPerSec) + delete(rawMsg, key) + case "provisionedIOPS": + err = unpopulate(val, "ProvisionedIOPS", &a.ProvisionedIOPS) + delete(rawMsg, key) + case "provisionedStorageGiB": + err = unpopulate(val, "ProvisionedStorageGiB", &a.ProvisionedStorageGiB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ActiveDirectoryProperties. func (a ActiveDirectoryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1747,6 +1853,41 @@ func (b *BlobServicePropertiesProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BurstingConstants. +func (b BurstingConstants) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "burstFloorIOPS", b.BurstFloorIOPS) + populate(objectMap, "burstIOScalar", b.BurstIOScalar) + populate(objectMap, "burstTimeframeSeconds", b.BurstTimeframeSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BurstingConstants. +func (b *BurstingConstants) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "burstFloorIOPS": + err = unpopulate(val, "BurstFloorIOPS", &b.BurstFloorIOPS) + delete(rawMsg, key) + case "burstIOScalar": + err = unpopulate(val, "BurstIOScalar", &b.BurstIOScalar) + delete(rawMsg, key) + case "burstTimeframeSeconds": + err = unpopulate(val, "BurstTimeframeSeconds", &b.BurstTimeframeSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ChangeFeed. func (c ChangeFeed) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3036,6 +3177,119 @@ func (f *FileServicePropertiesProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FileServiceUsage. +func (f FileServiceUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsage. +func (f *FileServiceUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileServiceUsageProperties. +func (f FileServiceUsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "burstingConstants", f.BurstingConstants) + populate(objectMap, "fileShareLimits", f.FileShareLimits) + populate(objectMap, "fileShareRecommendations", f.FileShareRecommendations) + populate(objectMap, "storageAccountLimits", f.StorageAccountLimits) + populate(objectMap, "storageAccountUsage", f.StorageAccountUsage) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsageProperties. +func (f *FileServiceUsageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "burstingConstants": + err = unpopulate(val, "BurstingConstants", &f.BurstingConstants) + delete(rawMsg, key) + case "fileShareLimits": + err = unpopulate(val, "FileShareLimits", &f.FileShareLimits) + delete(rawMsg, key) + case "fileShareRecommendations": + err = unpopulate(val, "FileShareRecommendations", &f.FileShareRecommendations) + delete(rawMsg, key) + case "storageAccountLimits": + err = unpopulate(val, "StorageAccountLimits", &f.StorageAccountLimits) + delete(rawMsg, key) + case "storageAccountUsage": + err = unpopulate(val, "StorageAccountUsage", &f.StorageAccountUsage) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileServiceUsages. +func (f FileServiceUsages) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileServiceUsages. +func (f *FileServiceUsages) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FileShare. func (f FileShare) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3153,6 +3407,53 @@ func (f *FileShareItems) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FileShareLimits. +func (f FileShareLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxProvisionedBandwidthMiBPerSec", f.MaxProvisionedBandwidthMiBPerSec) + populate(objectMap, "maxProvisionedIOPS", f.MaxProvisionedIOPS) + populate(objectMap, "maxProvisionedStorageGiB", f.MaxProvisionedStorageGiB) + populate(objectMap, "minProvisionedBandwidthMiBPerSec", f.MinProvisionedBandwidthMiBPerSec) + populate(objectMap, "minProvisionedIOPS", f.MinProvisionedIOPS) + populate(objectMap, "minProvisionedStorageGiB", f.MinProvisionedStorageGiB) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareLimits. +func (f *FileShareLimits) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maxProvisionedBandwidthMiBPerSec": + err = unpopulate(val, "MaxProvisionedBandwidthMiBPerSec", &f.MaxProvisionedBandwidthMiBPerSec) + delete(rawMsg, key) + case "maxProvisionedIOPS": + err = unpopulate(val, "MaxProvisionedIOPS", &f.MaxProvisionedIOPS) + delete(rawMsg, key) + case "maxProvisionedStorageGiB": + err = unpopulate(val, "MaxProvisionedStorageGiB", &f.MaxProvisionedStorageGiB) + delete(rawMsg, key) + case "minProvisionedBandwidthMiBPerSec": + err = unpopulate(val, "MinProvisionedBandwidthMiBPerSec", &f.MinProvisionedBandwidthMiBPerSec) + delete(rawMsg, key) + case "minProvisionedIOPS": + err = unpopulate(val, "MinProvisionedIOPS", &f.MinProvisionedIOPS) + delete(rawMsg, key) + case "minProvisionedStorageGiB": + err = unpopulate(val, "MinProvisionedStorageGiB", &f.MinProvisionedStorageGiB) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type FileShareProperties. func (f FileShareProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3162,11 +3463,19 @@ func (f FileShareProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "deleted", f.Deleted) populateDateTimeRFC3339(objectMap, "deletedTime", f.DeletedTime) populate(objectMap, "enabledProtocols", f.EnabledProtocols) + populate(objectMap, "fileSharePaidBursting", f.FileSharePaidBursting) + populate(objectMap, "includedBurstIops", f.IncludedBurstIops) populateDateTimeRFC3339(objectMap, "lastModifiedTime", f.LastModifiedTime) populate(objectMap, "leaseDuration", f.LeaseDuration) populate(objectMap, "leaseState", f.LeaseState) populate(objectMap, "leaseStatus", f.LeaseStatus) + populate(objectMap, "maxBurstCreditsForIops", f.MaxBurstCreditsForIops) populate(objectMap, "metadata", f.Metadata) + populateDateTimeRFC1123(objectMap, "nextAllowedProvisionedBandwidthDowngradeTime", f.NextAllowedProvisionedBandwidthDowngradeTime) + populateDateTimeRFC1123(objectMap, "nextAllowedProvisionedIopsDowngradeTime", f.NextAllowedProvisionedIopsDowngradeTime) + populateDateTimeRFC1123(objectMap, "nextAllowedQuotaDowngradeTime", f.NextAllowedQuotaDowngradeTime) + populate(objectMap, "provisionedBandwidthMibps", f.ProvisionedBandwidthMibps) + populate(objectMap, "provisionedIops", f.ProvisionedIops) populate(objectMap, "remainingRetentionDays", f.RemainingRetentionDays) populate(objectMap, "rootSquash", f.RootSquash) populate(objectMap, "shareQuota", f.ShareQuota) @@ -3204,6 +3513,12 @@ func (f *FileShareProperties) UnmarshalJSON(data []byte) error { case "enabledProtocols": err = unpopulate(val, "EnabledProtocols", &f.EnabledProtocols) delete(rawMsg, key) + case "fileSharePaidBursting": + err = unpopulate(val, "FileSharePaidBursting", &f.FileSharePaidBursting) + delete(rawMsg, key) + case "includedBurstIops": + err = unpopulate(val, "IncludedBurstIops", &f.IncludedBurstIops) + delete(rawMsg, key) case "lastModifiedTime": err = unpopulateDateTimeRFC3339(val, "LastModifiedTime", &f.LastModifiedTime) delete(rawMsg, key) @@ -3216,9 +3531,27 @@ func (f *FileShareProperties) UnmarshalJSON(data []byte) error { case "leaseStatus": err = unpopulate(val, "LeaseStatus", &f.LeaseStatus) delete(rawMsg, key) + case "maxBurstCreditsForIops": + err = unpopulate(val, "MaxBurstCreditsForIops", &f.MaxBurstCreditsForIops) + delete(rawMsg, key) case "metadata": err = unpopulate(val, "Metadata", &f.Metadata) delete(rawMsg, key) + case "nextAllowedProvisionedBandwidthDowngradeTime": + err = unpopulateDateTimeRFC1123(val, "NextAllowedProvisionedBandwidthDowngradeTime", &f.NextAllowedProvisionedBandwidthDowngradeTime) + delete(rawMsg, key) + case "nextAllowedProvisionedIopsDowngradeTime": + err = unpopulateDateTimeRFC1123(val, "NextAllowedProvisionedIopsDowngradeTime", &f.NextAllowedProvisionedIopsDowngradeTime) + delete(rawMsg, key) + case "nextAllowedQuotaDowngradeTime": + err = unpopulateDateTimeRFC1123(val, "NextAllowedQuotaDowngradeTime", &f.NextAllowedQuotaDowngradeTime) + delete(rawMsg, key) + case "provisionedBandwidthMibps": + err = unpopulate(val, "ProvisionedBandwidthMibps", &f.ProvisionedBandwidthMibps) + delete(rawMsg, key) + case "provisionedIops": + err = unpopulate(val, "ProvisionedIops", &f.ProvisionedIops) + delete(rawMsg, key) case "remainingRetentionDays": err = unpopulate(val, "RemainingRetentionDays", &f.RemainingRetentionDays) delete(rawMsg, key) @@ -3248,6 +3581,80 @@ func (f *FileShareProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FileSharePropertiesFileSharePaidBursting. +func (f FileSharePropertiesFileSharePaidBursting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "paidBurstingEnabled", f.PaidBurstingEnabled) + populate(objectMap, "paidBurstingMaxBandwidthMibps", f.PaidBurstingMaxBandwidthMibps) + populate(objectMap, "paidBurstingMaxIops", f.PaidBurstingMaxIops) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileSharePropertiesFileSharePaidBursting. +func (f *FileSharePropertiesFileSharePaidBursting) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "paidBurstingEnabled": + err = unpopulate(val, "PaidBurstingEnabled", &f.PaidBurstingEnabled) + delete(rawMsg, key) + case "paidBurstingMaxBandwidthMibps": + err = unpopulate(val, "PaidBurstingMaxBandwidthMibps", &f.PaidBurstingMaxBandwidthMibps) + delete(rawMsg, key) + case "paidBurstingMaxIops": + err = unpopulate(val, "PaidBurstingMaxIops", &f.PaidBurstingMaxIops) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileShareRecommendations. +func (f FileShareRecommendations) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bandwidthScalar", f.BandwidthScalar) + populate(objectMap, "baseBandwidthMiBPerSec", f.BaseBandwidthMiBPerSec) + populate(objectMap, "baseIOPS", f.BaseIOPS) + populate(objectMap, "ioScalar", f.IoScalar) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileShareRecommendations. +func (f *FileShareRecommendations) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bandwidthScalar": + err = unpopulate(val, "BandwidthScalar", &f.BandwidthScalar) + delete(rawMsg, key) + case "baseBandwidthMiBPerSec": + err = unpopulate(val, "BaseBandwidthMiBPerSec", &f.BaseBandwidthMiBPerSec) + delete(rawMsg, key) + case "baseIOPS": + err = unpopulate(val, "BaseIOPS", &f.BaseIOPS) + delete(rawMsg, key) + case "ioScalar": + err = unpopulate(val, "IoScalar", &f.IoScalar) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GeoReplicationStats. func (g GeoReplicationStats) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5378,6 +5785,7 @@ func (o ObjectReplicationPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "destinationAccount", o.DestinationAccount) populateDateTimeRFC3339(objectMap, "enabledTime", o.EnabledTime) + populate(objectMap, "metrics", o.Metrics) populate(objectMap, "policyId", o.PolicyID) populate(objectMap, "rules", o.Rules) populate(objectMap, "sourceAccount", o.SourceAccount) @@ -5399,6 +5807,9 @@ func (o *ObjectReplicationPolicyProperties) UnmarshalJSON(data []byte) error { case "enabledTime": err = unpopulateDateTimeRFC3339(val, "EnabledTime", &o.EnabledTime) delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &o.Metrics) + delete(rawMsg, key) case "policyId": err = unpopulate(val, "PolicyID", &o.PolicyID) delete(rawMsg, key) @@ -5416,6 +5827,33 @@ func (o *ObjectReplicationPolicyProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyPropertiesMetrics. +func (o ObjectReplicationPolicyPropertiesMetrics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", o.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ObjectReplicationPolicyPropertiesMetrics. +func (o *ObjectReplicationPolicyPropertiesMetrics) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &o.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ObjectReplicationPolicyRule. func (o ObjectReplicationPolicyRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/networksecurityperimeterconfigurations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/networksecurityperimeterconfigurations_client.go index 63c1116b44..b4773da4f8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/networksecurityperimeterconfigurations_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/networksecurityperimeterconfigurations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, cred // Get - Gets effective NetworkSecurityPerimeterConfiguration for association // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -76,7 +73,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) Get(ctx context.Cont } // getCreateRequest creates the Get request. -func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -99,7 +96,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,7 +113,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(re // NewListPager - Gets list of effective NetworkSecurityPerimeterConfiguration for storage account // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -147,7 +144,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) NewListPager(resourc } // listCreateRequest creates the List request. -func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *NetworkSecurityPerimeterConfigurationsClientListOptions) (*policy.Request, error) { +func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *NetworkSecurityPerimeterConfigurationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -166,7 +163,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +181,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listHandleResponse(r // BeginReconcile - Refreshes any information about the association. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -212,7 +209,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx c // Reconcile - Refreshes any information about the association. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) { var err error const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile" @@ -235,7 +232,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx contex } // reconcileCreateRequest creates the Reconcile request. -func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) { +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, accountName string, networkSecurityPerimeterConfigurationName string, _ *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -258,7 +255,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go index 2cf592f475..c10b4c2a0e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/objectreplicationpolicies_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewObjectReplicationPoliciesClient(subscriptionID string, credential azcore // CreateOrUpdate - Create or update the object replication policy of the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -79,7 +76,7 @@ func (client *ObjectReplicationPoliciesClient) CreateOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, options *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, properties ObjectReplicationPolicy, _ *ObjectReplicationPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -102,7 +99,7 @@ func (client *ObjectReplicationPoliciesClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { @@ -123,7 +120,7 @@ func (client *ObjectReplicationPoliciesClient) createOrUpdateHandleResponse(resp // Delete - Deletes the object replication policy associated with the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -154,7 +151,7 @@ func (client *ObjectReplicationPoliciesClient) Delete(ctx context.Context, resou } // deleteCreateRequest creates the Delete request. -func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientDeleteOptions) (*policy.Request, error) { +func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, _ *ObjectReplicationPoliciesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -177,7 +174,7 @@ func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +183,7 @@ func (client *ObjectReplicationPoliciesClient) deleteCreateRequest(ctx context.C // Get - Get the object replication policy of the storage account by policy ID. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -218,7 +215,7 @@ func (client *ObjectReplicationPoliciesClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, options *ObjectReplicationPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, objectReplicationPolicyID string, _ *ObjectReplicationPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -241,7 +238,7 @@ func (client *ObjectReplicationPoliciesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +255,7 @@ func (client *ObjectReplicationPoliciesClient) getHandleResponse(resp *http.Resp // NewListPager - List the object replication policies associated with the storage account. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -289,7 +286,7 @@ func (client *ObjectReplicationPoliciesClient) NewListPager(resourceGroupName st } // listCreateRequest creates the List request. -func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *ObjectReplicationPoliciesClientListOptions) (*policy.Request, error) { +func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *ObjectReplicationPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -308,7 +305,7 @@ func (client *ObjectReplicationPoliciesClient) listCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go index 8ceebe5de3..93d7185dcd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/operations_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Storage Rest API operations. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -66,14 +63,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Storage/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go index fec991677c..b0cbc5b2ee 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/options.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -11,20 +8,20 @@ package armstorage // AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginAbortHierarchicalNamespaceMigration // method. type AccountsClientBeginAbortHierarchicalNamespaceMigrationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method. type AccountsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AccountsClientBeginCustomerInitiatedMigrationOptions contains the optional parameters for the AccountsClient.BeginCustomerInitiatedMigration // method. type AccountsClientBeginCustomerInitiatedMigrationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -34,21 +31,21 @@ type AccountsClientBeginFailoverOptions struct { // value to Planned. FailoverType *string - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AccountsClientBeginHierarchicalNamespaceMigrationOptions contains the optional parameters for the AccountsClient.BeginHierarchicalNamespaceMigration // method. type AccountsClientBeginHierarchicalNamespaceMigrationOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AccountsClientBeginRestoreBlobRangesOptions contains the optional parameters for the AccountsClient.BeginRestoreBlobRanges // method. type AccountsClientBeginRestoreBlobRangesOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -122,7 +119,7 @@ type AccountsClientUpdateOptions struct { // BlobContainersClientBeginObjectLevelWormOptions contains the optional parameters for the BlobContainersClient.BeginObjectLevelWorm // method. type BlobContainersClientBeginObjectLevelWormOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -140,9 +137,9 @@ type BlobContainersClientCreateOptions struct { // BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.CreateOrUpdateImmutabilityPolicy // method. type BlobContainersClientCreateOrUpdateImmutabilityPolicyOptions struct { - // The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation - // only if the immutability policy already exists. If omitted, this operation will - // always be applied. + // The entity state (ETag) version of the immutability policy to update must be returned to the server for all update operations. + // The ETag value must include the leading and trailing double quotes as + // returned by the service. IfMatch *string // The ImmutabilityPolicy Properties that will be created or updated to a blob container. @@ -170,9 +167,9 @@ type BlobContainersClientExtendImmutabilityPolicyOptions struct { // BlobContainersClientGetImmutabilityPolicyOptions contains the optional parameters for the BlobContainersClient.GetImmutabilityPolicy // method. type BlobContainersClientGetImmutabilityPolicyOptions struct { - // The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation - // only if the immutability policy already exists. If omitted, this operation will - // always be applied. + // The entity state (ETag) version of the immutability policy to update must be returned to the server for all update operations. + // The ETag value must include the leading and trailing double quotes as + // returned by the service. IfMatch *string } @@ -297,11 +294,23 @@ type FileServicesClientGetServicePropertiesOptions struct { // placeholder for future optional parameters } +// FileServicesClientGetServiceUsageOptions contains the optional parameters for the FileServicesClient.GetServiceUsage method. +type FileServicesClientGetServiceUsageOptions struct { + // placeholder for future optional parameters +} + // FileServicesClientListOptions contains the optional parameters for the FileServicesClient.List method. type FileServicesClientListOptions struct { // placeholder for future optional parameters } +// FileServicesClientListServiceUsagesOptions contains the optional parameters for the FileServicesClient.NewListServiceUsagesPager +// method. +type FileServicesClientListServiceUsagesOptions struct { + // Optional, specifies the maximum number of file service usages to be included in the list response. + Maxpagesize *int32 +} + // FileServicesClientSetServicePropertiesOptions contains the optional parameters for the FileServicesClient.SetServiceProperties // method. type FileServicesClientSetServicePropertiesOptions struct { @@ -427,7 +436,7 @@ type ManagementPoliciesClientGetOptions struct { // NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile // method. type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -601,8 +610,7 @@ type TableServicesClientSetServicePropertiesOptions struct { // method. type TaskAssignmentInstancesReportClientListOptions struct { // Optional. When specified, it can be used to query using reporting properties. See Constructing Filter Strings - // [https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for - // details. + // [https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for details. Filter *string // Optional, specifies the maximum number of storage task assignment instances to be included in the list response. @@ -611,19 +619,19 @@ type TaskAssignmentInstancesReportClientListOptions struct { // TaskAssignmentsClientBeginCreateOptions contains the optional parameters for the TaskAssignmentsClient.BeginCreate method. type TaskAssignmentsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // TaskAssignmentsClientBeginDeleteOptions contains the optional parameters for the TaskAssignmentsClient.BeginDelete method. type TaskAssignmentsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // TaskAssignmentsClientBeginUpdateOptions contains the optional parameters for the TaskAssignmentsClient.BeginUpdate method. type TaskAssignmentsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -642,8 +650,7 @@ type TaskAssignmentsClientListOptions struct { // method. type TaskAssignmentsInstancesReportClientListOptions struct { // Optional. When specified, it can be used to query using reporting properties. See Constructing Filter Strings - // [https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for - // details. + // [https://learn.microsoft.com/rest/api/storageservices/querying-tables-and-entities#constructing-filter-strings] for details. Filter *string // Optional, specifies the maximum number of storage task assignment instances to be included in the list response. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go index d55e9f5e3b..f64ed68841 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privateendpointconnections_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // Delete - Deletes the specified private endpoint connection associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -75,7 +72,7 @@ func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -98,7 +95,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,7 +104,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -137,7 +134,7 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -160,7 +157,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -177,7 +174,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - List all the private endpoint connections associated with the storage account. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -208,7 +205,7 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s } // listCreateRequest creates the List request. -func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -227,7 +224,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,7 +242,7 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // Put - Update the state of specified private endpoint connection associated with the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -276,7 +273,7 @@ func (client *PrivateEndpointConnectionsClient) Put(ctx context.Context, resourc } // putCreateRequest creates the Put request. -func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientPutOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientPutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -299,7 +296,7 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go index aa95c50474..bd1a24c775 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/privatelinkresources_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // ListByStorageAccount - Gets the private link resources that need to be created for a storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -75,7 +72,7 @@ func (client *PrivateLinkResourcesClient) ListByStorageAccount(ctx context.Conte } // listByStorageAccountCreateRequest creates the ListByStorageAccount request. -func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListByStorageAccountOptions) (*policy.Request, error) { +func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *PrivateLinkResourcesClientListByStorageAccountOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -94,7 +91,7 @@ func (client *PrivateLinkResourcesClient) listByStorageAccountCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go index ce3553b8e0..d1b4ed83f4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queue_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewQueueClient(subscriptionID string, credential azcore.TokenCredential, op // Create - Creates a new queue with the specified queue name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -78,7 +75,7 @@ func (client *QueueClient) Create(ctx context.Context, resourceGroupName string, } // createCreateRequest creates the Create request. -func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientCreateOptions) (*policy.Request, error) { +func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, _ *QueueClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -101,7 +98,7 @@ func (client *QueueClient) createCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, queue); err != nil { @@ -122,7 +119,7 @@ func (client *QueueClient) createHandleResponse(resp *http.Response) (QueueClien // Delete - Deletes the queue with the specified queue name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -152,7 +149,7 @@ func (client *QueueClient) Delete(ctx context.Context, resourceGroupName string, } // deleteCreateRequest creates the Delete request. -func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientDeleteOptions) (*policy.Request, error) { +func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, _ *QueueClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -175,7 +172,7 @@ func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +181,7 @@ func (client *QueueClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the queue with the specified queue name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -215,7 +212,7 @@ func (client *QueueClient) Get(ctx context.Context, resourceGroupName string, ac } // getCreateRequest creates the Get request. -func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, options *QueueClientGetOptions) (*policy.Request, error) { +func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, _ *QueueClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -238,7 +235,7 @@ func (client *QueueClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +252,7 @@ func (client *QueueClient) getHandleResponse(resp *http.Response) (QueueClientGe // NewListPager - Gets a list of all the queues under the specified storage account // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -309,7 +306,7 @@ func (client *QueueClient) listCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", *options.Maxpagesize) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +324,7 @@ func (client *QueueClient) listHandleResponse(resp *http.Response) (QueueClientL // Update - Creates a new queue with the specified queue name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -359,7 +356,7 @@ func (client *QueueClient) Update(ctx context.Context, resourceGroupName string, } // updateCreateRequest creates the Update request. -func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, options *QueueClientUpdateOptions) (*policy.Request, error) { +func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue, _ *QueueClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -382,7 +379,7 @@ func (client *QueueClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, queue); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go index 8d8cbc88ea..72c431c6b3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/queueservices_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewQueueServicesClient(subscriptionID string, credential azcore.TokenCreden // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -76,7 +73,7 @@ func (client *QueueServicesClient) GetServiceProperties(ctx context.Context, res } // getServicePropertiesCreateRequest creates the GetServiceProperties request. -func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientGetServicePropertiesOptions) (*policy.Request, error) { +func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *QueueServicesClientGetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -96,7 +93,7 @@ func (client *QueueServicesClient) getServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +111,7 @@ func (client *QueueServicesClient) getServicePropertiesHandleResponse(resp *http // List - List all queue services for the storage account // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -142,7 +139,7 @@ func (client *QueueServicesClient) List(ctx context.Context, resourceGroupName s } // listCreateRequest creates the List request. -func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *QueueServicesClientListOptions) (*policy.Request, error) { +func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *QueueServicesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -161,7 +158,7 @@ func (client *QueueServicesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +177,7 @@ func (client *QueueServicesClient) listHandleResponse(resp *http.Response) (Queu // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -211,7 +208,7 @@ func (client *QueueServicesClient) SetServiceProperties(ctx context.Context, res } // setServicePropertiesCreateRequest creates the SetServiceProperties request. -func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, options *QueueServicesClientSetServicePropertiesOptions) (*policy.Request, error) { +func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties, _ *QueueServicesClientSetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -231,7 +228,7 @@ func (client *QueueServicesClient) setServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/responses.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/responses.go index e014af80f8..a7f6f5c99a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/responses.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/responses.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -290,11 +287,23 @@ type FileServicesClientGetServicePropertiesResponse struct { FileServiceProperties } +// FileServicesClientGetServiceUsageResponse contains the response from method FileServicesClient.GetServiceUsage. +type FileServicesClientGetServiceUsageResponse struct { + // The usage of file service in storage account. + FileServiceUsage +} + // FileServicesClientListResponse contains the response from method FileServicesClient.List. type FileServicesClientListResponse struct { FileServiceItems } +// FileServicesClientListServiceUsagesResponse contains the response from method FileServicesClient.NewListServiceUsagesPager. +type FileServicesClientListServiceUsagesResponse struct { + // List file service usages schema. + FileServiceUsages +} + // FileServicesClientSetServicePropertiesResponse contains the response from method FileServicesClient.SetServiceProperties. type FileServicesClientSetServicePropertiesResponse struct { // The properties of File services in storage account. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go index ff08406f10..f6404ce165 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/skus_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // NewListPager - Lists the available SKUs supported by Microsoft.Storage for given subscription. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ @@ -72,7 +69,7 @@ func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime. } // listCreateRequest creates the List request. -func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsClientListOptions) (*policy.Request, error) { +func (client *SKUsClient) listCreateRequest(ctx context.Context, _ *SKUsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -83,7 +80,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go index e21c38e41b..0dc4d6100a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/table_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewTableClient(subscriptionID string, credential azcore.TokenCredential, op // Create - Creates a new table with the specified table name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -99,7 +96,7 @@ func (client *TableClient) createCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -123,7 +120,7 @@ func (client *TableClient) createHandleResponse(resp *http.Response) (TableClien // Delete - Deletes the table with the specified table name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -152,7 +149,7 @@ func (client *TableClient) Delete(ctx context.Context, resourceGroupName string, } // deleteCreateRequest creates the Delete request. -func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientDeleteOptions) (*policy.Request, error) { +func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, _ *TableClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -175,7 +172,7 @@ func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +181,7 @@ func (client *TableClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the table with the specified table name, under the specified account if it exists. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -214,7 +211,7 @@ func (client *TableClient) Get(ctx context.Context, resourceGroupName string, ac } // getCreateRequest creates the Get request. -func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableClientGetOptions) (*policy.Request, error) { +func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, _ *TableClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -237,7 +234,7 @@ func (client *TableClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +251,7 @@ func (client *TableClient) getHandleResponse(resp *http.Response) (TableClientGe // NewListPager - Gets a list of all the tables under the specified storage account // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -283,7 +280,7 @@ func (client *TableClient) NewListPager(resourceGroupName string, accountName st } // listCreateRequest creates the List request. -func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableClientListOptions) (*policy.Request, error) { +func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -302,7 +299,7 @@ func (client *TableClient) listCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -320,7 +317,7 @@ func (client *TableClient) listHandleResponse(resp *http.Response) (TableClientL // Update - Creates a new table with the specified table name, under the specified account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -373,7 +370,7 @@ func (client *TableClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go index eba9a122a7..2905d91105 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/tableservices_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewTableServicesClient(subscriptionID string, credential azcore.TokenCreden // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -76,7 +73,7 @@ func (client *TableServicesClient) GetServiceProperties(ctx context.Context, res } // getServicePropertiesCreateRequest creates the GetServiceProperties request. -func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientGetServicePropertiesOptions) (*policy.Request, error) { +func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableServicesClientGetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -96,7 +93,7 @@ func (client *TableServicesClient) getServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +111,7 @@ func (client *TableServicesClient) getServicePropertiesHandleResponse(resp *http // List - List all table services for the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -142,7 +139,7 @@ func (client *TableServicesClient) List(ctx context.Context, resourceGroupName s } // listCreateRequest creates the List request. -func (client *TableServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *TableServicesClientListOptions) (*policy.Request, error) { +func (client *TableServicesClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, _ *TableServicesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -161,7 +158,7 @@ func (client *TableServicesClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +177,7 @@ func (client *TableServicesClient) listHandleResponse(resp *http.Response) (Tabl // and CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -211,7 +208,7 @@ func (client *TableServicesClient) SetServiceProperties(ctx context.Context, res } // setServicePropertiesCreateRequest creates the SetServiceProperties request. -func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, options *TableServicesClientSetServicePropertiesOptions) (*policy.Request, error) { +func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties, _ *TableServicesClientSetServicePropertiesOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -231,7 +228,7 @@ func (client *TableServicesClient) setServicePropertiesCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentinstancesreport_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentinstancesreport_client.go index d5c0a50e73..19bc76fae5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentinstancesreport_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentinstancesreport_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewTaskAssignmentInstancesReportClient(subscriptionID string, credential az // NewListPager - Fetch the report summary of a single storage task assignment's instances // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -107,7 +104,7 @@ func (client *TaskAssignmentInstancesReportClient) listCreateRequest(ctx context if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10)) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignments_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignments_client.go index 8312677be8..37db3de44f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignments_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignments_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -51,7 +48,7 @@ func NewTaskAssignmentsClient(subscriptionID string, credential azcore.TokenCred // set of properties, the request will succeed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -85,7 +82,7 @@ func (client *TaskAssignmentsClient) BeginCreate(ctx context.Context, resourceGr // set of properties, the request will succeed. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *TaskAssignmentsClient) create(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, options *TaskAssignmentsClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "TaskAssignmentsClient.BeginCreate" @@ -108,7 +105,7 @@ func (client *TaskAssignmentsClient) create(ctx context.Context, resourceGroupNa } // createCreateRequest creates the Create request. -func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, options *TaskAssignmentsClientBeginCreateOptions) (*policy.Request, error) { +func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignment, _ *TaskAssignmentsClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -131,7 +128,7 @@ func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -143,7 +140,7 @@ func (client *TaskAssignmentsClient) createCreateRequest(ctx context.Context, re // BeginDelete - Delete the storage task assignment sub-resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -172,7 +169,7 @@ func (client *TaskAssignmentsClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete the storage task assignment sub-resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *TaskAssignmentsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "TaskAssignmentsClient.BeginDelete" @@ -195,7 +192,7 @@ func (client *TaskAssignmentsClient) deleteOperation(ctx context.Context, resour } // deleteCreateRequest creates the Delete request. -func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, _ *TaskAssignmentsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -218,7 +215,7 @@ func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,7 +224,7 @@ func (client *TaskAssignmentsClient) deleteCreateRequest(ctx context.Context, re // Get - Get the storage task assignment properties // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -257,7 +254,7 @@ func (client *TaskAssignmentsClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *TaskAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, options *TaskAssignmentsClientGetOptions) (*policy.Request, error) { +func (client *TaskAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, _ *TaskAssignmentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -280,7 +277,7 @@ func (client *TaskAssignmentsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,7 +294,7 @@ func (client *TaskAssignmentsClient) getHandleResponse(resp *http.Response) (Tas // NewListPager - List all the storage task assignments in an account // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -349,7 +346,7 @@ func (client *TaskAssignmentsClient) listCreateRequest(ctx context.Context, reso if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10)) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,7 +364,7 @@ func (client *TaskAssignmentsClient) listHandleResponse(resp *http.Response) (Ta // BeginUpdate - Update storage task assignment properties // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -397,7 +394,7 @@ func (client *TaskAssignmentsClient) BeginUpdate(ctx context.Context, resourceGr // Update - Update storage task assignment properties // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 func (client *TaskAssignmentsClient) update(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, options *TaskAssignmentsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "TaskAssignmentsClient.BeginUpdate" @@ -420,7 +417,7 @@ func (client *TaskAssignmentsClient) update(ctx context.Context, resourceGroupNa } // updateCreateRequest creates the Update request. -func (client *TaskAssignmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, options *TaskAssignmentsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *TaskAssignmentsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, accountName string, storageTaskAssignmentName string, parameters TaskAssignmentUpdateParameters, _ *TaskAssignmentsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/storageTaskAssignments/{storageTaskAssignmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -443,7 +440,7 @@ func (client *TaskAssignmentsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentsinstancesreport_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentsinstancesreport_client.go index 28473744f1..f0600dbee2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentsinstancesreport_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/taskassignmentsinstancesreport_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewTaskAssignmentsInstancesReportClient(subscriptionID string, credential a // NewListPager - Fetch the report summary of all the storage task assignments and instances in an account // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - accountName - The name of the storage account within the specified resource group. Storage account names must be between // 3 and 24 characters in length and use numbers and lower-case letters only. @@ -101,7 +98,7 @@ func (client *TaskAssignmentsInstancesReportClient) listCreateRequest(ctx contex if options != nil && options.Maxpagesize != nil { reqQP.Set("$maxpagesize", strconv.FormatInt(int64(*options.Maxpagesize), 10)) } - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc1123.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc1123.go new file mode 100644 index 0000000000..dad32f06c5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc1123.go @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armstorage + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "strings" + "time" +) + +const ( + dateTimeRFC1123JSON = `"` + time.RFC1123 + `"` +) + +type dateTimeRFC1123 time.Time + +func (t dateTimeRFC1123) MarshalJSON() ([]byte, error) { + b := []byte(time.Time(t).Format(dateTimeRFC1123JSON)) + return b, nil +} + +func (t dateTimeRFC1123) MarshalText() ([]byte, error) { + b := []byte(time.Time(t).Format(time.RFC1123)) + return b, nil +} + +func (t *dateTimeRFC1123) UnmarshalJSON(data []byte) error { + p, err := time.Parse(dateTimeRFC1123JSON, strings.ToUpper(string(data))) + *t = dateTimeRFC1123(p) + return err +} + +func (t *dateTimeRFC1123) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } + p, err := time.Parse(time.RFC1123, string(data)) + *t = dateTimeRFC1123(p) + return err +} + +func (t dateTimeRFC1123) String() string { + return time.Time(t).Format(time.RFC1123) +} + +func populateDateTimeRFC1123(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC1123)(t) +} + +func unpopulateDateTimeRFC1123(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC1123 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go index 14fb2098b5..f13e107256 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/time_rfc3339.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go index e00dba24d5..a37623746b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/usages_client.go @@ -1,6 +1,3 @@ -//go:build go1.18 -// +build go1.18 - // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. @@ -45,7 +42,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListByLocationPager - Gets the current usage count and the limit for the resources of the location under the subscription. // -// Generated from API version 2023-05-01 +// Generated from API version 2024-01-01 // - location - The location of the Azure Storage resource. // - options - UsagesClientListByLocationOptions contains the optional parameters for the UsagesClient.NewListByLocationPager // method. @@ -74,7 +71,7 @@ func (client *UsagesClient) NewListByLocationPager(location string, options *Usa } // listByLocationCreateRequest creates the ListByLocation request. -func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, location string, options *UsagesClientListByLocationOptions) (*policy.Request, error) { +func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, location string, _ *UsagesClientListByLocationOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -89,7 +86,7 @@ func (client *UsagesClient) listByLocationCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2024-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md index 324c8ed0e4..0056d11241 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/CHANGELOG.md @@ -1,5 +1,58 @@ # Release History +## 1.6.1 (2025-04-16) + +### Bugs Fixed +* Fixed return value of DownloadBuffer when the HTTPRange count given is greater than the data length. Fixes [#23884](https://github.com/Azure/azure-sdk-for-go/issues/23884) + +### Other Changes +* Updated `azidentity` version to `1.9.0` +* Updated `azcore` version to `1.18.0` + +## 1.6.1-beta.1 (2025-02-12) + +### Features Added +* Upgraded service version to `2025-05-05`. + +## 1.6.0 (2025-01-23) + +### Features Added +* Upgraded service version to `2025-01-05`. + +## 1.6.0-beta.1 (2025-01-13) + +### Features Added +* Added permissions & resourcetype parameters in listblob response. +* Added BlobProperties field in BlobPrefix definition in listblob response. + +### Bugs Fixed +* Fix FilterBlob API if Query contains a space character. Fixes [#23546](https://github.com/Azure/azure-sdk-for-go/issues/23546) + +## 1.5.0 (2024-11-13) + +### Features Added +* Fix compareHeaders custom sorting algorithm for String To Sign. + +## 1.5.0-beta.1 (2024-10-22) + +### Other Changes +* Updated `azcore` version to `1.16.0` +* Updated `azidentity` version to `1.8.0` + +## 1.4.1 (2024-09-18) + +### Features Added +* Added crc64 response header to Put Blob. +* Upgraded service version to `2024-08-04`. + +## 1.4.1-beta.1 (2024-08-27) + +### Features Added +* Upgraded service version to `2024-08-04`. + +### Other Changes +* Updated `azcore` version to `1.14.0` + ## 1.4.0 (2024-07-18) ### Other Changes diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/README.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/README.md index e71157a197..9fbc90d60d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/README.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/README.md @@ -22,7 +22,7 @@ Key links: ### Prerequisites -- Go, version 1.18 or higher - [Install Go](https://go.dev/doc/install) +- [Supported](https://aka.ms/azsdk/go/supported-versions) version of Go - [Install Go](https://go.dev/doc/install) - Azure subscription - [Create a free account](https://azure.microsoft.com/free/) - Azure storage account - To create a storage account, use tools including the [Azure portal][storage_account_create_portal], [Azure PowerShell][storage_account_create_ps], or the [Azure CLI][storage_account_create_cli]. @@ -249,7 +249,7 @@ For more information see the [Code of Conduct FAQ][coc_faq] or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-go%2Fsdk%2Fstorage%2Fazblob%2FREADME.png) + [source]: https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/storage/azblob diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/assets.json b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/assets.json index 83e35475c9..11b07dbbc6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/assets.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/storage/azblob", - "Tag": "go/storage/azblob_bbf7a929e3" + "Tag": "go/storage/azblob_db9a368fe4" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/client.go index ec6907fbdc..98a624f505 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob/client.go @@ -11,6 +11,7 @@ import ( "io" "os" "sync" + "sync/atomic" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" @@ -334,7 +335,8 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl if o.BlockSize == 0 { o.BlockSize = DefaultDownloadBlockSize } - + dataDownloaded := int64(0) + computeReadLength := true count := o.Range.Count if count == CountToEnd { // If size not specified, calculate it // If we don't have the length at all, get it @@ -343,6 +345,8 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl return 0, err } count = *gr.ContentLength - o.Range.Offset + dataDownloaded = count + computeReadLength = false } if count <= 0 { @@ -387,6 +391,9 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl if err != nil { return err } + if computeReadLength { + atomic.AddInt64(&dataDownloaded, *dr.ContentLength) + } err = body.Close() return err }, @@ -394,7 +401,7 @@ func (b *Client) downloadBuffer(ctx context.Context, writer io.WriterAt, o downl if err != nil { return 0, err } - return count, nil + return dataDownloaded, nil } // DownloadStream reads a range of bytes from a blob. The response also includes the blob's properties and metadata. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/client.go index c511d8a79f..f36a162476 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/client.go @@ -95,7 +95,7 @@ func (c *Client) ServiceClient() *service.Client { } // CreateContainer is a lifecycle method to creates a new container under the specified account. -// If the container with the same name already exists, a ResourceExistsError will be raised. +// If the container with the same name already exists, a ContainerAlreadyExists Error will be raised. // This method returns a client with which to interact with the newly created container. func (c *Client) CreateContainer(ctx context.Context, containerName string, o *CreateContainerOptions) (CreateContainerResponse, error) { return c.svc.CreateContainer(ctx, containerName, o) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container/models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container/models.go index 61d936ab73..ccee90dbc5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/container/models.go @@ -7,10 +7,11 @@ package container import ( - "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob" "reflect" "time" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob" + "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported" "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated" ) @@ -126,7 +127,7 @@ func (o *GetPropertiesOptions) format() (*generated.ContainerClientGetProperties // ListBlobsInclude indicates what additional information the service should return with each blob. type ListBlobsInclude struct { - Copy, Metadata, Snapshots, UncommittedBlobs, Deleted, Tags, Versions, LegalHold, ImmutabilityPolicy, DeletedWithVersions bool + Copy, Metadata, Snapshots, UncommittedBlobs, Deleted, Tags, Versions, LegalHold, ImmutabilityPolicy, DeletedWithVersions, Permissions bool } func (l ListBlobsInclude) format() []generated.ListBlobsIncludeItem { @@ -166,7 +167,9 @@ func (l ListBlobsInclude) format() []generated.ListBlobsIncludeItem { if l.Versions { include = append(include, generated.ListBlobsIncludeItemVersions) } - + if l.Permissions { + include = append(include, generated.ListBlobsIncludeItemPermissions) + } return include } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go index adf46b0681..b0be323b7b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/shared_key_credential.go @@ -109,6 +109,91 @@ func getHeader(key string, headers map[string][]string) string { return "" } +func getWeightTables() [][]int { + tableLv0 := [...]int{ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x71c, 0x0, 0x71f, 0x721, 0x723, 0x725, + 0x0, 0x0, 0x0, 0x72d, 0x803, 0x0, 0x0, 0x733, 0x0, 0xd03, 0xd1a, 0xd1c, 0xd1e, + 0xd20, 0xd22, 0xd24, 0xd26, 0xd28, 0xd2a, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, + 0xe70, 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, + 0x0, 0x0, 0x0, 0x743, 0x744, 0x748, 0xe02, 0xe09, 0xe0a, 0xe1a, 0xe21, 0xe23, 0xe25, + 0xe2c, 0xe32, 0xe35, 0xe36, 0xe48, 0xe51, 0xe70, 0xe7c, 0xe7e, 0xe89, 0xe8a, 0xe91, 0xe99, + 0xe9f, 0xea2, 0xea4, 0xea6, 0xea7, 0xea9, 0x0, 0x74c, 0x0, 0x750, 0x0, + } + tableLv2 := [...]int{ + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8012, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8212, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, + } + tables := [][]int{tableLv0[:], tableLv2[:]} + return tables +} + +// NewHeaderStringComparer performs a multi-level, weight-based comparison of two strings +func compareHeaders(lhs, rhs string, tables [][]int) int { + currLevel, i, j := 0, 0, 0 + n := len(tables) + lhsLen := len(lhs) + rhsLen := len(rhs) + + for currLevel < n { + if currLevel == (n-1) && i != j { + if i > j { + return -1 + } + if i < j { + return 1 + } + return 0 + } + + var w1, w2 int + + // Check bounds before accessing lhs[i] + if i < lhsLen { + w1 = tables[currLevel][lhs[i]] + } else { + w1 = 0x1 + } + + // Check bounds before accessing rhs[j] + if j < rhsLen { + w2 = tables[currLevel][rhs[j]] + } else { + w2 = 0x1 + } + + if w1 == 0x1 && w2 == 0x1 { + i = 0 + j = 0 + currLevel++ + } else if w1 == w2 { + i++ + j++ + } else if w1 == 0 { + i++ + } else if w2 == 0 { + j++ + } else { + if w1 < w2 { + return -1 + } + if w1 > w2 { + return 1 + } + return 0 + } + } + return 0 +} + func (c *SharedKeyCredential) buildCanonicalizedHeader(headers http.Header) string { cm := map[string][]string{} for k, v := range headers { @@ -125,7 +210,11 @@ func (c *SharedKeyCredential) buildCanonicalizedHeader(headers http.Header) stri for key := range cm { keys = append(keys, key) } - sort.Strings(keys) + tables := getWeightTables() + // Sort the keys using the custom comparator + sort.Slice(keys, func(i, j int) bool { + return compareHeaders(keys[i], keys[j], tables) < 0 + }) ch := bytes.NewBufferString("") for i, key := range keys { if i > 0 { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go index b3059f6e1f..a18d0c670d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/exported/version.go @@ -8,5 +8,5 @@ package exported const ( ModuleName = "github.com/Azure/azure-sdk-for-go/sdk/storage/azblob" - ModuleVersion = "v1.4.0" + ModuleVersion = "v1.6.1" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md index 9714432c2f..96d47c4adf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/autorest.md @@ -7,7 +7,7 @@ go: true clear-output-folder: false version: "^3.0.0" license-header: MICROSOFT_MIT_NO_VERSION -input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/a32d0b2423d19835246bb2ef92941503bfd5e734/specification/storage/data-plane/Microsoft.BlobStorage/preview/2021-12-02/blob.json" +input-file: "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/ae95eb6a4701d844bada7d1c4f5ecf4a7444e5b8/specification/storage/data-plane/Microsoft.BlobStorage/stable/2025-01-05/blob.json" credential-scope: "https://storage.azure.com/.default" output-folder: ../generated file-prefix: "zz_" @@ -22,7 +22,52 @@ export-clients: true use: "@autorest/go@4.0.0-preview.65" ``` -### Updating service version to 2024-05-04 +### Add a Properties field to the BlobPrefix definition +```yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + $.BlobPrefix.properties["Properties"] = { + "type": "object", + "$ref": "#/definitions/BlobPropertiesInternal" + }; +``` + +### Add Owner,Group,Permissions,Acl,ResourceType in ListBlob Response +``` yaml +directive: +- from: swagger-document + where: $.definitions + transform: > + $.BlobPropertiesInternal.properties["Owner"] = { + "type" : "string", + }; + $.BlobPropertiesInternal.properties["Group"] = { + "type" : "string", + }; + $.BlobPropertiesInternal.properties["Permissions"] = { + "type" : "string", + }; + $.BlobPropertiesInternal.properties["Acl"] = { + "type" : "string", + }; + $.BlobPropertiesInternal.properties["ResourceType"] = { + "type" : "string", + }; + +``` + +### Add permissions in ListBlobsInclude +``` yaml +directive: +- from: swagger-document + where: $.parameters.ListBlobsInclude + transform: > + $.items.enum.push("permissions"); +``` + +### Updating service version to 2025-05-05 ```yaml directive: - from: @@ -35,8 +80,21 @@ directive: where: $ transform: >- return $. - replaceAll(`[]string{"2021-12-02"}`, `[]string{ServiceVersion}`). - replaceAll(`2021-12-02`, `2024-05-04`); + replaceAll(`[]string{"2025-01-05"}`, `[]string{ServiceVersion}`); +``` + +### Fix CRC Response Header in PutBlob response +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?BlockBlob"].put.responses["201"].headers + transform: > + $["x-ms-content-crc64"] = { + "x-ms-client-name": "ContentCRC64", + "type": "string", + "format": "byte", + "description": "Returned for a block blob so that the client can check the integrity of message content." + }; ``` ### Undo breaking change with BlobName @@ -364,11 +422,13 @@ directive: ``` yaml directive: - - from: zz_service_client.go - where: $ - transform: >- - return $. - replace(/req.Raw\(\).URL.RawQuery \= reqQP.Encode\(\)/, `req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1)`) +- from: + - zz_service_client.go + - zz_container_client.go + where: $ + transform: >- + return $. + replace(/req.Raw\(\).URL.RawQuery \= reqQP.Encode\(\)/g, `req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1)`); ``` ### Change `where` parameter in blob filtering to be required diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go index 1c2a036807..553cd227ef 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/constants.go @@ -6,4 +6,4 @@ package generated -const ServiceVersion = "2024-05-04" +const ServiceVersion = "2025-05-05" diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go index 8b24ee0898..9f9e145b58 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_appendblob_client.go @@ -29,7 +29,7 @@ type AppendBlobClient struct { // AppendBlob. Append Block is supported only on version 2015-02-21 version or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - body - Initial data // - options - AppendBlobClientAppendBlockOptions contains the optional parameters for the AppendBlobClient.AppendBlock method. @@ -116,6 +116,12 @@ func (client *AppendBlobClient) appendBlockCreateRequest(ctx context.Context, co if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } + if options != nil && options.StructuredBodyType != nil { + req.Raw().Header["x-ms-structured-body"] = []string{*options.StructuredBodyType} + } + if options != nil && options.StructuredContentLength != nil { + req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)} + } req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err @@ -187,6 +193,9 @@ func (client *AppendBlobClient) appendBlockHandleResponse(resp *http.Response) ( if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } + if val := resp.Header.Get("x-ms-structured-body"); val != "" { + result.StructuredBodyType = &val + } if val := resp.Header.Get("x-ms-version"); val != "" { result.Version = &val } @@ -198,7 +207,7 @@ func (client *AppendBlobClient) appendBlockHandleResponse(resp *http.Response) ( // created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - sourceURL - Specify a URL to the copy source. // - contentLength - The length of the request. // - options - AppendBlobClientAppendBlockFromURLOptions contains the optional parameters for the AppendBlobClient.AppendBlockFromURL @@ -384,7 +393,7 @@ func (client *AppendBlobClient) appendBlockFromURLHandleResponse(resp *http.Resp // Create - The Create Append Blob operation creates a new append blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - options - AppendBlobClientCreateOptions contains the optional parameters for the AppendBlobClient.Create method. // - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method. @@ -557,7 +566,7 @@ func (client *AppendBlobClient) createHandleResponse(resp *http.Response) (Appen // or later. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - AppendBlobClientSealOptions contains the optional parameters for the AppendBlobClient.Seal method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go index f30b81b970..54b2999894 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blob_client.go @@ -29,7 +29,7 @@ type BlobClient struct { // blob with zero length and full metadata. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - copyID - The copy identifier provided in the x-ms-copy-id header of the original Copy Blob operation. // - options - BlobClientAbortCopyFromURLOptions contains the optional parameters for the BlobClient.AbortCopyFromURL method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -101,7 +101,7 @@ func (client *BlobClient) abortCopyFromURLHandleResponse(resp *http.Response) (B // AcquireLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -203,7 +203,7 @@ func (client *BlobClient) acquireLeaseHandleResponse(resp *http.Response) (BlobC // BreakLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientBreakLeaseOptions contains the optional parameters for the BlobClient.BreakLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. func (client *BlobClient) BreakLease(ctx context.Context, options *BlobClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (BlobClientBreakLeaseResponse, error) { @@ -306,7 +306,7 @@ func (client *BlobClient) breakLeaseHandleResponse(resp *http.Response) (BlobCli // ChangeLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - leaseID - Specifies the current lease ID on the resource. // - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed // lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID @@ -408,7 +408,7 @@ func (client *BlobClient) changeLeaseHandleResponse(resp *http.Response) (BlobCl // until the copy is complete. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -582,7 +582,7 @@ func (client *BlobClient) copyFromURLHandleResponse(resp *http.Response) (BlobCl // CreateSnapshot - The Create Snapshot operation creates a read-only snapshot of a blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientCreateSnapshotOptions contains the optional parameters for the BlobClient.CreateSnapshot method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. // - CPKScopeInfo - CPKScopeInfo contains a group of parameters for the BlobClient.SetMetadata method. @@ -721,7 +721,7 @@ func (client *BlobClient) createSnapshotHandleResponse(resp *http.Response) (Blo // return an HTTP status code of 404 (ResourceNotFound). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientDeleteOptions contains the optional parameters for the BlobClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -817,7 +817,7 @@ func (client *BlobClient) deleteHandleResponse(resp *http.Response) (BlobClientD // DeleteImmutabilityPolicy - The Delete Immutability Policy operation deletes the immutability policy on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientDeleteImmutabilityPolicyOptions contains the optional parameters for the BlobClient.DeleteImmutabilityPolicy // method. func (client *BlobClient) DeleteImmutabilityPolicy(ctx context.Context, options *BlobClientDeleteImmutabilityPolicyOptions) (BlobClientDeleteImmutabilityPolicyResponse, error) { @@ -846,9 +846,15 @@ func (client *BlobClient) deleteImmutabilityPolicyCreateRequest(ctx context.Cont } reqQP := req.Raw().URL.Query() reqQP.Set("comp", "immutabilityPolicies") + if options != nil && options.Snapshot != nil { + reqQP.Set("snapshot", *options.Snapshot) + } if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } + if options != nil && options.VersionID != nil { + reqQP.Set("versionid", *options.VersionID) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { @@ -884,7 +890,7 @@ func (client *BlobClient) deleteImmutabilityPolicyHandleResponse(resp *http.Resp // can also call Download to read a snapshot. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientDownloadOptions contains the optional parameters for the BlobClient.Download method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -965,6 +971,9 @@ func (client *BlobClient) downloadCreateRequest(ctx context.Context, options *Bl if options != nil && options.RangeGetContentMD5 != nil { req.Raw().Header["x-ms-range-get-content-md5"] = []string{strconv.FormatBool(*options.RangeGetContentMD5)} } + if options != nil && options.StructuredBodyType != nil { + req.Raw().Header["x-ms-structured-body"] = []string{*options.StructuredBodyType} + } req.Raw().Header["x-ms-version"] = []string{ServiceVersion} return req, nil } @@ -1173,6 +1182,16 @@ func (client *BlobClient) downloadHandleResponse(resp *http.Response) (BlobClien if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } + if val := resp.Header.Get("x-ms-structured-body"); val != "" { + result.StructuredBodyType = &val + } + if val := resp.Header.Get("x-ms-structured-content-length"); val != "" { + structuredContentLength, err := strconv.ParseInt(val, 10, 64) + if err != nil { + return BlobClientDownloadResponse{}, err + } + result.StructuredContentLength = &structuredContentLength + } if val := resp.Header.Get("x-ms-tag-count"); val != "" { tagCount, err := strconv.ParseInt(val, 10, 64) if err != nil { @@ -1192,7 +1211,7 @@ func (client *BlobClient) downloadHandleResponse(resp *http.Response) (BlobClien // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientGetAccountInfoOptions contains the optional parameters for the BlobClient.GetAccountInfo method. func (client *BlobClient) GetAccountInfo(ctx context.Context, options *BlobClientGetAccountInfoOptions) (BlobClientGetAccountInfoResponse, error) { var err error @@ -1221,8 +1240,14 @@ func (client *BlobClient) getAccountInfoCreateRequest(ctx context.Context, optio reqQP := req.Raw().URL.Query() reqQP.Set("comp", "properties") reqQP.Set("restype", "account") + if options != nil && options.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/xml"} + if options != nil && options.RequestID != nil { + req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} + } req.Raw().Header["x-ms-version"] = []string{ServiceVersion} return req, nil } @@ -1243,6 +1268,13 @@ func (client *BlobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo } result.Date = &date } + if val := resp.Header.Get("x-ms-is-hns-enabled"); val != "" { + isHierarchicalNamespaceEnabled, err := strconv.ParseBool(val) + if err != nil { + return BlobClientGetAccountInfoResponse{}, err + } + result.IsHierarchicalNamespaceEnabled = &isHierarchicalNamespaceEnabled + } if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } @@ -1259,7 +1291,7 @@ func (client *BlobClient) getAccountInfoHandleResponse(resp *http.Response) (Blo // for the blob. It does not return the content of the blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientGetPropertiesOptions contains the optional parameters for the BlobClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -1577,7 +1609,7 @@ func (client *BlobClient) getPropertiesHandleResponse(resp *http.Response) (Blob // GetTags - The Get Tags operation enables users to get the tags associated with a blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientGetTagsOptions contains the optional parameters for the BlobClient.GetTags method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -1659,7 +1691,7 @@ func (client *BlobClient) getTagsHandleResponse(resp *http.Response) (BlobClient // Query - The Query operation enables users to select/project on blob data by providing simple query expressions. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientQueryOptions contains the optional parameters for the BlobClient.Query method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -1893,7 +1925,7 @@ func (client *BlobClient) queryHandleResponse(resp *http.Response) (BlobClientQu // ReleaseLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - leaseID - Specifies the current lease ID on the resource. // - options - BlobClientReleaseLeaseOptions contains the optional parameters for the BlobClient.ReleaseLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1987,7 +2019,7 @@ func (client *BlobClient) releaseLeaseHandleResponse(resp *http.Response) (BlobC // RenewLease - [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete operations // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - leaseID - Specifies the current lease ID on the resource. // - options - BlobClientRenewLeaseOptions contains the optional parameters for the BlobClient.RenewLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2084,7 +2116,7 @@ func (client *BlobClient) renewLeaseHandleResponse(resp *http.Response) (BlobCli // SetExpiry - Sets the time a blob will expire and be deleted. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - expiryOptions - Required. Indicates mode of the expiry time // - options - BlobClientSetExpiryOptions contains the optional parameters for the BlobClient.SetExpiry method. func (client *BlobClient) SetExpiry(ctx context.Context, expiryOptions ExpiryOptions, options *BlobClientSetExpiryOptions) (BlobClientSetExpiryResponse, error) { @@ -2164,7 +2196,7 @@ func (client *BlobClient) setExpiryHandleResponse(resp *http.Response) (BlobClie // SetHTTPHeaders - The Set HTTP Headers operation sets system properties on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientSetHTTPHeadersOptions contains the optional parameters for the BlobClient.SetHTTPHeaders method. // - BlobHTTPHeaders - BlobHTTPHeaders contains a group of parameters for the BlobClient.SetHTTPHeaders method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -2285,7 +2317,7 @@ func (client *BlobClient) setHTTPHeadersHandleResponse(resp *http.Response) (Blo // SetImmutabilityPolicy - The Set Immutability Policy operation sets the immutability policy on the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientSetImmutabilityPolicyOptions contains the optional parameters for the BlobClient.SetImmutabilityPolicy // method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2315,9 +2347,15 @@ func (client *BlobClient) setImmutabilityPolicyCreateRequest(ctx context.Context } reqQP := req.Raw().URL.Query() reqQP.Set("comp", "immutabilityPolicies") + if options != nil && options.Snapshot != nil { + reqQP.Set("snapshot", *options.Snapshot) + } if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } + if options != nil && options.VersionID != nil { + reqQP.Set("versionid", *options.VersionID) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfUnmodifiedSince != nil { @@ -2371,7 +2409,7 @@ func (client *BlobClient) setImmutabilityPolicyHandleResponse(resp *http.Respons // SetLegalHold - The Set Legal Hold operation sets a legal hold on the blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - legalHold - Specified if a legal hold should be set on the blob. // - options - BlobClientSetLegalHoldOptions contains the optional parameters for the BlobClient.SetLegalHold method. func (client *BlobClient) SetLegalHold(ctx context.Context, legalHold bool, options *BlobClientSetLegalHoldOptions) (BlobClientSetLegalHoldResponse, error) { @@ -2400,9 +2438,15 @@ func (client *BlobClient) setLegalHoldCreateRequest(ctx context.Context, legalHo } reqQP := req.Raw().URL.Query() reqQP.Set("comp", "legalhold") + if options != nil && options.Snapshot != nil { + reqQP.Set("snapshot", *options.Snapshot) + } if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } + if options != nil && options.VersionID != nil { + reqQP.Set("versionid", *options.VersionID) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { @@ -2446,7 +2490,7 @@ func (client *BlobClient) setLegalHoldHandleResponse(resp *http.Response) (BlobC // pairs // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientSetMetadataOptions contains the optional parameters for the BlobClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - CPKInfo - CPKInfo contains a group of parameters for the BlobClient.Download method. @@ -2578,7 +2622,7 @@ func (client *BlobClient) setMetadataHandleResponse(resp *http.Response) (BlobCl // SetTags - The Set Tags operation enables users to set tags on a blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - tags - Blob tags // - options - BlobClientSetTagsOptions contains the optional parameters for the BlobClient.SetTags method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -2667,7 +2711,7 @@ func (client *BlobClient) setTagsHandleResponse(resp *http.Response) (BlobClient // storage type. This operation does not update the blob's ETag. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - tier - Indicates the tier to be set on the blob. // - options - BlobClientSetTierOptions contains the optional parameters for the BlobClient.SetTier method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -2744,7 +2788,7 @@ func (client *BlobClient) setTierHandleResponse(resp *http.Response) (BlobClient // StartCopyFromURL - The Start Copy From URL operation copies a blob or an internet resource to a new blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -2896,7 +2940,7 @@ func (client *BlobClient) startCopyFromURLHandleResponse(resp *http.Response) (B // Undelete - Undelete a blob that was previously soft deleted // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - BlobClientUndeleteOptions contains the optional parameters for the BlobClient.Undelete method. func (client *BlobClient) Undelete(ctx context.Context, options *BlobClientUndeleteOptions) (BlobClientUndeleteResponse, error) { var err error diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go index fe4909d73c..324db7651d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_blockblob_client.go @@ -33,7 +33,7 @@ type BlockBlobClient struct { // belong to. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - blocks - Blob Blocks. // - options - BlockBlobClientCommitBlockListOptions contains the optional parameters for the BlockBlobClient.CommitBlockList // method. @@ -224,7 +224,7 @@ func (client *BlockBlobClient) commitBlockListHandleResponse(resp *http.Response // GetBlockList - The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - listType - Specifies whether to return the list of committed blocks, the list of uncommitted blocks, or both lists together. // - options - BlockBlobClientGetBlockListOptions contains the optional parameters for the BlockBlobClient.GetBlockList method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -329,7 +329,7 @@ func (client *BlockBlobClient) getBlockListHandleResponse(resp *http.Response) ( // Block from URL API in conjunction with Put Block List. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request @@ -532,7 +532,7 @@ func (client *BlockBlobClient) putBlobFromURLHandleResponse(resp *http.Response) // StageBlock - The Stage Block operation creates a new block to be committed as part of a blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal // to 64 bytes in size. For a given blob, the length of the value specified for the blockid // parameter must be the same size for each block. @@ -599,6 +599,12 @@ func (client *BlockBlobClient) stageBlockCreateRequest(ctx context.Context, bloc if leaseAccessConditions != nil && leaseAccessConditions.LeaseID != nil { req.Raw().Header["x-ms-lease-id"] = []string{*leaseAccessConditions.LeaseID} } + if options != nil && options.StructuredBodyType != nil { + req.Raw().Header["x-ms-structured-body"] = []string{*options.StructuredBodyType} + } + if options != nil && options.StructuredContentLength != nil { + req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)} + } req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err @@ -649,6 +655,9 @@ func (client *BlockBlobClient) stageBlockHandleResponse(resp *http.Response) (Bl if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } + if val := resp.Header.Get("x-ms-structured-body"); val != "" { + result.StructuredBodyType = &val + } if val := resp.Header.Get("x-ms-version"); val != "" { result.Version = &val } @@ -659,7 +668,7 @@ func (client *BlockBlobClient) stageBlockHandleResponse(resp *http.Response) (Bl // are read from a URL. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - blockID - A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal // to 64 bytes in size. For a given blob, the length of the value specified for the blockid // parameter must be the same size for each block. @@ -807,7 +816,7 @@ func (client *BlockBlobClient) stageBlockFromURLHandleResponse(resp *http.Respon // the content of a block blob, use the Put Block List operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - body - Initial data // - options - BlockBlobClientUploadOptions contains the optional parameters for the BlockBlobClient.Upload method. @@ -924,6 +933,12 @@ func (client *BlockBlobClient) uploadCreateRequest(ctx context.Context, contentL } } } + if options != nil && options.StructuredBodyType != nil { + req.Raw().Header["x-ms-structured-body"] = []string{*options.StructuredBodyType} + } + if options != nil && options.StructuredContentLength != nil { + req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)} + } if options != nil && options.BlobTagsString != nil { req.Raw().Header["x-ms-tags"] = []string{*options.BlobTagsString} } @@ -940,6 +955,13 @@ func (client *BlockBlobClient) uploadHandleResponse(resp *http.Response) (BlockB if val := resp.Header.Get("x-ms-client-request-id"); val != "" { result.ClientRequestID = &val } + if val := resp.Header.Get("x-ms-content-crc64"); val != "" { + contentCRC64, err := base64.StdEncoding.DecodeString(val) + if err != nil { + return BlockBlobClientUploadResponse{}, err + } + result.ContentCRC64 = contentCRC64 + } if val := resp.Header.Get("Content-MD5"); val != "" { contentMD5, err := base64.StdEncoding.DecodeString(val) if err != nil { @@ -980,6 +1002,9 @@ func (client *BlockBlobClient) uploadHandleResponse(resp *http.Response) (BlockB if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } + if val := resp.Header.Get("x-ms-structured-body"); val != "" { + result.StructuredBodyType = &val + } if val := resp.Header.Get("x-ms-version"); val != "" { result.Version = &val } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go index 768182775f..48724a4ce4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_constants.go @@ -343,6 +343,7 @@ const ( ListBlobsIncludeItemImmutabilitypolicy ListBlobsIncludeItem = "immutabilitypolicy" ListBlobsIncludeItemLegalhold ListBlobsIncludeItem = "legalhold" ListBlobsIncludeItemMetadata ListBlobsIncludeItem = "metadata" + ListBlobsIncludeItemPermissions ListBlobsIncludeItem = "permissions" ListBlobsIncludeItemSnapshots ListBlobsIncludeItem = "snapshots" ListBlobsIncludeItemTags ListBlobsIncludeItem = "tags" ListBlobsIncludeItemUncommittedblobs ListBlobsIncludeItem = "uncommittedblobs" @@ -358,6 +359,7 @@ func PossibleListBlobsIncludeItemValues() []ListBlobsIncludeItem { ListBlobsIncludeItemImmutabilitypolicy, ListBlobsIncludeItemLegalhold, ListBlobsIncludeItemMetadata, + ListBlobsIncludeItemPermissions, ListBlobsIncludeItemSnapshots, ListBlobsIncludeItemTags, ListBlobsIncludeItemUncommittedblobs, @@ -520,6 +522,7 @@ const ( StorageErrorCodeAuthorizationResourceTypeMismatch StorageErrorCode = "AuthorizationResourceTypeMismatch" StorageErrorCodeAuthorizationServiceMismatch StorageErrorCode = "AuthorizationServiceMismatch" StorageErrorCodeAuthorizationSourceIPMismatch StorageErrorCode = "AuthorizationSourceIPMismatch" + StorageErrorCodeBlobAccessTierNotSupportedForAccountType StorageErrorCode = "BlobAccessTierNotSupportedForAccountType" StorageErrorCodeBlobAlreadyExists StorageErrorCode = "BlobAlreadyExists" StorageErrorCodeBlobArchived StorageErrorCode = "BlobArchived" StorageErrorCodeBlobBeingRehydrated StorageErrorCode = "BlobBeingRehydrated" @@ -638,6 +641,7 @@ func PossibleStorageErrorCodeValues() []StorageErrorCode { StorageErrorCodeAuthorizationResourceTypeMismatch, StorageErrorCodeAuthorizationServiceMismatch, StorageErrorCodeAuthorizationSourceIPMismatch, + StorageErrorCodeBlobAccessTierNotSupportedForAccountType, StorageErrorCodeBlobAlreadyExists, StorageErrorCodeBlobArchived, StorageErrorCodeBlobBeingRehydrated, diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go index 39958d9580..61ddc6695c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_container_client.go @@ -31,7 +31,7 @@ type ContainerClient struct { // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - duration - Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. A non-infinite // lease can be between 15 and 60 seconds. A lease duration cannot be changed using // renew or change. @@ -67,7 +67,7 @@ func (client *ContainerClient) acquireLeaseCreateRequest(ctx context.Context, du if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -126,7 +126,7 @@ func (client *ContainerClient) acquireLeaseHandleResponse(resp *http.Response) ( // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientBreakLeaseOptions contains the optional parameters for the ContainerClient.BreakLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. func (client *ContainerClient) BreakLease(ctx context.Context, options *ContainerClientBreakLeaseOptions, modifiedAccessConditions *ModifiedAccessConditions) (ContainerClientBreakLeaseResponse, error) { @@ -159,7 +159,7 @@ func (client *ContainerClient) breakLeaseCreateRequest(ctx context.Context, opti if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -222,7 +222,7 @@ func (client *ContainerClient) breakLeaseHandleResponse(resp *http.Response) (Co // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - leaseID - Specifies the current lease ID on the resource. // - proposedLeaseID - Proposed lease ID, in a GUID string format. The Blob service returns 400 (Invalid request) if the proposed // lease ID is not in the correct format. See Guid Constructor (String) for a list of valid GUID @@ -259,7 +259,7 @@ func (client *ContainerClient) changeLeaseCreateRequest(ctx context.Context, lea if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -316,7 +316,7 @@ func (client *ContainerClient) changeLeaseHandleResponse(resp *http.Response) (C // fails // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientCreateOptions contains the optional parameters for the ContainerClient.Create method. // - ContainerCPKScopeInfo - ContainerCPKScopeInfo contains a group of parameters for the ContainerClient.Create method. func (client *ContainerClient) Create(ctx context.Context, options *ContainerClientCreateOptions, containerCPKScopeInfo *ContainerCPKScopeInfo) (ContainerClientCreateResponse, error) { @@ -348,7 +348,7 @@ func (client *ContainerClient) createCreateRequest(ctx context.Context, options if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.Access != nil { req.Raw().Header["x-ms-blob-public-access"] = []string{string(*options.Access)} @@ -409,7 +409,7 @@ func (client *ContainerClient) createHandleResponse(resp *http.Response) (Contai // deleted during garbage collection // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientDeleteOptions contains the optional parameters for the ContainerClient.Delete method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -442,7 +442,7 @@ func (client *ContainerClient) deleteCreateRequest(ctx context.Context, options if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -486,7 +486,7 @@ func (client *ContainerClient) deleteHandleResponse(resp *http.Response) (Contai // Filter blobs searches within the given container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - where - Filters the results to return only to return only blobs whose tags match the specified expression. // - options - ContainerClientFilterBlobsOptions contains the optional parameters for the ContainerClient.FilterBlobs method. func (client *ContainerClient) FilterBlobs(ctx context.Context, where string, options *ContainerClientFilterBlobsOptions) (ContainerClientFilterBlobsResponse, error) { @@ -529,7 +529,7 @@ func (client *ContainerClient) filterBlobsCreateRequest(ctx context.Context, whe reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } reqQP.Set("where", where) - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -567,7 +567,7 @@ func (client *ContainerClient) filterBlobsHandleResponse(resp *http.Response) (C // be accessed publicly. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientGetAccessPolicyOptions contains the optional parameters for the ContainerClient.GetAccessPolicy // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -601,7 +601,7 @@ func (client *ContainerClient) getAccessPolicyCreateRequest(ctx context.Context, if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -654,7 +654,7 @@ func (client *ContainerClient) getAccessPolicyHandleResponse(resp *http.Response // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientGetAccountInfoOptions contains the optional parameters for the ContainerClient.GetAccountInfo // method. func (client *ContainerClient) GetAccountInfo(ctx context.Context, options *ContainerClientGetAccountInfoOptions) (ContainerClientGetAccountInfoResponse, error) { @@ -684,8 +684,14 @@ func (client *ContainerClient) getAccountInfoCreateRequest(ctx context.Context, reqQP := req.Raw().URL.Query() reqQP.Set("comp", "properties") reqQP.Set("restype", "account") - req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + } + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} + if options != nil && options.RequestID != nil { + req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} + } req.Raw().Header["x-ms-version"] = []string{ServiceVersion} return req, nil } @@ -706,6 +712,13 @@ func (client *ContainerClient) getAccountInfoHandleResponse(resp *http.Response) } result.Date = &date } + if val := resp.Header.Get("x-ms-is-hns-enabled"); val != "" { + isHierarchicalNamespaceEnabled, err := strconv.ParseBool(val) + if err != nil { + return ContainerClientGetAccountInfoResponse{}, err + } + result.IsHierarchicalNamespaceEnabled = &isHierarchicalNamespaceEnabled + } if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } @@ -722,7 +735,7 @@ func (client *ContainerClient) getAccountInfoHandleResponse(resp *http.Response) // does not include the container's list of blobs // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientGetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. func (client *ContainerClient) GetProperties(ctx context.Context, options *ContainerClientGetPropertiesOptions, leaseAccessConditions *LeaseAccessConditions) (ContainerClientGetPropertiesResponse, error) { @@ -754,7 +767,7 @@ func (client *ContainerClient) getPropertiesCreateRequest(ctx context.Context, o if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -851,7 +864,7 @@ func (client *ContainerClient) getPropertiesHandleResponse(resp *http.Response) // NewListBlobFlatSegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientListBlobFlatSegmentOptions contains the optional parameters for the ContainerClient.NewListBlobFlatSegmentPager // method. // @@ -879,7 +892,7 @@ func (client *ContainerClient) ListBlobFlatSegmentCreateRequest(ctx context.Cont if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -918,7 +931,7 @@ func (client *ContainerClient) ListBlobFlatSegmentHandleResponse(resp *http.Resp // NewListBlobHierarchySegmentPager - [Update] The List Blobs operation returns a list of the blobs under the specified container // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - delimiter - When the request includes this parameter, the operation returns a BlobPrefix element in the response body that // acts as a placeholder for all blobs whose names begin with the same substring up to the // appearance of the delimiter character. The delimiter may be a single character or a string. @@ -970,7 +983,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentCreateRequest(ctx context if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -1011,7 +1024,7 @@ func (client *ContainerClient) ListBlobHierarchySegmentHandleResponse(resp *http // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - leaseID - Specifies the current lease ID on the resource. // - options - ContainerClientReleaseLeaseOptions contains the optional parameters for the ContainerClient.ReleaseLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1045,7 +1058,7 @@ func (client *ContainerClient) releaseLeaseCreateRequest(ctx context.Context, le if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -1097,7 +1110,7 @@ func (client *ContainerClient) releaseLeaseHandleResponse(resp *http.Response) ( // Rename - Renames an existing container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - sourceContainerName - Required. Specifies the name of the container to rename. // - options - ContainerClientRenameOptions contains the optional parameters for the ContainerClient.Rename method. func (client *ContainerClient) Rename(ctx context.Context, sourceContainerName string, options *ContainerClientRenameOptions) (ContainerClientRenameResponse, error) { @@ -1130,7 +1143,7 @@ func (client *ContainerClient) renameCreateRequest(ctx context.Context, sourceCo if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -1169,7 +1182,7 @@ func (client *ContainerClient) renameHandleResponse(resp *http.Response) (Contai // to 60 seconds, or can be infinite // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - leaseID - Specifies the current lease ID on the resource. // - options - ContainerClientRenewLeaseOptions contains the optional parameters for the ContainerClient.RenewLease method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1203,7 +1216,7 @@ func (client *ContainerClient) renewLeaseCreateRequest(ctx context.Context, leas if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -1258,7 +1271,7 @@ func (client *ContainerClient) renewLeaseHandleResponse(resp *http.Response) (Co // Restore - Restores a previously-deleted container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientRestoreOptions contains the optional parameters for the ContainerClient.Restore method. func (client *ContainerClient) Restore(ctx context.Context, options *ContainerClientRestoreOptions) (ContainerClientRestoreResponse, error) { var err error @@ -1290,7 +1303,7 @@ func (client *ContainerClient) restoreCreateRequest(ctx context.Context, options if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -1331,7 +1344,7 @@ func (client *ContainerClient) restoreHandleResponse(resp *http.Response) (Conta // may be accessed publicly. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - containerACL - the acls for the container // - options - ContainerClientSetAccessPolicyOptions contains the optional parameters for the ContainerClient.SetAccessPolicy // method. @@ -1367,7 +1380,7 @@ func (client *ContainerClient) setAccessPolicyCreateRequest(ctx context.Context, if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -1430,7 +1443,7 @@ func (client *ContainerClient) setAccessPolicyHandleResponse(resp *http.Response // SetMetadata - operation sets one or more user-defined name-value pairs for the specified container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ContainerClientSetMetadataOptions contains the optional parameters for the ContainerClient.SetMetadata method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. // - ModifiedAccessConditions - ModifiedAccessConditions contains a group of parameters for the ContainerClient.Delete method. @@ -1464,7 +1477,7 @@ func (client *ContainerClient) setMetadataCreateRequest(ctx context.Context, opt if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if modifiedAccessConditions != nil && modifiedAccessConditions.IfModifiedSince != nil { req.Raw().Header["If-Modified-Since"] = []string{(*modifiedAccessConditions.IfModifiedSince).In(gmt).Format(time.RFC1123)} @@ -1521,7 +1534,7 @@ func (client *ContainerClient) setMetadataHandleResponse(resp *http.Response) (C // SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header // value: multipart/mixed; boundary=batch_ @@ -1557,7 +1570,7 @@ func (client *ContainerClient) submitBatchCreateRequest(ctx context.Context, con if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) runtime.SkipBodyDownload(req) req.Raw().Header["Accept"] = []string{"application/xml"} req.Raw().Header["Content-Length"] = []string{strconv.FormatInt(contentLength, 10)} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_models.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_models.go index 72e2ab2d8a..803b2858e8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_models.go @@ -86,6 +86,9 @@ type BlobName struct { type BlobPrefix struct { // REQUIRED Name *string `xml:"Name"` + + // Properties of a blob + Properties *BlobProperties `xml:"Properties"` } // BlobProperties - Properties of a blob @@ -95,6 +98,7 @@ type BlobProperties struct { // REQUIRED LastModified *time.Time `xml:"Last-Modified"` + ACL *string `xml:"Acl"` AccessTier *AccessTier `xml:"AccessTier"` AccessTierChangeTime *time.Time `xml:"AccessTierChangeTime"` AccessTierInferred *bool `xml:"AccessTierInferred"` @@ -124,6 +128,7 @@ type BlobProperties struct { // The name of the encryption scope under which the blob is encrypted. EncryptionScope *string `xml:"EncryptionScope"` ExpiresOn *time.Time `xml:"Expiry-Time"` + Group *string `xml:"Group"` ImmutabilityPolicyExpiresOn *time.Time `xml:"ImmutabilityPolicyUntilDate"` ImmutabilityPolicyMode *ImmutabilityPolicyMode `xml:"ImmutabilityPolicyMode"` IncrementalCopy *bool `xml:"IncrementalCopy"` @@ -133,11 +138,14 @@ type BlobProperties struct { LeaseState *LeaseStateType `xml:"LeaseState"` LeaseStatus *LeaseStatusType `xml:"LeaseStatus"` LegalHold *bool `xml:"LegalHold"` + Owner *string `xml:"Owner"` + Permissions *string `xml:"Permissions"` // If an object is in rehydrate pending state then this header is returned with priority of rehydrate. Valid values are High // and Standard. RehydratePriority *RehydratePriority `xml:"RehydratePriority"` RemainingRetentionDays *int32 `xml:"RemainingRetentionDays"` + ResourceType *string `xml:"ResourceType"` ServerEncrypted *bool `xml:"ServerEncrypted"` TagCount *int32 `xml:"TagCount"` } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go index 35a67a2791..01d1422d02 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_options.go @@ -43,6 +43,13 @@ type AppendBlobClientAppendBlockOptions struct { // analytics logging is enabled. RequestID *string + // Required if the request body is a structured message. Specifies the message schema version and properties. + StructuredBodyType *string + + // Required if the request body is a structured message. Specifies the length of the blob/file content inside the message + // body. Will always be smaller than Content-Length. + StructuredContentLength *int64 + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] Timeout *int32 @@ -236,9 +243,18 @@ type BlobClientDeleteImmutabilityPolicyOptions struct { // analytics logging is enabled. RequestID *string + // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more + // information on working with blob snapshots, see Creating a Snapshot of a Blob. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + Snapshot *string + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] Timeout *int32 + + // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. + // It's for service version 2019-10-10 and newer. + VersionID *string } // BlobClientDeleteOptions contains the optional parameters for the BlobClient.Delete method. @@ -291,6 +307,10 @@ type BlobClientDownloadOptions struct { // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] Snapshot *string + // Specifies the response content should be returned as a structured message and specifies the message schema version and + // properties. + StructuredBodyType *string + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] Timeout *int32 @@ -302,7 +322,13 @@ type BlobClientDownloadOptions struct { // BlobClientGetAccountInfoOptions contains the optional parameters for the BlobClient.GetAccountInfo method. type BlobClientGetAccountInfoOptions struct { - // placeholder for future optional parameters + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage + // analytics logging is enabled. + RequestID *string + + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + Timeout *int32 } // BlobClientGetPropertiesOptions contains the optional parameters for the BlobClient.GetProperties method. @@ -423,9 +449,18 @@ type BlobClientSetImmutabilityPolicyOptions struct { // analytics logging is enabled. RequestID *string + // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more + // information on working with blob snapshots, see Creating a Snapshot of a Blob. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + Snapshot *string + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] Timeout *int32 + + // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. + // It's for service version 2019-10-10 and newer. + VersionID *string } // BlobClientSetLegalHoldOptions contains the optional parameters for the BlobClient.SetLegalHold method. @@ -434,9 +469,18 @@ type BlobClientSetLegalHoldOptions struct { // analytics logging is enabled. RequestID *string + // The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve. For more + // information on working with blob snapshots, see Creating a Snapshot of a Blob. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob] + Snapshot *string + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] Timeout *int32 + + // The version id parameter is an opaque DateTime value that, when present, specifies the version of the blob to operate on. + // It's for service version 2019-10-10 and newer. + VersionID *string } // BlobClientSetMetadataOptions contains the optional parameters for the BlobClient.SetMetadata method. @@ -702,6 +746,13 @@ type BlockBlobClientStageBlockOptions struct { // analytics logging is enabled. RequestID *string + // Required if the request body is a structured message. Specifies the message schema version and properties. + StructuredBodyType *string + + // Required if the request body is a structured message. Specifies the length of the blob/file content inside the message + // body. Will always be smaller than Content-Length. + StructuredContentLength *int64 + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] Timeout *int32 @@ -739,6 +790,13 @@ type BlockBlobClientUploadOptions struct { // analytics logging is enabled. RequestID *string + // Required if the request body is a structured message. Specifies the message schema version and properties. + StructuredBodyType *string + + // Required if the request body is a structured message. Specifies the length of the blob/file content inside the message + // body. Will always be smaller than Content-Length. + StructuredContentLength *int64 + // Optional. Indicates the tier to be set on the blob. Tier *AccessTier @@ -873,7 +931,13 @@ type ContainerClientGetAccessPolicyOptions struct { // ContainerClientGetAccountInfoOptions contains the optional parameters for the ContainerClient.GetAccountInfo method. type ContainerClientGetAccountInfoOptions struct { - // placeholder for future optional parameters + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage + // analytics logging is enabled. + RequestID *string + + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + Timeout *int32 } // ContainerClientGetPropertiesOptions contains the optional parameters for the ContainerClient.GetProperties method. @@ -1304,6 +1368,13 @@ type PageBlobClientUploadPagesOptions struct { // analytics logging is enabled. RequestID *string + // Required if the request body is a structured message. Specifies the message schema version and properties. + StructuredBodyType *string + + // Required if the request body is a structured message. Specifies the length of the blob/file content inside the message + // body. Will always be smaller than Content-Length. + StructuredContentLength *int64 + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] Timeout *int32 @@ -1357,7 +1428,13 @@ type ServiceClientFilterBlobsOptions struct { // ServiceClientGetAccountInfoOptions contains the optional parameters for the ServiceClient.GetAccountInfo method. type ServiceClientGetAccountInfoOptions struct { - // placeholder for future optional parameters + // Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage + // analytics logging is enabled. + RequestID *string + + // The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + // [https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations] + Timeout *int32 } // ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go index dd040e48a2..8d8c953473 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_pageblob_client.go @@ -27,7 +27,7 @@ type PageBlobClient struct { // ClearPages - The Clear Pages operation clears a set of pages from a page blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - options - PageBlobClientClearPagesOptions contains the optional parameters for the PageBlobClient.ClearPages method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -178,7 +178,7 @@ func (client *PageBlobClient) clearPagesHandleResponse(resp *http.Response) (Pag // 2016-05-31. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - copySource - Specifies the name of the source page blob snapshot. This value is a URL of up to 2 KB in length that specifies // a page blob snapshot. The value should be URL-encoded as it would appear in a request // URI. The source blob must either be public or must be authenticated via a shared access signature. @@ -280,7 +280,7 @@ func (client *PageBlobClient) copyIncrementalHandleResponse(resp *http.Response) // Create - The Create operation creates a new page blob. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned // to a 512-byte boundary. @@ -461,7 +461,7 @@ func (client *PageBlobClient) createHandleResponse(resp *http.Response) (PageBlo // NewGetPageRangesPager - The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot // of a page blob // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - PageBlobClientGetPageRangesOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesPager // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -582,7 +582,7 @@ func (client *PageBlobClient) GetPageRangesHandleResponse(resp *http.Response) ( // NewGetPageRangesDiffPager - The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that // were changed between target blob and previous snapshot. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - PageBlobClientGetPageRangesDiffOptions contains the optional parameters for the PageBlobClient.NewGetPageRangesDiffPager // method. // - LeaseAccessConditions - LeaseAccessConditions contains a group of parameters for the ContainerClient.GetProperties method. @@ -709,7 +709,7 @@ func (client *PageBlobClient) GetPageRangesDiffHandleResponse(resp *http.Respons // Resize - Resize the Blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - blobContentLength - This header specifies the maximum size for the page blob, up to 1 TB. The page blob size must be aligned // to a 512-byte boundary. // - options - PageBlobClientResizeOptions contains the optional parameters for the PageBlobClient.Resize method. @@ -828,7 +828,7 @@ func (client *PageBlobClient) resizeHandleResponse(resp *http.Response) (PageBlo // UpdateSequenceNumber - Update the sequence number of the blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - sequenceNumberAction - Required if the x-ms-blob-sequence-number header is set for the request. This property applies to // page blobs only. This property indicates how the service should modify the blob's sequence number // - options - PageBlobClientUpdateSequenceNumberOptions contains the optional parameters for the PageBlobClient.UpdateSequenceNumber @@ -937,7 +937,7 @@ func (client *PageBlobClient) updateSequenceNumberHandleResponse(resp *http.Resp // UploadPages - The Upload Pages operation writes a range of pages to a page blob // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - body - Initial data // - options - PageBlobClientUploadPagesOptions contains the optional parameters for the PageBlobClient.UploadPages method. @@ -1031,6 +1031,12 @@ func (client *PageBlobClient) uploadPagesCreateRequest(ctx context.Context, cont if options != nil && options.Range != nil { req.Raw().Header["x-ms-range"] = []string{*options.Range} } + if options != nil && options.StructuredBodyType != nil { + req.Raw().Header["x-ms-structured-body"] = []string{*options.StructuredBodyType} + } + if options != nil && options.StructuredContentLength != nil { + req.Raw().Header["x-ms-structured-content-length"] = []string{strconv.FormatInt(*options.StructuredContentLength, 10)} + } req.Raw().Header["x-ms-version"] = []string{ServiceVersion} if err := req.SetBody(body, "application/octet-stream"); err != nil { return nil, err @@ -1098,6 +1104,9 @@ func (client *PageBlobClient) uploadPagesHandleResponse(resp *http.Response) (Pa if val := resp.Header.Get("x-ms-request-id"); val != "" { result.RequestID = &val } + if val := resp.Header.Get("x-ms-structured-body"); val != "" { + result.StructuredBodyType = &val + } if val := resp.Header.Get("x-ms-version"); val != "" { result.Version = &val } @@ -1108,7 +1117,7 @@ func (client *PageBlobClient) uploadPagesHandleResponse(resp *http.Response) (Pa // a URL // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - sourceURL - Specify a URL to the copy source. // - sourceRange - Bytes of source data in the specified range. The length of this range should match the ContentLength header // and x-ms-range/Range destination range header. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go index adb736607f..5ed22156d2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_responses.go @@ -88,6 +88,9 @@ type AppendBlobClientAppendBlockResponse struct { // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string + // StructuredBodyType contains the information returned from the x-ms-structured-body header response. + StructuredBodyType *string + // Version contains the information returned from the x-ms-version header response. Version *string } @@ -469,6 +472,12 @@ type BlobClientDownloadResponse struct { // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string + // StructuredBodyType contains the information returned from the x-ms-structured-body header response. + StructuredBodyType *string + + // StructuredContentLength contains the information returned from the x-ms-structured-content-length header response. + StructuredContentLength *int64 + // TagCount contains the information returned from the x-ms-tag-count header response. TagCount *int64 @@ -490,6 +499,9 @@ type BlobClientGetAccountInfoResponse struct { // Date contains the information returned from the Date header response. Date *time.Time + // IsHierarchicalNamespaceEnabled contains the information returned from the x-ms-is-hns-enabled header response. + IsHierarchicalNamespaceEnabled *bool + // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string @@ -1167,6 +1179,9 @@ type BlockBlobClientStageBlockResponse struct { // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string + // StructuredBodyType contains the information returned from the x-ms-structured-body header response. + StructuredBodyType *string + // Version contains the information returned from the x-ms-version header response. Version *string } @@ -1176,6 +1191,9 @@ type BlockBlobClientUploadResponse struct { // ClientRequestID contains the information returned from the x-ms-client-request-id header response. ClientRequestID *string + // ContentCRC64 contains the information returned from the x-ms-content-crc64 header response. + ContentCRC64 []byte + // ContentMD5 contains the information returned from the Content-MD5 header response. ContentMD5 []byte @@ -1200,6 +1218,9 @@ type BlockBlobClientUploadResponse struct { // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string + // StructuredBodyType contains the information returned from the x-ms-structured-body header response. + StructuredBodyType *string + // Version contains the information returned from the x-ms-version header response. Version *string @@ -1371,6 +1392,9 @@ type ContainerClientGetAccountInfoResponse struct { // Date contains the information returned from the Date header response. Date *time.Time + // IsHierarchicalNamespaceEnabled contains the information returned from the x-ms-is-hns-enabled header response. + IsHierarchicalNamespaceEnabled *bool + // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string @@ -1873,6 +1897,9 @@ type PageBlobClientUploadPagesResponse struct { // RequestID contains the information returned from the x-ms-request-id header response. RequestID *string + // StructuredBodyType contains the information returned from the x-ms-structured-body header response. + StructuredBodyType *string + // Version contains the information returned from the x-ms-version header response. Version *string } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go index ae58529494..8764591b30 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/generated/zz_service_client.go @@ -30,7 +30,7 @@ type ServiceClient struct { // be scoped within the expression to a single container. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - where - Filters the results to return only to return only blobs whose tags match the specified expression. // - options - ServiceClientFilterBlobsOptions contains the optional parameters for the ServiceClient.FilterBlobs method. func (client *ServiceClient) FilterBlobs(ctx context.Context, where string, options *ServiceClientFilterBlobsOptions) (ServiceClientFilterBlobsResponse, error) { @@ -109,7 +109,7 @@ func (client *ServiceClient) filterBlobsHandleResponse(resp *http.Response) (Ser // GetAccountInfo - Returns the sku name and account kind // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ServiceClientGetAccountInfoOptions contains the optional parameters for the ServiceClient.GetAccountInfo method. func (client *ServiceClient) GetAccountInfo(ctx context.Context, options *ServiceClientGetAccountInfoOptions) (ServiceClientGetAccountInfoResponse, error) { var err error @@ -138,8 +138,14 @@ func (client *ServiceClient) getAccountInfoCreateRequest(ctx context.Context, op reqQP := req.Raw().URL.Query() reqQP.Set("comp", "properties") reqQP.Set("restype", "account") - req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.Timeout != nil { + reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) + } + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} + if options != nil && options.RequestID != nil { + req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} + } req.Raw().Header["x-ms-version"] = []string{ServiceVersion} return req, nil } @@ -183,7 +189,7 @@ func (client *ServiceClient) getAccountInfoHandleResponse(resp *http.Response) ( // CORS (Cross-Origin Resource Sharing) rules. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ServiceClientGetPropertiesOptions contains the optional parameters for the ServiceClient.GetProperties method. func (client *ServiceClient) GetProperties(ctx context.Context, options *ServiceClientGetPropertiesOptions) (ServiceClientGetPropertiesResponse, error) { var err error @@ -215,7 +221,7 @@ func (client *ServiceClient) getPropertiesCreateRequest(ctx context.Context, opt if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -246,7 +252,7 @@ func (client *ServiceClient) getPropertiesHandleResponse(resp *http.Response) (S // location endpoint when read-access geo-redundant replication is enabled for the storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ServiceClientGetStatisticsOptions contains the optional parameters for the ServiceClient.GetStatistics method. func (client *ServiceClient) GetStatistics(ctx context.Context, options *ServiceClientGetStatisticsOptions) (ServiceClientGetStatisticsResponse, error) { var err error @@ -278,7 +284,7 @@ func (client *ServiceClient) getStatisticsCreateRequest(ctx context.Context, opt if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -316,7 +322,7 @@ func (client *ServiceClient) getStatisticsHandleResponse(resp *http.Response) (S // bearer token authentication. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - keyInfo - Key information // - options - ServiceClientGetUserDelegationKeyOptions contains the optional parameters for the ServiceClient.GetUserDelegationKey // method. @@ -350,7 +356,7 @@ func (client *ServiceClient) getUserDelegationKeyCreateRequest(ctx context.Conte if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -390,7 +396,7 @@ func (client *ServiceClient) getUserDelegationKeyHandleResponse(resp *http.Respo // NewListContainersSegmentPager - The List Containers Segment operation returns a list of the containers under the specified // account // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - options - ServiceClientListContainersSegmentOptions contains the optional parameters for the ServiceClient.NewListContainersSegmentPager // method. // @@ -417,7 +423,7 @@ func (client *ServiceClient) ListContainersSegmentCreateRequest(ctx context.Cont if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -448,7 +454,7 @@ func (client *ServiceClient) ListContainersSegmentHandleResponse(resp *http.Resp // and CORS (Cross-Origin Resource Sharing) rules // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - storageServiceProperties - The StorageService properties. // - options - ServiceClientSetPropertiesOptions contains the optional parameters for the ServiceClient.SetProperties method. func (client *ServiceClient) SetProperties(ctx context.Context, storageServiceProperties StorageServiceProperties, options *ServiceClientSetPropertiesOptions) (ServiceClientSetPropertiesResponse, error) { @@ -481,7 +487,7 @@ func (client *ServiceClient) setPropertiesCreateRequest(ctx context.Context, sto if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) req.Raw().Header["Accept"] = []string{"application/xml"} if options != nil && options.RequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*options.RequestID} @@ -511,7 +517,7 @@ func (client *ServiceClient) setPropertiesHandleResponse(resp *http.Response) (S // SubmitBatch - The Batch operation allows multiple API calls to be embedded into a single HTTP request. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-03 +// Generated from API version 2025-01-05 // - contentLength - The length of the request. // - multipartContentType - Required. The value of this header must be multipart/mixed with a batch boundary. Example header // value: multipart/mixed; boundary=batch_ @@ -546,7 +552,7 @@ func (client *ServiceClient) submitBatchCreateRequest(ctx context.Context, conte if options != nil && options.Timeout != nil { reqQP.Set("timeout", strconv.FormatInt(int64(*options.Timeout), 10)) } - req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().URL.RawQuery = strings.Replace(reqQP.Encode(), "+", "%20", -1) runtime.SkipBodyDownload(req) req.Raw().Header["Accept"] = []string{"application/xml"} req.Raw().Header["Content-Length"] = []string{strconv.FormatInt(contentLength, 10)} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/shared/mmf_unix.go b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/shared/mmf_unix.go index cdcadf3116..072fd27b1d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/shared/mmf_unix.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/internal/shared/mmf_unix.go @@ -1,6 +1,6 @@ -//go:build go1.18 && (linux || darwin || dragonfly || freebsd || openbsd || netbsd || solaris || aix) +//go:build go1.18 && (linux || darwin || dragonfly || freebsd || openbsd || netbsd || solaris || aix || zos) // +build go1.18 -// +build linux darwin dragonfly freebsd openbsd netbsd solaris aix +// +build linux darwin dragonfly freebsd openbsd netbsd solaris aix zos // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go index 22c17d2012..549d68ab99 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential/confidential.go @@ -65,6 +65,13 @@ type AuthenticationScheme = authority.AuthenticationScheme type Account = shared.Account +type TokenSource = base.TokenSource + +const ( + TokenSourceIdentityProvider = base.TokenSourceIdentityProvider + TokenSourceCache = base.TokenSourceCache +) + // CertFromPEM converts a PEM file (.pem or .key) for use with [NewCredFromCert]. The file // must contain the public certificate and the private key. If a PEM block is encrypted and // password is not an empty string, it attempts to decrypt the PEM blocks using the password. @@ -639,7 +646,7 @@ func (cca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []s if err != nil { return AuthResult{}, err } - return cca.base.AuthResultFromToken(ctx, authParams, token, true) + return cca.base.AuthResultFromToken(ctx, authParams, token) } // acquireTokenByAuthCodeOptions contains the optional parameters used to acquire an access token using the authorization code flow. @@ -733,7 +740,7 @@ func (cca Client) AcquireTokenByCredential(ctx context.Context, scopes []string, if err != nil { return AuthResult{}, err } - return cca.base.AuthResultFromToken(ctx, authParams, token, true) + return cca.base.AuthResultFromToken(ctx, authParams, token) } // acquireTokenOnBehalfOfOptions contains optional configuration for AcquireTokenOnBehalfOf diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go index c9b8dbed08..b5cbb57217 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors/errors.go @@ -64,11 +64,20 @@ type CallErr struct { Err error } +type InvalidJsonErr struct { + Err error +} + // Errors implements error.Error(). func (e CallErr) Error() string { return e.Err.Error() } +// Errors implements error.Error(). +func (e InvalidJsonErr) Error() string { + return e.Err.Error() +} + // Verbose prints a versbose error message with the request or response. func (e CallErr) Verbose() string { e.Resp.Request = nil // This brings in a bunch of TLS crap we don't need diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go index e473d1267d..61c1c4cec1 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/base.go @@ -5,16 +5,17 @@ package base import ( "context" - "errors" "fmt" "net/url" "reflect" "strings" "sync" + "sync/atomic" "time" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache" - "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority" @@ -94,6 +95,7 @@ type AuthResult struct { // AuthResultMetadata which contains meta data for the AuthResult type AuthResultMetadata struct { + RefreshOn time.Time TokenSource TokenSource } @@ -101,9 +103,8 @@ type TokenSource int // These are all the types of token flows. const ( - SourceUnknown TokenSource = 0 - IdentityProvider TokenSource = 1 - Cache TokenSource = 2 + TokenSourceIdentityProvider TokenSource = 0 + TokenSourceCache TokenSource = 1 ) // AuthResultFromStorage creates an AuthResult from a storage token response (which is generated from the cache). @@ -111,7 +112,6 @@ func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResu if err := storageTokenResponse.AccessToken.Validate(); err != nil { return AuthResult{}, fmt.Errorf("problem with access token in StorageTokenResponse: %w", err) } - account := storageTokenResponse.Account accessToken := storageTokenResponse.AccessToken.Secret grantedScopes := strings.Split(storageTokenResponse.AccessToken.Scopes, scopeSeparator) @@ -132,7 +132,8 @@ func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResu GrantedScopes: grantedScopes, DeclinedScopes: nil, Metadata: AuthResultMetadata{ - TokenSource: Cache, + TokenSource: TokenSourceCache, + RefreshOn: storageTokenResponse.AccessToken.RefreshOn.T, }, }, nil } @@ -146,10 +147,11 @@ func NewAuthResult(tokenResponse accesstokens.TokenResponse, account shared.Acco Account: account, IDToken: tokenResponse.IDToken, AccessToken: tokenResponse.AccessToken, - ExpiresOn: tokenResponse.ExpiresOn.T, + ExpiresOn: tokenResponse.ExpiresOn, GrantedScopes: tokenResponse.GrantedScopes.Slice, Metadata: AuthResultMetadata{ - TokenSource: IdentityProvider, + TokenSource: TokenSourceIdentityProvider, + RefreshOn: tokenResponse.RefreshOn.T, }, }, nil } @@ -165,6 +167,8 @@ type Client struct { AuthParams authority.AuthParams // DO NOT EVER MAKE THIS A POINTER! See "Note" in New(). cacheAccessor cache.ExportReplace cacheAccessorMu *sync.RWMutex + canRefresh map[string]*atomic.Value + canRefreshMu *sync.Mutex } // Option is an optional argument to the New constructor. @@ -241,6 +245,8 @@ func New(clientID string, authorityURI string, token *oauth.Client, options ...O cacheAccessorMu: &sync.RWMutex{}, manager: storage.New(token), pmanager: storage.NewPartitionedManager(token), + canRefresh: make(map[string]*atomic.Value), + canRefreshMu: &sync.Mutex{}, } for _, o := range options { if err = o(&client); err != nil { @@ -345,6 +351,28 @@ func (b Client) AcquireTokenSilent(ctx context.Context, silent AcquireTokenSilen if silent.Claims == "" { ar, err = AuthResultFromStorage(storageTokenResponse) if err == nil { + if rt := storageTokenResponse.AccessToken.RefreshOn.T; !rt.IsZero() && Now().After(rt) { + b.canRefreshMu.Lock() + refreshValue, ok := b.canRefresh[tenant] + if !ok { + refreshValue = &atomic.Value{} + refreshValue.Store(false) + b.canRefresh[tenant] = refreshValue + } + b.canRefreshMu.Unlock() + if refreshValue.CompareAndSwap(false, true) { + defer refreshValue.Store(false) + // Added a check to see if the token is still same because there is a chance + // that the token is already refreshed by another thread. + // If the token is not same, we don't need to refresh it. + // Which means it refreshed. + if str, err := m.Read(ctx, authParams); err == nil && str.AccessToken.Secret == ar.AccessToken { + if tr, er := b.Token.Credential(ctx, authParams, silent.Credential); er == nil { + return b.AuthResultFromToken(ctx, authParams, tr) + } + } + } + } ar.AccessToken, err = authParams.AuthnScheme.FormatAccessToken(ar.AccessToken) return ar, err } @@ -362,7 +390,7 @@ func (b Client) AcquireTokenSilent(ctx context.Context, silent AcquireTokenSilen if err != nil { return ar, err } - return b.AuthResultFromToken(ctx, authParams, token, true) + return b.AuthResultFromToken(ctx, authParams, token) } func (b Client) AcquireTokenByAuthCode(ctx context.Context, authCodeParams AcquireTokenAuthCodeParameters) (AuthResult, error) { @@ -391,7 +419,7 @@ func (b Client) AcquireTokenByAuthCode(ctx context.Context, authCodeParams Acqui return AuthResult{}, err } - return b.AuthResultFromToken(ctx, authParams, token, true) + return b.AuthResultFromToken(ctx, authParams, token) } // AcquireTokenOnBehalfOf acquires a security token for an app using middle tier apps access token. @@ -420,15 +448,12 @@ func (b Client) AcquireTokenOnBehalfOf(ctx context.Context, onBehalfOfParams Acq authParams.UserAssertion = onBehalfOfParams.UserAssertion token, err := b.Token.OnBehalfOf(ctx, authParams, onBehalfOfParams.Credential) if err == nil { - ar, err = b.AuthResultFromToken(ctx, authParams, token, true) + ar, err = b.AuthResultFromToken(ctx, authParams, token) } return ar, err } -func (b Client) AuthResultFromToken(ctx context.Context, authParams authority.AuthParams, token accesstokens.TokenResponse, cacheWrite bool) (AuthResult, error) { - if !cacheWrite { - return NewAuthResult(token, shared.Account{}) - } +func (b Client) AuthResultFromToken(ctx context.Context, authParams authority.AuthParams, token accesstokens.TokenResponse) (AuthResult, error) { var m manager = b.manager if authParams.AuthorizationType == authority.ATOnBehalfOf { m = b.pmanager @@ -458,6 +483,10 @@ func (b Client) AuthResultFromToken(ctx context.Context, authParams authority.Au return ar, err } +// This function wraps time.Now() and is used for refreshing the application +// was created to test the function against refreshin +var Now = time.Now + func (b Client) AllAccounts(ctx context.Context) ([]shared.Account, error) { if b.cacheAccessor != nil { b.cacheAccessorMu.RLock() diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go similarity index 95% rename from vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.go rename to vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go index f9be90276d..7379e2233c 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/items.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/items.go @@ -72,6 +72,7 @@ type AccessToken struct { ClientID string `json:"client_id,omitempty"` Secret string `json:"secret,omitempty"` Scopes string `json:"target,omitempty"` + RefreshOn internalTime.Unix `json:"refresh_on,omitempty"` ExpiresOn internalTime.Unix `json:"expires_on,omitempty"` ExtendedExpiresOn internalTime.Unix `json:"extended_expires_on,omitempty"` CachedAt internalTime.Unix `json:"cached_at,omitempty"` @@ -83,7 +84,7 @@ type AccessToken struct { } // NewAccessToken is the constructor for AccessToken. -func NewAccessToken(homeID, env, realm, clientID string, cachedAt, expiresOn, extendedExpiresOn time.Time, scopes, token, tokenType, authnSchemeKeyID string) AccessToken { +func NewAccessToken(homeID, env, realm, clientID string, cachedAt, refreshOn, expiresOn, extendedExpiresOn time.Time, scopes, token, tokenType, authnSchemeKeyID string) AccessToken { return AccessToken{ HomeAccountID: homeID, Environment: env, @@ -93,6 +94,7 @@ func NewAccessToken(homeID, env, realm, clientID string, cachedAt, expiresOn, ex Secret: token, Scopes: scopes, CachedAt: internalTime.Unix{T: cachedAt.UTC()}, + RefreshOn: internalTime.Unix{T: refreshOn.UTC()}, ExpiresOn: internalTime.Unix{T: expiresOn.UTC()}, ExtendedExpiresOn: internalTime.Unix{T: extendedExpiresOn.UTC()}, TokenType: tokenType, @@ -102,8 +104,9 @@ func NewAccessToken(homeID, env, realm, clientID string, cachedAt, expiresOn, ex // Key outputs the key that can be used to uniquely look up this entry in a map. func (a AccessToken) Key() string { + ks := []string{a.HomeAccountID, a.Environment, a.CredentialType, a.ClientID, a.Realm, a.Scopes} key := strings.Join( - []string{a.HomeAccountID, a.Environment, a.CredentialType, a.ClientID, a.Realm, a.Scopes}, + ks, shared.CacheKeySeparator, ) // add token type to key for new access tokens types. skip for bearer token type to diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/partitioned_storage.go similarity index 99% rename from vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.go rename to vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/partitioned_storage.go index c093183306..ff07d4b5a4 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/partitioned_storage.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/partitioned_storage.go @@ -114,7 +114,8 @@ func (m *PartitionedManager) Write(authParameters authority.AuthParams, tokenRes realm, clientID, cachedAt, - tokenResponse.ExpiresOn.T, + tokenResponse.RefreshOn.T, + tokenResponse.ExpiresOn, tokenResponse.ExtExpiresOn.T, target, tokenResponse.AccessToken, diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go similarity index 98% rename from vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.go rename to vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go index 2221e60c43..84a234967f 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage/storage.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage/storage.go @@ -173,6 +173,7 @@ func (m *Manager) Write(authParameters authority.AuthParams, tokenResponse acces environment := authParameters.AuthorityInfo.Host realm := authParameters.AuthorityInfo.Tenant clientID := authParameters.ClientID + target := strings.Join(tokenResponse.GrantedScopes.Slice, scopeSeparator) cachedAt := time.Now() authnSchemeKeyID := authParameters.AuthnScheme.KeyID() @@ -193,7 +194,8 @@ func (m *Manager) Write(authParameters authority.AuthParams, tokenResponse acces realm, clientID, cachedAt, - tokenResponse.ExpiresOn.T, + tokenResponse.RefreshOn.T, + tokenResponse.ExpiresOn, tokenResponse.ExtExpiresOn.T, target, tokenResponse.AccessToken, @@ -265,6 +267,9 @@ func (m *Manager) aadMetadataFromCache(ctx context.Context, authorityInfo author } func (m *Manager) aadMetadata(ctx context.Context, authorityInfo authority.Info) (authority.InstanceDiscoveryMetadata, error) { + if m.requests == nil { + return authority.InstanceDiscoveryMetadata{}, fmt.Errorf("httpclient in oauth instance for fetching metadata is nil") + } m.aadCacheMu.Lock() defer m.aadCacheMu.Unlock() discoveryResponse, err := m.requests.AADInstanceDiscovery(ctx, authorityInfo) @@ -459,6 +464,7 @@ func (m *Manager) readAccount(homeAccountID string, envAliases []string, realm s func (m *Manager) writeAccount(account shared.Account) error { key := account.Key() + m.contractMu.Lock() defer m.contractMu.Unlock() m.contract.Accounts[key] = account diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go index 7b673e3fe1..de1bf381f4 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported/exported.go @@ -31,4 +31,6 @@ type TokenProviderResult struct { AccessToken string // ExpiresInSeconds is the lifetime of the token in seconds ExpiresInSeconds int + // RefreshInSeconds indicates the suggested time to refresh the token, if any + RefreshInSeconds int } diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go index fda5d7dd33..cda678e334 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/local/server.go @@ -146,7 +146,8 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) { // Note: It is a little weird we handle some errors by not going to the failPage. If they all should, // change this to s.error() and make s.error() write the failPage instead of an error code. _, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc))) - s.putResult(Result{Err: fmt.Errorf(desc)}) + s.putResult(Result{Err: fmt.Errorf("%s", desc)}) + return } diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go index e065313444..738a29eb9d 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/oauth.go @@ -111,7 +111,7 @@ func (t *Client) Credential(ctx context.Context, authParams authority.AuthParams Scopes: scopes, TenantID: authParams.AuthorityInfo.Tenant, } - tr, err := cred.TokenProvider(ctx, params) + pr, err := cred.TokenProvider(ctx, params) if err != nil { if len(scopes) == 0 { err = fmt.Errorf("token request had an empty authority.AuthParams.Scopes, which may cause the following error: %w", err) @@ -119,14 +119,18 @@ func (t *Client) Credential(ctx context.Context, authParams authority.AuthParams } return accesstokens.TokenResponse{}, err } - return accesstokens.TokenResponse{ - TokenType: authParams.AuthnScheme.AccessTokenType(), - AccessToken: tr.AccessToken, - ExpiresOn: internalTime.DurationTime{ - T: now.Add(time.Duration(tr.ExpiresInSeconds) * time.Second), - }, + tr := accesstokens.TokenResponse{ + TokenType: authParams.AuthnScheme.AccessTokenType(), + AccessToken: pr.AccessToken, + ExpiresOn: now.Add(time.Duration(pr.ExpiresInSeconds) * time.Second), GrantedScopes: accesstokens.Scopes{Slice: authParams.Scopes}, - }, nil + } + if pr.RefreshInSeconds > 0 { + tr.RefreshOn = internalTime.DurationTime{ + T: now.Add(time.Duration(pr.RefreshInSeconds) * time.Second), + } + } + return tr, nil } if err := t.resolveEndpoint(ctx, &authParams, ""); err != nil { diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go index a7b7b0742d..d738c7591e 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/accesstokens.go @@ -17,6 +17,7 @@ import ( /* #nosec */ "crypto/sha1" + "crypto/sha256" "crypto/x509" "encoding/base64" "encoding/json" @@ -68,7 +69,7 @@ type DeviceCodeResponse struct { UserCode string `json:"user_code"` DeviceCode string `json:"device_code"` - VerificationURL string `json:"verification_url"` + VerificationURL string `json:"verification_uri"` ExpiresIn int `json:"expires_in"` Interval int `json:"interval"` Message string `json:"message"` @@ -112,19 +113,31 @@ func (c *Credential) JWT(ctx context.Context, authParams authority.AuthParams) ( } return c.AssertionCallback(ctx, options) } - - token := jwt.NewWithClaims(jwt.SigningMethodRS256, jwt.MapClaims{ + claims := jwt.MapClaims{ "aud": authParams.Endpoints.TokenEndpoint, "exp": json.Number(strconv.FormatInt(time.Now().Add(10*time.Minute).Unix(), 10)), "iss": authParams.ClientID, "jti": uuid.New().String(), "nbf": json.Number(strconv.FormatInt(time.Now().Unix(), 10)), "sub": authParams.ClientID, - }) + } + + isADFSorDSTS := authParams.AuthorityInfo.AuthorityType == authority.ADFS || + authParams.AuthorityInfo.AuthorityType == authority.DSTS + + var signingMethod jwt.SigningMethod = jwt.SigningMethodPS256 + thumbprintKey := "x5t#S256" + + if isADFSorDSTS { + signingMethod = jwt.SigningMethodRS256 + thumbprintKey = "x5t" + } + + token := jwt.NewWithClaims(signingMethod, claims) token.Header = map[string]interface{}{ - "alg": "RS256", - "typ": "JWT", - "x5t": base64.StdEncoding.EncodeToString(thumbprint(c.Cert)), + "alg": signingMethod.Alg(), + "typ": "JWT", + thumbprintKey: base64.StdEncoding.EncodeToString(thumbprint(c.Cert, signingMethod.Alg())), } if authParams.SendX5C { @@ -133,17 +146,23 @@ func (c *Credential) JWT(ctx context.Context, authParams authority.AuthParams) ( assertion, err := token.SignedString(c.Key) if err != nil { - return "", fmt.Errorf("unable to sign a JWT token using private key: %w", err) + return "", fmt.Errorf("unable to sign JWT token: %w", err) } + return assertion, nil } // thumbprint runs the asn1.Der bytes through sha1 for use in the x5t parameter of JWT. // https://tools.ietf.org/html/rfc7517#section-4.8 -func thumbprint(cert *x509.Certificate) []byte { - /* #nosec */ - a := sha1.Sum(cert.Raw) - return a[:] +func thumbprint(cert *x509.Certificate, alg string) []byte { + switch alg { + case jwt.SigningMethodRS256.Name: // identity providers like ADFS don't support SHA256 assertions, so need to support this + hash := sha1.Sum(cert.Raw) /* #nosec */ + return hash[:] + default: + hash := sha256.Sum256(cert.Raw) + return hash[:] + } } // Client represents the REST calls to get tokens from token generator backends. @@ -262,11 +281,7 @@ func (c Client) FromClientSecret(ctx context.Context, authParameters authority.A qv.Set(clientID, authParameters.ClientID) addScopeQueryParam(qv, authParameters) - token, err := c.doTokenResp(ctx, authParameters, qv) - if err != nil { - return token, fmt.Errorf("FromClientSecret(): %w", err) - } - return token, nil + return c.doTokenResp(ctx, authParameters, qv) } func (c Client) FromAssertion(ctx context.Context, authParameters authority.AuthParams, assertion string) (TokenResponse, error) { @@ -281,11 +296,7 @@ func (c Client) FromAssertion(ctx context.Context, authParameters authority.Auth qv.Set(clientInfo, clientInfoVal) addScopeQueryParam(qv, authParameters) - token, err := c.doTokenResp(ctx, authParameters, qv) - if err != nil { - return token, fmt.Errorf("FromAssertion(): %w", err) - } - return token, nil + return c.doTokenResp(ctx, authParameters, qv) } func (c Client) FromUserAssertionClientSecret(ctx context.Context, authParameters authority.AuthParams, userAssertion string, clientSecret string) (TokenResponse, error) { diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go index 3107b45c11..32dde7b76b 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens/tokens.go @@ -10,6 +10,7 @@ import ( "errors" "fmt" "reflect" + "strconv" "strings" "time" @@ -173,14 +174,75 @@ type TokenResponse struct { FamilyID string `json:"foci"` IDToken IDToken `json:"id_token"` ClientInfo ClientInfo `json:"client_info"` - ExpiresOn internalTime.DurationTime `json:"expires_in"` + RefreshOn internalTime.DurationTime `json:"refresh_in,omitempty"` + ExpiresOn time.Time `json:"-"` ExtExpiresOn internalTime.DurationTime `json:"ext_expires_in"` GrantedScopes Scopes `json:"scope"` DeclinedScopes []string // This is derived AdditionalFields map[string]interface{} + scopesComputed bool +} + +func (tr *TokenResponse) UnmarshalJSON(data []byte) error { + type Alias TokenResponse + aux := &struct { + ExpiresIn internalTime.DurationTime `json:"expires_in,omitempty"` + ExpiresOn any `json:"expires_on,omitempty"` + *Alias + }{ + Alias: (*Alias)(tr), + } + + // Unmarshal the JSON data into the aux struct + if err := json.Unmarshal(data, &aux); err != nil { + return err + } + + // Function to parse different date formats + // This is a workaround for the issue described here: + // https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/4963 + parseExpiresOn := func(expiresOn string) (time.Time, error) { + var formats = []string{ + "01/02/2006 15:04:05", // MM/dd/yyyy HH:mm:ss + "2006-01-02 15:04:05", // yyyy-MM-dd HH:mm:ss + time.RFC3339Nano, // ISO 8601 (with nanosecond precision) + } + + for _, format := range formats { + if t, err := time.Parse(format, expiresOn); err == nil { + return t, nil + } + } + return time.Time{}, fmt.Errorf("invalid ExpiresOn format: %s", expiresOn) + } - scopesComputed bool + if expiresOnStr, ok := aux.ExpiresOn.(string); ok { + if ts, err := strconv.ParseInt(expiresOnStr, 10, 64); err == nil { + tr.ExpiresOn = time.Unix(ts, 0) + return nil + } + if expiresOnStr != "" { + if t, err := parseExpiresOn(expiresOnStr); err != nil { + return err + } else { + tr.ExpiresOn = t + return nil + } + } + } + + // Check if ExpiresOn is a number (Unix timestamp or ISO 8601) + if expiresOnNum, ok := aux.ExpiresOn.(float64); ok { + tr.ExpiresOn = time.Unix(int64(expiresOnNum), 0) + return nil + } + + if !aux.ExpiresIn.T.IsZero() { + tr.ExpiresOn = aux.ExpiresIn.T + return nil + } + return errors.New("expires_in and expires_on are both missing or invalid") } // ComputeScope computes the final scopes based on what was granted by the server and diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go index d62aac74eb..7906803669 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/internal/comm/comm.go @@ -98,7 +98,7 @@ func (c *Client) JSONCall(ctx context.Context, endpoint string, headers http.Hea if resp != nil { if err := unmarshal(data, resp); err != nil { - return fmt.Errorf("json decode error: %w\njson message bytes were: %s", err, string(data)) + return errors.InvalidJsonErr{Err: fmt.Errorf("json decode error: %w\njson message bytes were: %s", err, string(data))} } } return nil @@ -221,7 +221,7 @@ func (c *Client) URLFormCall(ctx context.Context, endpoint string, qv url.Values } if resp != nil { if err := unmarshal(data, resp); err != nil { - return fmt.Errorf("json decode error: %w\nraw message was: %s", err, string(data)) + return errors.InvalidJsonErr{Err: fmt.Errorf("json decode error: %w\nraw message was: %s", err, string(data))} } } return nil diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go index eb16b405c4..5e551abc83 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version/version.go @@ -5,4 +5,4 @@ package version // Version is the version of this client package that is communicated to the server. -const Version = "1.2.0" +const Version = "1.4.2" diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/azure_ml.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/azure_ml.go new file mode 100644 index 0000000000..d7cffc295e --- /dev/null +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/azure_ml.go @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +package managedidentity + +import ( + "context" + "net/http" + "os" +) + +func createAzureMLAuthRequest(ctx context.Context, id ID, resource string) (*http.Request, error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, os.Getenv(msiEndpointEnvVar), nil) + if err != nil { + return nil, err + } + + req.Header.Set("secret", os.Getenv(msiSecretEnvVar)) + q := req.URL.Query() + q.Set(apiVersionQueryParameterName, azureMLAPIVersion) + q.Set(resourceQueryParameterName, resource) + q.Set("clientid", os.Getenv("DEFAULT_IDENTITY_CLIENT_ID")) + if cid, ok := id.(UserAssignedClientID); ok { + q.Set("clientid", string(cid)) + } + req.URL.RawQuery = q.Encode() + return req, nil +} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/cloud_shell.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/cloud_shell.go new file mode 100644 index 0000000000..be9a0bca38 --- /dev/null +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/cloud_shell.go @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +package managedidentity + +import ( + "context" + "fmt" + "io" + "net/http" + "net/url" + "os" + "strings" +) + +func createCloudShellAuthRequest(ctx context.Context, resource string) (*http.Request, error) { + msiEndpoint := os.Getenv(msiEndpointEnvVar) + msiEndpointParsed, err := url.Parse(msiEndpoint) + if err != nil { + return nil, fmt.Errorf("couldn't parse %q: %s", msiEndpoint, err) + } + + data := url.Values{} + data.Set(resourceQueryParameterName, resource) + msiDataEncoded := data.Encode() + body := io.NopCloser(strings.NewReader(msiDataEncoded)) + + req, err := http.NewRequestWithContext(ctx, http.MethodPost, msiEndpointParsed.String(), body) + if err != nil { + return nil, fmt.Errorf("error creating http request %s", err) + } + + req.Header.Set(metaHTTPHeaderName, "true") + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + + return req, nil +} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/managedidentity.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/managedidentity.go new file mode 100644 index 0000000000..ca3de4325f --- /dev/null +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/managedidentity.go @@ -0,0 +1,717 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +/* +Package managedidentity provides a client for retrieval of Managed Identity applications. +The Managed Identity Client is used to acquire a token for managed identity assigned to +an azure resource such as Azure function, app service, virtual machine, etc. to acquire a token +without using credentials. +*/ +package managedidentity + +import ( + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "os" + "path/filepath" + "runtime" + "strings" + "sync/atomic" + "time" + + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/accesstokens" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority" + "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared" +) + +// AuthResult contains the results of one token acquisition operation. +// For details see https://aka.ms/msal-net-authenticationresult +type AuthResult = base.AuthResult + +type TokenSource = base.TokenSource + +const ( + TokenSourceIdentityProvider = base.TokenSourceIdentityProvider + TokenSourceCache = base.TokenSourceCache +) + +const ( + // DefaultToIMDS indicates that the source is defaulted to IMDS when no environment variables are set. + DefaultToIMDS Source = "DefaultToIMDS" + AzureArc Source = "AzureArc" + ServiceFabric Source = "ServiceFabric" + CloudShell Source = "CloudShell" + AzureML Source = "AzureML" + AppService Source = "AppService" + + // General request query parameter names + metaHTTPHeaderName = "Metadata" + apiVersionQueryParameterName = "api-version" + resourceQueryParameterName = "resource" + wwwAuthenticateHeaderName = "www-authenticate" + + // UAMI query parameter name + miQueryParameterClientId = "client_id" + miQueryParameterObjectId = "object_id" + miQueryParameterPrincipalId = "principal_id" + miQueryParameterResourceIdIMDS = "msi_res_id" + miQueryParameterResourceId = "mi_res_id" + + // IMDS + imdsDefaultEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" + imdsAPIVersion = "2018-02-01" + systemAssignedManagedIdentity = "system_assigned_managed_identity" + + // Azure Arc + azureArcEndpoint = "http://127.0.0.1:40342/metadata/identity/oauth2/token" + azureArcAPIVersion = "2020-06-01" + azureArcFileExtension = ".key" + azureArcMaxFileSizeBytes int64 = 4096 + linuxTokenPath = "/var/opt/azcmagent/tokens" // #nosec G101 + linuxHimdsPath = "/opt/azcmagent/bin/himds" + azureConnectedMachine = "AzureConnectedMachineAgent" + himdsExecutableName = "himds.exe" + tokenName = "Tokens" + + // App Service + appServiceAPIVersion = "2019-08-01" + + // AzureML + azureMLAPIVersion = "2017-09-01" + // Service Fabric + serviceFabricAPIVersion = "2019-07-01-preview" + + // Environment Variables + identityEndpointEnvVar = "IDENTITY_ENDPOINT" + identityHeaderEnvVar = "IDENTITY_HEADER" + azurePodIdentityAuthorityHostEnvVar = "AZURE_POD_IDENTITY_AUTHORITY_HOST" + imdsEndVar = "IMDS_ENDPOINT" + msiEndpointEnvVar = "MSI_ENDPOINT" + msiSecretEnvVar = "MSI_SECRET" + identityServerThumbprintEnvVar = "IDENTITY_SERVER_THUMBPRINT" + + defaultRetryCount = 3 +) + +var retryCodesForIMDS = []int{ + http.StatusNotFound, // 404 + http.StatusGone, // 410 + http.StatusTooManyRequests, // 429 + http.StatusInternalServerError, // 500 + http.StatusNotImplemented, // 501 + http.StatusBadGateway, // 502 + http.StatusServiceUnavailable, // 503 + http.StatusGatewayTimeout, // 504 + http.StatusHTTPVersionNotSupported, // 505 + http.StatusVariantAlsoNegotiates, // 506 + http.StatusInsufficientStorage, // 507 + http.StatusLoopDetected, // 508 + http.StatusNotExtended, // 510 + http.StatusNetworkAuthenticationRequired, // 511 +} + +var retryStatusCodes = []int{ + http.StatusRequestTimeout, // 408 + http.StatusTooManyRequests, // 429 + http.StatusInternalServerError, // 500 + http.StatusBadGateway, // 502 + http.StatusServiceUnavailable, // 503 + http.StatusGatewayTimeout, // 504 +} + +var getAzureArcPlatformPath = func(platform string) string { + switch platform { + case "windows": + return filepath.Join(os.Getenv("ProgramData"), azureConnectedMachine, tokenName) + case "linux": + return linuxTokenPath + default: + return "" + } +} + +var getAzureArcHimdsFilePath = func(platform string) string { + switch platform { + case "windows": + return filepath.Join(os.Getenv("ProgramData"), azureConnectedMachine, himdsExecutableName) + case "linux": + return linuxHimdsPath + default: + return "" + } +} + +type Source string + +type ID interface { + value() string +} + +type systemAssignedValue string // its private for a reason to make the input consistent. +type UserAssignedClientID string +type UserAssignedObjectID string +type UserAssignedResourceID string + +func (s systemAssignedValue) value() string { return string(s) } +func (c UserAssignedClientID) value() string { return string(c) } +func (o UserAssignedObjectID) value() string { return string(o) } +func (r UserAssignedResourceID) value() string { return string(r) } +func SystemAssigned() ID { + return systemAssignedValue(systemAssignedManagedIdentity) +} + +// cache never uses the client because instance discovery is always disabled. +var cacheManager *storage.Manager = storage.New(nil) + +type Client struct { + httpClient ops.HTTPClient + miType ID + source Source + authParams authority.AuthParams + retryPolicyEnabled bool + canRefresh *atomic.Value +} + +type AcquireTokenOptions struct { + claims string +} + +type ClientOption func(*Client) + +type AcquireTokenOption func(o *AcquireTokenOptions) + +// WithClaims sets additional claims to request for the token, such as those required by token revocation or conditional access policies. +// Use this option when Azure AD returned a claims challenge for a prior request. The argument must be decoded. +func WithClaims(claims string) AcquireTokenOption { + return func(o *AcquireTokenOptions) { + o.claims = claims + } +} + +// WithHTTPClient allows for a custom HTTP client to be set. +func WithHTTPClient(httpClient ops.HTTPClient) ClientOption { + return func(c *Client) { + c.httpClient = httpClient + } +} + +func WithRetryPolicyDisabled() ClientOption { + return func(c *Client) { + c.retryPolicyEnabled = false + } +} + +// Client to be used to acquire tokens for managed identity. +// ID: [SystemAssigned], [UserAssignedClientID], [UserAssignedResourceID], [UserAssignedObjectID] +// +// Options: [WithHTTPClient] +func New(id ID, options ...ClientOption) (Client, error) { + source, err := GetSource() + if err != nil { + return Client{}, err + } + + // Check for user-assigned restrictions based on the source + switch source { + case AzureArc: + switch id.(type) { + case UserAssignedClientID, UserAssignedResourceID, UserAssignedObjectID: + return Client{}, errors.New("Azure Arc doesn't support user-assigned managed identities") + } + case AzureML: + switch id.(type) { + case UserAssignedObjectID, UserAssignedResourceID: + return Client{}, errors.New("Azure ML supports specifying a user-assigned managed identity by client ID only") + } + case CloudShell: + switch id.(type) { + case UserAssignedClientID, UserAssignedResourceID, UserAssignedObjectID: + return Client{}, errors.New("Cloud Shell doesn't support user-assigned managed identities") + } + case ServiceFabric: + switch id.(type) { + case UserAssignedClientID, UserAssignedResourceID, UserAssignedObjectID: + return Client{}, errors.New("Service Fabric API doesn't support specifying a user-assigned identity. The identity is determined by cluster resource configuration. See https://aka.ms/servicefabricmi") + } + } + + switch t := id.(type) { + case UserAssignedClientID: + if len(string(t)) == 0 { + return Client{}, fmt.Errorf("empty %T", t) + } + case UserAssignedResourceID: + if len(string(t)) == 0 { + return Client{}, fmt.Errorf("empty %T", t) + } + case UserAssignedObjectID: + if len(string(t)) == 0 { + return Client{}, fmt.Errorf("empty %T", t) + } + case systemAssignedValue: + default: + return Client{}, fmt.Errorf("unsupported type %T", id) + } + zero := atomic.Value{} + zero.Store(false) + client := Client{ + miType: id, + httpClient: shared.DefaultClient, + retryPolicyEnabled: true, + source: source, + canRefresh: &zero, + } + for _, option := range options { + option(&client) + } + fakeAuthInfo, err := authority.NewInfoFromAuthorityURI("https://login.microsoftonline.com/managed_identity", false, true) + if err != nil { + return Client{}, err + } + client.authParams = authority.NewAuthParams(client.miType.value(), fakeAuthInfo) + return client, nil +} + +// GetSource detects and returns the managed identity source available on the environment. +func GetSource() (Source, error) { + identityEndpoint := os.Getenv(identityEndpointEnvVar) + identityHeader := os.Getenv(identityHeaderEnvVar) + identityServerThumbprint := os.Getenv(identityServerThumbprintEnvVar) + msiEndpoint := os.Getenv(msiEndpointEnvVar) + msiSecret := os.Getenv(msiSecretEnvVar) + imdsEndpoint := os.Getenv(imdsEndVar) + + if identityEndpoint != "" && identityHeader != "" { + if identityServerThumbprint != "" { + return ServiceFabric, nil + } + return AppService, nil + } else if msiEndpoint != "" { + if msiSecret != "" { + return AzureML, nil + } else { + return CloudShell, nil + } + } else if isAzureArcEnvironment(identityEndpoint, imdsEndpoint) { + return AzureArc, nil + } + + return DefaultToIMDS, nil +} + +// This function wraps time.Now() and is used for refreshing the application +// was created to test the function against refreshin +var now = time.Now + +// Acquires tokens from the configured managed identity on an azure resource. +// +// Resource: scopes application is requesting access to +// Options: [WithClaims] +func (c Client) AcquireToken(ctx context.Context, resource string, options ...AcquireTokenOption) (AuthResult, error) { + resource = strings.TrimSuffix(resource, "/.default") + o := AcquireTokenOptions{} + for _, option := range options { + option(&o) + } + c.authParams.Scopes = []string{resource} + + // ignore cached access tokens when given claims + if o.claims == "" { + stResp, err := cacheManager.Read(ctx, c.authParams) + if err != nil { + return AuthResult{}, err + } + ar, err := base.AuthResultFromStorage(stResp) + if err == nil { + if !stResp.AccessToken.RefreshOn.T.IsZero() && !stResp.AccessToken.RefreshOn.T.After(now()) && c.canRefresh.CompareAndSwap(false, true) { + defer c.canRefresh.Store(false) + if tr, er := c.getToken(ctx, resource); er == nil { + return tr, nil + } + } + ar.AccessToken, err = c.authParams.AuthnScheme.FormatAccessToken(ar.AccessToken) + return ar, err + } + } + return c.getToken(ctx, resource) +} + +func (c Client) getToken(ctx context.Context, resource string) (AuthResult, error) { + switch c.source { + case AzureArc: + return c.acquireTokenForAzureArc(ctx, resource) + case AzureML: + return c.acquireTokenForAzureML(ctx, resource) + case CloudShell: + return c.acquireTokenForCloudShell(ctx, resource) + case DefaultToIMDS: + return c.acquireTokenForIMDS(ctx, resource) + case AppService: + return c.acquireTokenForAppService(ctx, resource) + case ServiceFabric: + return c.acquireTokenForServiceFabric(ctx, resource) + default: + return AuthResult{}, fmt.Errorf("unsupported source %q", c.source) + } +} + +func (c Client) acquireTokenForAppService(ctx context.Context, resource string) (AuthResult, error) { + req, err := createAppServiceAuthRequest(ctx, c.miType, resource) + if err != nil { + return AuthResult{}, err + } + tokenResponse, err := c.getTokenForRequest(req, resource) + if err != nil { + return AuthResult{}, err + } + return authResultFromToken(c.authParams, tokenResponse) +} + +func (c Client) acquireTokenForIMDS(ctx context.Context, resource string) (AuthResult, error) { + req, err := createIMDSAuthRequest(ctx, c.miType, resource) + if err != nil { + return AuthResult{}, err + } + tokenResponse, err := c.getTokenForRequest(req, resource) + if err != nil { + return AuthResult{}, err + } + return authResultFromToken(c.authParams, tokenResponse) +} + +func (c Client) acquireTokenForCloudShell(ctx context.Context, resource string) (AuthResult, error) { + req, err := createCloudShellAuthRequest(ctx, resource) + if err != nil { + return AuthResult{}, err + } + tokenResponse, err := c.getTokenForRequest(req, resource) + if err != nil { + return AuthResult{}, err + } + return authResultFromToken(c.authParams, tokenResponse) +} + +func (c Client) acquireTokenForAzureML(ctx context.Context, resource string) (AuthResult, error) { + req, err := createAzureMLAuthRequest(ctx, c.miType, resource) + if err != nil { + return AuthResult{}, err + } + tokenResponse, err := c.getTokenForRequest(req, resource) + if err != nil { + return AuthResult{}, err + } + return authResultFromToken(c.authParams, tokenResponse) +} + +func (c Client) acquireTokenForServiceFabric(ctx context.Context, resource string) (AuthResult, error) { + req, err := createServiceFabricAuthRequest(ctx, resource) + if err != nil { + return AuthResult{}, err + } + tokenResponse, err := c.getTokenForRequest(req, resource) + if err != nil { + return AuthResult{}, err + } + return authResultFromToken(c.authParams, tokenResponse) +} + +func (c Client) acquireTokenForAzureArc(ctx context.Context, resource string) (AuthResult, error) { + req, err := createAzureArcAuthRequest(ctx, resource, "") + if err != nil { + return AuthResult{}, err + } + + response, err := c.httpClient.Do(req) + if err != nil { + return AuthResult{}, err + } + defer response.Body.Close() + + if response.StatusCode != http.StatusUnauthorized { + return AuthResult{}, fmt.Errorf("expected a 401 response, received %d", response.StatusCode) + } + + secret, err := c.getAzureArcSecretKey(response, runtime.GOOS) + if err != nil { + return AuthResult{}, err + } + + secondRequest, err := createAzureArcAuthRequest(ctx, resource, string(secret)) + if err != nil { + return AuthResult{}, err + } + + tokenResponse, err := c.getTokenForRequest(secondRequest, resource) + if err != nil { + return AuthResult{}, err + } + return authResultFromToken(c.authParams, tokenResponse) +} + +func authResultFromToken(authParams authority.AuthParams, token accesstokens.TokenResponse) (AuthResult, error) { + if cacheManager == nil { + return AuthResult{}, errors.New("cache instance is nil") + } + account, err := cacheManager.Write(authParams, token) + if err != nil { + return AuthResult{}, err + } + // if refreshOn is not set, set it to half of the time until expiry if expiry is more than 2 hours away + if token.RefreshOn.T.IsZero() { + if lifetime := time.Until(token.ExpiresOn); lifetime > 2*time.Hour { + token.RefreshOn.T = time.Now().Add(lifetime / 2) + } + } + ar, err := base.NewAuthResult(token, account) + if err != nil { + return AuthResult{}, err + } + ar.AccessToken, err = authParams.AuthnScheme.FormatAccessToken(ar.AccessToken) + return ar, err +} + +// contains checks if the element is present in the list. +func contains[T comparable](list []T, element T) bool { + for _, v := range list { + if v == element { + return true + } + } + return false +} + +// retry performs an HTTP request with retries based on the provided options. +func (c Client) retry(maxRetries int, req *http.Request) (*http.Response, error) { + var resp *http.Response + var err error + for attempt := 0; attempt < maxRetries; attempt++ { + tryCtx, tryCancel := context.WithTimeout(req.Context(), time.Minute) + defer tryCancel() + if resp != nil && resp.Body != nil { + _, _ = io.Copy(io.Discard, resp.Body) + resp.Body.Close() + } + cloneReq := req.Clone(tryCtx) + resp, err = c.httpClient.Do(cloneReq) + retrylist := retryStatusCodes + if c.source == DefaultToIMDS { + retrylist = retryCodesForIMDS + } + if err == nil && !contains(retrylist, resp.StatusCode) { + return resp, nil + } + select { + case <-time.After(time.Second): + case <-req.Context().Done(): + err = req.Context().Err() + return resp, err + } + } + return resp, err +} + +func (c Client) getTokenForRequest(req *http.Request, resource string) (accesstokens.TokenResponse, error) { + r := accesstokens.TokenResponse{} + var resp *http.Response + var err error + + if c.retryPolicyEnabled { + resp, err = c.retry(defaultRetryCount, req) + } else { + resp, err = c.httpClient.Do(req) + } + if err != nil { + return r, err + } + responseBytes, err := io.ReadAll(resp.Body) + defer resp.Body.Close() + if err != nil { + return r, err + } + switch resp.StatusCode { + case http.StatusOK, http.StatusAccepted: + default: + sd := strings.TrimSpace(string(responseBytes)) + if sd != "" { + return r, errors.CallErr{ + Req: req, + Resp: resp, + Err: fmt.Errorf("http call(%s)(%s) error: reply status code was %d:\n%s", + req.URL.String(), + req.Method, + resp.StatusCode, + sd), + } + } + return r, errors.CallErr{ + Req: req, + Resp: resp, + Err: fmt.Errorf("http call(%s)(%s) error: reply status code was %d", req.URL.String(), req.Method, resp.StatusCode), + } + } + + err = json.Unmarshal(responseBytes, &r) + if err != nil { + return r, errors.InvalidJsonErr{ + Err: fmt.Errorf("error parsing the json error: %s", err), + } + } + r.GrantedScopes.Slice = append(r.GrantedScopes.Slice, resource) + + return r, err +} + +func createAppServiceAuthRequest(ctx context.Context, id ID, resource string) (*http.Request, error) { + identityEndpoint := os.Getenv(identityEndpointEnvVar) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, identityEndpoint, nil) + if err != nil { + return nil, err + } + req.Header.Set("X-IDENTITY-HEADER", os.Getenv(identityHeaderEnvVar)) + q := req.URL.Query() + q.Set("api-version", appServiceAPIVersion) + q.Set("resource", resource) + switch t := id.(type) { + case UserAssignedClientID: + q.Set(miQueryParameterClientId, string(t)) + case UserAssignedResourceID: + q.Set(miQueryParameterResourceId, string(t)) + case UserAssignedObjectID: + q.Set(miQueryParameterObjectId, string(t)) + case systemAssignedValue: + default: + return nil, fmt.Errorf("unsupported type %T", id) + } + req.URL.RawQuery = q.Encode() + return req, nil +} + +func createIMDSAuthRequest(ctx context.Context, id ID, resource string) (*http.Request, error) { + msiEndpoint, err := url.Parse(imdsDefaultEndpoint) + if err != nil { + return nil, fmt.Errorf("couldn't parse %q: %s", imdsDefaultEndpoint, err) + } + msiParameters := msiEndpoint.Query() + msiParameters.Set(apiVersionQueryParameterName, imdsAPIVersion) + msiParameters.Set(resourceQueryParameterName, resource) + + switch t := id.(type) { + case UserAssignedClientID: + msiParameters.Set(miQueryParameterClientId, string(t)) + case UserAssignedResourceID: + msiParameters.Set(miQueryParameterResourceIdIMDS, string(t)) + case UserAssignedObjectID: + msiParameters.Set(miQueryParameterObjectId, string(t)) + case systemAssignedValue: // not adding anything + default: + return nil, fmt.Errorf("unsupported type %T", id) + } + + msiEndpoint.RawQuery = msiParameters.Encode() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, msiEndpoint.String(), nil) + if err != nil { + return nil, fmt.Errorf("error creating http request %s", err) + } + req.Header.Set(metaHTTPHeaderName, "true") + return req, nil +} + +func createAzureArcAuthRequest(ctx context.Context, resource string, key string) (*http.Request, error) { + identityEndpoint := os.Getenv(identityEndpointEnvVar) + if identityEndpoint == "" { + identityEndpoint = azureArcEndpoint + } + msiEndpoint, parseErr := url.Parse(identityEndpoint) + + if parseErr != nil { + return nil, fmt.Errorf("couldn't parse %q: %s", identityEndpoint, parseErr) + } + + msiParameters := msiEndpoint.Query() + msiParameters.Set(apiVersionQueryParameterName, azureArcAPIVersion) + msiParameters.Set(resourceQueryParameterName, resource) + + msiEndpoint.RawQuery = msiParameters.Encode() + req, err := http.NewRequestWithContext(ctx, http.MethodGet, msiEndpoint.String(), nil) + if err != nil { + return nil, fmt.Errorf("error creating http request %s", err) + } + req.Header.Set(metaHTTPHeaderName, "true") + + if key != "" { + req.Header.Set("Authorization", fmt.Sprintf("Basic %s", key)) + } + + return req, nil +} + +func isAzureArcEnvironment(identityEndpoint, imdsEndpoint string) bool { + if identityEndpoint != "" && imdsEndpoint != "" { + return true + } + himdsFilePath := getAzureArcHimdsFilePath(runtime.GOOS) + if himdsFilePath != "" { + if _, err := os.Stat(himdsFilePath); err == nil { + return true + } + } + return false +} + +func (c *Client) getAzureArcSecretKey(response *http.Response, platform string) (string, error) { + wwwAuthenticateHeader := response.Header.Get(wwwAuthenticateHeaderName) + + if len(wwwAuthenticateHeader) == 0 { + return "", errors.New("response has no www-authenticate header") + } + + // check if the platform is supported + expectedSecretFilePath := getAzureArcPlatformPath(platform) + if expectedSecretFilePath == "" { + return "", errors.New("platform not supported, expected linux or windows") + } + + parts := strings.Split(wwwAuthenticateHeader, "Basic realm=") + if len(parts) < 2 { + return "", fmt.Errorf("basic realm= not found in the string, instead found: %s", wwwAuthenticateHeader) + } + + secretFilePath := parts + + // check that the file in the file path is a .key file + fileName := filepath.Base(secretFilePath[1]) + if !strings.HasSuffix(fileName, azureArcFileExtension) { + return "", fmt.Errorf("invalid file extension, expected %s, got %s", azureArcFileExtension, filepath.Ext(fileName)) + } + + // check that file path from header matches the expected file path for the platform + if expectedSecretFilePath != filepath.Dir(secretFilePath[1]) { + return "", fmt.Errorf("invalid file path, expected %s, got %s", expectedSecretFilePath, filepath.Dir(secretFilePath[1])) + } + + fileInfo, err := os.Stat(secretFilePath[1]) + if err != nil { + return "", fmt.Errorf("failed to get metadata for %s due to error: %s", secretFilePath[1], err) + } + + // Throw an error if the secret file's size is greater than 4096 bytes + if s := fileInfo.Size(); s > azureArcMaxFileSizeBytes { + return "", fmt.Errorf("invalid secret file size, expected %d, file size was %d", azureArcMaxFileSizeBytes, s) + } + + // Attempt to read the contents of the secret file + secret, err := os.ReadFile(secretFilePath[1]) + if err != nil { + return "", fmt.Errorf("failed to read %q due to error: %s", secretFilePath[1], err) + } + + return string(secret), nil +} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/servicefabric.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/servicefabric.go new file mode 100644 index 0000000000..535065e9d9 --- /dev/null +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity/servicefabric.go @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +package managedidentity + +import ( + "context" + "net/http" + "os" +) + +func createServiceFabricAuthRequest(ctx context.Context, resource string) (*http.Request, error) { + identityEndpoint := os.Getenv(identityEndpointEnvVar) + req, err := http.NewRequestWithContext(ctx, http.MethodGet, identityEndpoint, nil) + if err != nil { + return nil, err + } + req.Header.Set("Accept", "application/json") + req.Header.Set("Secret", os.Getenv(identityHeaderEnvVar)) + q := req.URL.Query() + q.Set("api-version", serviceFabricAPIVersion) + q.Set("resource", resource) + req.URL.RawQuery = q.Encode() + return req, nil +} diff --git a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go index 392e5e43f7..7beed26174 100644 --- a/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go +++ b/vendor/github.com/AzureAD/microsoft-authentication-library-for-go/apps/public/public.go @@ -51,6 +51,13 @@ type AuthenticationScheme = authority.AuthenticationScheme type Account = shared.Account +type TokenSource = base.TokenSource + +const ( + TokenSourceIdentityProvider = base.TokenSourceIdentityProvider + TokenSourceCache = base.TokenSourceCache +) + var errNoAccount = errors.New("no account was specified with public.WithSilentAccount(), or the specified account is invalid") // clientOptions configures the Client's behavior. @@ -387,7 +394,7 @@ func (pca Client) AcquireTokenByUsernamePassword(ctx context.Context, scopes []s if err != nil { return AuthResult{}, err } - return pca.base.AuthResultFromToken(ctx, authParams, token, true) + return pca.base.AuthResultFromToken(ctx, authParams, token) } type DeviceCodeResult = accesstokens.DeviceCodeResult @@ -412,7 +419,7 @@ func (d DeviceCode) AuthenticationResult(ctx context.Context) (AuthResult, error if err != nil { return AuthResult{}, err } - return d.client.base.AuthResultFromToken(ctx, d.authParams, token, true) + return d.client.base.AuthResultFromToken(ctx, d.authParams, token) } // acquireTokenByDeviceCodeOptions contains optional configuration for AcquireTokenByDeviceCode @@ -687,7 +694,7 @@ func (pca Client) AcquireTokenInteractive(ctx context.Context, scopes []string, return AuthResult{}, err } - return pca.base.AuthResultFromToken(ctx, authParams, token, true) + return pca.base.AuthResultFromToken(ctx, authParams, token) } type interactiveAuthResult struct { diff --git a/vendor/github.com/golang-jwt/jwt/v5/README.md b/vendor/github.com/golang-jwt/jwt/v5/README.md index 964598a317..0bb636f222 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/README.md +++ b/vendor/github.com/golang-jwt/jwt/v5/README.md @@ -10,11 +10,11 @@ implementation of [JSON Web Tokens](https://datatracker.ietf.org/doc/html/rfc7519). Starting with [v4.0.0](https://github.com/golang-jwt/jwt/releases/tag/v4.0.0) -this project adds Go module support, but maintains backwards compatibility with +this project adds Go module support, but maintains backward compatibility with older `v3.x.y` tags and upstream `github.com/dgrijalva/jwt-go`. See the [`MIGRATION_GUIDE.md`](./MIGRATION_GUIDE.md) for more information. Version v5.0.0 introduces major improvements to the validation of tokens, but is not -entirely backwards compatible. +entirely backward compatible. > After the original author of the library suggested migrating the maintenance > of `jwt-go`, a dedicated team of open source maintainers decided to clone the @@ -24,7 +24,7 @@ entirely backwards compatible. **SECURITY NOTICE:** Some older versions of Go have a security issue in the -crypto/elliptic. Recommendation is to upgrade to at least 1.15 See issue +crypto/elliptic. The recommendation is to upgrade to at least 1.15 See issue [dgrijalva/jwt-go#216](https://github.com/dgrijalva/jwt-go/issues/216) for more detail. @@ -32,7 +32,7 @@ detail. what you expect](https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/). This library attempts to make it easy to do the right thing by requiring key -types match the expected alg, but you should take the extra step to verify it in +types to match the expected alg, but you should take the extra step to verify it in your usage. See the examples provided. ### Supported Go versions @@ -41,7 +41,7 @@ Our support of Go versions is aligned with Go's [version release policy](https://golang.org/doc/devel/release#policy). So we will support a major version of Go until there are two newer major releases. We no longer support building jwt-go with unsupported Go versions, as these contain security -vulnerabilities which will not be fixed. +vulnerabilities that will not be fixed. ## What the heck is a JWT? @@ -117,7 +117,7 @@ notable differences: This library is considered production ready. Feedback and feature requests are appreciated. The API should be considered stable. There should be very few -backwards-incompatible changes outside of major version updates (and only with +backward-incompatible changes outside of major version updates (and only with good reason). This project uses [Semantic Versioning 2.0.0](http://semver.org). Accepted pull @@ -125,8 +125,8 @@ requests will land on `main`. Periodically, versions will be tagged from `main`. You can find all the releases on [the project releases page](https://github.com/golang-jwt/jwt/releases). -**BREAKING CHANGES:*** A full list of breaking changes is available in -`VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating +**BREAKING CHANGES:** A full list of breaking changes is available in +`VERSION_HISTORY.md`. See [`MIGRATION_GUIDE.md`](./MIGRATION_GUIDE.md) for more information on updating your code. ## Extensions diff --git a/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md b/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md index b08402c342..2740597f17 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md +++ b/vendor/github.com/golang-jwt/jwt/v5/SECURITY.md @@ -2,11 +2,11 @@ ## Supported Versions -As of February 2022 (and until this document is updated), the latest version `v4` is supported. +As of November 2024 (and until this document is updated), the latest version `v5` is supported. In critical cases, we might supply back-ported patches for `v4`. ## Reporting a Vulnerability -If you think you found a vulnerability, and even if you are not sure, please report it to jwt-go-security@googlegroups.com or one of the other [golang-jwt maintainers](https://github.com/orgs/golang-jwt/people). Please try be explicit, describe steps to reproduce the security issue with code example(s). +If you think you found a vulnerability, and even if you are not sure, please report it a [GitHub Security Advisory](https://github.com/golang-jwt/jwt/security/advisories/new). Please try be explicit, describe steps to reproduce the security issue with code example(s). You will receive a response within a timely manner. If the issue is confirmed, we will do our best to release a patch as soon as possible given the complexity of the problem. diff --git a/vendor/github.com/golang-jwt/jwt/v5/parser.go b/vendor/github.com/golang-jwt/jwt/v5/parser.go index ecf99af78f..054c7eb6ff 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/parser.go +++ b/vendor/github.com/golang-jwt/jwt/v5/parser.go @@ -8,6 +8,8 @@ import ( "strings" ) +const tokenDelimiter = "." + type Parser struct { // If populated, only these methods will be considered valid. validMethods []string @@ -136,9 +138,10 @@ func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyf // It's only ever useful in cases where you know the signature is valid (since it has already // been or will be checked elsewhere in the stack) and you want to extract values from it. func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Token, parts []string, err error) { - parts = strings.Split(tokenString, ".") - if len(parts) != 3 { - return nil, parts, newError("token contains an invalid number of segments", ErrTokenMalformed) + var ok bool + parts, ok = splitToken(tokenString) + if !ok { + return nil, nil, newError("token contains an invalid number of segments", ErrTokenMalformed) } token = &Token{Raw: tokenString} @@ -196,6 +199,33 @@ func (p *Parser) ParseUnverified(tokenString string, claims Claims) (token *Toke return token, parts, nil } +// splitToken splits a token string into three parts: header, claims, and signature. It will only +// return true if the token contains exactly two delimiters and three parts. In all other cases, it +// will return nil parts and false. +func splitToken(token string) ([]string, bool) { + parts := make([]string, 3) + header, remain, ok := strings.Cut(token, tokenDelimiter) + if !ok { + return nil, false + } + parts[0] = header + claims, remain, ok := strings.Cut(remain, tokenDelimiter) + if !ok { + return nil, false + } + parts[1] = claims + // One more cut to ensure the signature is the last part of the token and there are no more + // delimiters. This avoids an issue where malicious input could contain additional delimiters + // causing unecessary overhead parsing tokens. + signature, _, unexpected := strings.Cut(remain, tokenDelimiter) + if unexpected { + return nil, false + } + parts[2] = signature + + return parts, true +} + // DecodeSegment decodes a JWT specific base64url encoding. This function will // take into account whether the [Parser] is configured with additional options, // such as [WithStrictDecoding] or [WithPaddingAllowed]. diff --git a/vendor/github.com/golang-jwt/jwt/v5/token.go b/vendor/github.com/golang-jwt/jwt/v5/token.go index 352873a2d9..9c7f4ab010 100644 --- a/vendor/github.com/golang-jwt/jwt/v5/token.go +++ b/vendor/github.com/golang-jwt/jwt/v5/token.go @@ -75,7 +75,7 @@ func (t *Token) SignedString(key interface{}) (string, error) { } // SigningString generates the signing string. This is the most expensive part -// of the whole deal. Unless you need this for something special, just go +// of the whole deal. Unless you need this for something special, just go // straight for the SignedString. func (t *Token) SigningString() (string, error) { h, err := json.Marshal(t.Header) diff --git a/vendor/golang.org/x/crypto/cryptobyte/asn1.go b/vendor/golang.org/x/crypto/cryptobyte/asn1.go index 2492f796af..d25979d9f5 100644 --- a/vendor/golang.org/x/crypto/cryptobyte/asn1.go +++ b/vendor/golang.org/x/crypto/cryptobyte/asn1.go @@ -234,7 +234,7 @@ func (b *Builder) AddASN1(tag asn1.Tag, f BuilderContinuation) { // Identifiers with the low five bits set indicate high-tag-number format // (two or more octets), which we don't support. if tag&0x1f == 0x1f { - b.err = fmt.Errorf("cryptobyte: high-tag number identifier octects not supported: 0x%x", tag) + b.err = fmt.Errorf("cryptobyte: high-tag number identifier octets not supported: 0x%x", tag) return } b.AddUint8(uint8(tag)) diff --git a/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go index bd896bdc76..8d99551fee 100644 --- a/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/mac_noasm.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (!amd64 && !ppc64le && !ppc64 && !s390x) || !gc || purego +//go:build (!amd64 && !loong64 && !ppc64le && !ppc64 && !s390x) || !gc || purego package poly1305 diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go similarity index 94% rename from vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go rename to vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go index 164cd47d32..315b84ac39 100644 --- a/vendor/golang.org/x/crypto/internal/poly1305/sum_amd64.go +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_asm.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build gc && !purego +//go:build gc && !purego && (amd64 || loong64 || ppc64 || ppc64le) package poly1305 diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_loong64.s b/vendor/golang.org/x/crypto/internal/poly1305/sum_loong64.s new file mode 100644 index 0000000000..bc8361da40 --- /dev/null +++ b/vendor/golang.org/x/crypto/internal/poly1305/sum_loong64.s @@ -0,0 +1,123 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build gc && !purego + +// func update(state *macState, msg []byte) +TEXT ·update(SB), $0-32 + MOVV state+0(FP), R4 + MOVV msg_base+8(FP), R5 + MOVV msg_len+16(FP), R6 + + MOVV $0x10, R7 + + MOVV (R4), R8 // h0 + MOVV 8(R4), R9 // h1 + MOVV 16(R4), R10 // h2 + MOVV 24(R4), R11 // r0 + MOVV 32(R4), R12 // r1 + + BLT R6, R7, bytes_between_0_and_15 + +loop: + MOVV (R5), R14 // msg[0:8] + MOVV 8(R5), R16 // msg[8:16] + ADDV R14, R8, R8 // h0 (x1 + y1 = z1', if z1' < x1 then z1' overflow) + ADDV R16, R9, R27 + SGTU R14, R8, R24 // h0.carry + SGTU R9, R27, R28 + ADDV R27, R24, R9 // h1 + SGTU R27, R9, R24 + OR R24, R28, R24 // h1.carry + ADDV $0x01, R24, R24 + ADDV R10, R24, R10 // h2 + + ADDV $16, R5, R5 // msg = msg[16:] + +multiply: + MULV R8, R11, R14 // h0r0.lo + MULHVU R8, R11, R15 // h0r0.hi + MULV R9, R11, R13 // h1r0.lo + MULHVU R9, R11, R16 // h1r0.hi + ADDV R13, R15, R15 + SGTU R13, R15, R24 + ADDV R24, R16, R16 + MULV R10, R11, R25 + ADDV R16, R25, R25 + MULV R8, R12, R13 // h0r1.lo + MULHVU R8, R12, R16 // h0r1.hi + ADDV R13, R15, R15 + SGTU R13, R15, R24 + ADDV R24, R16, R16 + MOVV R16, R8 + MULV R10, R12, R26 // h2r1 + MULV R9, R12, R13 // h1r1.lo + MULHVU R9, R12, R16 // h1r1.hi + ADDV R13, R25, R25 + ADDV R16, R26, R27 + SGTU R13, R25, R24 + ADDV R27, R24, R26 + ADDV R8, R25, R25 + SGTU R8, R25, R24 + ADDV R24, R26, R26 + AND $3, R25, R10 + AND $-4, R25, R17 + ADDV R17, R14, R8 + ADDV R26, R15, R27 + SGTU R17, R8, R24 + SGTU R26, R27, R28 + ADDV R27, R24, R9 + SGTU R27, R9, R24 + OR R24, R28, R24 + ADDV R24, R10, R10 + SLLV $62, R26, R27 + SRLV $2, R25, R28 + SRLV $2, R26, R26 + OR R27, R28, R25 + ADDV R25, R8, R8 + ADDV R26, R9, R27 + SGTU R25, R8, R24 + SGTU R26, R27, R28 + ADDV R27, R24, R9 + SGTU R27, R9, R24 + OR R24, R28, R24 + ADDV R24, R10, R10 + + SUBV $16, R6, R6 + BGE R6, R7, loop + +bytes_between_0_and_15: + BEQ R6, R0, done + MOVV $1, R14 + XOR R15, R15 + ADDV R6, R5, R5 + +flush_buffer: + MOVBU -1(R5), R25 + SRLV $56, R14, R24 + SLLV $8, R15, R28 + SLLV $8, R14, R14 + OR R24, R28, R15 + XOR R25, R14, R14 + SUBV $1, R6, R6 + SUBV $1, R5, R5 + BNE R6, R0, flush_buffer + + ADDV R14, R8, R8 + SGTU R14, R8, R24 + ADDV R15, R9, R27 + SGTU R15, R27, R28 + ADDV R27, R24, R9 + SGTU R27, R9, R24 + OR R24, R28, R24 + ADDV R10, R24, R10 + + MOVV $16, R6 + JMP multiply + +done: + MOVV R8, (R4) + MOVV R9, 8(R4) + MOVV R10, 16(R4) + RET diff --git a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go b/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go deleted file mode 100644 index 1a1679aaad..0000000000 --- a/vendor/golang.org/x/crypto/internal/poly1305/sum_ppc64x.go +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright 2019 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build gc && !purego && (ppc64 || ppc64le) - -package poly1305 - -//go:noescape -func update(state *macState, msg []byte) - -// mac is a wrapper for macGeneric that redirects calls that would have gone to -// updateGeneric to update. -// -// Its Write and Sum methods are otherwise identical to the macGeneric ones, but -// using function pointers would carry a major performance cost. -type mac struct{ macGeneric } - -func (h *mac) Write(p []byte) (int, error) { - nn := len(p) - if h.offset > 0 { - n := copy(h.buffer[h.offset:], p) - if h.offset+n < TagSize { - h.offset += n - return nn, nil - } - p = p[n:] - h.offset = 0 - update(&h.macState, h.buffer[:]) - } - if n := len(p) - (len(p) % TagSize); n > 0 { - update(&h.macState, p[:n]) - p = p[n:] - } - if len(p) > 0 { - h.offset += copy(h.buffer[h.offset:], p) - } - return nn, nil -} - -func (h *mac) Sum(out *[16]byte) { - state := h.macState - if h.offset > 0 { - update(&state, h.buffer[:h.offset]) - } - finalize(out, &state.h, &state.s) -} diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go index cf66309c4a..db1c95fab1 100644 --- a/vendor/golang.org/x/net/context/context.go +++ b/vendor/golang.org/x/net/context/context.go @@ -3,29 +3,31 @@ // license that can be found in the LICENSE file. // Package context defines the Context type, which carries deadlines, -// cancelation signals, and other request-scoped values across API boundaries +// cancellation signals, and other request-scoped values across API boundaries // and between processes. // As of Go 1.7 this package is available in the standard library under the -// name context. https://golang.org/pkg/context. +// name [context], and migrating to it can be done automatically with [go fix]. // -// Incoming requests to a server should create a Context, and outgoing calls to -// servers should accept a Context. The chain of function calls between must -// propagate the Context, optionally replacing it with a modified copy created -// using WithDeadline, WithTimeout, WithCancel, or WithValue. +// Incoming requests to a server should create a [Context], and outgoing +// calls to servers should accept a Context. The chain of function +// calls between them must propagate the Context, optionally replacing +// it with a derived Context created using [WithCancel], [WithDeadline], +// [WithTimeout], or [WithValue]. // // Programs that use Contexts should follow these rules to keep interfaces // consistent across packages and enable static analysis tools to check context // propagation: // // Do not store Contexts inside a struct type; instead, pass a Context -// explicitly to each function that needs it. The Context should be the first +// explicitly to each function that needs it. This is discussed further in +// https://go.dev/blog/context-and-structs. The Context should be the first // parameter, typically named ctx: // // func DoSomething(ctx context.Context, arg Arg) error { // // ... use ctx ... // } // -// Do not pass a nil Context, even if a function permits it. Pass context.TODO +// Do not pass a nil [Context], even if a function permits it. Pass [context.TODO] // if you are unsure about which Context to use. // // Use context Values only for request-scoped data that transits processes and @@ -34,9 +36,30 @@ // The same Context may be passed to functions running in different goroutines; // Contexts are safe for simultaneous use by multiple goroutines. // -// See http://blog.golang.org/context for example code for a server that uses +// See https://go.dev/blog/context for example code for a server that uses // Contexts. -package context // import "golang.org/x/net/context" +// +// [go fix]: https://go.dev/cmd/go#hdr-Update_packages_to_use_new_APIs +package context + +import ( + "context" // standard library's context, as of Go 1.7 + "time" +) + +// A Context carries a deadline, a cancellation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context = context.Context + +// Canceled is the error returned by [Context.Err] when the context is canceled +// for some reason other than its deadline passing. +var Canceled = context.Canceled + +// DeadlineExceeded is the error returned by [Context.Err] when the context is canceled +// due to its deadline passing. +var DeadlineExceeded = context.DeadlineExceeded // Background returns a non-nil, empty Context. It is never canceled, has no // values, and has no deadline. It is typically used by the main function, @@ -49,8 +72,73 @@ func Background() Context { // TODO returns a non-nil, empty Context. Code should use context.TODO when // it's unclear which Context to use or it is not yet available (because the // surrounding function has not yet been extended to accept a Context -// parameter). TODO is recognized by static analysis tools that determine -// whether Contexts are propagated correctly in a program. +// parameter). func TODO() Context { return todo } + +var ( + background = context.Background() + todo = context.TODO() +) + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// A CancelFunc may be called by multiple goroutines simultaneously. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc = context.CancelFunc + +// WithCancel returns a derived context that points to the parent context +// but has a new Done channel. The returned context's Done channel is closed +// when the returned cancel function is called or when the parent context's +// Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this [Context] complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + return context.WithCancel(parent) +} + +// WithDeadline returns a derived context that points to the parent context +// but has the deadline adjusted to be no later than d. If the parent's +// deadline is already earlier than d, WithDeadline(parent, d) is semantically +// equivalent to parent. The returned [Context.Done] channel is closed when +// the deadline expires, when the returned cancel function is called, +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this [Context] complete. +func WithDeadline(parent Context, d time.Time) (Context, CancelFunc) { + return context.WithDeadline(parent, d) +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this [Context] complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return context.WithTimeout(parent, timeout) +} + +// WithValue returns a derived context that points to the parent Context. +// In the derived context, the value associated with key is val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +// +// The provided key must be comparable and should not be of type +// string or any other built-in type to avoid collisions between +// packages using context. Users of WithValue should define their own +// types for keys. To avoid allocating when assigning to an +// interface{}, context keys often have concrete type +// struct{}. Alternatively, exported context key variables' static +// type should be a pointer or interface. +func WithValue(parent Context, key, val interface{}) Context { + return context.WithValue(parent, key, val) +} diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go deleted file mode 100644 index 0c1b867937..0000000000 --- a/vendor/golang.org/x/net/context/go17.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.7 - -package context - -import ( - "context" // standard library's context, as of Go 1.7 - "time" -) - -var ( - todo = context.TODO() - background = context.Background() -) - -// Canceled is the error returned by Context.Err when the context is canceled. -var Canceled = context.Canceled - -// DeadlineExceeded is the error returned by Context.Err when the context's -// deadline passes. -var DeadlineExceeded = context.DeadlineExceeded - -// WithCancel returns a copy of parent with a new Done channel. The returned -// context's Done channel is closed when the returned cancel function is called -// or when the parent context's Done channel is closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { - ctx, f := context.WithCancel(parent) - return ctx, f -} - -// WithDeadline returns a copy of the parent context with the deadline adjusted -// to be no later than d. If the parent's deadline is already earlier than d, -// WithDeadline(parent, d) is semantically equivalent to parent. The returned -// context's Done channel is closed when the deadline expires, when the returned -// cancel function is called, or when the parent context's Done channel is -// closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { - ctx, f := context.WithDeadline(parent, deadline) - return ctx, f -} - -// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete: -// -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } -func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { - return WithDeadline(parent, time.Now().Add(timeout)) -} - -// WithValue returns a copy of parent in which the value associated with key is -// val. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -func WithValue(parent Context, key interface{}, val interface{}) Context { - return context.WithValue(parent, key, val) -} diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go deleted file mode 100644 index e31e35a904..0000000000 --- a/vendor/golang.org/x/net/context/go19.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2017 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build go1.9 - -package context - -import "context" // standard library's context, as of Go 1.7 - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context = context.Context - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc = context.CancelFunc diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go deleted file mode 100644 index 065ff3dfa5..0000000000 --- a/vendor/golang.org/x/net/context/pre_go17.go +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.7 - -package context - -import ( - "errors" - "fmt" - "sync" - "time" -) - -// An emptyCtx is never canceled, has no values, and has no deadline. It is not -// struct{}, since vars of this type must have distinct addresses. -type emptyCtx int - -func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { - return -} - -func (*emptyCtx) Done() <-chan struct{} { - return nil -} - -func (*emptyCtx) Err() error { - return nil -} - -func (*emptyCtx) Value(key interface{}) interface{} { - return nil -} - -func (e *emptyCtx) String() string { - switch e { - case background: - return "context.Background" - case todo: - return "context.TODO" - } - return "unknown empty Context" -} - -var ( - background = new(emptyCtx) - todo = new(emptyCtx) -) - -// Canceled is the error returned by Context.Err when the context is canceled. -var Canceled = errors.New("context canceled") - -// DeadlineExceeded is the error returned by Context.Err when the context's -// deadline passes. -var DeadlineExceeded = errors.New("context deadline exceeded") - -// WithCancel returns a copy of parent with a new Done channel. The returned -// context's Done channel is closed when the returned cancel function is called -// or when the parent context's Done channel is closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { - c := newCancelCtx(parent) - propagateCancel(parent, c) - return c, func() { c.cancel(true, Canceled) } -} - -// newCancelCtx returns an initialized cancelCtx. -func newCancelCtx(parent Context) *cancelCtx { - return &cancelCtx{ - Context: parent, - done: make(chan struct{}), - } -} - -// propagateCancel arranges for child to be canceled when parent is. -func propagateCancel(parent Context, child canceler) { - if parent.Done() == nil { - return // parent is never canceled - } - if p, ok := parentCancelCtx(parent); ok { - p.mu.Lock() - if p.err != nil { - // parent has already been canceled - child.cancel(false, p.err) - } else { - if p.children == nil { - p.children = make(map[canceler]bool) - } - p.children[child] = true - } - p.mu.Unlock() - } else { - go func() { - select { - case <-parent.Done(): - child.cancel(false, parent.Err()) - case <-child.Done(): - } - }() - } -} - -// parentCancelCtx follows a chain of parent references until it finds a -// *cancelCtx. This function understands how each of the concrete types in this -// package represents its parent. -func parentCancelCtx(parent Context) (*cancelCtx, bool) { - for { - switch c := parent.(type) { - case *cancelCtx: - return c, true - case *timerCtx: - return c.cancelCtx, true - case *valueCtx: - parent = c.Context - default: - return nil, false - } - } -} - -// removeChild removes a context from its parent. -func removeChild(parent Context, child canceler) { - p, ok := parentCancelCtx(parent) - if !ok { - return - } - p.mu.Lock() - if p.children != nil { - delete(p.children, child) - } - p.mu.Unlock() -} - -// A canceler is a context type that can be canceled directly. The -// implementations are *cancelCtx and *timerCtx. -type canceler interface { - cancel(removeFromParent bool, err error) - Done() <-chan struct{} -} - -// A cancelCtx can be canceled. When canceled, it also cancels any children -// that implement canceler. -type cancelCtx struct { - Context - - done chan struct{} // closed by the first cancel call. - - mu sync.Mutex - children map[canceler]bool // set to nil by the first cancel call - err error // set to non-nil by the first cancel call -} - -func (c *cancelCtx) Done() <-chan struct{} { - return c.done -} - -func (c *cancelCtx) Err() error { - c.mu.Lock() - defer c.mu.Unlock() - return c.err -} - -func (c *cancelCtx) String() string { - return fmt.Sprintf("%v.WithCancel", c.Context) -} - -// cancel closes c.done, cancels each of c's children, and, if -// removeFromParent is true, removes c from its parent's children. -func (c *cancelCtx) cancel(removeFromParent bool, err error) { - if err == nil { - panic("context: internal error: missing cancel error") - } - c.mu.Lock() - if c.err != nil { - c.mu.Unlock() - return // already canceled - } - c.err = err - close(c.done) - for child := range c.children { - // NOTE: acquiring the child's lock while holding parent's lock. - child.cancel(false, err) - } - c.children = nil - c.mu.Unlock() - - if removeFromParent { - removeChild(c.Context, c) - } -} - -// WithDeadline returns a copy of the parent context with the deadline adjusted -// to be no later than d. If the parent's deadline is already earlier than d, -// WithDeadline(parent, d) is semantically equivalent to parent. The returned -// context's Done channel is closed when the deadline expires, when the returned -// cancel function is called, or when the parent context's Done channel is -// closed, whichever happens first. -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete. -func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { - if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { - // The current deadline is already sooner than the new one. - return WithCancel(parent) - } - c := &timerCtx{ - cancelCtx: newCancelCtx(parent), - deadline: deadline, - } - propagateCancel(parent, c) - d := deadline.Sub(time.Now()) - if d <= 0 { - c.cancel(true, DeadlineExceeded) // deadline has already passed - return c, func() { c.cancel(true, Canceled) } - } - c.mu.Lock() - defer c.mu.Unlock() - if c.err == nil { - c.timer = time.AfterFunc(d, func() { - c.cancel(true, DeadlineExceeded) - }) - } - return c, func() { c.cancel(true, Canceled) } -} - -// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to -// implement Done and Err. It implements cancel by stopping its timer then -// delegating to cancelCtx.cancel. -type timerCtx struct { - *cancelCtx - timer *time.Timer // Under cancelCtx.mu. - - deadline time.Time -} - -func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { - return c.deadline, true -} - -func (c *timerCtx) String() string { - return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) -} - -func (c *timerCtx) cancel(removeFromParent bool, err error) { - c.cancelCtx.cancel(false, err) - if removeFromParent { - // Remove this timerCtx from its parent cancelCtx's children. - removeChild(c.cancelCtx.Context, c) - } - c.mu.Lock() - if c.timer != nil { - c.timer.Stop() - c.timer = nil - } - c.mu.Unlock() -} - -// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). -// -// Canceling this context releases resources associated with it, so code should -// call cancel as soon as the operations running in this Context complete: -// -// func slowOperationWithTimeout(ctx context.Context) (Result, error) { -// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) -// defer cancel() // releases resources if slowOperation completes before timeout elapses -// return slowOperation(ctx) -// } -func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { - return WithDeadline(parent, time.Now().Add(timeout)) -} - -// WithValue returns a copy of parent in which the value associated with key is -// val. -// -// Use context Values only for request-scoped data that transits processes and -// APIs, not for passing optional parameters to functions. -func WithValue(parent Context, key interface{}, val interface{}) Context { - return &valueCtx{parent, key, val} -} - -// A valueCtx carries a key-value pair. It implements Value for that key and -// delegates all other calls to the embedded Context. -type valueCtx struct { - Context - key, val interface{} -} - -func (c *valueCtx) String() string { - return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) -} - -func (c *valueCtx) Value(key interface{}) interface{} { - if c.key == key { - return c.val - } - return c.Context.Value(key) -} diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go deleted file mode 100644 index ec5a638033..0000000000 --- a/vendor/golang.org/x/net/context/pre_go19.go +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2014 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.9 - -package context - -import "time" - -// A Context carries a deadline, a cancelation signal, and other values across -// API boundaries. -// -// Context's methods may be called by multiple goroutines simultaneously. -type Context interface { - // Deadline returns the time when work done on behalf of this context - // should be canceled. Deadline returns ok==false when no deadline is - // set. Successive calls to Deadline return the same results. - Deadline() (deadline time.Time, ok bool) - - // Done returns a channel that's closed when work done on behalf of this - // context should be canceled. Done may return nil if this context can - // never be canceled. Successive calls to Done return the same value. - // - // WithCancel arranges for Done to be closed when cancel is called; - // WithDeadline arranges for Done to be closed when the deadline - // expires; WithTimeout arranges for Done to be closed when the timeout - // elapses. - // - // Done is provided for use in select statements: - // - // // Stream generates values with DoSomething and sends them to out - // // until DoSomething returns an error or ctx.Done is closed. - // func Stream(ctx context.Context, out chan<- Value) error { - // for { - // v, err := DoSomething(ctx) - // if err != nil { - // return err - // } - // select { - // case <-ctx.Done(): - // return ctx.Err() - // case out <- v: - // } - // } - // } - // - // See http://blog.golang.org/pipelines for more examples of how to use - // a Done channel for cancelation. - Done() <-chan struct{} - - // Err returns a non-nil error value after Done is closed. Err returns - // Canceled if the context was canceled or DeadlineExceeded if the - // context's deadline passed. No other values for Err are defined. - // After Done is closed, successive calls to Err return the same value. - Err() error - - // Value returns the value associated with this context for key, or nil - // if no value is associated with key. Successive calls to Value with - // the same key returns the same result. - // - // Use context values only for request-scoped data that transits - // processes and API boundaries, not for passing optional parameters to - // functions. - // - // A key identifies a specific value in a Context. Functions that wish - // to store values in Context typically allocate a key in a global - // variable then use that key as the argument to context.WithValue and - // Context.Value. A key can be any type that supports equality; - // packages should define keys as an unexported type to avoid - // collisions. - // - // Packages that define a Context key should provide type-safe accessors - // for the values stores using that key: - // - // // Package user defines a User type that's stored in Contexts. - // package user - // - // import "golang.org/x/net/context" - // - // // User is the type of value stored in the Contexts. - // type User struct {...} - // - // // key is an unexported type for keys defined in this package. - // // This prevents collisions with keys defined in other packages. - // type key int - // - // // userKey is the key for user.User values in Contexts. It is - // // unexported; clients use user.NewContext and user.FromContext - // // instead of using this key directly. - // var userKey key = 0 - // - // // NewContext returns a new Context that carries value u. - // func NewContext(ctx context.Context, u *User) context.Context { - // return context.WithValue(ctx, userKey, u) - // } - // - // // FromContext returns the User value stored in ctx, if any. - // func FromContext(ctx context.Context) (*User, bool) { - // u, ok := ctx.Value(userKey).(*User) - // return u, ok - // } - Value(key interface{}) interface{} -} - -// A CancelFunc tells an operation to abandon its work. -// A CancelFunc does not wait for the work to stop. -// After the first call, subsequent calls to a CancelFunc do nothing. -type CancelFunc func() diff --git a/vendor/golang.org/x/net/http/httpproxy/proxy.go b/vendor/golang.org/x/net/http/httpproxy/proxy.go index 6404aaf157..d89c257ae7 100644 --- a/vendor/golang.org/x/net/http/httpproxy/proxy.go +++ b/vendor/golang.org/x/net/http/httpproxy/proxy.go @@ -14,6 +14,7 @@ import ( "errors" "fmt" "net" + "net/netip" "net/url" "os" "strings" @@ -177,8 +178,10 @@ func (cfg *config) useProxy(addr string) bool { if host == "localhost" { return false } - ip := net.ParseIP(host) - if ip != nil { + nip, err := netip.ParseAddr(host) + var ip net.IP + if err == nil { + ip = net.IP(nip.AsSlice()) if ip.IsLoopback() { return false } @@ -360,6 +363,9 @@ type domainMatch struct { } func (m domainMatch) match(host, port string, ip net.IP) bool { + if ip != nil { + return false + } if strings.HasSuffix(host, m.host) || (m.matchHost && host == m.host[1:]) { return m.port == "" || m.port == port } diff --git a/vendor/golang.org/x/net/http2/frame.go b/vendor/golang.org/x/net/http2/frame.go index 81faec7e75..97bd8b06f7 100644 --- a/vendor/golang.org/x/net/http2/frame.go +++ b/vendor/golang.org/x/net/http2/frame.go @@ -225,6 +225,11 @@ var fhBytes = sync.Pool{ }, } +func invalidHTTP1LookingFrameHeader() FrameHeader { + fh, _ := readFrameHeader(make([]byte, frameHeaderLen), strings.NewReader("HTTP/1.1 ")) + return fh +} + // ReadFrameHeader reads 9 bytes from r and returns a FrameHeader. // Most users should use Framer.ReadFrame instead. func ReadFrameHeader(r io.Reader) (FrameHeader, error) { @@ -503,10 +508,16 @@ func (fr *Framer) ReadFrame() (Frame, error) { return nil, err } if fh.Length > fr.maxReadSize { + if fh == invalidHTTP1LookingFrameHeader() { + return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err) + } return nil, ErrFrameTooLarge } payload := fr.getReadBuf(fh.Length) if _, err := io.ReadFull(fr.r, payload); err != nil { + if fh == invalidHTTP1LookingFrameHeader() { + return nil, fmt.Errorf("http2: failed reading the frame payload: %w, note that the frame header looked like an HTTP/1.1 header", err) + } return nil, err } f, err := typeFrameParser(fh.Type)(fr.frameCache, fh, fr.countError, payload) diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index 7434b87843..51fca38f61 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -1068,7 +1068,10 @@ func (sc *serverConn) serve(conf http2Config) { func (sc *serverConn) handlePingTimer(lastFrameReadTime time.Time) { if sc.pingSent { - sc.vlogf("timeout waiting for PING response") + sc.logf("timeout waiting for PING response") + if f := sc.countErrorFunc; f != nil { + f("conn_close_lost_ping") + } sc.conn.Close() return } @@ -2233,25 +2236,25 @@ func (sc *serverConn) newStream(id, pusherID uint32, state streamState) *stream func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*responseWriter, *http.Request, error) { sc.serveG.check() - rp := requestParam{ - method: f.PseudoValue("method"), - scheme: f.PseudoValue("scheme"), - authority: f.PseudoValue("authority"), - path: f.PseudoValue("path"), - protocol: f.PseudoValue("protocol"), + rp := httpcommon.ServerRequestParam{ + Method: f.PseudoValue("method"), + Scheme: f.PseudoValue("scheme"), + Authority: f.PseudoValue("authority"), + Path: f.PseudoValue("path"), + Protocol: f.PseudoValue("protocol"), } // extended connect is disabled, so we should not see :protocol - if disableExtendedConnectProtocol && rp.protocol != "" { + if disableExtendedConnectProtocol && rp.Protocol != "" { return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) } - isConnect := rp.method == "CONNECT" + isConnect := rp.Method == "CONNECT" if isConnect { - if rp.protocol == "" && (rp.path != "" || rp.scheme != "" || rp.authority == "") { + if rp.Protocol == "" && (rp.Path != "" || rp.Scheme != "" || rp.Authority == "") { return nil, nil, sc.countError("bad_connect", streamError(f.StreamID, ErrCodeProtocol)) } - } else if rp.method == "" || rp.path == "" || (rp.scheme != "https" && rp.scheme != "http") { + } else if rp.Method == "" || rp.Path == "" || (rp.Scheme != "https" && rp.Scheme != "http") { // See 8.1.2.6 Malformed Requests and Responses: // // Malformed requests or responses that are detected @@ -2265,15 +2268,16 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res return nil, nil, sc.countError("bad_path_method", streamError(f.StreamID, ErrCodeProtocol)) } - rp.header = make(http.Header) + header := make(http.Header) + rp.Header = header for _, hf := range f.RegularFields() { - rp.header.Add(sc.canonicalHeader(hf.Name), hf.Value) + header.Add(sc.canonicalHeader(hf.Name), hf.Value) } - if rp.authority == "" { - rp.authority = rp.header.Get("Host") + if rp.Authority == "" { + rp.Authority = header.Get("Host") } - if rp.protocol != "" { - rp.header.Set(":protocol", rp.protocol) + if rp.Protocol != "" { + header.Set(":protocol", rp.Protocol) } rw, req, err := sc.newWriterAndRequestNoBody(st, rp) @@ -2282,7 +2286,7 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res } bodyOpen := !f.StreamEnded() if bodyOpen { - if vv, ok := rp.header["Content-Length"]; ok { + if vv, ok := rp.Header["Content-Length"]; ok { if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil { req.ContentLength = int64(cl) } else { @@ -2298,84 +2302,38 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res return rw, req, nil } -type requestParam struct { - method string - scheme, authority, path string - protocol string - header http.Header -} - -func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp requestParam) (*responseWriter, *http.Request, error) { +func (sc *serverConn) newWriterAndRequestNoBody(st *stream, rp httpcommon.ServerRequestParam) (*responseWriter, *http.Request, error) { sc.serveG.check() var tlsState *tls.ConnectionState // nil if not scheme https - if rp.scheme == "https" { + if rp.Scheme == "https" { tlsState = sc.tlsState } - needsContinue := httpguts.HeaderValuesContainsToken(rp.header["Expect"], "100-continue") - if needsContinue { - rp.header.Del("Expect") - } - // Merge Cookie headers into one "; "-delimited value. - if cookies := rp.header["Cookie"]; len(cookies) > 1 { - rp.header.Set("Cookie", strings.Join(cookies, "; ")) - } - - // Setup Trailers - var trailer http.Header - for _, v := range rp.header["Trailer"] { - for _, key := range strings.Split(v, ",") { - key = http.CanonicalHeaderKey(textproto.TrimString(key)) - switch key { - case "Transfer-Encoding", "Trailer", "Content-Length": - // Bogus. (copy of http1 rules) - // Ignore. - default: - if trailer == nil { - trailer = make(http.Header) - } - trailer[key] = nil - } - } - } - delete(rp.header, "Trailer") - - var url_ *url.URL - var requestURI string - if rp.method == "CONNECT" && rp.protocol == "" { - url_ = &url.URL{Host: rp.authority} - requestURI = rp.authority // mimic HTTP/1 server behavior - } else { - var err error - url_, err = url.ParseRequestURI(rp.path) - if err != nil { - return nil, nil, sc.countError("bad_path", streamError(st.id, ErrCodeProtocol)) - } - requestURI = rp.path + res := httpcommon.NewServerRequest(rp) + if res.InvalidReason != "" { + return nil, nil, sc.countError(res.InvalidReason, streamError(st.id, ErrCodeProtocol)) } body := &requestBody{ conn: sc, stream: st, - needsContinue: needsContinue, + needsContinue: res.NeedsContinue, } - req := &http.Request{ - Method: rp.method, - URL: url_, + req := (&http.Request{ + Method: rp.Method, + URL: res.URL, RemoteAddr: sc.remoteAddrStr, - Header: rp.header, - RequestURI: requestURI, + Header: rp.Header, + RequestURI: res.RequestURI, Proto: "HTTP/2.0", ProtoMajor: 2, ProtoMinor: 0, TLS: tlsState, - Host: rp.authority, + Host: rp.Authority, Body: body, - Trailer: trailer, - } - req = req.WithContext(st.ctx) - + Trailer: res.Trailer, + }).WithContext(st.ctx) rw := sc.newResponseWriter(st, req) return rw, req, nil } @@ -3270,12 +3228,12 @@ func (sc *serverConn) startPush(msg *startPushRequest) { // we start in "half closed (remote)" for simplicity. // See further comments at the definition of stateHalfClosedRemote. promised := sc.newStream(promisedID, msg.parent.id, stateHalfClosedRemote) - rw, req, err := sc.newWriterAndRequestNoBody(promised, requestParam{ - method: msg.method, - scheme: msg.url.Scheme, - authority: msg.url.Host, - path: msg.url.RequestURI(), - header: cloneHeader(msg.header), // clone since handler runs concurrently with writing the PUSH_PROMISE + rw, req, err := sc.newWriterAndRequestNoBody(promised, httpcommon.ServerRequestParam{ + Method: msg.method, + Scheme: msg.url.Scheme, + Authority: msg.url.Host, + Path: msg.url.RequestURI(), + Header: cloneHeader(msg.header), // clone since handler runs concurrently with writing the PUSH_PROMISE }) if err != nil { // Should not happen, since we've already validated msg.url. diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index f2c166b615..f26356b9cd 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -1286,6 +1286,19 @@ func (cc *ClientConn) responseHeaderTimeout() time.Duration { return 0 } +// actualContentLength returns a sanitized version of +// req.ContentLength, where 0 actually means zero (not unknown) and -1 +// means unknown. +func actualContentLength(req *http.Request) int64 { + if req.Body == nil || req.Body == http.NoBody { + return 0 + } + if req.ContentLength != 0 { + return req.ContentLength + } + return -1 +} + func (cc *ClientConn) decrStreamReservations() { cc.mu.Lock() defer cc.mu.Unlock() @@ -1310,7 +1323,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) reqCancel: req.Cancel, isHead: req.Method == "HEAD", reqBody: req.Body, - reqBodyContentLength: httpcommon.ActualContentLength(req), + reqBodyContentLength: actualContentLength(req), trace: httptrace.ContextClientTrace(ctx), peerClosed: make(chan struct{}), abort: make(chan struct{}), @@ -1318,7 +1331,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) donec: make(chan struct{}), } - cs.requestedGzip = httpcommon.IsRequestGzip(req, cc.t.disableCompression()) + cs.requestedGzip = httpcommon.IsRequestGzip(req.Method, req.Header, cc.t.disableCompression()) go cs.doRequest(req, streamf) @@ -1349,7 +1362,7 @@ func (cc *ClientConn) roundTrip(req *http.Request, streamf func(*clientStream)) } res.Request = req res.TLS = cc.tlsState - if res.Body == noBody && httpcommon.ActualContentLength(req) == 0 { + if res.Body == noBody && actualContentLength(req) == 0 { // If there isn't a request or response body still being // written, then wait for the stream to be closed before // RoundTrip returns. @@ -1596,12 +1609,7 @@ func (cs *clientStream) encodeAndWriteHeaders(req *http.Request) error { // sent by writeRequestBody below, along with any Trailers, // again in form HEADERS{1}, CONTINUATION{0,}) cc.hbuf.Reset() - res, err := httpcommon.EncodeHeaders(httpcommon.EncodeHeadersParam{ - Request: req, - AddGzipHeader: cs.requestedGzip, - PeerMaxHeaderListSize: cc.peerMaxHeaderListSize, - DefaultUserAgent: defaultUserAgent, - }, func(name, value string) { + res, err := encodeRequestHeaders(req, cs.requestedGzip, cc.peerMaxHeaderListSize, func(name, value string) { cc.writeHeader(name, value) }) if err != nil { @@ -1617,6 +1625,22 @@ func (cs *clientStream) encodeAndWriteHeaders(req *http.Request) error { return err } +func encodeRequestHeaders(req *http.Request, addGzipHeader bool, peerMaxHeaderListSize uint64, headerf func(name, value string)) (httpcommon.EncodeHeadersResult, error) { + return httpcommon.EncodeHeaders(req.Context(), httpcommon.EncodeHeadersParam{ + Request: httpcommon.Request{ + Header: req.Header, + Trailer: req.Trailer, + URL: req.URL, + Host: req.Host, + Method: req.Method, + ActualContentLength: actualContentLength(req), + }, + AddGzipHeader: addGzipHeader, + PeerMaxHeaderListSize: peerMaxHeaderListSize, + DefaultUserAgent: defaultUserAgent, + }, headerf) +} + // cleanupWriteRequest performs post-request tasks. // // If err (the result of writeRequest) is non-nil and the stream is not closed, @@ -2186,6 +2210,13 @@ func (rl *clientConnReadLoop) cleanup() { } cc.cond.Broadcast() cc.mu.Unlock() + + if !cc.seenSettings { + // If we have a pending request that wants extended CONNECT, + // let it continue and fail with the connection error. + cc.extendedConnectAllowed = true + close(cc.seenSettingsChan) + } } // countReadFrameError calls Transport.CountError with a string @@ -2278,9 +2309,6 @@ func (rl *clientConnReadLoop) run() error { if VerboseLogs { cc.vlogf("http2: Transport conn %p received error from processing frame %v: %v", cc, summarizeFrame(f), err) } - if !cc.seenSettings { - close(cc.seenSettingsChan) - } return err } } diff --git a/vendor/golang.org/x/net/internal/httpcommon/headermap.go b/vendor/golang.org/x/net/internal/httpcommon/headermap.go index ad3fbacd60..92483d8e41 100644 --- a/vendor/golang.org/x/net/internal/httpcommon/headermap.go +++ b/vendor/golang.org/x/net/internal/httpcommon/headermap.go @@ -5,7 +5,7 @@ package httpcommon import ( - "net/http" + "net/textproto" "sync" ) @@ -82,7 +82,7 @@ func buildCommonHeaderMaps() { commonLowerHeader = make(map[string]string, len(common)) commonCanonHeader = make(map[string]string, len(common)) for _, v := range common { - chk := http.CanonicalHeaderKey(v) + chk := textproto.CanonicalMIMEHeaderKey(v) commonLowerHeader[chk] = v commonCanonHeader[v] = chk } @@ -104,7 +104,7 @@ func CanonicalHeader(v string) string { if s, ok := commonCanonHeader[v]; ok { return s } - return http.CanonicalHeaderKey(v) + return textproto.CanonicalMIMEHeaderKey(v) } // CachedCanonicalHeader returns the canonical form of a well-known header name. diff --git a/vendor/golang.org/x/net/internal/httpcommon/request.go b/vendor/golang.org/x/net/internal/httpcommon/request.go index 3439147738..4b70553179 100644 --- a/vendor/golang.org/x/net/internal/httpcommon/request.go +++ b/vendor/golang.org/x/net/internal/httpcommon/request.go @@ -5,10 +5,12 @@ package httpcommon import ( + "context" "errors" "fmt" - "net/http" "net/http/httptrace" + "net/textproto" + "net/url" "sort" "strconv" "strings" @@ -21,9 +23,21 @@ var ( ErrRequestHeaderListSize = errors.New("request header list larger than peer's advertised limit") ) +// Request is a subset of http.Request. +// It'd be simpler to pass an *http.Request, of course, but we can't depend on net/http +// without creating a dependency cycle. +type Request struct { + URL *url.URL + Method string + Host string + Header map[string][]string + Trailer map[string][]string + ActualContentLength int64 // 0 means 0, -1 means unknown +} + // EncodeHeadersParam is parameters to EncodeHeaders. type EncodeHeadersParam struct { - Request *http.Request + Request Request // AddGzipHeader indicates that an "accept-encoding: gzip" header should be // added to the request. @@ -47,11 +61,11 @@ type EncodeHeadersResult struct { // It validates a request and calls headerf with each pseudo-header and header // for the request. // The headerf function is called with the validated, canonicalized header name. -func EncodeHeaders(param EncodeHeadersParam, headerf func(name, value string)) (res EncodeHeadersResult, _ error) { +func EncodeHeaders(ctx context.Context, param EncodeHeadersParam, headerf func(name, value string)) (res EncodeHeadersResult, _ error) { req := param.Request // Check for invalid connection-level headers. - if err := checkConnHeaders(req); err != nil { + if err := checkConnHeaders(req.Header); err != nil { return res, err } @@ -73,7 +87,10 @@ func EncodeHeaders(param EncodeHeadersParam, headerf func(name, value string)) ( // isNormalConnect is true if this is a non-extended CONNECT request. isNormalConnect := false - protocol := req.Header.Get(":protocol") + var protocol string + if vv := req.Header[":protocol"]; len(vv) > 0 { + protocol = vv[0] + } if req.Method == "CONNECT" && protocol == "" { isNormalConnect = true } else if protocol != "" && req.Method != "CONNECT" { @@ -107,9 +124,7 @@ func EncodeHeaders(param EncodeHeadersParam, headerf func(name, value string)) ( return res, fmt.Errorf("invalid HTTP trailer %s", err) } - contentLength := ActualContentLength(req) - - trailers, err := commaSeparatedTrailers(req) + trailers, err := commaSeparatedTrailers(req.Trailer) if err != nil { return res, err } @@ -123,7 +138,7 @@ func EncodeHeaders(param EncodeHeadersParam, headerf func(name, value string)) ( f(":authority", host) m := req.Method if m == "" { - m = http.MethodGet + m = "GET" } f(":method", m) if !isNormalConnect { @@ -198,8 +213,8 @@ func EncodeHeaders(param EncodeHeadersParam, headerf func(name, value string)) ( f(k, v) } } - if shouldSendReqContentLength(req.Method, contentLength) { - f("content-length", strconv.FormatInt(contentLength, 10)) + if shouldSendReqContentLength(req.Method, req.ActualContentLength) { + f("content-length", strconv.FormatInt(req.ActualContentLength, 10)) } if param.AddGzipHeader { f("accept-encoding", "gzip") @@ -225,7 +240,7 @@ func EncodeHeaders(param EncodeHeadersParam, headerf func(name, value string)) ( } } - trace := httptrace.ContextClientTrace(req.Context()) + trace := httptrace.ContextClientTrace(ctx) // Header list size is ok. Write the headers. enumerateHeaders(func(name, value string) { @@ -243,19 +258,19 @@ func EncodeHeaders(param EncodeHeadersParam, headerf func(name, value string)) ( } }) - res.HasBody = contentLength != 0 + res.HasBody = req.ActualContentLength != 0 res.HasTrailers = trailers != "" return res, nil } // IsRequestGzip reports whether we should add an Accept-Encoding: gzip header // for a request. -func IsRequestGzip(req *http.Request, disableCompression bool) bool { +func IsRequestGzip(method string, header map[string][]string, disableCompression bool) bool { // TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere? if !disableCompression && - req.Header.Get("Accept-Encoding") == "" && - req.Header.Get("Range") == "" && - req.Method != "HEAD" { + len(header["Accept-Encoding"]) == 0 && + len(header["Range"]) == 0 && + method != "HEAD" { // Request gzip only, not deflate. Deflate is ambiguous and // not as universally supported anyway. // See: https://zlib.net/zlib_faq.html#faq39 @@ -280,22 +295,22 @@ func IsRequestGzip(req *http.Request, disableCompression bool) bool { // // Certain headers are special-cased as okay but not transmitted later. // For example, we allow "Transfer-Encoding: chunked", but drop the header when encoding. -func checkConnHeaders(req *http.Request) error { - if v := req.Header.Get("Upgrade"); v != "" { - return fmt.Errorf("invalid Upgrade request header: %q", req.Header["Upgrade"]) +func checkConnHeaders(h map[string][]string) error { + if vv := h["Upgrade"]; len(vv) > 0 && (vv[0] != "" && vv[0] != "chunked") { + return fmt.Errorf("invalid Upgrade request header: %q", vv) } - if vv := req.Header["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") { + if vv := h["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") { return fmt.Errorf("invalid Transfer-Encoding request header: %q", vv) } - if vv := req.Header["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !asciiEqualFold(vv[0], "close") && !asciiEqualFold(vv[0], "keep-alive")) { + if vv := h["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !asciiEqualFold(vv[0], "close") && !asciiEqualFold(vv[0], "keep-alive")) { return fmt.Errorf("invalid Connection request header: %q", vv) } return nil } -func commaSeparatedTrailers(req *http.Request) (string, error) { - keys := make([]string, 0, len(req.Trailer)) - for k := range req.Trailer { +func commaSeparatedTrailers(trailer map[string][]string) (string, error) { + keys := make([]string, 0, len(trailer)) + for k := range trailer { k = CanonicalHeader(k) switch k { case "Transfer-Encoding", "Trailer", "Content-Length": @@ -310,19 +325,6 @@ func commaSeparatedTrailers(req *http.Request) (string, error) { return "", nil } -// ActualContentLength returns a sanitized version of -// req.ContentLength, where 0 actually means zero (not unknown) and -1 -// means unknown. -func ActualContentLength(req *http.Request) int64 { - if req.Body == nil || req.Body == http.NoBody { - return 0 - } - if req.ContentLength != 0 { - return req.ContentLength - } - return -1 -} - // validPseudoPath reports whether v is a valid :path pseudo-header // value. It must be either: // @@ -340,7 +342,7 @@ func validPseudoPath(v string) bool { return (len(v) > 0 && v[0] == '/') || v == "*" } -func validateHeaders(hdrs http.Header) string { +func validateHeaders(hdrs map[string][]string) string { for k, vv := range hdrs { if !httpguts.ValidHeaderFieldName(k) && k != ":protocol" { return fmt.Sprintf("name %q", k) @@ -377,3 +379,89 @@ func shouldSendReqContentLength(method string, contentLength int64) bool { return false } } + +// ServerRequestParam is parameters to NewServerRequest. +type ServerRequestParam struct { + Method string + Scheme, Authority, Path string + Protocol string + Header map[string][]string +} + +// ServerRequestResult is the result of NewServerRequest. +type ServerRequestResult struct { + // Various http.Request fields. + URL *url.URL + RequestURI string + Trailer map[string][]string + + NeedsContinue bool // client provided an "Expect: 100-continue" header + + // If the request should be rejected, this is a short string suitable for passing + // to the http2 package's CountError function. + // It might be a bit odd to return errors this way rather than returing an error, + // but this ensures we don't forget to include a CountError reason. + InvalidReason string +} + +func NewServerRequest(rp ServerRequestParam) ServerRequestResult { + needsContinue := httpguts.HeaderValuesContainsToken(rp.Header["Expect"], "100-continue") + if needsContinue { + delete(rp.Header, "Expect") + } + // Merge Cookie headers into one "; "-delimited value. + if cookies := rp.Header["Cookie"]; len(cookies) > 1 { + rp.Header["Cookie"] = []string{strings.Join(cookies, "; ")} + } + + // Setup Trailers + var trailer map[string][]string + for _, v := range rp.Header["Trailer"] { + for _, key := range strings.Split(v, ",") { + key = textproto.CanonicalMIMEHeaderKey(textproto.TrimString(key)) + switch key { + case "Transfer-Encoding", "Trailer", "Content-Length": + // Bogus. (copy of http1 rules) + // Ignore. + default: + if trailer == nil { + trailer = make(map[string][]string) + } + trailer[key] = nil + } + } + } + delete(rp.Header, "Trailer") + + // "':authority' MUST NOT include the deprecated userinfo subcomponent + // for "http" or "https" schemed URIs." + // https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8 + if strings.IndexByte(rp.Authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") { + return ServerRequestResult{ + InvalidReason: "userinfo_in_authority", + } + } + + var url_ *url.URL + var requestURI string + if rp.Method == "CONNECT" && rp.Protocol == "" { + url_ = &url.URL{Host: rp.Authority} + requestURI = rp.Authority // mimic HTTP/1 server behavior + } else { + var err error + url_, err = url.ParseRequestURI(rp.Path) + if err != nil { + return ServerRequestResult{ + InvalidReason: "bad_path", + } + } + requestURI = rp.Path + } + + return ServerRequestResult{ + URL: url_, + NeedsContinue: needsContinue, + RequestURI: requestURI, + Trailer: trailer, + } +} diff --git a/vendor/golang.org/x/net/websocket/websocket.go b/vendor/golang.org/x/net/websocket/websocket.go index ac76165ceb..3448d20395 100644 --- a/vendor/golang.org/x/net/websocket/websocket.go +++ b/vendor/golang.org/x/net/websocket/websocket.go @@ -6,9 +6,10 @@ // as specified in RFC 6455. // // This package currently lacks some features found in an alternative -// and more actively maintained WebSocket package: +// and more actively maintained WebSocket packages: // -// https://pkg.go.dev/github.com/coder/websocket +// - [github.com/gorilla/websocket] +// - [github.com/coder/websocket] package websocket // import "golang.org/x/net/websocket" import ( diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 9c105f23af..2e73ee1975 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -149,6 +149,18 @@ var ARM struct { _ CacheLinePad } +// The booleans in Loong64 contain the correspondingly named cpu feature bit. +// The struct is padded to avoid false sharing. +var Loong64 struct { + _ CacheLinePad + HasLSX bool // support 128-bit vector extension + HasLASX bool // support 256-bit vector extension + HasCRC32 bool // support CRC instruction + HasLAM_BH bool // support AM{SWAP/ADD}[_DB].{B/H} instruction + HasLAMCAS bool // support AMCAS[_DB].{B/H/W/D} instruction + _ CacheLinePad +} + // MIPS64X contains the supported CPU features of the current mips64/mips64le // platforms. If the current platform is not mips64/mips64le or the current // operating system is not Linux then all feature flags are false. diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go new file mode 100644 index 0000000000..4f34114329 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go @@ -0,0 +1,22 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +// HWCAP bits. These are exposed by the Linux kernel. +const ( + hwcap_LOONGARCH_LSX = 1 << 4 + hwcap_LOONGARCH_LASX = 1 << 5 +) + +func doinit() { + // TODO: Features that require kernel support like LSX and LASX can + // be detected here once needed in std library or by the compiler. + Loong64.HasLSX = hwcIsSet(hwCap, hwcap_LOONGARCH_LSX) + Loong64.HasLASX = hwcIsSet(hwCap, hwcap_LOONGARCH_LASX) +} + +func hwcIsSet(hwc uint, val uint) bool { + return hwc&val != 0 +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go index 7d902b6847..a428dec9cd 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 +//go:build linux && !arm && !arm64 && !loong64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_loong64.go b/vendor/golang.org/x/sys/cpu/cpu_loong64.go index 558635850c..45ecb29ae7 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_loong64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_loong64.go @@ -8,5 +8,43 @@ package cpu const cacheLineSize = 64 +// Bit fields for CPUCFG registers, Related reference documents: +// https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_cpucfg +const ( + // CPUCFG1 bits + cpucfg1_CRC32 = 1 << 25 + + // CPUCFG2 bits + cpucfg2_LAM_BH = 1 << 27 + cpucfg2_LAMCAS = 1 << 28 +) + func initOptions() { + options = []option{ + {Name: "lsx", Feature: &Loong64.HasLSX}, + {Name: "lasx", Feature: &Loong64.HasLASX}, + {Name: "crc32", Feature: &Loong64.HasCRC32}, + {Name: "lam_bh", Feature: &Loong64.HasLAM_BH}, + {Name: "lamcas", Feature: &Loong64.HasLAMCAS}, + } + + // The CPUCFG data on Loong64 only reflects the hardware capabilities, + // not the kernel support status, so features such as LSX and LASX that + // require kernel support cannot be obtained from the CPUCFG data. + // + // These features only require hardware capability support and do not + // require kernel specific support, so they can be obtained directly + // through CPUCFG + cfg1 := get_cpucfg(1) + cfg2 := get_cpucfg(2) + + Loong64.HasCRC32 = cfgIsSet(cfg1, cpucfg1_CRC32) + Loong64.HasLAMCAS = cfgIsSet(cfg2, cpucfg2_LAMCAS) + Loong64.HasLAM_BH = cfgIsSet(cfg2, cpucfg2_LAM_BH) +} + +func get_cpucfg(reg uint32) uint32 + +func cfgIsSet(cfg uint32, val uint32) bool { + return cfg&val != 0 } diff --git a/vendor/golang.org/x/sys/cpu/cpu_loong64.s b/vendor/golang.org/x/sys/cpu/cpu_loong64.s new file mode 100644 index 0000000000..71cbaf1ce2 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_loong64.s @@ -0,0 +1,13 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// func get_cpucfg(reg uint32) uint32 +TEXT ·get_cpucfg(SB), NOSPLIT|NOFRAME, $0 + MOVW reg+0(FP), R5 + // CPUCFG R5, R4 = 0x00006ca4 + WORD $0x00006ca4 + MOVW R4, ret+8(FP) + RET diff --git a/vendor/golang.org/x/sys/cpu/parse.go b/vendor/golang.org/x/sys/cpu/parse.go index 762b63d688..56a7e1a176 100644 --- a/vendor/golang.org/x/sys/cpu/parse.go +++ b/vendor/golang.org/x/sys/cpu/parse.go @@ -13,7 +13,7 @@ import "strconv" // https://golang.org/cl/209597. func parseRelease(rel string) (major, minor, patch int, ok bool) { // Strip anything after a dash or plus. - for i := 0; i < len(rel); i++ { + for i := range len(rel) { if rel[i] == '-' || rel[i] == '+' { rel = rel[:i] break @@ -21,7 +21,7 @@ func parseRelease(rel string) (major, minor, patch int, ok bool) { } next := func() (int, bool) { - for i := 0; i < len(rel); i++ { + for i := range len(rel) { if rel[i] == '.' { ver, err := strconv.Atoi(rel[:i]) rel = rel[i+1:] diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 099867deed..798f61ad3b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -602,7 +602,150 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI return } -//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) +// sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) +const minIovec = 8 + +func Readv(fd int, iovs [][]byte) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = readv(fd, iovecs) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = preadv(fd, iovecs, offset) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Writev(fd int, iovs [][]byte) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = writev(fd, iovecs) + writevRacedetect(iovecs, n) + return n, err +} + +func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { + if !darwinKernelVersionMin(11, 0, 0) { + return 0, ENOSYS + } + + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = pwritev(fd, iovecs, offset) + writevRacedetect(iovecs, n) + return n, err +} + +func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { + for _, b := range bs { + var v Iovec + v.SetLen(len(b)) + if len(b) > 0 { + v.Base = &b[0] + } else { + v.Base = (*byte)(unsafe.Pointer(&_zero)) + } + vecs = append(vecs, v) + } + return vecs +} + +func writevRacedetect(iovecs []Iovec, n int) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceReadRange(unsafe.Pointer(iovecs[i].Base), m) + } + } +} + +func readvRacedetect(iovecs []Iovec, n int, err error) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) + } + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } +} + +func darwinMajorMinPatch() (maj, min, patch int, err error) { + var un Utsname + err = Uname(&un) + if err != nil { + return + } + + var mmp [3]int + c := 0 +Loop: + for _, b := range un.Release[:] { + switch { + case b >= '0' && b <= '9': + mmp[c] = 10*mmp[c] + int(b-'0') + case b == '.': + c++ + if c > 2 { + return 0, 0, 0, ENOTSUP + } + case b == 0: + break Loop + default: + return 0, 0, 0, ENOTSUP + } + } + if c != 2 { + return 0, 0, 0, ENOTSUP + } + return mmp[0], mmp[1], mmp[2], nil +} + +func darwinKernelVersionMin(maj, min, patch int) bool { + actualMaj, actualMin, actualPatch, err := darwinMajorMinPatch() + if err != nil { + return false + } + return actualMaj > maj || actualMaj == maj && (actualMin > min || actualMin == min && actualPatch >= patch) +} + //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) @@ -705,3 +848,7 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) +//sys readv(fd int, iovecs []Iovec) (n int, err error) +//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) +//sys writev(fd int, iovecs []Iovec) (n int, err error) +//sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 230a94549a..4958a65708 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -13,6 +13,7 @@ package unix import ( "encoding/binary" + "slices" "strconv" "syscall" "time" @@ -417,7 +418,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { return nil, 0, EINVAL } sa.raw.Family = AF_UNIX - for i := 0; i < n; i++ { + for i := range n { sa.raw.Path[i] = int8(name[i]) } // length is family (uint16), name, NUL. @@ -507,7 +508,7 @@ func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) { psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm)) psm[0] = byte(sa.PSM) psm[1] = byte(sa.PSM >> 8) - for i := 0; i < len(sa.Addr); i++ { + for i := range len(sa.Addr) { sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i] } cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid)) @@ -589,11 +590,11 @@ func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i] = rx[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i+4] = tx[i] } return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil @@ -618,11 +619,11 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) n := (*[8]byte)(unsafe.Pointer(&sa.Name)) - for i := 0; i < 8; i++ { + for i := range 8 { sa.raw.Addr[i] = n[i] } p := (*[4]byte)(unsafe.Pointer(&sa.PGN)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i+8] = p[i] } sa.raw.Addr[12] = sa.Addr @@ -911,7 +912,7 @@ func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) { // These are EBCDIC encoded by the kernel, but we still need to pad them // with blanks. Initializing with blanks allows the caller to feed in either // a padded or an unpadded string. - for i := 0; i < 8; i++ { + for i := range 8 { sa.raw.Nodeid[i] = ' ' sa.raw.User_id[i] = ' ' sa.raw.Name[i] = ' ' @@ -1148,7 +1149,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { var user [8]byte var name [8]byte - for i := 0; i < 8; i++ { + for i := range 8 { user[i] = byte(pp.User_id[i]) name[i] = byte(pp.Name[i]) } @@ -1173,11 +1174,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { Ifindex: int(pp.Ifindex), } name := (*[8]byte)(unsafe.Pointer(&sa.Name)) - for i := 0; i < 8; i++ { + for i := range 8 { name[i] = pp.Addr[i] } pgn := (*[4]byte)(unsafe.Pointer(&sa.PGN)) - for i := 0; i < 4; i++ { + for i := range 4 { pgn[i] = pp.Addr[i+8] } addr := (*[1]byte)(unsafe.Pointer(&sa.Addr)) @@ -1188,11 +1189,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { Ifindex: int(pp.Ifindex), } rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) - for i := 0; i < 4; i++ { + for i := range 4 { rx[i] = pp.Addr[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) - for i := 0; i < 4; i++ { + for i := range 4 { tx[i] = pp.Addr[i+4] } return sa, nil @@ -2216,10 +2217,7 @@ func readvRacedetect(iovecs []Iovec, n int, err error) { return } for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } + m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) @@ -2270,10 +2268,7 @@ func writevRacedetect(iovecs []Iovec, n int) { return } for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } + m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceReadRange(unsafe.Pointer(iovecs[i].Base), m) @@ -2320,12 +2315,7 @@ func isGroupMember(gid int) bool { return false } - for _, g := range groups { - if g == gid { - return true - } - } - return false + return slices.Contains(groups, gid) } func isCapDacOverrideSet() bool { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 24b346e1a3..813c05b664 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index ebd213100b..fda328582b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_fstat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat64(SB) GLOBL ·libc_fstat64_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 824b9c2d5e..e6f58f3c6f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 4f178a2293..7f8998b905 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/windows/registry/key.go b/vendor/golang.org/x/sys/windows/registry/key.go index fd8632444e..39aeeb644f 100644 --- a/vendor/golang.org/x/sys/windows/registry/key.go +++ b/vendor/golang.org/x/sys/windows/registry/key.go @@ -164,7 +164,12 @@ loopItems: func CreateKey(k Key, path string, access uint32) (newk Key, openedExisting bool, err error) { var h syscall.Handle var d uint32 - err = regCreateKeyEx(syscall.Handle(k), syscall.StringToUTF16Ptr(path), + var pathPointer *uint16 + pathPointer, err = syscall.UTF16PtrFromString(path) + if err != nil { + return 0, false, err + } + err = regCreateKeyEx(syscall.Handle(k), pathPointer, 0, nil, _REG_OPTION_NON_VOLATILE, access, nil, &h, &d) if err != nil { return 0, false, err @@ -174,7 +179,11 @@ func CreateKey(k Key, path string, access uint32) (newk Key, openedExisting bool // DeleteKey deletes the subkey path of key k and its values. func DeleteKey(k Key, path string) error { - return regDeleteKey(syscall.Handle(k), syscall.StringToUTF16Ptr(path)) + pathPointer, err := syscall.UTF16PtrFromString(path) + if err != nil { + return err + } + return regDeleteKey(syscall.Handle(k), pathPointer) } // A KeyInfo describes the statistics of a key. It is returned by Stat. diff --git a/vendor/golang.org/x/sys/windows/registry/value.go b/vendor/golang.org/x/sys/windows/registry/value.go index 74db26b94d..a1bcbb2362 100644 --- a/vendor/golang.org/x/sys/windows/registry/value.go +++ b/vendor/golang.org/x/sys/windows/registry/value.go @@ -340,7 +340,11 @@ func (k Key) SetBinaryValue(name string, value []byte) error { // DeleteValue removes a named value from the key k. func (k Key) DeleteValue(name string) error { - return regDeleteValue(syscall.Handle(k), syscall.StringToUTF16Ptr(name)) + namePointer, err := syscall.UTF16PtrFromString(name) + if err != nil { + return err + } + return regDeleteValue(syscall.Handle(k), namePointer) } // ReadValueNames returns the value names of key k. diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 9d138de5fe..ad67df2fdb 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1074,6 +1074,7 @@ const ( IP_ADD_MEMBERSHIP = 0xc IP_DROP_MEMBERSHIP = 0xd IP_PKTINFO = 0x13 + IP_MTU_DISCOVER = 0x47 IPV6_V6ONLY = 0x1b IPV6_UNICAST_HOPS = 0x4 @@ -1083,6 +1084,7 @@ const ( IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_PKTINFO = 0x13 + IPV6_MTU_DISCOVER = 0x47 MSG_OOB = 0x1 MSG_PEEK = 0x2 @@ -1132,6 +1134,15 @@ const ( WSASYS_STATUS_LEN = 128 ) +// enum PMTUD_STATE from ws2ipdef.h +const ( + IP_PMTUDISC_NOT_SET = 0 + IP_PMTUDISC_DO = 1 + IP_PMTUDISC_DONT = 2 + IP_PMTUDISC_PROBE = 3 + IP_PMTUDISC_MAX = 4 +) + type WSABuf struct { Len uint32 Buf *byte @@ -1146,6 +1157,22 @@ type WSAMsg struct { Flags uint32 } +type WSACMSGHDR struct { + Len uintptr + Level int32 + Type int32 +} + +type IN_PKTINFO struct { + Addr [4]byte + Ifindex uint32 +} + +type IN6_PKTINFO struct { + Addr [16]byte + Ifindex uint32 +} + // Flags for WSASocket const ( WSA_FLAG_OVERLAPPED = 0x01 diff --git a/vendor/golang.org/x/term/terminal.go b/vendor/golang.org/x/term/terminal.go index f636667fb0..14f89470ab 100644 --- a/vendor/golang.org/x/term/terminal.go +++ b/vendor/golang.org/x/term/terminal.go @@ -44,6 +44,8 @@ type Terminal struct { // bytes, as an index into |line|). If it returns ok=false, the key // press is processed normally. Otherwise it returns a replacement line // and the new cursor position. + // + // This will be disabled during ReadPassword. AutoCompleteCallback func(line string, pos int, key rune) (newLine string, newPos int, ok bool) // Escape contains a pointer to the escape codes for this terminal. @@ -692,6 +694,8 @@ func (t *Terminal) Write(buf []byte) (n int, err error) { // ReadPassword temporarily changes the prompt and reads a password, without // echo, from the terminal. +// +// The AutoCompleteCallback is disabled during this call. func (t *Terminal) ReadPassword(prompt string) (line string, err error) { t.lock.Lock() defer t.lock.Unlock() @@ -699,6 +703,11 @@ func (t *Terminal) ReadPassword(prompt string) (line string, err error) { oldPrompt := t.prompt t.prompt = []rune(prompt) t.echo = false + oldAutoCompleteCallback := t.AutoCompleteCallback + t.AutoCompleteCallback = nil + defer func() { + t.AutoCompleteCallback = oldAutoCompleteCallback + }() line, err = t.readLine() diff --git a/vendor/golang.org/x/text/internal/number/format.go b/vendor/golang.org/x/text/internal/number/format.go index cd94c5dc4e..1aadcf4077 100644 --- a/vendor/golang.org/x/text/internal/number/format.go +++ b/vendor/golang.org/x/text/internal/number/format.go @@ -394,9 +394,7 @@ func appendScientific(dst []byte, f *Formatter, n *Digits) (b []byte, postPre, p exp := n.Exp - int32(n.Comma) exponential := f.Symbol(SymExponential) if exponential == "E" { - dst = append(dst, "\u202f"...) // NARROW NO-BREAK SPACE dst = append(dst, f.Symbol(SymSuperscriptingExponent)...) - dst = append(dst, "\u202f"...) // NARROW NO-BREAK SPACE dst = f.AppendDigit(dst, 1) dst = f.AppendDigit(dst, 0) switch { diff --git a/vendor/golang.org/x/text/language/parse.go b/vendor/golang.org/x/text/language/parse.go index 4d57222e77..053336e286 100644 --- a/vendor/golang.org/x/text/language/parse.go +++ b/vendor/golang.org/x/text/language/parse.go @@ -59,7 +59,7 @@ func (c CanonType) Parse(s string) (t Tag, err error) { if changed { tt.RemakeString() } - return makeTag(tt), err + return makeTag(tt), nil } // Compose creates a Tag from individual parts, which may be of type Tag, Base, diff --git a/vendor/modules.txt b/vendor/modules.txt index 7805073376..4a045e5574 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -35,8 +35,8 @@ github.com/Azure/azure-pipeline-go/pipeline ## explicit github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2019-06-01/storage github.com/Azure/azure-sdk-for-go/version -# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 -## explicit; go 1.18 +# github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.0 +## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/azcore github.com/Azure/azure-sdk-for-go/sdk/azcore/arm github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/internal/resource @@ -60,12 +60,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime github.com/Azure/azure-sdk-for-go/sdk/azcore/streaming github.com/Azure/azure-sdk-for-go/sdk/azcore/to github.com/Azure/azure-sdk-for-go/sdk/azcore/tracing -# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -## explicit; go 1.18 +# github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.9.0 +## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity github.com/Azure/azure-sdk-for-go/sdk/azidentity/internal -# github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 -## explicit; go 1.18 +# github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 +## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/internal/diag github.com/Azure/azure-sdk-for-go/sdk/internal/errorinfo github.com/Azure/azure-sdk-for-go/sdk/internal/exported @@ -79,8 +79,8 @@ github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork # github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns v1.1.0 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/privatedns/armprivatedns -# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.6.0 -## explicit; go 1.18 +# github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.8.0 +## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage # github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.1 ## explicit; go 1.18 @@ -88,8 +88,8 @@ github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets # github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.1 ## explicit; go 1.18 github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal -# github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 -## explicit; go 1.18 +# github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 +## explicit; go 1.23.0 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/appendblob github.com/Azure/azure-sdk-for-go/sdk/storage/azblob/blob @@ -139,13 +139,13 @@ github.com/Azure/go-autorest/tracing github.com/Azure/msi-dataplane/pkg/dataplane github.com/Azure/msi-dataplane/pkg/dataplane/internal/challenge github.com/Azure/msi-dataplane/pkg/dataplane/internal/client -# github.com/AzureAD/microsoft-authentication-library-for-go v1.3.3 +# github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 ## explicit; go 1.18 github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache github.com/AzureAD/microsoft-authentication-library-for-go/apps/confidential github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base -github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/internal/storage +github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base/storage github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time @@ -161,6 +161,7 @@ github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/o github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/options github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/shared github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version +github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity github.com/AzureAD/microsoft-authentication-library-for-go/apps/public # github.com/IBM/go-sdk-core/v5 v5.14.1 ## explicit; go 1.19 @@ -376,7 +377,7 @@ github.com/golang-jwt/jwt # github.com/golang-jwt/jwt/v4 v4.5.0 ## explicit; go 1.16 github.com/golang-jwt/jwt/v4 -# github.com/golang-jwt/jwt/v5 v5.2.1 +# github.com/golang-jwt/jwt/v5 v5.2.2 ## explicit; go 1.18 github.com/golang-jwt/jwt/v5 # github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da @@ -915,8 +916,8 @@ go.uber.org/zap/internal/pool go.uber.org/zap/internal/stacktrace go.uber.org/zap/zapcore go.uber.org/zap/zapgrpc -# golang.org/x/crypto v0.33.0 -## explicit; go 1.20 +# golang.org/x/crypto v0.37.0 +## explicit; go 1.23.0 golang.org/x/crypto/chacha20 golang.org/x/crypto/chacha20poly1305 golang.org/x/crypto/cryptobyte @@ -933,8 +934,8 @@ golang.org/x/crypto/sha3 ## explicit; go 1.20 golang.org/x/exp/constraints golang.org/x/exp/slices -# golang.org/x/net v0.35.0 -## explicit; go 1.18 +# golang.org/x/net v0.39.0 +## explicit; go 1.23.0 golang.org/x/net/context golang.org/x/net/http/httpguts golang.org/x/net/http/httpproxy @@ -957,22 +958,22 @@ golang.org/x/oauth2/google/internal/stsexchange golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sync v0.11.0 -## explicit; go 1.18 +# golang.org/x/sync v0.13.0 +## explicit; go 1.23.0 golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.30.0 -## explicit; go 1.18 +# golang.org/x/sys v0.32.0 +## explicit; go 1.23.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.29.0 -## explicit; go 1.18 +# golang.org/x/term v0.31.0 +## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.22.0 -## explicit; go 1.18 +# golang.org/x/text v0.24.0 +## explicit; go 1.23.0 golang.org/x/text/encoding golang.org/x/text/encoding/charmap golang.org/x/text/encoding/internal