mirror of
https://github.com/dnlbauer/cordra-mcp.git
synced 2026-09-10 21:55:30 +00:00
feat: change variable name for base url
This commit is contained in:
@@ -102,7 +102,7 @@ class CordraClient:
|
|||||||
CordraAuthenticationError: If authentication fails
|
CordraAuthenticationError: If authentication fails
|
||||||
CordraClientError: For other API errors
|
CordraClientError: For other API errors
|
||||||
"""
|
"""
|
||||||
url = f"{self.config.cordra_url}/objects/{object_id}"
|
url = f"{self.config.base_url}/objects/{object_id}"
|
||||||
params = {"full": "true"}
|
params = {"full": "true"}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -143,7 +143,7 @@ class CordraClient:
|
|||||||
CordraAuthenticationError: If authentication fails
|
CordraAuthenticationError: If authentication fails
|
||||||
CordraClientError: For other API errors
|
CordraClientError: For other API errors
|
||||||
"""
|
"""
|
||||||
url = f"{self.config.cordra_url}/search"
|
url = f"{self.config.base_url}/search"
|
||||||
params = {"query": query}
|
params = {"query": query}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
"""Configuration settings for the MCP Cordra server."""
|
"""Configuration settings for the MCP Cordra server."""
|
||||||
|
|
||||||
|
|
||||||
from pydantic import Field
|
from pydantic import Field
|
||||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||||
|
|
||||||
@@ -15,29 +14,20 @@ class CordraConfig(BaseSettings):
|
|||||||
case_sensitive=False,
|
case_sensitive=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
cordra_url: str = Field(
|
base_url: str = Field(
|
||||||
default="https://localhost:8443",
|
default="https://localhost:8443",
|
||||||
description="Base URL of the Cordra repository"
|
description="Base URL of the Cordra repository",
|
||||||
)
|
)
|
||||||
username: str | None = Field(
|
username: str | None = Field(
|
||||||
default=None,
|
default=None, description="Username for Cordra authentication"
|
||||||
description="Username for Cordra authentication"
|
|
||||||
)
|
)
|
||||||
password: str | None = Field(
|
password: str | None = Field(
|
||||||
default=None,
|
default=None, description="Password for Cordra authentication"
|
||||||
description="Password for Cordra authentication"
|
|
||||||
)
|
)
|
||||||
max_search_results: int = Field(
|
max_search_results: int = Field(
|
||||||
default=1000,
|
default=1000, description="Maximum number of search results to return"
|
||||||
description="Maximum number of search results to return"
|
|
||||||
)
|
)
|
||||||
verify_ssl: bool = Field(
|
verify_ssl: bool = Field(
|
||||||
default=True,
|
default=True, description="Whether to verify SSL certificates"
|
||||||
description="Whether to verify SSL certificates"
|
|
||||||
)
|
)
|
||||||
timeout: int = Field(
|
timeout: int = Field(default=30, description="Request timeout in seconds")
|
||||||
default=30,
|
|
||||||
description="Request timeout in seconds"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ from cordra_mcp.config import CordraConfig
|
|||||||
def config():
|
def config():
|
||||||
"""Create a test configuration."""
|
"""Create a test configuration."""
|
||||||
return CordraConfig(
|
return CordraConfig(
|
||||||
cordra_url="https://test.example.com",
|
base_url="https://test.example.com",
|
||||||
username="testuser",
|
username="testuser",
|
||||||
password="testpass",
|
password="testpass",
|
||||||
verify_ssl=False,
|
verify_ssl=False,
|
||||||
@@ -239,7 +239,7 @@ class TestCordraConfig:
|
|||||||
def test_default_config(self):
|
def test_default_config(self):
|
||||||
"""Test default configuration values."""
|
"""Test default configuration values."""
|
||||||
config = CordraConfig()
|
config = CordraConfig()
|
||||||
assert config.cordra_url == "https://localhost:8443"
|
assert config.base_url == "https://localhost:8443"
|
||||||
assert config.username is None
|
assert config.username is None
|
||||||
assert config.password is None
|
assert config.password is None
|
||||||
assert config.max_search_results == 1000
|
assert config.max_search_results == 1000
|
||||||
|
|||||||
Reference in New Issue
Block a user