зеркало из https://github.com/Azure/ARO-RP.git
Update fake RefreshToken to use a randomly generated string (#2526)
Required to pass Microsoft Guardian tests.
This commit is contained in:
Родитель
6b1f429e83
Коммит
93663d1d35
|
@ -10,8 +10,10 @@ import (
|
|||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/url"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest/adal"
|
||||
"github.com/golang/mock/gomock"
|
||||
|
@ -119,9 +121,10 @@ func createToken(tr *tokenRequirements) (*adal.ServicePrincipalToken, error) {
|
|||
|
||||
tk := adal.Token{}
|
||||
|
||||
r := rand.New(rand.NewSource(time.Now().UnixMicro()))
|
||||
tk = adal.Token{
|
||||
AccessToken: headerEnc + "." + claimsEnc + "." + signatureEnc,
|
||||
RefreshToken: "IwOGYzYTlmM2YxOTQ5MGE3YmNmMDFkNTVk",
|
||||
RefreshToken: fmt.Sprintf("rand-%d", r.Int()),
|
||||
ExpiresIn: json.Number("300"),
|
||||
Resource: tr.resource,
|
||||
Type: "refresh",
|
||||
|
|
|
@ -10,8 +10,10 @@ import (
|
|||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/url"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest/adal"
|
||||
"github.com/golang/mock/gomock"
|
||||
|
@ -269,9 +271,10 @@ func createToken(tr *tokenRequirements) (*adal.ServicePrincipalToken, error) {
|
|||
|
||||
tk := adal.Token{}
|
||||
|
||||
r := rand.New(rand.NewSource(time.Now().UnixMicro()))
|
||||
tk = adal.Token{
|
||||
AccessToken: headerEnc + "." + claimsEnc + "." + signatureEnc,
|
||||
RefreshToken: "IwOGYzYTlmM2YxOTQ5MGE3YmNmMDFkNTVk",
|
||||
RefreshToken: fmt.Sprintf("rand-%d", r.Int()),
|
||||
ExpiresIn: json.Number("300"),
|
||||
Resource: tr.resource,
|
||||
Type: "refresh",
|
||||
|
|
Загрузка…
Ссылка в новой задаче