Skip to content

fix: bump mpp-rs to accept standard base64 in WWW-Authenticate#384

Open
gakonst wants to merge 1 commit intomainfrom
fix/lenient-base64-mpp
Open

fix: bump mpp-rs to accept standard base64 in WWW-Authenticate#384
gakonst wants to merge 1 commit intomainfrom
fix/lenient-base64-mpp

Conversation

@gakonst
Copy link
Contributor

@gakonst gakonst commented Mar 24, 2026

Problem

tempo request fails against servers that encode the request field in the WWW-Authenticate header using standard base64 (RFC 4648 §4) instead of base64url (RFC 4648 §5):

tempo request -t -X POST --json '{"vcpus":1,"ram_mb":256,"disk_gb":1,"duration":60}' https://openvps.sh/v1/provision
# → E_PAYMENT: "Unsupported payment method: "

The misleading error occurs because mpp::parse_www_authenticate fails on the base64-padded request field before ever reading the method field, causing the error to cascade as an empty-string method.

Fix

Bumps mpp dependency to include tempoxyz/mpp-rs#149, which makes base64url_decode lenient — it normalizes standard base64 (+, /, =) to URL-safe alphabet before decoding, matching the mppx TypeScript SDK behavior.

Verified

Before: E_PAYMENT: "Unsupported payment method: "

After (dry-run):

./target/release/tempo-request -t --dry-run -X POST \
  --json '{"vcpus":2,"ram_mb":1024,"disk_gb":10,"duration":3600}' \
  https://openvps.sh/v1/provision
# → [DRY RUN] Signed transaction ready, skipping submission.

All tests pass (make test).

Note

Once mpp-rs#149 is merged to main, this branch ref should be updated from fix/lenient-base64-decode-v0.5 back to main.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

⚠️ Changelog not found.

A changelog entry is required before merging.

Add changelog

@gakonst gakonst force-pushed the fix/lenient-base64-mpp branch from 739ff22 to d5afd14 Compare March 24, 2026 22:07
Updates mpp dependency to latest main which includes mpp-rs#149
(lenient base64url decoding) plus the 0.7.0 API refactor.

Breaking changes adapted:
- estimate_gas now takes (provider, TempoTransactionRequest) instead
  of 11 separate args — build request inline with a closure
- tempo-alloy added as workspace dep for TempoTransactionRequest
- reqwest http2_adaptive_window removed (dropped in newer reqwest)
@gakonst gakonst force-pushed the fix/lenient-base64-mpp branch from d5afd14 to 9e528f9 Compare March 24, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant