{"record":{"id":"109b91f6d3edfa99","repo":"Pumpkin-MC/Pumpkin","slug":"has-an-expired-public-key","errorCode":null,"errorMessage":"has an expired public key","messagePattern":"has an expired public key","errorType":"exception","errorClass":"ChatError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin/src/net/java/play/mod.rs","lineNumber":138,"sourceCode":"        }\n    }\n}\n\n#[derive(Debug, Error)]\npub enum ChatError {\n    #[error(\"sent an oversized message\")]\n    OversizedMessage,\n    #[error(\"sent a message with illegal characters\")]\n    IllegalCharacters,\n    #[error(\"sent a chat with invalid/no signature\")]\n    UnsignedChat,\n    #[error(\"has too many unacknowledged chats queued\")]\n    TooManyPendingChats,\n    #[error(\"sent a chat that couldn't be validated\")]\n    ChatValidationFailed,\n    #[error(\"sent a chat with an out of order timestamp\")]\n    OutOfOrderChat,\n    #[error(\"has an expired public key\")]\n    ExpiredPublicKey,\n    #[error(\"attempted to initialize a session with an invalid public key\")]\n    InvalidPublicKey,\n}\n\nimpl PumpkinError for ChatError {\n    fn is_kick(&self) -> bool {\n        true\n    }\n\n    fn severity(&self) -> Level {\n        Level::WARN\n    }\n\n    fn client_kick_reason(&self) -> Option<String> {\n        match self {\n            Self::OversizedMessage => Some(\"Chat message too long\".into()),\n            Self::IllegalCharacters => Some(","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin/src/net/java/play/mod.rs#L120-L156","documentation":"ChatError sentinel for the secure-chat key lifecycle: the player's public key attached to the login/chat session has expired, so signatures can no longer be trusted. Fires when the client keeps chatting with a key whose expiry timestamp is in the past (server clocks drifting or a stale client session). The expired key is delivered by the client in its profile/signature data.","triggerScenarios":"Thrown at crates/pumpkin/src/net/java/play/mod.rs:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Kick the player so a fresh key is negotiated","Check key expiry (allowed from timestamp) before accepting signatures","Log the expiry event"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}