larksuite / oapi-sdk-python

Larksuite development interface SDK
MIT License
319 stars 50 forks source link

配置订阅方式验签出错-challenge请求缺少header #79

Closed czp1623-g closed 1 month ago

czp1623-g commented 1 month ago

麻烦帮忙看看~

1、已设置Verification Token 和Encrypt Key 2、lark-oapi==1.3.0

接收到的challenge请求:

[Lark] [2024-08-14 01:40:02,631] [DEBUG] card access, uri: ***, headers: 
{
    "_dict": {
        "accept-encoding": "gzip",
        "content-type": "application/json;charset=utf-8",
        "host": "***",
        "unit": "eu_nc",
        "user-agent": "Go-http-client/1.1",
        "x-amzn-trace-id": "***",
        "x-forwarded-for": "***",
        "x-forwarded-port": "443",
        "x-forwarded-proto": "https",
        "x-request-id": "***"
    }
}
, body: 
{
    "encrypt": "*****"
}

遇到的报错:

[Lark] [2024-08-14 01:40:02,631] [ERROR] handle card failed, uri:***, request_id: ***, err: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
--
Traceback (most recent call last):
File "/opt/python/lib/python3.11/site-packages/lark_oapi/card/action_handler.py", line 50, in do
self._verify_sign(req)
File "/opt/python/lib/python3.11/site-packages/lark_oapi/card/action_handler.py", line 85, in _verify_sign
bs = (timestamp + nonce + self._verification_token).encode(UTF_8) + request.body
~~~~~~~~~~^~~~~~~
TypeError: unsupported operand type(s) for +: 'NoneType' and 'NoneType'
czp1623-g commented 1 month ago

刚试了下又可以了..应该是之前的sdk低版本(lark-oapi==1.0.17)原因,以为升级了实则还没升级..