> ## Documentation Index
> Fetch the complete documentation index at: https://docs.westyx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Rust SDK - Version history

> What changed in each release of the Rust SDK, and how to migrate across a breaking change.

Every release of `westyx-nexus` and `westyx-nexus-openfeature`, newest first. The two crates release from one tag and share one version number. Where a release broke something, its **Migrating** section shows the change to make. The repository's [`CHANGELOG.md`](https://gitlab.com/westyx/nexus/sdk/rust/-/blob/main/CHANGELOG.md) carries the same releases in full detail.

## v0.17.0-beta.2 - 2026-11-19

* **OpenFeature `423 service_locked` hold:** uses a timed suppression window (default 5 minutes) matching `environment_disabled`, so `evaluate_ab` recovers automatically once the lockdown is lifted.
* **Secret file background refresh:** `get_secret_file_path()` now triggers `ensure_fresh()` consistently with the other read methods.

## v0.17.0-beta.1 (2026-11-19)

* **HTTP 423 `service_locked`:** adds `NexusError::ServiceLocked`; stops the SSE stream immediately and halts background sync retries until an explicit sync succeeds.
* **OpenFeature provider:** suppresses repeated `evaluate_ab` requests while the service is locked down, serving the cached snapshot as `STALE`.

## v0.16.0-beta.1 - 2026-11-12

* **A switched-off environment is reported by name.** `403 {"error":"environment_disabled"}` returns `NexusError::EnvironmentDisabled { operation }` on every request, the stream and the token exchange. The cached snapshot keeps serving; the background refresh and the stream wait five minutes between attempts, one warning is logged, and the first successful sync clears it. The OpenFeature provider serves the snapshot as `STALE` meanwhile.
* **Every API error carries its status and code.** A status no other variant describes is `NexusError::Api { operation, status, code }`, `Forbidden` carries its `code`, and `err.status()` / `err.code()` answer for any error. No message carries a response body.
* **The startup summary.** The `Nexus client ready` event names the configs, secrets and flags the first sync delivered - never a value. With no `tracing` subscriber installed, `WESTYX_NEXUS_LOG_STARTUP=1` writes it to stderr.
* **`sync_errors()`** lists the resources the server did not deliver, each logged once as a warning; `log_sync_errors: Some(false)` keeps the list without the warnings.
* **A WIF refresh that fails while the session is still valid keeps the session**; once it has expired, a failed refresh is `SessionExpired` with the refresh error as its `source`.
* **The stream's error budget restarts after a connection that held for 30 seconds**, however it ended; a connection that ends sooner counts as an error, so a flapping endpoint backs off and falls back to polling.

### Migrating to v0.16.0-beta.1

* **Minimum supported Rust version 1.91.1** (was 1.88) - the oldest toolchain that resolves a dependency set with no open security advisory. A project pinned below it stays on `0.15.0-beta.1`.

* `NexusError::Forbidden` becomes `NexusError::Forbidden { .. }` in a pattern.

* `NexusError::SessionExpired` becomes `NexusError::SessionExpired { .. }`; the cause is `std::error::Error::source`.

* Code that read the status out of `SyncFailed("...: unexpected status N")` matches `NexusError::Api { status, .. }` or calls `err.status()`.

* A `NexusConfig` built without `..Default::default()` adds `log_sync_errors: None`.

## v0.15.0-beta.1 - 2026-09-30

