{"record":{"id":"6927af562b40e7a1","repo":"jeecgboot/JeecgBoot","slug":"signature","errorCode":null,"errorMessage":"signature为空","messagePattern":"signature为空","errorType":"validation","errorClass":"JeecgBootException","httpStatus":null,"severity":"error","filePath":"jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/filter/ApiAuthFilter.java","lineNumber":199,"sourceCode":"            result = (result << 8) | (Integer.parseInt(parts[i]) & 0xFF);\n        }\n        return result;\n    }\n    //update-end---author:scott ---date:20260416  for：【PR/9083】OpenAPI白名单增强，支持CIDR网段和通配符匹配-----------\n\n    /**\n     * 签名验证\n     * @param appkey\n     * @param signature\n     * @param timestamp\n     * @return\n     */\n    protected void checkSignValid(String appkey, String signature, String timestamp) {\n        if (!StringUtils.hasText(appkey)) {\n            throw new JeecgBootException(\"appkey为空\");\n        }\n        if (!StringUtils.hasText(signature)) {\n            throw new JeecgBootException(\"signature为空\");\n        }\n        if (!StringUtils.hasText(timestamp)) {\n            throw new JeecgBootException(\"timastamp时间戳为空\");\n        }\n        if (!timestamp.matches(\"[0-9]*\")) {\n            throw new JeecgBootException(\"timastamp时间戳不合法\");\n        }\n        if (System.currentTimeMillis() - Long.parseLong(timestamp) > 5 * 60 * 1000) {\n            throw new JeecgBootException(\"signature签名已过期(超过五分钟)\");\n        }\n    }\n\n    /**\n     * 认证信息核验\n     * @param appKey\n     * @param signature\n     * @param timestamp\n     * @param openApiAuth","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/jeecgboot/JeecgBoot/blob/96fb33f5ec68516da0b0147da06b2eb0419e063a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/filter/ApiAuthFilter.java#L181-L217","documentation":"Thrown by checkSignValid when the signature parameter is blank. It is the second guard after appkey, ensuring the MD5 signature the client must compute (md5(appkey + sk + timestamp)) is present before validation against the stored secret.","triggerScenarios":"OpenAPI call missing the signature header/param; client computed the signature but did not attach it to the request; case-sensitivity mismatch on the parameter name.","commonSituations":"Client SDK builds the signature but forgets to send it; a proxy strips unknown headers; integration test that hard-codes only appkey and timestamp.","solutions":["Compute signature = md5(appkey + sk + timestamp) and send it in the signature param/header expected by the filter.","Verify the parameter name and casing match the filter's extraction.","Ensure no intermediary proxy strips the header."],"exampleFix":"// before: request.addHeader(\"appkey\", ak);  // signature omitted\n// after:  String sig = md5(ak + sk + ts);\n//         request.addHeader(\"appkey\", ak);\n//         request.addHeader(\"signature\", sig);\n//         request.addHeader(\"timestamp\", ts);","handlingStrategy":"validation","validationCode":"if (signature == null || signature.trim().isEmpty()) {\n    throw new IllegalStateException(\"signature required\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute the signature and attach it in the same code path that sets appkey.","Verify no proxy strips unknown headers.","Add a unit test asserting all three headers are present on every outbound call."],"tags":["openapi","auth","signature","input-validation"],"backgroundTag":null,"analyzedSha":"96fb33f5ec68516da0b0147da06b2eb0419e063a","analyzedAt":"2026-08-14T00:04:16.786Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}