Skip to content

Commit 66c86a4

Browse files
committed
fix(dms): remove instance_name from DMSCredentials and update INTEGRATION_TESTS.md
1 parent f8a5f6e commit 66c86a4

6 files changed

Lines changed: 16 additions & 12 deletions

File tree

docs/INTEGRATION_TESTS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ CLOUD_SDK_CFG_DATA_ANONYMIZATION_DEFAULT_DESTINATION_NAME=your-client-certificat
9696

9797
The destination must be configured with `ClientCertificateAuthentication` and reference a certificate bundle containing the client certificate and private key.
9898

99+
### DMS Integration Tests
100+
101+
For DMS (Document Management Service) integration tests, configure the following variables in `.env_integration_tests`:
102+
103+
```bash
104+
# DMS Configuration
105+
CLOUD_SDK_CFG_SDM_DEFAULT_URI=https://your-sdm-api-uri-here
106+
CLOUD_SDK_CFG_SDM_DEFAULT_UAA='{"url":"https://your-auth-url","clientid":"your-client-id","clientsecret":"your-client-secret","identityzone":"your-identity-zone"}'
107+
```
108+
109+
**Note**: The test fixture automatically onboards test repositories (standard and version-enabled) at session start and cleans them up on teardown. No pre-existing repositories are required.
110+
99111
### ADMS Integration Tests
100112

101113
For ADMS (Advanced Document Management Service) integration tests, configure the following variables in `.env_integration_tests`:
@@ -145,6 +157,7 @@ uv run pytest tests/core/integration/auditlog -v
145157
uv run pytest tests/core/integration/data_anonymization -v
146158
uv run pytest tests/objectstore/integration/ -v
147159
uv run pytest tests/destination/integration/ -v
160+
uv run pytest tests/dms/integration/ -v
148161
uv run pytest tests/agent_memory/integration/ -v
149162
uv run pytest tests/adms/integration/ -v
150163
uv run pytest tests/agentgateway/integration/ -v

src/sap_cloud_sdk/dms/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,7 @@ def __init__(
110110
read_timeout=read_timeout,
111111
)
112112
self._telemetry_source: Optional[Module] = None
113-
logger.debug(
114-
"DMSClient initialized for instance '%s'", credentials.instance_name
115-
)
113+
logger.debug("DMSClient initialized")
116114

117115
@record_metrics(Module.DMS, Operation.DMS_ONBOARD_REPOSITORY)
118116
def onboard_repository(

src/sap_cloud_sdk/dms/config.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,19 @@ def _validate_uaa(self) -> None:
7777
f"UAA credentials missing required fields: {', '.join(sorted(missing_fields))}"
7878
)
7979

80-
def to_credentials(self, instance_name: str) -> DMSCredentials:
80+
def to_credentials(self) -> DMSCredentials:
8181
"""Convert the binding data to DMSCredentials.
8282
8383
Parses the UAA JSON and constructs a DMSCredentials object with the necessary information
8484
for authenticating and connecting to the DMS service.
8585
86-
Args:
87-
instance_name: The logical instance name for these credentials.
88-
8986
Returns:
9087
DMSCredentials: The credentials extracted from the binding data
9188
"""
9289
uaa_data: Dict[str, Any] = json.loads(self.uaa)
9390
token_url = uaa_data["url"].rstrip("/") + "/oauth/token"
9491

9592
return DMSCredentials(
96-
instance_name=instance_name,
9793
uri=self.uri,
9894
client_id=uaa_data["clientid"],
9995
client_secret=uaa_data["clientsecret"],
@@ -131,7 +127,7 @@ def load_sdm_config_from_env_or_mount(instance: Optional[str] = None) -> DMSCred
131127
)
132128

133129
binding.validate()
134-
return binding.to_credentials(inst)
130+
return binding.to_credentials()
135131

136132
except Exception as e:
137133
# Rely on the central secret resolver to provide aggregated, generic guidance

src/sap_cloud_sdk/dms/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def _to_dict_drop_none(obj: Any) -> dict[str, Any]:
3030
class DMSCredentials:
3131
"""Credentials for authenticating with the DMS service."""
3232

33-
instance_name: str
3433
uri: str
3534
client_id: str
3635
client_secret: str

tests/dms/unit/test_client_admin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def client():
7272
mock_http = Mock()
7373
MockHttp.return_value = mock_http
7474
creds = DMSCredentials(
75-
instance_name="test-instance",
7675
uri="https://api.example.com",
7776
client_id="test-client",
7877
client_secret="test-secret",

tests/dms/unit/test_client_cmis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def _mock_response(data):
100100
def client():
101101
"""Create a DMSClient with a mocked HttpInvoker."""
102102
creds = DMSCredentials(
103-
instance_name="test-instance",
104103
uri="https://api.example.com",
105104
client_id="test-client",
106105
client_secret="test-secret",

0 commit comments

Comments
 (0)