* **The endpoint can come from the environment.** Leave `endpoint` empty and the client reads `WESTYX_SERVICE_ENDPOINT` (`westyx_nexus::SERVICE_ENDPOINT_ENV`) when it is created - `westyx dev run` sets it for the script's service, so a locally started application needs neither an endpoint nor a key in its code. A value in the field always wins, and an error about the variable's value names the variable. See [Configuration](https://docs.westyx.dev/sdks/rust/configuration.md#service-endpoint).

## v0.14.0-beta.2 - 2026-08-29

* **Three declared dependency floors raised to versions that actually build.** `serde_json` to `1.0.25`, `tempfile` to `3.10.0`, and the dev-only `mockito` to `1.3.0` - a `-Z minimal-versions` build now runs every pipeline, so a declared floor cannot silently stop building again.

## v0.14.0-beta.1 - 2026-08-20

* **Breaking: secrets are `SecretString`.** `get_secret` returns a `secrecy::SecretString`, read with `.expose_secret()` (both re-exported from the crate root). The value is zeroised on drop - so a replaced cache snapshot leaves no plaintext in freed memory - and `Debug` renders it as `[REDACTED]`.
* **Credential-bearing requests refuse redirects.** The API and stream clients set `redirect::Policy::none()`, so a 3xx never resends the API key or the WIF session token to another host.
* **The public-key guard honours the backend's classification.** A key the backend reports as public is refused secret access whether or not it carries the `wxp_` prefix - either signal is sufficient.
* **The `developer` credential is matched on host and port**, so two local services on the same host but different ports resolve to their own sessions.

### Migrating to v0.14.0-beta.1

| Before | Now |
| - | - |
| `let s: String = client.get_secret(k)?;` | `let s = client.get_secret(k)?; s.expose_secret()` |

Import `ExposeSecret` from the crate root.

## v0.13.0-beta.1 - 2026-08-09

* **A typed provider vocabulary.** `WifProvider` is a `#[non_exhaustive]` enum implementing `Display` and `FromStr`, so a provider read out of an environment variable is validated where it is read rather than deep inside a session refresh.
* **Breaking: one `credential` field.** `WifConfig.provider` and `WifConfig.token_source` collapse into `credential: WifCredential`, so a provider and a custom source cannot both be configured.
* **An async credential source that can express a whole exchange body.** `WifCredentialSource` produces either an OIDC token or the complete token-exchange payload, so a credential that is not an OIDC token fits without a change to the SDK. `blocking_token_source` adapts an existing synchronous closure.
* **The `developer` provider.** On a machine where `westyx dev setup` has run, the SDK sends the Nexus session token the CLI already obtained. It performs no token exchange and is probed **last**, so a real cloud credential always wins.
* **Contradictions rejected at construction**, naming the fix: `aws_region` outside `aws_iam`, and `aws_iam` without the `aws-iam` cargo feature.
* **Printing a `NexusConfig` or a `WifConfig` renders the API key as `set`/`unset`.**

### Migrating to v0.13.0-beta.1

| Before | Now |
| - | - |
| `provider: "kubernetes".into()` | `credential: WifProvider::Kubernetes.into()` |
| `provider: "auto".into()` (or omitted) | omit it - `credential` defaults to `WifProvider::Auto` |
| `token_source: Some(Box::new(f))` | `credential: WifCredential::Source(blocking_token_source(f))` |
| `provider: "aws_iam".into(), aws_region: ...` | `credential: WifProvider::AwsIam.into(), aws_region: ...` |

## v0.12.0-beta.1 - 2026-08-04

* **The OpenFeature provider resolves boolean flags per user.** An evaluation context carrying a targeting key selects a per-user evaluation through the A/B Testing add-on, so rollout percentages and cohort rules apply. One request covers every flag in the snapshot, results are memoised per user for 30 seconds, and concurrent evaluations for the same user coalesce into one call. See [OpenFeature](https://docs.westyx.dev/sdks/rust/openfeature.md).
* **`NexusProviderOptions`** - `targeting_ttl`, `max_targeting_keys` and `addon_suppression`, each validated when the provider is built.
* **`find_flag` on the blocking client**, matching the async one: a disabled flag and an absent one are distinguishable on both surfaces.
* **Breaking:** `evaluate_ab` takes `&HashMap<String, String>` for its attributes on both clients. The service compares attribute values with `eq`, `neq` and `in`, so a string map is what a cohort rule can act on. Values built with `json!("pro")` become `"pro".to_string()`.
* **Through the provider, a whole number written `5.0` resolves as `5`.** JSON has one number type; a fractional value resolves as `TYPE_MISMATCH` with your default rather than being truncated, and values beyond the float range keep their exact value.
* **A composite config value containing a JSON null resolves as `TYPE_MISMATCH`.** The OpenFeature value model has no null, so such a value cannot be represented there; read it as raw JSON through the wrapped client.

### Migrating to v0.12.0-beta.1

| Before | Now |
| - | - |
| `evaluate_ab(keys, user, &HashMap<String, Value>)` | `evaluate_ab(keys, user, &HashMap<String, String>)` |

## v0.11.0-beta.2 - 2026-07-29

The largest rework in the crate's history. It breaks the public API; [Async migration](https://docs.westyx.dev/sdks/rust/async-migration.md) lists the one-line change per break.

* **Async-first client.** `create`, `sync`, `set_secret`, `delete_secret`, `delete_secret_version` and `evaluate_ab` are `async fn`. Cache reads stay synchronous, and `spawn_blocking` wrappers are no longer needed.
* **`blocking` feature** for applications with no runtime of their own.
* **`tracing` instrumentation** with structured fields on create, sync, the token exchange and the stream loop.
* **Owner-only file-type secrets.** Each client materialises them into its own private `0700` directory, and each file is created `0600` at creation via `create_new` + `O_NOFOLLOW` plus an atomic rename. Two clients never share a path, and a secret removed on the server is removed from disk.
* **Cleanup runs while the stream is active.** The SSE task now holds only a weak reference, so dropping the last clone reaches the cleanup.
* **Stream deadlines** - a connect deadline plus an idle deadline that resets on every byte, keepalive comments included.
* **One status-to-error mapping** shared by every endpoint; `evaluate_ab` reports `RateLimited` on 429.
* **Bounded response bodies** everywhere, with a size error instead of a truncated document.
* **Coalesced refreshes** - concurrent reads on a stale snapshot trigger one request, and snapshots cannot apply out of order.
* **Billing back-off instead of a halt**, cleared by the next successful sync.
* **Configuration validated once, at construction**, naming the option and the list index.
* **`auth_expiring` forces a refresh**, and a 401 forces one refresh plus one retry.
* **`NexusError::Transport` replaces `Http`**, so the HTTP client is no longer part of the semver contract; the enum is `#[non_exhaustive]` and gained `Config` and `ResponseTooLarge`.
* **Exact RFC 3339 date arithmetic**, so a quarantine expiry between March and December of a leap year is no longer a day early, and an absurd expiry is clamped to 24 hours.
* **OpenFeature provider** - see [OpenFeature](https://docs.westyx.dev/sdks/rust/openfeature.md).
* **Edition 2024**, `thiserror 2`, and minimum supported Rust version **1.88**, measured and verified by a CI job.

### Migrating to v0.11.0-beta.2

[Async migration](https://docs.westyx.dev/sdks/rust/async-migration.md) lists the one-line change per break.

## v0.10.1-beta.1 - 2026-07-10

* **Public-key error message no longer mentions the retired `pk_` prefix** - the error surfaced when a public-key client attempts a secret operation reads "cannot read or write secrets with a public key".

## v0.9.0-beta.1 - 2026-07-03

* **`aws_iam` WIF provider (AWS IAM Caller Identity)** - authenticates non-EKS AWS compute (**ECS/Fargate, Lambda, plain EC2**) that has IAM credentials but no OIDC token. The SDK SigV4-signs an STS `GetCallerIdentity` request (never sent to AWS) and posts it to `/v1/auth/token-exchange`; Nexus replays it against a pinned STS endpoint to prove your IAM role. The signed `X-Nexus-Server-ID` is your service's own endpoint host - a captured request is valid for that one service only. Behind the optional `aws-iam` cargo feature, off by default. See [Workload identity](https://docs.westyx.dev/sdks/rust/workload-identity.md#aws-iam-non-eks-aws-compute).
* **Azure IMDS path** - the `azure` provider prefers the projected federated token file (`$AZURE_FEDERATED_TOKEN_FILE`, AKS) and otherwise fetches an IMDS managed-identity token, requiring an explicit `api://<client-id>` audience.
* **Security hardening** - plain-http endpoints rejected (loopback excepted); a failed WIF refresh fails closed; token-exchange 400/403 map to `BadRequest`/`Forbidden`; the slug `Host` header is sent on the exchange; metadata and exchange reads are bounded; `expires_in` is clamped.

## v0.8.0-beta.2 - 2026-07-01

* **WIF GCP fix** - the `gcp` provider fetches a real Google-signed OIDC identity token from the GCE metadata server. It previously read the `GOOGLE_APPLICATION_CREDENTIALS` key file, which is not a JWT and was rejected by the token exchange. Auto-detection was aligned with the actual token sources.

## v0.8.0-beta.1 - 2026-06-16

* Version alignment across the Westyx Nexus SDK suite.

## v0.6.0-beta.1 - 2026-06-11

* **The stream reconnects after the polling fallback**, on the cooldown schedule `sse_reconnect_cooldown` sets.

## v0.5.1-beta.1 - 2026-06-03

* **Security** - response bodies are no longer embedded in error messages; `SecretNotFound` truncates the key to 128 characters; file-secret paths carry an opaque hash rather than the key name; WIF token files are whitespace-trimmed.
* **SSE** - `flag.toggled` triggers a re-sync, and a `429` carrying a quarantine body pauses reconnects until `expires_at`.

## v0.5.0-beta.1 - 2026-06-01

* The first release of the Rust SDK.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.