MSP-8520 restore blitz
This commit is contained in:
1 parent
4fecfaa701
commit
888a71df57
1 file changed
+5
-3
+5
-3
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
|
"net/url"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"testing"
|
"testing"
|
||||||
@@ -54,7 +55,8 @@ func (s *AuthTestSuite) SetupTest() {
|
|||||||
s.oauthClientName = fake.It[string]()
|
s.oauthClientName = fake.It[string]()
|
||||||
|
|
||||||
mocksrv, host := s.initMockOauth()
|
mocksrv, host := s.initMockOauth()
|
||||||
s.oauthCli.GlobalRequestConfig().BaseUrl = host
|
oauthHost, _ := url.JoinPath(host, "/blitz/")
|
||||||
|
s.oauthCli.GlobalRequestConfig().BaseUrl = oauthHost
|
||||||
|
|
||||||
remote := conf.Remote{
|
remote := conf.Remote{
|
||||||
Oauth: &conf.Oauth{
|
Oauth: &conf.Oauth{
|
||||||
@@ -325,7 +327,7 @@ func (s *AuthTestSuite) TestBruteForceLogin() {
|
|||||||
|
|
||||||
func (s *AuthTestSuite) initMockOauth() (*httptest.Server, string) {
|
func (s *AuthTestSuite) initMockOauth() (*httptest.Server, string) {
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
mux.HandleFunc("/oauth/te", func(writer http.ResponseWriter, request *http.Request) {
|
mux.HandleFunc("/blitz/oauth/te", func(writer http.ResponseWriter, request *http.Request) {
|
||||||
res := entity.OauthTokenResponse{
|
res := entity.OauthTokenResponse{
|
||||||
OauthAuthError: nil,
|
OauthAuthError: nil,
|
||||||
IdToken: "1",
|
IdToken: "1",
|
||||||
@@ -336,7 +338,7 @@ func (s *AuthTestSuite) initMockOauth() (*httptest.Server, string) {
|
|||||||
_, err = writer.Write(data)
|
_, err = writer.Write(data)
|
||||||
s.NoError(err)
|
s.NoError(err)
|
||||||
})
|
})
|
||||||
mux.HandleFunc("/oauth/me", func(writer http.ResponseWriter, request *http.Request) {
|
mux.HandleFunc("/blitz/oauth/me", func(writer http.ResponseWriter, request *http.Request) {
|
||||||
res := entity.OauthUserResponse{
|
res := entity.OauthUserResponse{
|
||||||
OauthAuthError: nil,
|
OauthAuthError: nil,
|
||||||
Email: "oauth@email.ru",
|
Email: "oauth@email.ru",
|
||||||
|
|||||||
Reference in new issue
Block a user