Handle inactive PAT owner as invalid OAuth token

This commit is contained in:
elky
2026-06-21 11:39:20 +08:00
parent 279735ae7f
commit 61bdd304b7
4 changed files with 90 additions and 0 deletions
@@ -149,6 +149,8 @@ fn status_proves_access_token_invalid(status_code: u16, response_text: Option<&s
"expired access token",
"authentication token has been invalidated",
"token has been invalidated",
"personal access token owner is inactive",
"biscuit_baker_service_auth_credential_error_status",
"security token included in the request is expired",
]
.iter()
@@ -196,6 +198,12 @@ mod tests {
403,
Some("The security token included in the request is expired")
));
assert!(status_proves_access_token_invalid(
403,
Some(
r#"{"error":{"code":"biscuit_baker_service_auth_credential_error_status","message":"Personal access token owner is inactive."}}"#
)
));
assert!(!status_proves_access_token_invalid(403, None));
assert!(!status_proves_access_token_invalid(
403,