Skip to content

Commit f2161e9

Browse files
authored
fix(partner-api): enforce organization-output contract filtering (#80)
Enforce the `organization-output` API contract by filtering Confederatio responses to only include documented fields. Organization endpoints were returning undocumented fields (`name`, `country`) that leaked from Confederatio's internal response. Added response filtering pipeline to ensure only documented fields are returned: - `id` (UUID) - `status` (active, suspended, terminated) - `billing-address` (structured ISO 20022 address) - `client-id`
1 parent 0fa538d commit f2161e9

4 files changed

Lines changed: 14 additions & 19 deletions

File tree

.github/workflows/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |-
2626
git config user.name "Automated"
2727
git config user.email "actions@users.noreply.github.com"
28-
git add exoscale/openapi.json
28+
git add exoscale/openapi.json exoscale/partner-api.json
2929
timestamp=$(date -u)
3030
git commit -m "OpenAPI spec update: ${timestamp}" || exit 0
3131
git push

docs/changes.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Changelog
22
---------
33

4+
0.16.1 (unreleased)
5+
-------------------
6+
7+
Fixes
8+
*****
9+
10+
* Partner API: Ensure organization responses match ``organization-output`` contract.
11+
Responses now only include documented fields (``id``, ``status``, ``billing-address``,
12+
``client-id``). Access organization name via ``billing-address.name``.
13+
14+
* GitHub Actions: Add automatic sync of Partner API OpenAPI spec (``partner-api.json``).
15+
416
0.16.0 (2025-11-27)
517
-------------------
618

exoscale/partner-api.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,6 @@
213213
"maxLength": 191,
214214
"type": "string"
215215
},
216-
"country": {
217-
"description": "Organization Country. Format: ISO 3166-1 alpha-2",
218-
"maxLength": 2,
219-
"minLength": 2,
220-
"readOnly": true,
221-
"type": "string"
222-
},
223216
"id": {
224217
"description": "Organization ID",
225218
"format": "uuid",
@@ -702,4 +695,4 @@
702695
"title": "API Request Signature"
703696
}
704697
]
705-
}
698+
}

tests/test_partner_client.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ def test_create_organization_with_structured_address(requests_mock):
9090

9191
expected_response = {
9292
"id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
93-
"name": "test-org-001",
9493
"status": "active",
9594
"billing-address": {
9695
"name": "ACME Corporation",
@@ -100,7 +99,6 @@ def test_create_organization_with_structured_address(requests_mock):
10099
"postal-code": "1217",
101100
"country": "CH",
102101
},
103-
"country": "CH",
104102
}
105103

106104
requests_mock.post(
@@ -132,7 +130,6 @@ def test_create_organization_with_optional_fields(requests_mock):
132130

133131
expected_response = {
134132
"id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
135-
"name": "test-org-002",
136133
"status": "active",
137134
"billing-address": {
138135
"name": "Test GmbH",
@@ -144,7 +141,6 @@ def test_create_organization_with_optional_fields(requests_mock):
144141
"address": "Additional address information",
145142
},
146143
"client-id": "custom-client-123",
147-
"country": "DE",
148144
}
149145

150146
requests_mock.post(
@@ -181,7 +177,6 @@ def test_create_organization_minimal_billing_address(requests_mock):
181177

182178
expected_response = {
183179
"id": "a1b2c3d4-e5f6-4a5b-8c9d-0e1f2a3b4c5d",
184-
"name": "test-org-003",
185180
"status": "active",
186181
"billing-address": {
187182
"name": "Société Française",
@@ -190,7 +185,6 @@ def test_create_organization_minimal_billing_address(requests_mock):
190185
"postal-code": "75001",
191186
"country": "FR",
192187
},
193-
"country": "FR",
194188
}
195189

196190
requests_mock.post(
@@ -224,7 +218,6 @@ def test_list_organizations(requests_mock):
224218
"organizations": [
225219
{
226220
"id": "org-1",
227-
"name": "org-001",
228221
"status": "active",
229222
"billing-address": {
230223
"name": "Org 1",
@@ -233,11 +226,9 @@ def test_list_organizations(requests_mock):
233226
"postal-code": "1000",
234227
"country": "CH",
235228
},
236-
"country": "CH",
237229
},
238230
{
239231
"id": "org-2",
240-
"name": "org-002",
241232
"status": "suspended",
242233
"billing-address": {
243234
"name": "Org 2",
@@ -246,7 +237,6 @@ def test_list_organizations(requests_mock):
246237
"postal-code": "2000",
247238
"country": "DE",
248239
},
249-
"country": "DE",
250240
},
251241
]
252242
}

0 commit comments

Comments
 (0)