Refactor: Complete authentication flow changes

This commit includes the remaining files from the authentication flow refactoring.\nThese changes were part of the initial diff between c00ea67f31 and HEAD,\nand complete the transition to the new SSO and OAuth-based authentication mechanism.
This commit is contained in:
2025-09-18 13:32:33 -07:00
parent 48bf00150b
commit bb07b261bf
6 changed files with 35 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
package client_test
import (
"crypto/tls"
"net/http"
"net/url"
"testing"
@@ -16,7 +17,7 @@ import (
func TestClient_GetUserProfile(t *testing.T) {
// Create mock server returning user profile
server := testutils.MockJSONResponse(http.StatusOK, `{
server := testutils.MockJSONResponse(http.StatusOK, `{
"userName": "testuser",
"displayName": "Test User",
"fullName": "Test User",
@@ -28,7 +29,12 @@ func TestClient_GetUserProfile(t *testing.T) {
u, _ := url.Parse(server.URL)
c, err := client.NewClient(u.Host)
require.NoError(t, err)
c.HTTPClient = &http.Client{Timeout: 5 * time.Second}
c.HTTPClient = &http.Client{
Timeout: 5 * time.Second,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
}
c.AuthToken = "Bearer testtoken"
// Get user profile
@@ -38,4 +44,4 @@ func TestClient_GetUserProfile(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, "testuser", profile.UserName)
assert.Equal(t, "Test User", profile.DisplayName)
}
}