From 34fbc2f8b1955a252bcc3780d91a6db77f461c03 Mon Sep 17 00:00:00 2001 From: Kharec Date: Fri, 9 Jan 2026 18:43:25 +0100 Subject: [PATCH] test: ensure refresh token rotation is documented --- internal/e2e/api_documentation_test.go | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/internal/e2e/api_documentation_test.go b/internal/e2e/api_documentation_test.go index 0c3a0de..86e1c8f 100644 --- a/internal/e2e/api_documentation_test.go +++ b/internal/e2e/api_documentation_test.go @@ -218,5 +218,39 @@ func TestE2E_APIEndpointDocumentation(t *testing.T) { t.Logf("Auth endpoint %s may use inline request body", endpoint) } } + + refreshEndpointData, ok := paths["/api/auth/refresh"].(map[string]any) + if ok { + postMethod, ok := refreshEndpointData["post"].(map[string]any) + if ok { + responses, ok := postMethod["responses"].(map[string]any) + if ok { + successResponse, ok := responses["200"].(map[string]any) + if ok { + content, ok := successResponse["content"].(map[string]any) + if ok { + applicationJson, ok := content["application/json"].(map[string]any) + if ok { + schema, ok := applicationJson["schema"].(map[string]any) + if ok { + properties, ok := schema["properties"].(map[string]any) + if !ok { + data, ok := schema["data"].(map[string]any) + if ok { + properties, ok = data["properties"].(map[string]any) + } + } + if properties != nil { + if properties["refresh_token"] == nil { + t.Error("Refresh endpoint response schema missing refresh_token field (rotation not documented)") + } + } + } + } + } + } + } + } + } }) }