{"id":1037,"date":"2021-10-28T16:56:22","date_gmt":"2021-10-28T08:56:22","guid":{"rendered":"https:\/\/choson_steven.lifenet.com.tw\/?p=1037"},"modified":"2023-03-29T11:07:00","modified_gmt":"2023-03-29T03:07:00","slug":"%e5%be%ae%e6%9c%8d%e5%8b%99-api-%e9%96%98%e9%81%93%e5%99%a8","status":"publish","type":"post","link":"https:\/\/choson.lifenet.com.tw\/?p=1037","title":{"rendered":"\u5fae\u670d\u52d9-API \u9598\u9053\u5668"},"content":{"rendered":"\n<p><img decoding=\"async\" src=\"https:\/\/ithelp.ithome.com.tw\/upload\/images\/20211028\/20132160vo7Cp5OeRE.png\" alt=\"https:\/\/ithelp.ithome.com.tw\/upload\/images\/20211028\/20132160vo7Cp5OeRE.png\"><br>-API \u9598\u9053\u5668\u548c\u670d\u52d9\u7db2\u683c\uff08\u4f86\u6e90\uff1aLiran Katz\uff09<br>\u5be6\u65bd API \u9598\u9053\u5668\u4ee5\u4fc3\u9032\u8de8\u5883\u901a\u4fe1\uff1b\u4ed6\u5011\u63a7\u5236\u8457\u5357\u5317\u548c\u6771\u897f\u5411\u7684\u4ea4\u901a\u3002\u5916\u90e8\u6216\u908a\u7de3 API \u9598\u9053\u5668\u5c07\u4f86\u81ea\u5ba2\u6236\u7aef\u7684\u5165\u7ad9\u8acb\u6c42\u8def\u7531\u5230\u9069\u7576\u7684\u670d\u52d9\uff1b\u5167\u90e8 API \u9598\u9053\u5668\u4fc3\u9032\u4e86\u5404\u7a2e\u670d\u52d9\u7db2\u683c\u7bc4\u570d\u4e4b\u9593\u7684\u901a\u4fe1\u3002\u670d\u52d9\u7db2\u683c\u4fc3\u9032\u7279\u5b9a\u7bc4\u570d\u5167\u7684\u670d\u52d9\u5230\u670d\u52d9\u901a\u4fe1\u3002<br>API \u9598\u9053\u5668\u67b6\u69cb\u53ef\u4ee5\u662f\u6574\u9ad4\u5f0f\u7684\uff0c\u4e5f\u53ef\u4ee5\u662f\u5206\u4f48\u5f0f\u7684\u3002<br>\u5728\u6574\u9ad4\u5f0fAPI \u9598\u9053\u5668\u67b6\u69cb\u4e2d\uff0c\u901a\u5e38\u53ea\u6709\u4e00\u500b API \u9598\u9053\u5668\u90e8\u7f72\u5728\u4f01\u696d\u7db2\u8def\u7684\u908a\u7de3\uff08\u4f8b\u5982\uff0c\u975e\u8ecd\u4e8b\u5340 (DMZ)\uff09\uff0c\u4e26\u5728\u4f01\u696d\u7d1a\u70ba API \u63d0\u4f9b\u6240\u6709\u670d\u52d9\u3002<br>\u5728\u5206\u4f48\u5f0fAPI\u9598\u9053\u5668\u67b6\u69cb\u4e2d\uff0c\u6709\u591a\u500b\u5fae\u9598\u9053\u5668\u5be6\u4f8b\uff0c\u90e8\u7f72\u5728\u66f4\u9760\u8fd1\u5fae\u670d\u52d9API\u7684\u5730\u65b9\u3002\u5fae\u9598\u9053\u5668\u901a\u5e38\u662f\u4f4e\u7684\u8986\u84cb\u5340\uff0c\u5176\u53ef\u4ee5\u88ab\u7528\u4f86\u5b9a\u7fa9\u548c\u57f7\u884c\u81ea\u5b9a\u7fa9\u7b56\u7565\uff0c\u56e0\u6b64\u9069\u5408\u7528\u65bc\u57fa\u65bc\u5fae\u670d\u52d9\u7684\u61c9\u7528\u7a0b\u5e8f\uff0c\u5fc5\u9808\u901a\u904e\u7279\u5b9a\u7684\u670d\u52d9\u7684\u5b89\u5168\u7b56\u7565\u4f86\u4fdd\u8b77\u53ef\u8173\u672cAPI\u9598\u9053\u5668\u3002<br>\u5fae\u9598\u9053\u5668\u901a\u5e38\u4f5c\u70ba\u4f7f\u7528 Node.js \u7b49\u958b\u767c\u5e73\u53f0\u7684\u7368\u7acb\u5bb9\u5668\u5be6\u73fe\u3002\u5b83\u4e0d\u540c\u65bc\u670d\u52d9\u7db2\u683c\u67b6\u69cb\u7684 sidecar \u4ee3\u7406\uff0c\u5f8c\u8005\u662f\u5728 API \u7aef\u9ede\u672c\u8eab\u5be6\u73fe\u7684\u3002<br>\u4f86\u6e90\uff1a\u4f86\u6e90\uff1aNIST SP 800-204<\/p>\n\n\n\n<p><strong>\u670d\u52d9\u7db2\u683c(Service Mesh)<\/strong><br>\u670d\u52d9\u7db2\u683c\u662f\u4e00\u500b\u5c08\u7528\u7684\u57fa\u790e\u8a2d\u65bd\u5c64\uff0c\u5b83\u901a\u904e\u670d\u52d9\u767c\u73fe\u3001\u8def\u7531\u548c\u5167\u90e8\u8ca0\u8f09\u5e73\u8861\u3001\u6d41\u91cf\u914d\u7f6e\u3001\u52a0\u5bc6\u3001\u8eab\u4efd\u9a57\u8b49\u548c\u6388\u6b0a\u3001\u6307\u6a19\u548c\u76e3\u63a7\u4f86\u4fc3\u9032\u670d\u52d9\u5230\u670d\u52d9\u7684\u901a\u4fe1\u3002<br>\u670d\u52d9\u7db2\u683c\u70ba\u5fae\u670d\u52d9\u61c9\u7528\u7a0b\u5e8f\u4e2d\u7684\u6bcf\u500b\u670d\u52d9\u5275\u5efa\u4e00\u500b\u5c0f\u578b\u4ee3\u7406\u670d\u52d9\u5668\u5be6\u4f8b\u3002\u9019\u7a2e\u5c08\u9580\u7684\u4ee3\u7406\u6c7d\u8eca\u6709\u6642\u5728\u670d\u52d9\u7db2\u683c\u8853\u8a9e\u4e2d\u88ab\u7a31\u70ba\u201c sidecar \u4ee3\u7406\u201d\u3002Sidecar \u4ee3\u7406\u5f62\u6210\u4e86\u6578\u64da\u5e73\u9762\uff0c\u800c\u57f7\u884c\u5b89\u5168\u6027\uff08\u8a2a\u554f\u63a7\u5236\u3001\u901a\u4fe1\u76f8\u95dc\uff09\u6240\u9700\u7684\u904b\u884c\u6642\u64cd\u4f5c\u662f\u901a\u904e\u5f9e\u63a7\u5236\u5e73\u9762\u5411 sidecar \u4ee3\u7406\u6ce8\u5165\u7b56\u7565\uff08\u4f8b\u5982\u8a2a\u554f\u63a7\u5236\u7b56\u7565\uff09\u4f86\u555f\u7528\u7684\u3002\u9019\u4e5f\u63d0\u4f9b\u4e86\u5728\u4e0d\u4fee\u6539\u5fae\u670d\u52d9\u4ee3\u78bc\u7684\u60c5\u6cc1\u4e0b\u52d5\u614b\u66f4\u6539\u7b56\u7565\u7684\u9748\u6d3b\u6027\u3002<br>\u4f86\u6e90\uff1aNIST SP 800-204<\/p>\n\n\n\n<p><strong>API\u9598\u9053\u5668(API Gateway)<\/strong><br>API \u9598\u9053\u5668\u7684\u4e3b\u8981\u529f\u80fd\u662f\u59cb\u7d42\u5c07\u5165\u7ad9\u8acb\u6c42\u8def\u7531\u5230\u6b63\u78ba\u7684\u4e0b\u6e38\u670d\u52d9\uff0c\u53ef\u9078\u64c7\u57f7\u884c\u5354\u8b70\u8f49\u63db \uff08\u5373 Web \u5354\u8b70\u4e4b\u9593\u7684\u8f49\u63db\uff0c\u4f8b\u5982 HTTP \u548c WebSocket\uff0c\u4ee5\u53ca\u5167\u90e8\u4f7f\u7528\u7684 Web \u4e0d\u53cb\u597d\u5354\u8b70\uff0c\u4f8b\u5982\u4f5c\u70ba AMQP \u548c Thrift \u4e8c\u9032\u5236 RPC)\u4e26\u4e14\u6709\u6642\u7d44\u5408 requests\u3002\u5728\u6975\u5c11\u6578\u60c5\u6cc1\u4e0b\uff0c\u5b83\u5011\u88ab\u7528\u4f5c\u524d\u7aef\u540e\u7aef (BFF) \u7684\u4e00\u90e8\u5206\uff0c\u5f9e\u800c\u652f\u6301\u5177\u6709\u4e0d\u540c\u5916\u5f62\u56e0\u7d20\uff08\u4f8b\u5982\uff0c\u700f\u89bd\u5668\u3001\u79fb\u52d5\u8a2d\u5099\uff09\u7684\u5ba2\u6236\u7aef\u3002<br>\u4f86\u81ea\u5ba2\u6236\u7aef\u7684\u6240\u6709\u8acb\u6c42\u9996\u5148\u901a\u904e API \u9598\u9053\u5668\uff0c\u7136\u5f8c\u5c07\u8acb\u6c42\u8def\u7531\u5230\u9069\u7576\u7684\u5fae\u670d\u52d9\u3002API \u9598\u9053\u5668\u901a\u5e38\u6703\u901a\u904e\u8abf\u7528\u591a\u500b\u5fae\u670d\u52d9\u4e26\u805a\u5408\u7d50\u679c\u4f86\u8655\u7406\u8acb\u6c42\u3002<br>\u7531\u65bcAPI\u9598\u9053\u5668\u662f\u5fae\u670d\u52d9\u7684\u5165\u53e3\u9ede\uff0c\u6240\u4ee5\u5b83\u61c9\u8a72\u914d\u5099\u5fc5\u8981\u7684\u57fa\u790e\u670d\u52d9\uff08\u9664\u4e86\u5176\u4e3b\u8981\u7684\u8acb\u6c42\u6574\u5f62\u670d\u52d9\uff09\uff0c\u5982\u670d\u52d9\u767c\u73fe\u3001\u8a8d\u8b49\u548c\u5b58\u53d6\u63a7\u5236\u3001\u8ca0\u8f09\u5e73\u8861\u3001\u7de9\u5b58\u3001\u63d0\u4f9b\u81ea\u5b9a\u7fa9API\u5c0d\u65bc\u6bcf\u7a2e\u985e\u578b\u7684\u5ba2\u6236\u7aef\uff0c\u61c9\u7528\u611f\u77e5\u5065\u5eb7\u6aa2\u67e5\u3001\u670d\u52d9\u76e3\u63a7\u3001\u653b\u64ca\u6aa2\u6e2c\u3001\u653b\u64ca\u97ff\u61c9\u3001\u5b89\u5168\u65e5\u8a8c\u8a18\u9304\u548c\u76e3\u63a7\u4ee5\u53ca\u65b7\u8def\u5668\u3002<br>\u4f86\u6e90\uff1a<a href=\"https:\/\/nvlpubs.nist.gov\/nistpubs\/SpecialPublications\/NIST.SP.800-204.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">NIST SP 800-204<\/a><\/p>\n\n\n\n<p>\u53c3\u8003<br>.&nbsp;<a href=\"https:\/\/nvlpubs.nist.gov\/nistpubs\/SpecialPublications\/NIST.SP.800-204.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">NIST SP 800-204<\/a><br>.&nbsp;<a href=\"https:\/\/morioh.com\/p\/97be16423e28\" target=\"_blank\" rel=\"noreferrer noopener\">\u7db2\u8def\u5c64\u8907\u7fd2<\/a><br>.&nbsp;<a href=\"https:\/\/www.akana.com\/blog\/service-mesh-vs-api-gateway\" target=\"_blank\" rel=\"noreferrer noopener\">\u670d\u52d9\u7db2\u683c\u8207 API \u9598\u9053\u5668\uff1a\u6709\u4ec0\u9ebc\u5340\u5225\uff1f<\/a><br>.&nbsp;<a href=\"https:\/\/konghq.com\/blog\/the-difference-between-api-gateways-and-service-mesh\/\" target=\"_blank\" rel=\"noreferrer noopener\">API \u9598\u9053\u5668\u548c\u670d\u52d9\u7db2\u683c\u7684\u5340\u5225<\/a><br>.&nbsp;<a href=\"https:\/\/www.linkedin.com\/pulse\/api-gateway-vs-service-mesh-harsh-manvar\/\" target=\"_blank\" rel=\"noreferrer noopener\">API \u9598\u9053\u5668\u8207\u670d\u52d9\u7db2\u683c<\/a><br>.&nbsp;<a href=\"https:\/\/www.infoq.com\/articles\/api-gateway-service-mesh-app-modernisation\/\" target=\"_blank\" rel=\"noreferrer noopener\">API \u9598\u9053\u5668\u548c\u670d\u52d9\u7db2\u683c\uff1a\u6253\u958b\u61c9\u7528\u73fe\u4ee3\u5316\u7684\u5927\u9580<\/a><\/p>\n\n\n\n<p>\u8cc7\u6599\u4f86\u6e90\uff1a&nbsp;<a href=\"https:\/\/wentzwu.com\/2021\/08\/23\/cissp-practice-questions-20210823\/\" target=\"_blank\" rel=\"noreferrer noopener\">Wentz Wu QOTD-20210823<\/a><\/p>\n\n\n\n<p>PS:\u6b64\u6587\u7ae0\u7d93\u904e\u4f5c\u8005\u540c\u610f\u520a\u767b \u4e26\u4e14\u6388\u6b0a\u53ef\u4ee5\u7ffb\u8b6f\u6210\u4e2d\u6587<\/p>\n","protected":false},"excerpt":{"rendered":"<p>-API \u9598\u9053\u5668\u548c\u670d\u52d9\u7db2\u683c\uff08\u4f86\u6e90\uff1aLiran Katz\uff09\u5be6\u65bd API \u9598\u9053\u5668\u4ee5\u4fc3\u9032\u8de8\u5883\u901a\u4fe1\uff1b\u4ed6\u5011\u63a7\u5236\u8457\u5357\u5317\u548c\u6771 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1037","post","type-post","status-publish","format-standard","hentry","category-cisspcertified-information-systems-security-professional"],"_links":{"self":[{"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/1037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1037"}],"version-history":[{"count":2,"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/1037\/revisions"}],"predecessor-version":[{"id":2759,"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/1037\/revisions\/2759"}],"wp:attachment":[{"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/choson.lifenet.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}