← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 4545.d.1.h

插件握手不是安全认证

理解等级:高级

HandshakeConfig让宿主与插件对齐协议版本和约定标记,帮助拒绝不适配的启动方式并给出友好错误。MagicCookie不是秘密凭证,握手通过不能证明插件可信。书中明确把它定位为用户体验功能,不能把共享的常量包装成攻击防护。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Loose Coupling · 查看原书依据

      Importantly, this is a UX feature, not a security feature. var HandshakeConfig = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "BASIC_PLUGIN", MagicCookieValue: "hello", } The SayerRPCServer Server Implementation SayerPlugin’s Server method provides a definition of an RPC server — the SayerRPCServer struct — to serve the actual methods in a way that’s consistent with net/rpc. type SayerRPCServer struct

    参考来源

    - 位置:《Cloud Native Go》第08章《Loose Coupling》(来源项目book-sources;源文件:extracted/Cloud Native Go (Matthew A. Titmus)/_epub-src/OEBPS/ch08.xhtml) - 结论依据:HandshakeConfig让宿主与插件对齐协议版本和约定标记,帮助拒绝不适配的启动方式并给出友好错误。原文相应定义、示例或限制为此结论提供依据;补充纠错与版本边界在正文就近标明。 - 原始内容:Importantly, this is a UX feature, not a security feature. var HandshakeConfig = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "BASIC_PLUGIN", MagicCookieValue: "hello", } The SayerRPCServer Server Implementation SayerPlugin’s Server method provides a definition of an RPC server — the SayerRPCServer struct — to serve the actual methods in a way that’s consistent with net/rpc. type SayerRPCServer struct