Repository navigation
Conversation
Kosthi
reviewed
Nov 30, 2026
Kosthi
left a comment
Owner
There was a problem hiding this comment.
Thanks for putting this together! Apple's edge now drops the legacy MZFinance.woa/wa/authenticate endpoint even with the trailing slash, and sign-in routes through auth/v1/native with Store ADI device provisioning (X-Apple-AMD / X-Apple-AMD-M). Closing in favor of #25, which implements the native Store authentication flow and non-plist response handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Apple's bag can advertise the bare
/wa/authenticateURL. Posting to that path can return an empty HTTP 204 or HTML instead of reaching the Store handler. This PR canonicalizes the validated initial URL to/wa/authenticate/, preserving its host and routing query. It follows upstream's October 5 fix: majd/ipatool@f9aa653.The accompanying recovery and diagnostics fix handles 0.1.8's
Serde("invalid type: string \"<html>\", expected a map"): a 301 without Location previously fell through to plist deserialization, and the existing Store-error retry could never run. Transient non-plist replies (204, 404, 5xx, or redirects without Location) receive at most three total sends, 250 ms apart, with identical signed bytes and the same attempt counter. A Store dictionary remains authoritative at any HTTP status. The helper does not resend 403, 429, or real redirects.HTML is rejected before plist normalization. Auth parse diagnostics report only status, an allowlisted media type, and byte count; response previews, raw parser values, and full redirect-URL debug output are removed from this path. Endpoint validation remains before normalization and before forwarding credentials. No dependency or lockfile changes.
Related: #17 and #19. This overlaps #19's recovery behavior and adds URL canonicalization, actual HTTP resend tests, and diagnostics without response snippets.
Validation on macOS 27.0.1 (26A434), Apple Silicon, Rust 1.99.1:
api::auth::loginwith a reserved .invalid account reproduced empty HTTP 204 before URL normalization. Adding only the trailing slash returned a structured Store response. A repeated A/B comparison gave HTML 403 on the bare URL and a Store response on the slashed URL. With the fix inparse_bag, the normal login path returned the expected BadLogin rejection for the fictitious account. No user password, 2FA, token, signature, or response body was printed.cargo test --locked --workspace: 115 passed, 8 opt-in network tests ignored.make check(formatting plus clippy with warnings denied) andcargo build --release --lockedpassed; ARM64 binary smoke checks passed.The user subsequently verified a successful real-account login with the rebuilt ARM64 binary on macOS 27.0.1: the CLI reported a successful login and account information. This is user-reported end-to-end confirmation; the agent did not receive or use the user's password or 2FA code. Account names, email, DSID, storefront and pod values are omitted from this report. Persistent service rejection still fails after bounded retries.