diff --git a/.version b/.version index e7e42a4..39ee137 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -6.3.0 \ No newline at end of file +6.3.1 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a16089c..2fcafcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### v6.3.1 +* Корневой путь до методов СУДИР перенесён в конфигурацию + * Ранее: В конфигурации `https://sudir-domain/` + фиксированно в коде `/blitz/oauth/*` + * Сейчас: В конфигурации `https://sudir-domain/<указать, что необходимо>` + фиксированно в коде `/oauth/*` ### v6.3.0 * убрана интеграция с LDAP * исправлен сброс разблокировки и назначения ролей на пользователя diff --git a/repository/sudir.go b/repository/sudir.go index b45debb..ecb6b7b 100644 --- a/repository/sudir.go +++ b/repository/sudir.go @@ -25,7 +25,7 @@ func NewSudir(httpCli *httpcli.Client, cfg *conf.SudirAuth) Sudir { } func (s Sudir) GetToken(ctx context.Context, authCode string) (*entity.SudirTokenResponse, error) { - urlString, err := url.JoinPath(s.cfg.Host, "/blitz/oauth/te") + urlString, err := url.JoinPath(s.cfg.Host, "/oauth/te") if err != nil { return nil, errors.WithMessage(err, "build url") } @@ -56,7 +56,7 @@ func (s Sudir) GetToken(ctx context.Context, authCode string) (*entity.SudirToke } func (s Sudir) GetUser(ctx context.Context, accessToken string) (*entity.SudirUserResponse, error) { - urlString, err := url.JoinPath(s.cfg.Host, "/blitz/oauth/me") + urlString, err := url.JoinPath(s.cfg.Host, "/oauth/me") if err != nil { return nil, errors.WithMessage(err, "build url") } diff --git a/tests/auth_test.go b/tests/auth_test.go index aef6caf..bd86fbc 100644 --- a/tests/auth_test.go +++ b/tests/auth_test.go @@ -5,6 +5,7 @@ import ( "fmt" "net/http" "net/http/httptest" + "net/url" "strconv" "sync/atomic" "testing" @@ -50,12 +51,13 @@ func (s *AuthTestSuite) SetupTest() { s.httpCli = httpcli.New() mocksrv, host := s.initMockSudir() + sudirHost, _ := url.JoinPath(host, "/blitz/") remote := conf.Remote{ SudirAuth: &conf.SudirAuth{ ClientId: "admin", ClientSecret: "admin", - Host: host, + Host: sudirHost, RedirectURI: "http://localhost", }, ExpireSec: 3600,