{"record":{"id":"dca547fe60ea4e2e","repo":"jeecgboot/JeecgBoot","slug":"appkey","errorCode":null,"errorMessage":"appkey为空","messagePattern":"appkey为空","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":196,"sourceCode":"        }\n        long result = 0;\n        for (int i = 0; i < 4; i++) {\n            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","sourceCodeStart":178,"sourceCodeEnd":214,"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#L178-L214","documentation":"Thrown by ApiAuthFilter.checkSignValid when the appkey parameter is blank (null, empty, or whitespace). appkey is the first of three required signed-request parameters (appkey, signature, timestamp) and is validated with StringUtils.hasText before any crypto or DB work.","triggerScenarios":"An OpenAPI call is made without the appkey header/param, or with an empty string; a client SDK misnames the parameter (e.g. 'appKey' vs 'appkey' depending on case sensitivity of the header map).","commonSituations":"Client integration forgot to set the appkey; parameter name mismatch between client and the filter's expected header; a test harness that omits credentials.","solutions":["Send the appkey as the filter expects - check doFilterInternal for the exact header/param name used (typically 'appkey').","Confirm the appkey is non-empty and trimmed of whitespace.","Verify the client SDK sets all three: appkey, signature, timestamp."],"exampleFix":"// before: request without appkey\n// after:  request.addHeader(\"appkey\", \"ak_12345\");","handlingStrategy":"validation","validationCode":"// Ensure appkey is present before opening the request\nif (appkey == null || appkey.trim().isEmpty()) {\n    throw new IllegalStateException(\"appkey required before OpenAPI call\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize appkey/signature/timestamp injection in one client method so none can be omitted.","Fail the client build if credentials are unset.","Match the exact header/param name expected by ApiAuthFilter."],"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"}