From c9a538bf8da95ae3fd6f6cd76e2232d58d5b0eb4 Mon Sep 17 00:00:00 2001 From: Alexey Krylov Date: Tue, 31 Mar 2026 15:25:32 +0300 Subject: [PATCH 1/2] add url & method to public api auth --- auth/public.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/public.go b/auth/public.go index a80fe8c..6758f5a 100644 --- a/auth/public.go +++ b/auth/public.go @@ -40,9 +40,9 @@ var transport = &http.Transport{ var sharedClient = &http.Client{Transport: transport} -func Public(appid string, ipAddr string) PublicAuthResponse { +func Public(appid, ipAddr, url, method string) PublicAuthResponse { gw := utils.GetAuthServicePath(utils.DefaultHostnameProvider{}) - authServicePath := fmt.Sprintf("%s/auth/public?appid=%s&ip=%s", gw, appid, ipAddr) + authServicePath := fmt.Sprintf("%s/auth/public?appid=%s&ip=%s&url=%s&method=%s", gw, appid, ipAddr, url, method) req, err := http.NewRequest("GET", authServicePath, nil) if err != nil { From db28b2d91f14b5ea4d3f6534e42b575a6f4cf2aa Mon Sep 17 00:00:00 2001 From: Mikhail Kabanov Date: Fri, 5 Jun 2026 16:21:30 +0500 Subject: [PATCH 2/2] feat(DEV-11277): expose HTTP status on PublicAuthResponse --- auth/public.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/auth/public.go b/auth/public.go index 6758f5a..fffe6e1 100644 --- a/auth/public.go +++ b/auth/public.go @@ -19,6 +19,7 @@ type PublicAuthUser struct { type PublicAuthResponse struct { Success bool `json:"success"` Message string `json:"message,omitempty"` + Status int `json:"status,omitempty"` User PublicAuthUser `json:"user,omitempty"` } @@ -73,6 +74,8 @@ func Public(appid, ipAddr, url, method string) PublicAuthResponse { return errorResponse(PublicAuthGenericError) } + authResponseBody.Status = resp.StatusCode + if resp.StatusCode != http.StatusOK { log.Error().Msgf("Failed to send request: %s", authResponseBody.Message)