synckit-client: remove dead OAuthTokenRequest struct
The struct was constructed only in a serialization test; the real OAuth
exchange (authenticate_with_code) builds form-encoded params inline, so
the struct was unused in shipping code and its JSON-shape test was
misleading (the wire format is application/x-www-form-urlencoded). Drop
both; clears a dead_code warning in dependents (audiofiles).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2 files changed,
+4 insertions,
-30 deletions
| 364 |
364 |
|
// ── OAuth types ──
|
| 365 |
365 |
|
|
| 366 |
366 |
|
#[test]
|
| 367 |
|
- |
fn oauth_token_request_serialization() {
|
| 368 |
|
- |
let req = OAuthTokenRequest {
|
| 369 |
|
- |
grant_type: "authorization_code",
|
| 370 |
|
- |
code: "auth-code-123",
|
| 371 |
|
- |
redirect_uri: "http://127.0.0.1:8080/",
|
| 372 |
|
- |
code_verifier: "verifier-abc",
|
| 373 |
|
- |
client_id: "api-key",
|
| 374 |
|
- |
key: "session-key-xyz",
|
| 375 |
|
- |
};
|
| 376 |
|
- |
|
| 377 |
|
- |
let json = serde_json::to_string(&req).unwrap();
|
| 378 |
|
- |
let parsed: serde_json::Value = serde_json::from_str(&json).unwrap();
|
| 379 |
|
- |
assert_eq!(parsed["grant_type"], "authorization_code");
|
| 380 |
|
- |
assert_eq!(parsed["code"], "auth-code-123");
|
| 381 |
|
- |
assert_eq!(parsed["code_verifier"], "verifier-abc");
|
| 382 |
|
- |
assert_eq!(parsed["key"], "session-key-xyz");
|
| 383 |
|
- |
}
|
| 384 |
|
- |
|
| 385 |
|
- |
#[test]
|
| 386 |
367 |
|
fn oauth_token_response_deserialization() {
|
| 387 |
368 |
|
let json = r#"{
|
| 388 |
369 |
|
"access_token": "jwt-access-token",
|
| 314 |
314 |
|
}
|
| 315 |
315 |
|
|
| 316 |
316 |
|
// ── OAuth ──
|
| 317 |
|
- |
|
| 318 |
|
- |
#[derive(Serialize)]
|
| 319 |
|
- |
pub(crate) struct OAuthTokenRequest<'a> {
|
| 320 |
|
- |
pub grant_type: &'a str,
|
| 321 |
|
- |
pub code: &'a str,
|
| 322 |
|
- |
pub redirect_uri: &'a str,
|
| 323 |
|
- |
pub code_verifier: &'a str,
|
| 324 |
|
- |
pub client_id: &'a str,
|
| 325 |
|
- |
/// Developer-defined SDK key for billing attribution. See `AuthRequest`.
|
| 326 |
|
- |
pub key: &'a str,
|
| 327 |
|
- |
}
|
|
317 |
+ |
//
|
|
318 |
+ |
// The token request is sent as form-encoded params built inline in
|
|
319 |
+ |
// `authenticate_with_code` (the endpoint expects `application/x-www-form-urlencoded`,
|
|
320 |
+ |
// not JSON), so there is no request struct here — only the response.
|
| 328 |
321 |
|
|
| 329 |
322 |
|
#[derive(Deserialize)]
|
| 330 |
323 |
|
pub(crate) struct OAuthTokenResponse {
|