@smbcloud / cli / commits / 99c765d

Document and test Apple OAuth response fields

Co-Authored-By: siGit Code <noreply@sigit.si>

keypair34 committed Sep 30, 2026 at 19:41 UTC 99c765d50b347c0b4c3a0e63a93f2ae8fd9aebb4
1 file changed +15 -2
crates/smbcloud-model/src/app_auth.rs
+15 -2
@@ -13,9 +13,13 @@ pub struct AuthApp {
13 // arg — the two are intentionally different types.
14 pub project_id: Option<i32>,
15 pub support_email: Option<String>,
16 + /// Whether Sign in with Apple is enabled for this auth app.
17 pub apple_oauth_enabled: Option<bool>,
18 + /// The Services ID used as the Apple OAuth client identifier.
19 pub apple_oauth_client_id: Option<String>,
20 + /// Whether the required Apple OAuth credentials are configured.
21 pub apple_oauth_configured: Option<bool>,
22 + /// Whether an Apple OAuth client secret has been stored.
23 pub apple_oauth_secret_present: Option<bool>,
24 #[serde(with = "ar_date_format")]
25 pub created_at: DateTime<Utc>,
@@ -87,8 +91,8 @@ mod tests {
91 let mut payload = json!({
92 "id": "app-id",
93 "name": "Example",
90 - "created_at": "2026-09-30T08:00:00.000Z",
91 - "updated_at": "2026-09-30T08:00:00.000Z"
94 + "created_at": "2026-09-30T08:00:00.000+00:00",
95 + "updated_at": "2026-09-30T08:00:00.000+00:00"
96 });
97 let legacy: AuthApp = serde_json::from_value(payload.clone())?;
98 assert_eq!(legacy.apple_oauth_enabled, None);
@@ -108,6 +112,15 @@ mod tests {
112 );
113 assert_eq!(configured.apple_oauth_configured, Some(true));
114 assert_eq!(configured.apple_oauth_secret_present, Some(true));
115 +
116 + let serialized = serde_json::to_value(&configured)?;
117 + assert_eq!(serialized["apple_oauth_enabled"], json!(true));
118 + assert_eq!(
119 + serialized["apple_oauth_client_id"],
120 + json!("com.example.web")
121 + );
122 + assert_eq!(serialized["apple_oauth_configured"], json!(true));
123 + assert_eq!(serialized["apple_oauth_secret_present"], json!(true));
124 Ok(())
125 }
126 #[test]