mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 06:10:22 +00:00
rebase: bump the github-dependencies group with 2 updates
Bumps the github-dependencies group with 2 updates: [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) and [github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets](https://github.com/Azure/azure-sdk-for-go). Updates `github.com/aws/aws-sdk-go-v2/service/sts` from 1.32.3 to 1.32.4 - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.32.3...v1.32.4) Updates `github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets` from 1.2.0 to 1.3.0 - [Release notes](https://github.com/Azure/azure-sdk-for-go/releases) - [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md) - [Commits](https://github.com/Azure/azure-sdk-for-go/compare/v1.2...sdk/azcore/v1.3.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-dependencies - dependency-name: github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-dependencies ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
89ab2e78e8
commit
710e7d273c
14
go.mod
14
go.mod
@ -5,7 +5,7 @@ go 1.22.5
|
|||||||
require (
|
require (
|
||||||
github.com/IBM/keyprotect-go-client v0.15.1
|
github.com/IBM/keyprotect-go-client v0.15.1
|
||||||
github.com/aws/aws-sdk-go v1.55.5
|
github.com/aws/aws-sdk-go v1.55.5
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.32.3
|
github.com/aws/aws-sdk-go-v2/service/sts v1.32.4
|
||||||
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
|
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
|
||||||
github.com/ceph/go-ceph v0.30.1-0.20241102143109-75d1af3ed638
|
github.com/ceph/go-ceph v0.30.1-0.20241102143109-75d1af3ed638
|
||||||
github.com/container-storage-interface/spec v1.10.0
|
github.com/container-storage-interface/spec v1.10.0
|
||||||
@ -47,24 +47,24 @@ require (
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.2.0
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.0
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.16.0 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0 // indirect
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0 // indirect
|
||||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 // indirect
|
||||||
github.com/NYTimes/gziphandler v1.1.1 // indirect
|
github.com/NYTimes/gziphandler v1.1.1 // indirect
|
||||||
github.com/ansel1/merry v1.6.2 // indirect
|
github.com/ansel1/merry v1.6.2 // indirect
|
||||||
github.com/ansel1/merry/v2 v2.0.1 // indirect
|
github.com/ansel1/merry/v2 v2.0.1 // indirect
|
||||||
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
|
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
|
||||||
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a // indirect
|
||||||
github.com/aws/aws-sdk-go-v2 v1.32.3 // indirect
|
github.com/aws/aws-sdk-go-v2 v1.32.4 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3 // indirect
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 // indirect
|
||||||
github.com/aws/smithy-go v1.22.0 // indirect
|
github.com/aws/smithy-go v1.22.0 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/blang/semver/v4 v4.0.0 // indirect
|
github.com/blang/semver/v4 v4.0.0 // indirect
|
||||||
|
28
go.sum
28
go.sum
@ -1328,8 +1328,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0 h1:+m0M/LFxN43KvUL
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0/go.mod h1:PwOyop78lveYMRs6oCxjiVyBdyCgIYH6XHIVZO9/SFQ=
|
github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.0/go.mod h1:PwOyop78lveYMRs6oCxjiVyBdyCgIYH6XHIVZO9/SFQ=
|
||||||
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 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.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.2.0 h1:TkNl6WlpHdZSMt0Zngw8y0c9ZMi3GwmYl0kKNbW9PvU=
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.0 h1:WLUIpeyv04H0RCcQHaA4TNoyrQ39Ox7V+re+iaqzTe0=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.2.0/go.mod h1:ukmL56lWl275SgNFijuwx0Wv6n6HmzzpPWW4kMoy/wY=
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.0/go.mod h1:hd8hTTIY3VmUVPRHNH7GVCHO3SHgXkJKZHReby/bnUQ=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0 h1:eXnN9kaS8TiDwXjoie3hMRLuwdUBUMW9KRgOqB3mCaw=
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0 h1:eXnN9kaS8TiDwXjoie3hMRLuwdUBUMW9KRgOqB3mCaw=
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0/go.mod h1:XIpam8wumeZ5rVMuhdDQLMfIPDf1WO3IzrCRO3e3e3o=
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0/go.mod h1:XIpam8wumeZ5rVMuhdDQLMfIPDf1WO3IzrCRO3e3e3o=
|
||||||
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
|
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
|
||||||
@ -1346,8 +1346,8 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ
|
|||||||
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
|
||||||
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 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM=
|
||||||
github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE=
|
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.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU=
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1 h1:gUDtaZk8heteyfdmv+pcfHvhR9llnh7c7GMwZ8RVG04=
|
||||||
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
|
github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/IBM/keyprotect-go-client v0.5.1/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI=
|
github.com/IBM/keyprotect-go-client v0.5.1/go.mod h1:5TwDM/4FRJq1ZOlwQL1xFahLWQ3TveR88VmL1u3njyI=
|
||||||
@ -1411,18 +1411,18 @@ github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:l
|
|||||||
github.com/aws/aws-sdk-go v1.44.164/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
github.com/aws/aws-sdk-go v1.44.164/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
||||||
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
|
github.com/aws/aws-sdk-go v1.55.5 h1:KKUZBfBoyqy5d3swXyiC7Q76ic40rYcbqH7qjh59kzU=
|
||||||
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
|
github.com/aws/aws-sdk-go v1.55.5/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
|
||||||
github.com/aws/aws-sdk-go-v2 v1.32.3 h1:T0dRlFBKcdaUPGNtkBSwHZxrtis8CQU17UpNBZYd0wk=
|
github.com/aws/aws-sdk-go-v2 v1.32.4 h1:S13INUiTxgrPueTmrm5DZ+MiAo99zYzHEFh1UNkOxNE=
|
||||||
github.com/aws/aws-sdk-go-v2 v1.32.3/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo=
|
github.com/aws/aws-sdk-go-v2 v1.32.4/go.mod h1:2SK5n0a2karNTv5tbP1SjsX0uhttou00v/HpXKM1ZUo=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 h1:Jw50LwEkVjuVzE1NzkhNKkBf9cRN7MtE1F/b2cOKTUM=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 h1:A2w6m6Tmr+BNXjDsr7M90zkWjsu4JXHwrzPg235STs4=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22/go.mod h1:Y/SmAyPcOTmpeVaWSzSKiILfXTVJwrGmYZhcRbhWuEY=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23/go.mod h1:35EVp9wyeANdujZruvHiQUAo9E3vbhnIO1mTCAxMlY0=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 h1:981MHwBaRZM7+9QSR6XamDzF/o7ouUGxFzr+nVSIhrs=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 h1:pgYW9FCabt2M25MoHYCfMrVY2ghiiBKYWUVXfwZs+sU=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22/go.mod h1:1RA1+aBEfn+CAB/Mh0MB6LsdCYCnjZm7tKXtnk499ZQ=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23/go.mod h1:c48kLgzO19wAu3CPkDWC28JbaJ+hfQlsdl7I2+oqIbk=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g=
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 h1:TToQNkvGguu209puTojY/ozlqy2d/SFNcoLIqTFi42g=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ=
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0/go.mod h1:0jp+ltwkf+SwG2fm/PKo8t4y8pJSgOCO4D8Lz3k0aHQ=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3 h1:qcxX0JYlgWH3hpPUnd6U0ikcl6LLA9sLkXE2w1fpMvY=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 h1:tHxQi/XHPK0ctd/wdOw0t7Xrc2OxcRCnVzv8lwWPu0c=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3/go.mod h1:cLSNEmI45soc+Ef8K/L+8sEA3A3pYFEYf5B5UI+6bH4=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4/go.mod h1:4GQbF1vJzG60poZqWatZlhP31y8PGCCVTvIGPdaaYJ0=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.32.3 h1:wVnQ6tigGsRqSWDEEyH6lSAJ9OyFUsSnbaUWChuSGzs=
|
github.com/aws/aws-sdk-go-v2/service/sts v1.32.4 h1:yDxvkz3/uOKfxnv8YhzOi9m+2OGIxF+on3KOISbK5IU=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.32.3/go.mod h1:VZa9yTFyj4o10YGsmDO4gbQJUvvhY72fhumT8W4LqsE=
|
github.com/aws/aws-sdk-go-v2/service/sts v1.32.4/go.mod h1:9XEUty5v5UAsMiFOBJrNibZgwCeOma73jgGwwhgffa8=
|
||||||
github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM=
|
github.com/aws/smithy-go v1.22.0 h1:uunKnWlcoL3zO7q+gG2Pk53joueEOsnNB28QdMsmiMM=
|
||||||
github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
|
github.com/aws/smithy-go v1.22.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
|
||||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
# Release History
|
# Release History
|
||||||
|
|
||||||
|
## 1.3.0 (2024-11-06)
|
||||||
|
|
||||||
|
### Features Added
|
||||||
|
* Added API Version support. Users can now change the default API Version by setting ClientOptions.APIVersion
|
||||||
|
|
||||||
## 1.2.0 (2024-10-21)
|
## 1.2.0 (2024-10-21)
|
||||||
|
|
||||||
### Features Added
|
### Features Added
|
||||||
|
@ -38,6 +38,10 @@ func NewClient(vaultURL string, credential azcore.TokenCredential, options *Clie
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
azcoreClient, err := azcore.NewClient(moduleName, version, runtime.PipelineOptions{
|
azcoreClient, err := azcore.NewClient(moduleName, version, runtime.PipelineOptions{
|
||||||
|
APIVersion: runtime.APIVersionOptions{
|
||||||
|
Location: runtime.APIVersionLocationQueryParam,
|
||||||
|
Name: "api-version",
|
||||||
|
},
|
||||||
PerRetry: []policy.Policy{authPolicy},
|
PerRetry: []policy.Policy{authPolicy},
|
||||||
Tracing: runtime.TracingOptions{
|
Tracing: runtime.TracingOptions{
|
||||||
Namespace: "Microsoft.KeyVault",
|
Namespace: "Microsoft.KeyVault",
|
||||||
|
2
vendor/github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets/version.go
generated
vendored
2
vendor/github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets/version.go
generated
vendored
@ -8,5 +8,5 @@ package azsecrets
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets"
|
moduleName = "github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets"
|
||||||
version = "v1.2.0"
|
version = "v1.3.0"
|
||||||
)
|
)
|
||||||
|
@ -18,6 +18,8 @@ import (
|
|||||||
"encoding/pem"
|
"encoding/pem"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache"
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/base"
|
||||||
@ -315,16 +317,21 @@ func New(authority, clientID string, cred Credential, options ...Option) (Client
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return Client{}, err
|
return Client{}, err
|
||||||
}
|
}
|
||||||
|
autoEnabledRegion := os.Getenv("MSAL_FORCE_REGION")
|
||||||
opts := clientOptions{
|
opts := clientOptions{
|
||||||
authority: authority,
|
authority: authority,
|
||||||
// if the caller specified a token provider, it will handle all details of authentication, using Client only as a token cache
|
// if the caller specified a token provider, it will handle all details of authentication, using Client only as a token cache
|
||||||
disableInstanceDiscovery: cred.tokenProvider != nil,
|
disableInstanceDiscovery: cred.tokenProvider != nil,
|
||||||
httpClient: shared.DefaultClient,
|
httpClient: shared.DefaultClient,
|
||||||
|
azureRegion: autoEnabledRegion,
|
||||||
}
|
}
|
||||||
for _, o := range options {
|
for _, o := range options {
|
||||||
o(&opts)
|
o(&opts)
|
||||||
}
|
}
|
||||||
|
if strings.EqualFold(opts.azureRegion, "DisableMsalForceRegion") {
|
||||||
|
opts.azureRegion = ""
|
||||||
|
}
|
||||||
|
|
||||||
baseOpts := []base.Option{
|
baseOpts := []base.Option{
|
||||||
base.WithCacheAccessor(opts.accessor),
|
base.WithCacheAccessor(opts.accessor),
|
||||||
base.WithClientCapabilities(opts.capabilities),
|
base.WithClientCapabilities(opts.capabilities),
|
||||||
|
@ -89,8 +89,23 @@ type AuthResult struct {
|
|||||||
ExpiresOn time.Time
|
ExpiresOn time.Time
|
||||||
GrantedScopes []string
|
GrantedScopes []string
|
||||||
DeclinedScopes []string
|
DeclinedScopes []string
|
||||||
|
Metadata AuthResultMetadata
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AuthResultMetadata which contains meta data for the AuthResult
|
||||||
|
type AuthResultMetadata struct {
|
||||||
|
TokenSource TokenSource
|
||||||
|
}
|
||||||
|
|
||||||
|
type TokenSource int
|
||||||
|
|
||||||
|
// These are all the types of token flows.
|
||||||
|
const (
|
||||||
|
SourceUnknown TokenSource = 0
|
||||||
|
IdentityProvider TokenSource = 1
|
||||||
|
Cache TokenSource = 2
|
||||||
|
)
|
||||||
|
|
||||||
// AuthResultFromStorage creates an AuthResult from a storage token response (which is generated from the cache).
|
// AuthResultFromStorage creates an AuthResult from a storage token response (which is generated from the cache).
|
||||||
func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResult, error) {
|
func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResult, error) {
|
||||||
if err := storageTokenResponse.AccessToken.Validate(); err != nil {
|
if err := storageTokenResponse.AccessToken.Validate(); err != nil {
|
||||||
@ -109,7 +124,17 @@ func AuthResultFromStorage(storageTokenResponse storage.TokenResponse) (AuthResu
|
|||||||
return AuthResult{}, fmt.Errorf("problem decoding JWT token: %w", err)
|
return AuthResult{}, fmt.Errorf("problem decoding JWT token: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AuthResult{account, idToken, accessToken, storageTokenResponse.AccessToken.ExpiresOn.T, grantedScopes, nil}, nil
|
return AuthResult{
|
||||||
|
Account: account,
|
||||||
|
IDToken: idToken,
|
||||||
|
AccessToken: accessToken,
|
||||||
|
ExpiresOn: storageTokenResponse.AccessToken.ExpiresOn.T,
|
||||||
|
GrantedScopes: grantedScopes,
|
||||||
|
DeclinedScopes: nil,
|
||||||
|
Metadata: AuthResultMetadata{
|
||||||
|
TokenSource: Cache,
|
||||||
|
},
|
||||||
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewAuthResult creates an AuthResult.
|
// NewAuthResult creates an AuthResult.
|
||||||
@ -123,6 +148,9 @@ func NewAuthResult(tokenResponse accesstokens.TokenResponse, account shared.Acco
|
|||||||
AccessToken: tokenResponse.AccessToken,
|
AccessToken: tokenResponse.AccessToken,
|
||||||
ExpiresOn: tokenResponse.ExpiresOn.T,
|
ExpiresOn: tokenResponse.ExpiresOn.T,
|
||||||
GrantedScopes: tokenResponse.GrantedScopes.Slice,
|
GrantedScopes: tokenResponse.GrantedScopes.Slice,
|
||||||
|
Metadata: AuthResultMetadata{
|
||||||
|
TokenSource: IdentityProvider,
|
||||||
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,10 +18,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const addField = "AdditionalFields"
|
const addField = "AdditionalFields"
|
||||||
const (
|
|
||||||
marshalJSON = "MarshalJSON"
|
|
||||||
unmarshalJSON = "UnmarshalJSON"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
leftBrace = []byte("{")[0]
|
leftBrace = []byte("{")[0]
|
||||||
@ -106,47 +102,37 @@ func delimIs(got json.Token, want rune) bool {
|
|||||||
// hasMarshalJSON will determine if the value or a pointer to this value has
|
// hasMarshalJSON will determine if the value or a pointer to this value has
|
||||||
// the MarshalJSON method.
|
// the MarshalJSON method.
|
||||||
func hasMarshalJSON(v reflect.Value) bool {
|
func hasMarshalJSON(v reflect.Value) bool {
|
||||||
if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
|
ok := false
|
||||||
_, ok := v.Interface().(json.Marshaler)
|
if _, ok = v.Interface().(json.Marshaler); !ok {
|
||||||
return ok
|
var i any
|
||||||
}
|
|
||||||
|
|
||||||
if v.Kind() == reflect.Ptr {
|
if v.Kind() == reflect.Ptr {
|
||||||
v = v.Elem()
|
i = v.Elem().Interface()
|
||||||
} else {
|
} else if v.CanAddr() {
|
||||||
if !v.CanAddr() {
|
i = v.Addr().Interface()
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
v = v.Addr()
|
_, ok = i.(json.Marshaler)
|
||||||
}
|
}
|
||||||
|
|
||||||
if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
|
|
||||||
_, ok := v.Interface().(json.Marshaler)
|
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// callMarshalJSON will call MarshalJSON() method on the value or a pointer to this value.
|
// callMarshalJSON will call MarshalJSON() method on the value or a pointer to this value.
|
||||||
// This will panic if the method is not defined.
|
// This will panic if the method is not defined.
|
||||||
func callMarshalJSON(v reflect.Value) ([]byte, error) {
|
func callMarshalJSON(v reflect.Value) ([]byte, error) {
|
||||||
if method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {
|
if marsh, ok := v.Interface().(json.Marshaler); ok {
|
||||||
marsh := v.Interface().(json.Marshaler)
|
|
||||||
return marsh.MarshalJSON()
|
return marsh.MarshalJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
if v.Kind() == reflect.Ptr {
|
if v.Kind() == reflect.Ptr {
|
||||||
v = v.Elem()
|
if marsh, ok := v.Elem().Interface().(json.Marshaler); ok {
|
||||||
|
return marsh.MarshalJSON()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if v.CanAddr() {
|
if v.CanAddr() {
|
||||||
v = v.Addr()
|
if marsh, ok := v.Addr().Interface().(json.Marshaler); ok {
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if method := v.MethodByName(unmarshalJSON); method.Kind() != reflect.Invalid {
|
|
||||||
marsh := v.Interface().(json.Marshaler)
|
|
||||||
return marsh.MarshalJSON()
|
return marsh.MarshalJSON()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
panic(fmt.Sprintf("callMarshalJSON called on type %T that does not have MarshalJSON defined", v.Interface()))
|
panic(fmt.Sprintf("callMarshalJSON called on type %T that does not have MarshalJSON defined", v.Interface()))
|
||||||
}
|
}
|
||||||
@ -162,14 +148,10 @@ func hasUnmarshalJSON(v reflect.Value) bool {
|
|||||||
v = v.Addr()
|
v = v.Addr()
|
||||||
}
|
}
|
||||||
|
|
||||||
if method := v.MethodByName(unmarshalJSON); method.Kind() != reflect.Invalid {
|
|
||||||
_, ok := v.Interface().(json.Unmarshaler)
|
_, ok := v.Interface().(json.Unmarshaler)
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// hasOmitEmpty indicates if the field has instructed us to not output
|
// hasOmitEmpty indicates if the field has instructed us to not output
|
||||||
// the field if omitempty is set on the tag. tag is the string
|
// the field if omitempty is set on the tag. tag is the string
|
||||||
// returned by reflect.StructField.Tag().Get().
|
// returned by reflect.StructField.Tag().Get().
|
||||||
|
@ -7,6 +7,7 @@ package local
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"html"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
@ -141,7 +142,7 @@ func (s *Server) handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
headerErr := q.Get("error")
|
headerErr := q.Get("error")
|
||||||
if headerErr != "" {
|
if headerErr != "" {
|
||||||
desc := q.Get("error_description")
|
desc := html.EscapeString(q.Get("error_description"))
|
||||||
// Note: It is a little weird we handle some errors by not going to the failPage. If they all should,
|
// 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.
|
// 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)))
|
_, _ = w.Write([]byte(fmt.Sprintf(failPage, headerErr, desc)))
|
||||||
|
@ -10,6 +10,8 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/exported"
|
||||||
internalTime "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time"
|
internalTime "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json/types/time"
|
||||||
@ -18,7 +20,6 @@ import (
|
|||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust"
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/wstrust/defs"
|
||||||
"github.com/google/uuid"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// ResolveEndpointer contains the methods for resolving authority endpoints.
|
// ResolveEndpointer contains the methods for resolving authority endpoints.
|
||||||
@ -331,7 +332,7 @@ func (t *Client) DeviceCode(ctx context.Context, authParams authority.AuthParams
|
|||||||
func (t *Client) resolveEndpoint(ctx context.Context, authParams *authority.AuthParams, userPrincipalName string) error {
|
func (t *Client) resolveEndpoint(ctx context.Context, authParams *authority.AuthParams, userPrincipalName string) error {
|
||||||
endpoints, err := t.Resolver.ResolveEndpoints(ctx, authParams.AuthorityInfo, userPrincipalName)
|
endpoints, err := t.Resolver.ResolveEndpoints(ctx, authParams.AuthorityInfo, userPrincipalName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to resolve an endpoint: %s", err)
|
return fmt.Errorf("unable to resolve an endpoint: %w", err)
|
||||||
}
|
}
|
||||||
authParams.Endpoints = endpoints
|
authParams.Endpoints = endpoints
|
||||||
return nil
|
return nil
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
authorizationEndpoint = "https://%v/%v/oauth2/v2.0/authorize"
|
authorizationEndpoint = "https://%v/%v/oauth2/v2.0/authorize"
|
||||||
instanceDiscoveryEndpoint = "https://%v/common/discovery/instance"
|
aadInstanceDiscoveryEndpoint = "https://%v/common/discovery/instance"
|
||||||
tenantDiscoveryEndpointWithRegion = "https://%s.%s/%s/v2.0/.well-known/openid-configuration"
|
tenantDiscoveryEndpointWithRegion = "https://%s.%s/%s/v2.0/.well-known/openid-configuration"
|
||||||
regionName = "REGION_NAME"
|
regionName = "REGION_NAME"
|
||||||
defaultAPIVersion = "2021-10-01"
|
defaultAPIVersion = "2021-10-01"
|
||||||
@ -48,12 +48,11 @@ type jsonCaller interface {
|
|||||||
|
|
||||||
var aadTrustedHostList = map[string]bool{
|
var aadTrustedHostList = map[string]bool{
|
||||||
"login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list
|
"login.windows.net": true, // Microsoft Azure Worldwide - Used in validation scenarios where host is not this list
|
||||||
"login.chinacloudapi.cn": true, // Microsoft Azure China
|
"login.partner.microsoftonline.cn": true, // Microsoft Azure China
|
||||||
"login.microsoftonline.de": true, // Microsoft Azure Blackforest
|
"login.microsoftonline.de": true, // Microsoft Azure Blackforest
|
||||||
"login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy
|
"login-us.microsoftonline.com": true, // Microsoft Azure US Government - Legacy
|
||||||
"login.microsoftonline.us": true, // Microsoft Azure US Government
|
"login.microsoftonline.us": true, // Microsoft Azure US Government
|
||||||
"login.microsoftonline.com": true, // Microsoft Azure Worldwide
|
"login.microsoftonline.com": true, // Microsoft Azure Worldwide
|
||||||
"login.cloudgovapi.us": true, // Microsoft Azure US Government
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustedHost checks if an AAD host is trusted/valid.
|
// TrustedHost checks if an AAD host is trusted/valid.
|
||||||
@ -137,8 +136,12 @@ const (
|
|||||||
const (
|
const (
|
||||||
AAD = "MSSTS"
|
AAD = "MSSTS"
|
||||||
ADFS = "ADFS"
|
ADFS = "ADFS"
|
||||||
|
DSTS = "DSTS"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DSTSTenant is referenced throughout multiple files, let us use a const in case we ever need to change it.
|
||||||
|
const DSTSTenant = "7a433bfc-2514-4697-b467-e0933190487f"
|
||||||
|
|
||||||
// AuthenticationScheme is an extensibility mechanism designed to be used only by Azure Arc for proof of possession access tokens.
|
// AuthenticationScheme is an extensibility mechanism designed to be used only by Azure Arc for proof of possession access tokens.
|
||||||
type AuthenticationScheme interface {
|
type AuthenticationScheme interface {
|
||||||
// Extra parameters that are added to the request to the /token endpoint.
|
// Extra parameters that are added to the request to the /token endpoint.
|
||||||
@ -236,23 +239,26 @@ func NewAuthParams(clientID string, authorityInfo Info) AuthParams {
|
|||||||
// - the client is configured to authenticate only Microsoft accounts via the "consumers" endpoint
|
// - the client is configured to authenticate only Microsoft accounts via the "consumers" endpoint
|
||||||
// - the resulting authority URL is invalid
|
// - the resulting authority URL is invalid
|
||||||
func (p AuthParams) WithTenant(ID string) (AuthParams, error) {
|
func (p AuthParams) WithTenant(ID string) (AuthParams, error) {
|
||||||
switch ID {
|
if ID == "" || ID == p.AuthorityInfo.Tenant {
|
||||||
case "", p.AuthorityInfo.Tenant:
|
|
||||||
// keep the default tenant because the caller didn't override it
|
|
||||||
return p, nil
|
return p, nil
|
||||||
case "common", "consumers", "organizations":
|
}
|
||||||
if p.AuthorityInfo.AuthorityType == AAD {
|
|
||||||
|
var authority string
|
||||||
|
switch p.AuthorityInfo.AuthorityType {
|
||||||
|
case AAD:
|
||||||
|
if ID == "common" || ID == "consumers" || ID == "organizations" {
|
||||||
return p, fmt.Errorf(`tenant ID must be a specific tenant, not "%s"`, ID)
|
return p, fmt.Errorf(`tenant ID must be a specific tenant, not "%s"`, ID)
|
||||||
}
|
}
|
||||||
// else we'll return a better error below
|
|
||||||
}
|
|
||||||
if p.AuthorityInfo.AuthorityType != AAD {
|
|
||||||
return p, errors.New("the authority doesn't support tenants")
|
|
||||||
}
|
|
||||||
if p.AuthorityInfo.Tenant == "consumers" {
|
if p.AuthorityInfo.Tenant == "consumers" {
|
||||||
return p, errors.New(`client is configured to authenticate only personal Microsoft accounts, via the "consumers" endpoint`)
|
return p, errors.New(`client is configured to authenticate only personal Microsoft accounts, via the "consumers" endpoint`)
|
||||||
}
|
}
|
||||||
authority := "https://" + path.Join(p.AuthorityInfo.Host, ID)
|
authority = "https://" + path.Join(p.AuthorityInfo.Host, ID)
|
||||||
|
case ADFS:
|
||||||
|
return p, errors.New("ADFS authority doesn't support tenants")
|
||||||
|
case DSTS:
|
||||||
|
return p, errors.New("dSTS authority doesn't support tenants")
|
||||||
|
}
|
||||||
|
|
||||||
info, err := NewInfoFromAuthorityURI(authority, p.AuthorityInfo.ValidateAuthority, p.AuthorityInfo.InstanceDiscoveryDisabled)
|
info, err := NewInfoFromAuthorityURI(authority, p.AuthorityInfo.ValidateAuthority, p.AuthorityInfo.InstanceDiscoveryDisabled)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
info.Region = p.AuthorityInfo.Region
|
info.Region = p.AuthorityInfo.Region
|
||||||
@ -344,44 +350,59 @@ type Info struct {
|
|||||||
Host string
|
Host string
|
||||||
CanonicalAuthorityURI string
|
CanonicalAuthorityURI string
|
||||||
AuthorityType string
|
AuthorityType string
|
||||||
UserRealmURIPrefix string
|
|
||||||
ValidateAuthority bool
|
ValidateAuthority bool
|
||||||
Tenant string
|
Tenant string
|
||||||
Region string
|
Region string
|
||||||
InstanceDiscoveryDisabled bool
|
InstanceDiscoveryDisabled bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func firstPathSegment(u *url.URL) (string, error) {
|
|
||||||
pathParts := strings.Split(u.EscapedPath(), "/")
|
|
||||||
if len(pathParts) >= 2 {
|
|
||||||
return pathParts[1], nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return "", errors.New(`authority must be an https URL such as "https://login.microsoftonline.com/<your tenant>"`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// NewInfoFromAuthorityURI creates an AuthorityInfo instance from the authority URL provided.
|
// NewInfoFromAuthorityURI creates an AuthorityInfo instance from the authority URL provided.
|
||||||
func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceDiscoveryDisabled bool) (Info, error) {
|
func NewInfoFromAuthorityURI(authority string, validateAuthority bool, instanceDiscoveryDisabled bool) (Info, error) {
|
||||||
u, err := url.Parse(strings.ToLower(authority))
|
|
||||||
if err != nil || u.Scheme != "https" {
|
cannonicalAuthority := authority
|
||||||
return Info{}, errors.New(`authority must be an https URL such as "https://login.microsoftonline.com/<your tenant>"`)
|
|
||||||
|
// suffix authority with / if it doesn't have one
|
||||||
|
if !strings.HasSuffix(cannonicalAuthority, "/") {
|
||||||
|
cannonicalAuthority += "/"
|
||||||
}
|
}
|
||||||
|
|
||||||
tenant, err := firstPathSegment(u)
|
u, err := url.Parse(strings.ToLower(cannonicalAuthority))
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Info{}, err
|
return Info{}, fmt.Errorf("couldn't parse authority url: %w", err)
|
||||||
}
|
}
|
||||||
authorityType := AAD
|
if u.Scheme != "https" {
|
||||||
if tenant == "adfs" {
|
return Info{}, errors.New("authority url scheme must be https")
|
||||||
|
}
|
||||||
|
|
||||||
|
pathParts := strings.Split(u.EscapedPath(), "/")
|
||||||
|
if len(pathParts) < 3 {
|
||||||
|
return Info{}, errors.New(`authority must be an URL such as "https://login.microsoftonline.com/<your tenant>"`)
|
||||||
|
}
|
||||||
|
|
||||||
|
var authorityType, tenant string
|
||||||
|
switch pathParts[1] {
|
||||||
|
case "adfs":
|
||||||
authorityType = ADFS
|
authorityType = ADFS
|
||||||
|
case "dstsv2":
|
||||||
|
if len(pathParts) != 4 {
|
||||||
|
return Info{}, fmt.Errorf("dSTS authority must be an https URL such as https://<authority>/dstsv2/%s", DSTSTenant)
|
||||||
|
}
|
||||||
|
if pathParts[2] != DSTSTenant {
|
||||||
|
return Info{}, fmt.Errorf("dSTS authority only accepts a single tenant %q", DSTSTenant)
|
||||||
|
}
|
||||||
|
authorityType = DSTS
|
||||||
|
tenant = DSTSTenant
|
||||||
|
default:
|
||||||
|
authorityType = AAD
|
||||||
|
tenant = pathParts[1]
|
||||||
}
|
}
|
||||||
|
|
||||||
// u.Host includes the port, if any, which is required for private cloud deployments
|
// u.Host includes the port, if any, which is required for private cloud deployments
|
||||||
return Info{
|
return Info{
|
||||||
Host: u.Host,
|
Host: u.Host,
|
||||||
CanonicalAuthorityURI: fmt.Sprintf("https://%v/%v/", u.Host, tenant),
|
CanonicalAuthorityURI: cannonicalAuthority,
|
||||||
AuthorityType: authorityType,
|
AuthorityType: authorityType,
|
||||||
UserRealmURIPrefix: fmt.Sprintf("https://%v/common/userrealm/", u.Hostname()),
|
|
||||||
ValidateAuthority: validateAuthority,
|
ValidateAuthority: validateAuthority,
|
||||||
Tenant: tenant,
|
Tenant: tenant,
|
||||||
InstanceDiscoveryDisabled: instanceDiscoveryDisabled,
|
InstanceDiscoveryDisabled: instanceDiscoveryDisabled,
|
||||||
@ -525,7 +546,7 @@ func (c Client) AADInstanceDiscovery(ctx context.Context, authorityInfo Info) (I
|
|||||||
discoveryHost = authorityInfo.Host
|
discoveryHost = authorityInfo.Host
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoint := fmt.Sprintf(instanceDiscoveryEndpoint, discoveryHost)
|
endpoint := fmt.Sprintf(aadInstanceDiscoveryEndpoint, discoveryHost)
|
||||||
err = c.Comm.JSONCall(ctx, endpoint, http.Header{}, qv, nil, &resp)
|
err = c.Comm.JSONCall(ctx, endpoint, http.Header{}, qv, nil, &resp)
|
||||||
}
|
}
|
||||||
return resp, err
|
return resp, err
|
||||||
@ -543,17 +564,19 @@ func detectRegion(ctx context.Context) string {
|
|||||||
client := http.Client{
|
client := http.Client{
|
||||||
Timeout: time.Duration(2 * time.Second),
|
Timeout: time.Duration(2 * time.Second),
|
||||||
}
|
}
|
||||||
req, _ := http.NewRequest("GET", imdsEndpoint, nil)
|
req, _ := http.NewRequestWithContext(ctx, http.MethodGet, imdsEndpoint, nil)
|
||||||
req.Header.Set("Metadata", "true")
|
req.Header.Set("Metadata", "true")
|
||||||
resp, err := client.Do(req)
|
resp, err := client.Do(req)
|
||||||
|
if err == nil {
|
||||||
|
defer resp.Body.Close()
|
||||||
|
}
|
||||||
// If the request times out or there is an error, it is retried once
|
// If the request times out or there is an error, it is retried once
|
||||||
if err != nil || resp.StatusCode != 200 {
|
if err != nil || resp.StatusCode != http.StatusOK {
|
||||||
resp, err = client.Do(req)
|
resp, err = client.Do(req)
|
||||||
if err != nil || resp.StatusCode != 200 {
|
if err != nil || resp.StatusCode != http.StatusOK {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
|
||||||
response, err := io.ReadAll(resp.Body)
|
response, err := io.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
|
@ -18,10 +18,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/errors"
|
||||||
customJSON "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json"
|
customJSON "github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/json"
|
||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/version"
|
||||||
"github.com/google/uuid"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// HTTPClient represents an HTTP client.
|
// HTTPClient represents an HTTP client.
|
||||||
@ -70,15 +71,13 @@ func (c *Client) JSONCall(ctx context.Context, endpoint string, headers http.Hea
|
|||||||
unmarshal = customJSON.Unmarshal
|
unmarshal = customJSON.Unmarshal
|
||||||
}
|
}
|
||||||
|
|
||||||
u, err := url.Parse(endpoint)
|
req, err := http.NewRequestWithContext(ctx, http.MethodGet, fmt.Sprintf("%s?%s", endpoint, qv.Encode()), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("could not parse path URL(%s): %w", endpoint, err)
|
return fmt.Errorf("could not create request: %w", err)
|
||||||
}
|
}
|
||||||
u.RawQuery = qv.Encode()
|
|
||||||
|
|
||||||
addStdHeaders(headers)
|
addStdHeaders(headers)
|
||||||
|
req.Header = headers
|
||||||
req := &http.Request{Method: http.MethodGet, URL: u, Header: headers}
|
|
||||||
|
|
||||||
if body != nil {
|
if body != nil {
|
||||||
// Note: In case your wondering why we are not gzip encoding....
|
// Note: In case your wondering why we are not gzip encoding....
|
||||||
|
@ -18,9 +18,6 @@ import (
|
|||||||
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
|
"github.com/AzureAD/microsoft-authentication-library-for-go/apps/internal/oauth/ops/authority"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ADFS is an active directory federation service authority type.
|
|
||||||
const ADFS = "ADFS"
|
|
||||||
|
|
||||||
type cacheEntry struct {
|
type cacheEntry struct {
|
||||||
Endpoints authority.Endpoints
|
Endpoints authority.Endpoints
|
||||||
ValidForDomainsInList map[string]bool
|
ValidForDomainsInList map[string]bool
|
||||||
@ -51,7 +48,7 @@ func (m *authorityEndpoint) ResolveEndpoints(ctx context.Context, authorityInfo
|
|||||||
return endpoints, nil
|
return endpoints, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoint, err := m.openIDConfigurationEndpoint(ctx, authorityInfo, userPrincipalName)
|
endpoint, err := m.openIDConfigurationEndpoint(ctx, authorityInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return authority.Endpoints{}, err
|
return authority.Endpoints{}, err
|
||||||
}
|
}
|
||||||
@ -83,7 +80,7 @@ func (m *authorityEndpoint) cachedEndpoints(authorityInfo authority.Info, userPr
|
|||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
|
|
||||||
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
|
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
|
||||||
if authorityInfo.AuthorityType == ADFS {
|
if authorityInfo.AuthorityType == authority.ADFS {
|
||||||
domain, err := adfsDomainFromUpn(userPrincipalName)
|
domain, err := adfsDomainFromUpn(userPrincipalName)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if _, ok := cacheEntry.ValidForDomainsInList[domain]; ok {
|
if _, ok := cacheEntry.ValidForDomainsInList[domain]; ok {
|
||||||
@ -102,7 +99,7 @@ func (m *authorityEndpoint) addCachedEndpoints(authorityInfo authority.Info, use
|
|||||||
|
|
||||||
updatedCacheEntry := createcacheEntry(endpoints)
|
updatedCacheEntry := createcacheEntry(endpoints)
|
||||||
|
|
||||||
if authorityInfo.AuthorityType == ADFS {
|
if authorityInfo.AuthorityType == authority.ADFS {
|
||||||
// Since we're here, we've made a call to the backend. We want to ensure we're caching
|
// Since we're here, we've made a call to the backend. We want to ensure we're caching
|
||||||
// the latest values from the server.
|
// the latest values from the server.
|
||||||
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
|
if cacheEntry, ok := m.cache[authorityInfo.CanonicalAuthorityURI]; ok {
|
||||||
@ -119,9 +116,12 @@ func (m *authorityEndpoint) addCachedEndpoints(authorityInfo authority.Info, use
|
|||||||
m.cache[authorityInfo.CanonicalAuthorityURI] = updatedCacheEntry
|
m.cache[authorityInfo.CanonicalAuthorityURI] = updatedCacheEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, authorityInfo authority.Info, userPrincipalName string) (string, error) {
|
func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, authorityInfo authority.Info) (string, error) {
|
||||||
if authorityInfo.Tenant == "adfs" {
|
if authorityInfo.AuthorityType == authority.ADFS {
|
||||||
return fmt.Sprintf("https://%s/adfs/.well-known/openid-configuration", authorityInfo.Host), nil
|
return fmt.Sprintf("https://%s/adfs/.well-known/openid-configuration", authorityInfo.Host), nil
|
||||||
|
} else if authorityInfo.AuthorityType == authority.DSTS {
|
||||||
|
return fmt.Sprintf("https://%s/dstsv2/%s/v2.0/.well-known/openid-configuration", authorityInfo.Host, authority.DSTSTenant), nil
|
||||||
|
|
||||||
} else if authorityInfo.ValidateAuthority && !authority.TrustedHost(authorityInfo.Host) {
|
} else if authorityInfo.ValidateAuthority && !authority.TrustedHost(authorityInfo.Host) {
|
||||||
resp, err := m.rest.Authority().AADInstanceDiscovery(ctx, authorityInfo)
|
resp, err := m.rest.Authority().AADInstanceDiscovery(ctx, authorityInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -134,7 +134,6 @@ func (m *authorityEndpoint) openIDConfigurationEndpoint(ctx context.Context, aut
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return resp.TenantDiscoveryEndpoint, nil
|
return resp.TenantDiscoveryEndpoint, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return authorityInfo.CanonicalAuthorityURI + "v2.0/.well-known/openid-configuration", nil
|
return authorityInfo.CanonicalAuthorityURI + "v2.0/.well-known/openid-configuration", nil
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package aws
|
package aws
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.32.3"
|
const goModuleVersion = "1.32.4"
|
||||||
|
4
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
generated
vendored
4
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
generated
vendored
@ -1,3 +1,7 @@
|
|||||||
|
# v1.3.23 (2024-11-06)
|
||||||
|
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v1.3.22 (2024-10-28)
|
# v1.3.22 (2024-10-28)
|
||||||
|
|
||||||
* **Dependency Update**: Updated to the latest SDK module versions
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package configsources
|
package configsources
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.3.22"
|
const goModuleVersion = "1.3.23"
|
||||||
|
4
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
generated
vendored
4
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
generated
vendored
@ -1,3 +1,7 @@
|
|||||||
|
# v2.6.23 (2024-11-06)
|
||||||
|
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v2.6.22 (2024-10-28)
|
# v2.6.22 (2024-10-28)
|
||||||
|
|
||||||
* **Dependency Update**: Updated to the latest SDK module versions
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package endpoints
|
package endpoints
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "2.6.22"
|
const goModuleVersion = "2.6.23"
|
||||||
|
4
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
generated
vendored
4
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
generated
vendored
@ -1,3 +1,7 @@
|
|||||||
|
# v1.12.4 (2024-11-06)
|
||||||
|
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v1.12.3 (2024-10-28)
|
# v1.12.3 (2024-10-28)
|
||||||
|
|
||||||
* **Dependency Update**: Updated to the latest SDK module versions
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
package presignedurl
|
package presignedurl
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.12.3"
|
const goModuleVersion = "1.12.4"
|
||||||
|
4
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
4
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
@ -1,3 +1,7 @@
|
|||||||
|
# v1.32.4 (2024-11-06)
|
||||||
|
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v1.32.3 (2024-10-28)
|
# v1.32.3 (2024-10-28)
|
||||||
|
|
||||||
* **Dependency Update**: Updated to the latest SDK module versions
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package sts
|
package sts
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.32.3"
|
const goModuleVersion = "1.32.4"
|
||||||
|
14
vendor/modules.txt
vendored
14
vendor/modules.txt
vendored
@ -33,13 +33,13 @@ github.com/Azure/azure-sdk-for-go/sdk/internal/log
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/internal/poller
|
github.com/Azure/azure-sdk-for-go/sdk/internal/poller
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal/temporal
|
github.com/Azure/azure-sdk-for-go/sdk/internal/temporal
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal/uuid
|
github.com/Azure/azure-sdk-for-go/sdk/internal/uuid
|
||||||
# github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.2.0
|
# github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets v1.3.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets
|
||||||
# github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0
|
# github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v1.1.0
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal
|
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal
|
||||||
# github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2
|
# github.com/AzureAD/microsoft-authentication-library-for-go v1.3.1
|
||||||
## explicit; go 1.18
|
## explicit; go 1.18
|
||||||
github.com/AzureAD/microsoft-authentication-library-for-go/apps/cache
|
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/confidential
|
||||||
@ -126,7 +126,7 @@ github.com/aws/aws-sdk-go/service/sso/ssoiface
|
|||||||
github.com/aws/aws-sdk-go/service/ssooidc
|
github.com/aws/aws-sdk-go/service/ssooidc
|
||||||
github.com/aws/aws-sdk-go/service/sts
|
github.com/aws/aws-sdk-go/service/sts
|
||||||
github.com/aws/aws-sdk-go/service/sts/stsiface
|
github.com/aws/aws-sdk-go/service/sts/stsiface
|
||||||
# github.com/aws/aws-sdk-go-v2 v1.32.3
|
# github.com/aws/aws-sdk-go-v2 v1.32.4
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/aws/aws-sdk-go-v2/aws
|
github.com/aws/aws-sdk-go-v2/aws
|
||||||
github.com/aws/aws-sdk-go-v2/aws/defaults
|
github.com/aws/aws-sdk-go-v2/aws/defaults
|
||||||
@ -149,19 +149,19 @@ github.com/aws/aws-sdk-go-v2/internal/sdk
|
|||||||
github.com/aws/aws-sdk-go-v2/internal/strings
|
github.com/aws/aws-sdk-go-v2/internal/strings
|
||||||
github.com/aws/aws-sdk-go-v2/internal/sync/singleflight
|
github.com/aws/aws-sdk-go-v2/internal/sync/singleflight
|
||||||
github.com/aws/aws-sdk-go-v2/internal/timeconv
|
github.com/aws/aws-sdk-go-v2/internal/timeconv
|
||||||
# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22
|
# github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources
|
github.com/aws/aws-sdk-go-v2/internal/configsources
|
||||||
# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22
|
# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2
|
||||||
# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0
|
# github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding
|
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding
|
||||||
# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3
|
# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
|
||||||
# github.com/aws/aws-sdk-go-v2/service/sts v1.32.3
|
# github.com/aws/aws-sdk-go-v2/service/sts v1.32.4
|
||||||
## explicit; go 1.21
|
## explicit; go 1.21
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts
|
github.com/aws/aws-sdk-go-v2/service/sts
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints
|
github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints
|
||||||
|
Loading…
Reference in New Issue
Block a user