fix null OAuthToken field in SDA accounts causing migrations to crash and burn (#227)

This commit is contained in:
Carson McManus 2023-06-25 19:52:48 -04:00 committed by GitHub
parent 93a5fe643c
commit d2ba7d8f1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 1 deletions

View file

@ -155,7 +155,7 @@ pub struct Session {
#[serde(default, rename = "WebCookie")] #[serde(default, rename = "WebCookie")]
pub web_cookie: Option<String>, pub web_cookie: Option<String>,
#[serde(default, rename = "OAuthToken")] #[serde(default, rename = "OAuthToken")]
pub token: String, pub token: Option<String>,
#[serde(rename = "SteamID")] #[serde(rename = "SteamID")]
pub steam_id: u64, pub steam_id: u64,
} }

View file

@ -294,6 +294,10 @@ mod tests {
manifest: "src/fixtures/maFiles/compat/no-webcookie/manifest.json", manifest: "src/fixtures/maFiles/compat/no-webcookie/manifest.json",
passkey: None, passkey: None,
}, },
Test {
manifest: "src/fixtures/maFiles/compat/null-oauthtoken/manifest.json",
passkey: None,
},
]; ];
for case in cases { for case in cases {
eprintln!("testing: {:?}", case); eprintln!("testing: {:?}", case);

View file

@ -0,0 +1,17 @@
{
"encrypted": false,
"first_run": true,
"entries": [
{
"encryption_iv": null,
"encryption_salt": null,
"filename": "nulloauthtoken.maFile",
"steamid": 1234
}
],
"periodic_checking": false,
"periodic_checking_interval": 5,
"periodic_checking_checkall": false,
"auto_confirm_market_transactions": false,
"auto_confirm_trades": false
}

View file

@ -0,0 +1 @@
{"shared_secret":"zvIayp3JPvtvX/QGHqsqKBk/44s=","serial_number":"kljasfhds","revocation_code":"R12345","uri":"otpauth://totp/Steam:example?secret=ASDF&issuer=Steam","server_time":1602522478,"account_name":"example","token_gid":"jkkjlhkhjgf","identity_secret":"kjsdlwowiqe=","secret_1":"sklduhfgsdlkjhf=","status":1,"device_id":"android:99d2ad0e-4bad-4247-b111-26393aae0be3","fully_enrolled":true,"Session":{"SessionID":"a;lskdjf","SteamLogin":"983498437543","SteamLoginSecure":"dlkjdsl;j%7C%32984730298","WebCookie":"asdk;lf;dsjlkfd","OAuthToken":null,"SteamID":1234}}