services/gateway's tenantauth interceptor defaults
RATION_GATEWAY_REQUIRE_TENANT_AUTH to true, but sdk/rust/ration-client
had zero way to attach any credential — no WithAPIKey/WithBearerToken
equivalent of what sdk/go/ration got in round 3. Every RPC the Rust SDK
made against a default-config gateway failed Unauthenticated; its own
doc.go-equivalent example never worked. Added CredentialInterceptor
(tonic Interceptor) plus Client::connect_with_api_key/
connect_with_bearer_token and from_channel_with_api_key/
from_channel_with_bearer_token, mirroring the Go SDK's dial-option
pattern.
Also closed a smaller parity gap found along the way: CloseCard
(round 11) was wired into gateway.proto/CLI but never added to either
official SDK, so an external platform customer importing sdk/go/ration
or sdk/rust/ration-client had no way to shut off a leaked/offboarded
card's spending via the SDK itself. Added Client.CloseCard (Go) and
Client::close_card (Rust).
Verified live against the real bare-metal 8-service stack
(scripts/start-individually.sh): a throwaway Go program using the real
sdk/go/ration module (replace-directive to this repo) issued a card
through the gateway, closed it, confirmed idempotent re-close, confirmed
AdjustCardLimit now correctly rejects the closed card, and confirmed an
unknown card_id fails the same way GetCard/AdjustCardLimit already do.
`ration status` showed the full $100 hold released back to Available.
Separately, a throwaway Rust binary against the real ration-client
crate (path dependency) first proved the pre-fix gap live (Client::connect
with zero credential against the real auth-required gateway ->
Unauthenticated), then used connect_with_api_key to run the identical
issue/close/idempotent-close/adjust-limit-rejected/unknown-card cycle
successfully, independently confirmed via `ration status` that the
$75 hold was released.
make build (full Rust+Go+SDK), go vet across every Go module, cargo
build --release, cargo clippy, cargo fmt all clean, 0 regressions.
cargo test for ration-client remains pre-existing-broken only on its
FakeGateway test fixture missing close_card/get_dashboard_snapshot
(round 3's already-flagged, intentionally-not-fixed gap, per the
no-test-infra-work standing rule) — unaffected by this change since
make build never runs cargo test for this crate.