Help
Migrating the SDKs from 0.1 to 0.2
What changed between SDK 0.1.x and 0.2.0 in all five languages, and what to change in your code.
All five SDKs moved from 0.1.0 to 0.2.0 together. Both versions target API v1 (gateway and control-plane
OpenAPI contract 0.1.0); 0.2.0 needs a server that exposes the runtime endpoints it adds (/v1/inspect,
/v1/dlp/scan, /v1/traces/spans, /v1/simulations/run) — older servers answer not_found for them, never
silently.
Under SemVer 0.x rules a MINOR release may break, and every break is called out below.
Update the dependency#
| SDK | 0.2 dependency |
|---|---|
| TypeScript | npm install @gebsecure01/sdk@^0.2.0 |
| Python | pip install "gebsecure>=0.2,<0.3" |
| Go | go get github.com/gebsecure/gebsecure-go@v0.2.0 |
| Java | com.gebsecure:gebsecure-sdk:0.2.0 |
| .NET | dotnet add package GebSecure --version 0.2.0 |
Ranges written for 0.1 (^0.1.0, <0.2) do not admit 0.2.0. Packages that depend on the SDK must widen them —
in this repository cli/package.json, integrations/typescript/*/package.json and
integrations/python/gebsecure-integrations/pyproject.toml did so in the same change.
Breaking changes#
Retry classification follows the HTTP method (all SDKs). In 0.1 only the call types the SDK knew to be idempotent were retried on 5xx/network errors. In 0.2:
GET,PUTandDELETEare idempotent and retried on 502/503/504 and network errors — exceptupdatePolicy(PUT /v1/policies/{id}), which appends a version and is never retried.PATCHand otherPOSTs are retried on 5xx/network errors only when you pass a per-call idempotency key (sent asIdempotency-Key):{ idempotencyKey }(TypeScript),idempotency_key=(Python),WithIdempotencyKey(Go),RequestOptions.withIdempotencyKey(Java),RequestOptions.IdempotencyKey(.NET).- 429 is still retried for everything.
If you relied on a POST being retried, pass an idempotency key — only when repeating the call is safe.
Go: optional numeric fields became pointers. Fields whose valid range includes 0 and that have no server
default are now pointers so 0 can be sent explicitly — DelegationConstraints.MaxAmount (*float64), and in
the new models e.g. AuditSearchParams.AfterSeq / MinRisk, UpdateConnectionRequest.MaxRetries,
RevokeSecretRequest.Version.
Python: invalid input raises ValueError without echoing values. Previously the pydantic ValidationError
(also a ValueError) included the input; request bodies can carry secrets, so 0.2 names the fields only. Code
catching ValueError is unaffected; code that parsed the pydantic error must change.
204 responses. Operations without a response body resolve to undefined (TypeScript), None (Python), only an
error (Go), void (Java) or a completed Task (.NET).
New in 0.2#
- Runtime protection:
inspect(prompt injection + inbound DLP),dlpScan,reportSpanswithbuildSpan/traceparentOf, andrunSimulation(withfailOnMismatchraisingSimulationFailedError, which carries the typed run). - Session auth for CLIs and CI:
login(refresh token in the body),refreshSession(never retried except 429),logout,me, and an unauthenticated provider for logging in. - Management APIs: policies (versions, diff, tests including
PUTreplace, deploy — a 412 deploy report is returned withdeployed: false— rollback, simulate), agents and credentials, secrets (write-only values), connectors and connections (OAuth, client-credentials and JWT-bearer installs, health), audit (search withafterSeqtailing, export, verify), approvals (details, decide with the snapshot hash), alerts, traces and session replay. - Parity: Python gained
with_delegation,get_access_tokenandtraceparentonwait_for_approval; Go gainedClient.AccessTokenandClient.WithDelegation; JavagetAccessToken(); .NETGetAccessTokenAsync.
The complete method lists are on the SDK reference pages; each SDK's
CHANGELOG.md has the details.
Checklist#
- Bump the dependency (and any ranges in packages that depend on the SDK).
- Add idempotency keys to POST/PATCH calls you want retried on 5xx; drop custom retry wrappers around
updatePolicy. - Go: take addresses for the pointer fields listed above.
- Python: update code that inspected pydantic validation errors from request coercion.
- Replace hand-written calls to
/v1/inspect,/v1/dlp/scan,/v1/traces/spansor the management endpoints with the new SDK methods.