Skip to content

Commit bdffdc4

Browse files
committed
Use POST method for all netlicensing_update_xxx tools; fixes #2
1 parent 471ccd6 commit bdffdc4

File tree

8 files changed

+20
-20
lines changed

8 files changed

+20
-20
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ rm -rf dist/
269269
hatch build --target wheel
270270

271271
# Build the Docker image locally
272-
docker build -t ghcr.io/labs64/netlicensing-mcp:latest
272+
docker build -t ghcr.io/labs64/netlicensing-mcp:latest .
273273
```
274-
274+
275275
### HTTP mode (for remote / shared deployments)
276276

277277
```bash
@@ -280,7 +280,7 @@ python -m netlicensing_mcp.server http
280280
```
281281

282282
Use `ngrok` or a reverse proxy to expose the HTTP endpoint to remote MCP clients:
283-
283+
284284
```bash
285285
ngrok http 8000
286286
# Then point your client at the generated HTTPS URL

src/netlicensing_mcp/tools/bundles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ async def update_bundle(
7070
data["currency"] = currency
7171
if description is not None:
7272
data["description"] = description
73-
return await nl_put(f"/bundle/{bundle_number}", data)
73+
return await nl_post(f"/bundle/{bundle_number}", data)
7474

7575

7676
async def delete_bundle(bundle_number: str, force_cascade: bool = False) -> str:

src/netlicensing_mcp/tools/license_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ async def update_license_template(
128128
data["quantity"] = str(quantity)
129129
if grace_period is not None:
130130
data["gracePeriod"] = str(grace_period).lower()
131-
return await nl_put(f"/licensetemplate/{template_number}", data)
131+
return await nl_post(f"/licensetemplate/{template_number}", data)
132132

133133

134134
async def delete_license_template(template_number: str, force_cascade: bool = False) -> str:

src/netlicensing_mcp/tools/licensees.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ async def update_licensee(
7575
data["markedForTransfer"] = str(marked_for_transfer).lower()
7676
if licensee_secret is not None:
7777
data["licenseeSecret"] = licensee_secret
78-
return await nl_put(f"/licensee/{licensee_number}", data)
78+
return await nl_post(f"/licensee/{licensee_number}", data)
7979

8080

8181
async def delete_licensee(licensee_number: str, force_cascade: bool = False) -> str:

src/netlicensing_mcp/tools/licenses.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ async def update_license(
131131
data["parentfeature"] = parent_feature
132132
if hidden is not None:
133133
data["hidden"] = str(hidden).lower()
134-
return await nl_put(f"/license/{license_number}", data)
134+
return await nl_post(f"/license/{license_number}", data)
135135

136136

137137
async def delete_license(license_number: str, force_cascade: bool = False) -> str:

src/netlicensing_mcp/tools/product_modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async def update_product_module(
9696
data["redThreshold"] = str(red_threshold)
9797
if node_secret_mode is not None:
9898
data["nodeSecretMode"] = node_secret_mode
99-
return await nl_put(f"/productmodule/{module_number}", data)
99+
return await nl_post(f"/productmodule/{module_number}", data)
100100

101101

102102
async def delete_product_module(module_number: str, force_cascade: bool = False) -> str:

src/netlicensing_mcp/tools/products.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async def update_product(
9090
data["vatMode"] = vat_mode
9191
if licensee_secret_mode is not None:
9292
data["licenseeSecretMode"] = licensee_secret_mode
93-
return await nl_put(f"/product/{product_number}", data)
93+
return await nl_post(f"/product/{product_number}", data)
9494

9595

9696
async def delete_product(product_number: str, force_cascade: bool = False) -> str:

tests/test_tools.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ async def test_create_product_all_fields(product_response):
282282
@pytest.mark.asyncio
283283
async def test_update_product(product_response):
284284
with patch(
285-
"netlicensing_mcp.tools.products.nl_put", new=AsyncMock(return_value=product_response)
285+
"netlicensing_mcp.tools.products.nl_post", new=AsyncMock(return_value=product_response)
286286
):
287287
from netlicensing_mcp.tools.products import update_product
288288

@@ -293,7 +293,7 @@ async def test_update_product(product_response):
293293
@pytest.mark.asyncio
294294
async def test_update_product_all_fields(product_response):
295295
mock_put = AsyncMock(return_value=product_response)
296-
with patch("netlicensing_mcp.tools.products.nl_put", new=mock_put):
296+
with patch("netlicensing_mcp.tools.products.nl_post", new=mock_put):
297297
from netlicensing_mcp.tools.products import update_product
298298

299299
result = await update_product(
@@ -381,7 +381,7 @@ async def test_create_bundle(bundle_response):
381381
@pytest.mark.asyncio
382382
async def test_update_bundle(bundle_response):
383383
with patch(
384-
"netlicensing_mcp.tools.bundles.nl_put", new=AsyncMock(return_value=bundle_response)
384+
"netlicensing_mcp.tools.bundles.nl_post", new=AsyncMock(return_value=bundle_response)
385385
):
386386
from netlicensing_mcp.tools.bundles import update_bundle
387387

@@ -509,7 +509,7 @@ async def test_create_product_module_all_fields(module_response):
509509
@pytest.mark.asyncio
510510
async def test_update_product_module(module_response):
511511
with patch(
512-
"netlicensing_mcp.tools.product_modules.nl_put",
512+
"netlicensing_mcp.tools.product_modules.nl_post",
513513
new=AsyncMock(return_value=module_response),
514514
):
515515
from netlicensing_mcp.tools.product_modules import update_product_module
@@ -521,7 +521,7 @@ async def test_update_product_module(module_response):
521521
@pytest.mark.asyncio
522522
async def test_update_product_module_all_fields(module_response):
523523
mock_put = AsyncMock(return_value=module_response)
524-
with patch("netlicensing_mcp.tools.product_modules.nl_put", new=mock_put):
524+
with patch("netlicensing_mcp.tools.product_modules.nl_post", new=mock_put):
525525
from netlicensing_mcp.tools.product_modules import update_product_module
526526

527527
result = await update_product_module(
@@ -662,7 +662,7 @@ async def test_create_license_template_all_fields(template_response):
662662
@pytest.mark.asyncio
663663
async def test_update_license_template(template_response):
664664
with patch(
665-
"netlicensing_mcp.tools.license_templates.nl_put",
665+
"netlicensing_mcp.tools.license_templates.nl_post",
666666
new=AsyncMock(return_value=template_response),
667667
):
668668
from netlicensing_mcp.tools.license_templates import update_license_template
@@ -674,7 +674,7 @@ async def test_update_license_template(template_response):
674674
@pytest.mark.asyncio
675675
async def test_update_license_template_all_fields(template_response):
676676
mock_put = AsyncMock(return_value=template_response)
677-
with patch("netlicensing_mcp.tools.license_templates.nl_put", new=mock_put):
677+
with patch("netlicensing_mcp.tools.license_templates.nl_post", new=mock_put):
678678
from netlicensing_mcp.tools.license_templates import update_license_template
679679

680680
result = await update_license_template(
@@ -849,7 +849,7 @@ async def test_create_licensee_all_fields(licensee_response):
849849
@pytest.mark.asyncio
850850
async def test_update_licensee(licensee_response):
851851
with patch(
852-
"netlicensing_mcp.tools.licensees.nl_put", new=AsyncMock(return_value=licensee_response)
852+
"netlicensing_mcp.tools.licensees.nl_post", new=AsyncMock(return_value=licensee_response)
853853
):
854854
from netlicensing_mcp.tools.licensees import update_licensee
855855

@@ -860,7 +860,7 @@ async def test_update_licensee(licensee_response):
860860
@pytest.mark.asyncio
861861
async def test_update_licensee_all_fields(licensee_response):
862862
mock_put = AsyncMock(return_value=licensee_response)
863-
with patch("netlicensing_mcp.tools.licensees.nl_put", new=mock_put):
863+
with patch("netlicensing_mcp.tools.licensees.nl_post", new=mock_put):
864864
from netlicensing_mcp.tools.licensees import update_licensee
865865

866866
result = await update_licensee(
@@ -1007,7 +1007,7 @@ async def test_create_license_all_fields(license_response):
10071007
async def test_update_license_deactivate(license_response):
10081008
deactivated = dict(license_response)
10091009
deactivated["items"]["item"][0]["property"][1]["value"] = "false"
1010-
with patch("netlicensing_mcp.tools.licenses.nl_put", new=AsyncMock(return_value=deactivated)):
1010+
with patch("netlicensing_mcp.tools.licenses.nl_post", new=AsyncMock(return_value=deactivated)):
10111011
from netlicensing_mcp.tools.licenses import update_license
10121012

10131013
result = await update_license("L001", active=False)
@@ -1018,7 +1018,7 @@ async def test_update_license_deactivate(license_response):
10181018
@pytest.mark.asyncio
10191019
async def test_update_license_all_fields(license_response):
10201020
mock_put = AsyncMock(return_value=license_response)
1021-
with patch("netlicensing_mcp.tools.licenses.nl_put", new=mock_put):
1021+
with patch("netlicensing_mcp.tools.licenses.nl_post", new=mock_put):
10221022
from netlicensing_mcp.tools.licenses import update_license
10231023

10241024
result = await update_license(

0 commit comments

Comments
 (0)