You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Cursor** users: start at the repo root **[`AGENTS.md`](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`** (universal for any editor or tool).
3
+
**Cursor** users: start at **[AGENTS.md](../../AGENTS.md)**. All conventions live in **`skills/*/SKILL.md`**.
4
4
5
-
This folder only points contributors here so nothing editor-specific duplicates the canonical docs.
5
+
This folder only points contributors to **`AGENTS.md`**so editor-specific config does not duplicate the canonical docs.
**Universal entry point** for anyone automating or assisting work in this repo—AI agents (Cursor, Copilot, CLI tools), reviewers, and contributors. Conventions and detailed guidance live in **`skills/*/SKILL.md`**, not in editor-specific config, so the same instructions apply whether or not you use Cursor.
3
+
**Universal entry point** for contributors and AI agents. Detailed conventions live in **`skills/*/SKILL.md`**.
|**Purpose**| Python client for the **Content Management API (CMA)**: organizations, stacks, content types, entries, assets, webhooks, workflows, OAuth, and related resources. Uses **`requests`** via **`_APIClient`**. |
|**Purpose:**| Python client for the **Content Management API (CMA)**: organizations, stacks, content types, entries, assets, webhooks, workflows, OAuth, and related resources. Uses **`requests`** via **`_APIClient`**. |
|`contentstack_management/__init__.py`| Public exports |
32
-
|`tests/cred.py`|**`get_credentials()`** — **dotenv** + env vars for API/mock tests |
32
+
|`tests/integration/`|**Live e2e / sanity suite** (pytest). Self-contained: creates a fresh stack per run, exercises every SDK method (positive/negative/edge), tears it down. Own `framework/` + `data/`; config in `tests/integration/.env`. |
33
+
|`tests/cred.py`|**`get_credentials()`** — **dotenv** + env vars for the legacy `tests/api` / `tests/mock` suites |
|**Sanity / e2e (live)**|`pytest tests/integration` — dynamically creates a stack, runs the full suite, tears it down. Needs `tests/integration/.env` (`EMAIL`, `PASSWORD`, `HOST`, `ORGANIZATION`). Writes a timestamped HTML report + cURL log to the repo root. |
41
+
| Sanity, keep stack |`DELETE_DYNAMIC_RESOURCES=false pytest tests/integration` (preserve the created stack for debugging) |
42
+
| Sanity, one resource |`pytest tests/integration/api/test_12_content_type.py`|
43
+
| Test (unit) |`pytest tests/unit/ -v`|
44
+
| Test (mock) |`pytest tests/mock/ -v`|
45
+
| Test (legacy API, live) |`pytest tests/api/ -v` (needs `.env` — see `tests/cred.py`) |
46
+
| Coverage (CI) |`coverage run -m pytest tests/unit/`|
47
+
| Lint |`pylint contentstack_management/`|
48
+
49
+
> **CI note:**`.github/workflows/unit-test.yml` runs **only `tests/unit/`** (no credentials). The `tests/integration` sanity suite is run manually (or via a credential-gated job) because it provisions real stacks.
39
50
40
-
pytest tests/unit/ -v
41
-
pytest tests/api/ -v # live CMA — needs .env (see tests/cred.py)
42
-
pytest tests/mock/ -v
43
-
pytest tests/ -v
44
-
coverage run -m pytest tests/unit/
45
-
```
51
+
## Environment variables
46
52
47
-
## Environment variables (API / integrationtests)
53
+
**Sanity / e2e suite** (`tests/integration`) — configured via **`tests/integration/.env`** (gitignored). No pre-existing stack/UIDs needed; the suite creates everything at runtime.
48
54
49
-
Loaded via **`tests/cred.py`** (`load_dotenv()`). Examples include **`HOST`**, **`APIKEY`**, **`AUTHTOKEN`**, **`MANAGEMENT_TOKEN`**, **`ORG_UID`**, and resource UIDs (**`CONTENT_TYPE_UID`**, **`ENTRY_UID`**, …). See that file for the full list.
55
+
| Var | Required | Purpose |
56
+
|-----|----------|---------|
57
+
|`EMAIL`, `PASSWORD`| ✅ | Login for the run (a **non-2FA** account) |
58
+
|`HOST`| ✅ | API host (e.g. `api.contentstack.io`) |
59
+
|`ORGANIZATION`| ✅ | Org the dynamic test stack is created in |
60
+
|`MFA_SECRET`| — | TOTP secret (for the OAuth/2FA account, not the primary login) |
61
+
|`DELETE_DYNAMIC_RESOURCES`| — |`false` keeps the created stack for debugging (default deletes) |
|`PERSONALIZE_HOST`| — | Personalize project for variant tests |
50
64
51
-
Do not commit secrets.
65
+
**Legacy `tests/api` / `tests/mock`** — loaded via **`tests/cred.py`** (`load_dotenv()`): `HOST`, `APIKEY`, `AUTHTOKEN`, `MANAGEMENT_TOKEN`, `ORG_UID`, and resource UIDs. See that file for the full list.
52
66
53
-
## Where the real documentation lives: skills
67
+
Do not commit secrets. `tests/integration/.env`, `docs/`, and the repo-root `cma-python-report-*.html` / `api-requests-*.txt` are gitignored.
54
68
55
-
Read these **`SKILL.md` files** for full conventions—**this is the source of truth** for implementation and review:
69
+
## Where the documentation lives: skills
56
70
57
71
| Skill | Path | What it covers |
58
72
|-------|------|----------------|
@@ -63,10 +77,10 @@ Read these **`SKILL.md` files** for full conventions—**this is the source of t
|**Framework / HTTP**|[`skills/framework/SKILL.md`](skills/framework/SKILL.md)|**`requests`**, retries, OAuth interceptor, where to change transport |
65
79
66
-
An index with short “when to use” hints is in [`skills/README.md`](skills/README.md).
80
+
An index with “when to use” hints is in [`skills/README.md`](skills/README.md).
67
81
68
-
## Using Cursor
82
+
## Using Cursor (optional)
69
83
70
-
If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same source of truth as everyone else; no separate `.mdc` rule files.
84
+
If you use **Cursor**, [`.cursor/rules/README.md`](.cursor/rules/README.md) only points to **`AGENTS.md`**—same docs as everyone else.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+40-2Lines changed: 40 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,51 @@
2
2
3
3
## Content Management SDK For Python
4
4
---
5
-
## v1.9.0
5
+
## v1.11.0
6
6
7
-
#### Date: 18 May 2026
7
+
#### Date: 20 July 2026
8
8
9
9
- Entry variants: added `publish` and `unpublish` for the entry publish/unpublish endpoints; documented payloads including `entry.variants` and optional `entry.variant_rules` on publish.
10
10
- Entry variants: optional stack branch via the `branch` request header; `Entry.variants()` accepts no arguments, a branch UID only, or `(variant_uid, branch)` (use `variants(variant_uid, None)` when targeting a variant without a branch).
11
11
12
+
---
13
+
## v1.10.2
14
+
15
+
#### Date: 13 July 2026
16
+
17
+
- Removed hardcoded password literals in unit tests to resolve Snyk CWE-798 (Use of Hardcoded Passwords) findings.
18
+
19
+
---
20
+
## v1.10.1
21
+
22
+
#### Date: 26 June 2026
23
+
24
+
- Fixed `Asset.update()` to send the JSON body with `Content-Type: application/json` instead of an invalid bare `multipart/form-data`, which the API rejected with 422.
25
+
- Fixed `Asset.replace()` to let the HTTP layer set `multipart/form-data` with a proper boundary (a bare `multipart/form-data` header without a boundary previously caused a 422). Both fixes also remove a side effect that leaked the wrong `Content-Type` onto subsequent requests.
26
+
27
+
---
28
+
## v1.10.0
29
+
30
+
#### Date: 22 June 2026
31
+
32
+
- Dynamic region endpoint resolution via the Contentstack Regions Registry (`regions.json`).
33
+
- Added `Endpoint` class with 3-tier resolution: in-memory cache → bundled `data/regions.json` → live CDN download.
-`Client` now resolves the `contentManagement` endpoint from the registry instead of a hardcoded host pattern.
36
+
- Bundled `contentstack_management/data/regions.json` included in `package_data` — always present after `pip install`.
37
+
-`setup.py` auto-refreshes `regions.json` at build time via a custom `BuildPyWithRegions` command; network failures warn but never block the build.
38
+
- Runtime fallback: if `regions.json` is absent, the SDK downloads it live on the first `Endpoint` call.
39
+
- New regions and services require no SDK code changes — registry update is sufficient.
40
+
- Added `refresh_regions()` utility to programmatically download the latest regions manifest from the Contentstack CDN and overwrite the bundled `data/regions.json` (`from contentstack_management import refresh_regions`).
41
+
- Added `python3 -m contentstack_management.region_refresh` CLI command for refreshing the registry after `pip install` (source-tree script `scripts/download_regions.py` is for contributors only).
42
+
43
+
---
44
+
## v1.9.0
45
+
46
+
#### Date: 01 June 2026
47
+
48
+
- Removed unused `bson` dependency so the package installs on Python 3.12+ and 3.14 (the standalone `bson` 0.5.x package fails to build on newer Python versions).
0 commit comments