Skip to content

Commit 60f40a1

Browse files
committed
chore(carbonserver) adjust auth test
1 parent 42e6ff9 commit 60f40a1

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

carbonserver/tests/api/service/test_auth_provider.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
from carbonserver.api.services.auth_providers.oidc_auth_provider import OIDCAuthProvider
6+
from carbonserver.config import settings
67

78

89
class TestOIDCAuthProvider:
@@ -17,25 +18,11 @@ def test_oidc_provider_initialization(self):
1718
)
1819

1920
# Check all required methods exist
20-
assert hasattr(provider, "get_auth_url")
21-
assert hasattr(provider, "handle_auth_callback")
22-
assert hasattr(provider, "validate_access_token")
23-
assert hasattr(provider, "get_user_info")
24-
assert hasattr(provider, "get_token_endpoint")
25-
assert hasattr(provider, "get_authorize_endpoint")
21+
assert hasattr(provider, "get_authorize_url")
2622
assert hasattr(provider, "get_client_credentials")
2723

2824
# Test endpoint methods
29-
assert provider.get_token_endpoint() == "https://auth.example.com/api/token"
30-
assert provider.get_authorize_endpoint() == "https://auth.example.com/authorize"
31-
assert provider.get_client_credentials() == ("test_client", "test_secret")
32-
33-
def test_oidc_provider_base_url_normalization(self):
34-
"""Test that base URL is normalized correctly."""
35-
provider = OIDCAuthProvider(
36-
base_url="https://auth.example.com/", # trailing slash
37-
client_id="test_client",
38-
client_secret="test_secret",
25+
assert provider.get_client_credentials() == (
26+
settings.oidc_client_id,
27+
settings.oidc_client_secret,
3928
)
40-
41-
assert provider.base_url == "https://auth.example.com"

0 commit comments

Comments
 (0)