{"id":556546,"date":"2022-03-08T01:32:40","date_gmt":"2022-03-07T17:32:40","guid":{"rendered":"http:\/\/4563.org\/?p=556546"},"modified":"2022-03-08T01:32:40","modified_gmt":"2022-03-07T17:32:40","slug":"%e7%bd%91%e5%85%b3%e8%bd%ac%e5%8f%91%e5%88%b0%e9%89%b4%e6%9d%83%ef%bc%8c%e9%89%b4%e6%9d%83%e5%86%8d%e8%bd%ac%e5%88%b0%e4%b8%9a%e5%8a%a1%e6%80%8e%e4%b9%88%e5%86%99%ef%bc%9f-5","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=556546","title":{"rendered":"\u7f51\u5173\u8f6c\u53d1\u5230\u9274\u6743\uff0c\u9274\u6743\u518d\u8f6c\u5230\u4e1a\u52a1\u600e\u4e48\u5199\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1> \u7f51\u5173\u8f6c\u53d1\u5230\u9274\u6743\uff0c\u9274\u6743\u518d\u8f6c\u5230\u4e1a\u52a1\u600e\u4e48\u5199\uff1f <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : MeloForsaken <\/span>  <span><i><\/i> 54<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<ol>\n<li>\u5982\u4f55\u628a\u5230\u7f51\u5173\u7684\u8bf7\u6c42\u90fd\u8f6c\u53d1\u5230\u9274\u6743\u670d\u52a1\u4e0a\uff1f\u8fd9\u4e2a <code>route<\/code> \u5f97\u600e\u4e48\u5199\uff1f<\/li>\n<li>\u8f6c\u53d1\u5230\u9274\u6743\u670d\u52a1\u4e0a\u7684\u8bf7\u6c42\uff0c\u9274\u6743\u540e\u5982\u4f55\u518d\u8f6c\u53d1\u5230\u4e1a\u52a1\u4e0a\uff1f\u662f\u91cd\u5b9a\u5411\u5230\u4e1a\u52a1\u670d\u52a1\u4e0a\uff1f\u600e\u4e48\u77e5\u9053\u7aef\u53e3\u548c IP \uff1f\u8fd8\u662f\u518d\u8f6c\u4f1a\u7f51\u5173\uff1f<\/li>\n<\/ol><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>31<\/span>) <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"7137959\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : retanoj <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u611f\u89c9\u4e0d\u662f\u4e2a route \uff0c\u662f\u4e2a filter <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137960\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : FanError <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div>  \u6700\u8fd1\u4e5f\u5728\u5b66\u4e60\u8fd9\u65b9\u9762\u4e1c\u4e1c\uff0c\u4f3c\u4e4e\u73b0\u5728\u5e38\u7528\u7684\u65b9\u6848\u662f\u628a\u9274\u6743\u76f4\u63a5\u5728\u7f51\u5173\u4e0a\u505a\u7684\u3002<br \/>\u4e1a\u52a1\u4e0a\u4e0d\u505a\u4efb\u4f55\u9274\u6743\u64cd\u4f5c <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137961\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : MeloForsaken <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @retanoj \u662f\u7684\uff0c\u662f\u6211\u7406\u89e3\u9519\u4e86\uff0c\u4f46\u662f filter \u91cc\u600e\u4e48\u8f6c\u53d1\u5230\u9274\u6743\u670d\u52a1\u4e0a\uff08\u4e0d\u7528\u771f\u6b63\u7684 ip \u548c\u7aef\u53e3\uff09 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137962\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : sxfscool <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4e1a\u52a1\u4e0d\u505a\u9274\u6743\uff0c\u9274\u6743\u7684\u4fe1\u606f\u5f53\u6210\u53c2\u6570\u4f20\u9012\u5230\u5b50\u670d\u52a1 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137963\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : MeloForsaken <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @sxfscool @FanError \u4e1a\u52a1\u548c\u9274\u6743\u5206\u5f00\u7684\u554a\uff0c\u9274\u6743\u662f\u5355\u72ec\u7684\u4e00\u4e2a\u670d\u52a1 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137964\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : FanError <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @MeloForsaken \u7f51\u4e0a\u7684\u65b9\u6848\u5168\u90e8\u662f\u5728\u7f51\u5173\u4e0a\u505a\u7684\uff0c\u6240\u4ee5\u4e0d\u5b58\u5728\u8f6c\u53d1\u8fd9\u4e2a\u95ee\u9898<br \/>\u9274\u6743\u901a\u8fc7\u4e86\uff0c\u76f4\u63a5\u5230\u4e1a\u52a1\u6a21\u5757 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137965\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : eason1874 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4ec0\u4e48\u600e\u4e48\u5199\uff0c\u4e0d\u5c31\u5199\u62e6\u622a\u5668\u90a3\u6837\u5199\u4e48\uff0c\u8fd9\u95ee\u9898\u95ee\u5f97\u592a\u5bbd\u6cdb\uff0c\u5f88\u96be\u7b54\u3002\u4f60\u8981\u95ee\u5177\u4f53\u54ea\u4e2a\u8bed\u8a00\u7684\u600e\u4e48\u8bf4\uff0c\u5927\u5bb6\u8fd8\u53ef\u4ee5\u7ed9\u4f60\u63a8\u8350\u4e00\u4e9b\u6846\u67b6\u4f8b\u5b50<br \/>\u5982\u679c\u4e0d\u5927\u61c2\uff0c\u5e72\u8106\u7528\u8f6f\u4ef6\u65b9\u6848\u5f97\u4e86\uff0cAPISIX \u4e4b\u7c7b\u7684\u5f00\u6e90 API \u7f51\u5173\uff0c\u5e26\u63a7\u5236\u53f0\uff0c\u53ef\u4ee5\u50cf\u7528\u4e91\u5382\u5546 API \u7f51\u5173\u670d\u52a1\u90a3\u6837\u914d\u7f6e <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137966\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : anonydmer <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> 1. \u662f\u8ba4\u8bc1\u8fd8\u662f\u9274\u6743\uff1f\u4e24\u8005\u4e0d\u4e00\u6837\u3002\u8ba4\u8bc1\u5bb9\u6613\u7edf\u4e00\u5904\u7406\uff0c\u4f46\u662f\u9274\u6743\u89c6\u4e1a\u52a1\u9700\u6c42\u800c\u5b9a\uff0c\u590d\u6742\u7684\u9274\u6743\u53ea\u80fd\u662f\u4e1a\u52a1\u65b9\u81ea\u5df1\u505a<br \/>2. \u4e0d\u7ba1\u4f60\u662f\u8ba4\u8bc1\u8fd8\u662f\u6388\u6743\u670d\u52a1\u72ec\u7acb\u51fa\u6765\u4e86\uff0c\u53c2\u7167\u4e00\uff0c\u5e94\u8be5\u7528 filter \u800c\u4e0d\u662f route \uff1b\u5982\u679c\u7528 route \u4e0d\u662f\u628a\u9274\u6743\u670d\u52a1\u53c8\u505a\u6210\u7f51\u5173\u670d\u52a1\u4e86\uff1f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137967\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : abersheeran <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4f60\u662f\u60f3\u8ba9\u9274\u6743\u670d\u52a1\u63d0\u4f9b RPC \uff0c\u7136\u540e\u7f51\u5173\u53bb\u8c03\u7528\u5427\uff1f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137968\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : kifile <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> aop \u5207\u9762\uff0c\u6ce8\u89e3\u9274\u6743\u5904\u7406 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137969\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : abobobo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u7f51\u5173\u5199\u4e2a filter \uff0c\u5728\u7f51\u5173\u9a8c\u8bc1\u8bf7\u6c42\u5934\u90e8\u5e26\u7684 token \uff0c \u9a8c\u8bc1\u901a\u8fc7\u540e\u901a\u8fc7\u670d\u52a1\u540d\u8f6c\u53d1\u5230\u4e1a\u52a1\u4e0a\uff08\u5728 gateway \u91cc\u914d\u7f6e\u597d \u670d\u52a1\u540d\u79f0\u4ee5\u53ca\u5339\u914d\u89c4\u5219\uff09 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137970\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : retanoj <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u201c\u8f6c\u53d1\u201d\u7684\u610f\u601d\u53ef\u4ee5\u662f\u5c06 HTTP \u8bf7\u6c42\u539f\u5c01\u4e0d\u52a8\u7684\u53d1\u5f80\u53e6\u4e00\u4e2a\u76ee\u7684\u5730<br \/>\u5728\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u7406\u89e3\u4e3a\u89e3\u6790\u8bf7\u6c42\uff0c\u505a\u4e00\u4e9b\u4e1a\u52a1\u903b\u8f91\uff08\u6bd4\u5982\u8ba4\u8bc1\u68c0\u67e5\uff09\uff0c\u518d\u53d6\u51fa\u4e00\u4e9b\u8c03\u7528\u7684\u670d\u52a1\uff0c\u53c2\u6570\uff0c\u8fdb\u884c\uff08\u8fdc\u7a0b\uff1f\uff09\u670d\u52a1\u8c03\u7528 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137971\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nicholasxuu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u6211\u4eec\u662f envoy \u9274\u6743 filter \u5728 request \u4e0a\u52a0\u4e2a header \uff08\u5185\u90e8\u4e0d\u4f1a\u51b2\u7a81\u7684 header \u540d\uff0c\u5982\u679c\u7528\u6237\u4f20\u4e86\u5c31\u5220\u6389\uff09\uff0c\u7136\u540e\u4e1a\u52a1\u76f4\u63a5\u8bfb header \u5c31\u884c\u4e86\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137972\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : securityCoding <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u8fd9\u63d0\u95ee\u4e5f\u662f\u9189\u4e86,\u81f3\u5c11\u5e26\u4e2a\u6280\u672f\u6808\u554a<br \/>\u5982\u4f55\u628a\u5230\u7f51\u5173\u7684\u8bf7\u6c42\u90fd\u8f6c\u53d1\u5230\u9274\u6743\u670d\u52a1\u4e0a\uff1f<br \/>\u81ea\u5b9a\u4e49 filter<br \/>\u8fd9\u4e2a route \u5f97\u600e\u4e48\u5199\uff1f<br \/>route \u91cc\u9762\u914d\u7f6e\u4e00\u4e0b\u9274\u6743\u7684 filter<br \/>\u8f6c\u53d1\u5230\u9274\u6743\u670d\u52a1\u4e0a\u7684\u8bf7\u6c42<br \/>\u4e0d\u7528\u8f6c\u53d1,filter \u91cc\u9762\u8bf7\u6c42\u8ba4\u8bc1\u670d\u52a1<br \/>\u9274\u6743\u540e\u5982\u4f55\u518d\u8f6c\u53d1\u5230\u4e1a\u52a1\u4e0a\uff1f<br \/>\u7f51\u5173\u672c\u8eab\u5c31\u662f proxy \u89d2\u8272,\u4e0d\u7528\u518d\u6b21\u8f6c\u53d1<br \/>\u662f\u91cd\u5b9a\u5411\u5230\u4e1a\u52a1\u670d\u52a1\u4e0a\uff1f<br \/>\u63a5\u4e0a<br \/>\u600e\u4e48\u77e5\u9053\u7aef\u53e3\u548c IP \uff1f<br \/>\u7f51\u5173\u91cc\u9762\u4e00\u822c\u4f1a\u6709\u76ee\u6807\u670d\u52a1\u6982\u5ff5. spring-cloud-gateway \u662f\u670d\u52a1\u6ce8\u518c\u540d,\u5185\u7f6e\u9ed8\u8ba4 filter \u81ea\u52a8\u67e5\u8be2\u53ef\u7528\u8282\u70b9<br \/>\u8fd8\u662f\u518d\u8f6c\u4f1a\u7f51\u5173\uff1f<br \/>\u7f51\u5173\u672c\u8eab\u5c31\u662f proxy<br \/>\u7efc\u4e0a,\u4f60\u9700\u8981\u5148\u628a\u7f51\u5173\u6d89\u53ca\u7684\u6982\u5ff5\u5f04\u6e05\u695a,\u518d\u91cd\u65b0\u7ec4\u7ec7\u4e00\u4e0b\u95ee\u9898 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137973\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : SuperShuYe <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> GW \u670d\u52a1\uff08\u5916\u7f51\uff09\uff1a<br \/>gw.abc.com \u9274\u6743\u540e header \u643a\u5e26 token <br \/>\u8fd9\u91cc\u914d\u7f6e\u8f6c\u53d1 172.168.0.1 gw.abc.com\/order 172.168.0.2 gw.abc.com\/user<br \/>Order \u670d\u52a1\uff08\u5185\u7f51\uff09\uff1a<br \/>172.168.0.1 gw.abc.com\/order<br \/>User \u670d\u52a1\uff08\u5185\u7f51\uff09 \uff1a<br \/>172.168.0.2 gw.abc.com\/user <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137974\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Saxton <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u9274\u6743\u4e2d\u5fc3\u6c38\u8fdc\u53ea\u8d1f\u8d23\u9274\u6743\uff0c\u903b\u8f91\u4e0d\u8981\u641e\u9519\u4e86\uff0c\u8f6c\u53d1\u6743\u8fd8\u662f\u5728\u7f51\u5173\u8eab\u4e0a\uff0c\u76ee\u524d\u6211\u4eec\u7684\u7cfb\u7edf\u7684\u662f <br \/>\u8bf7\u6c42 -\u300b\u7f51\u5173-\u300b\u9274\u6743-\u300b \u7f51\u5173-\u300b \u8f6c\u53d1\u5230\u5bf9\u5e94\u670d\u52a1\uff0c\u5bf9\u5e94\u7684\u670d\u52a1\u4e0d\u9700\u8981\u5728\u9274\u6743\u4e86\uff0c\u5f53\u7136\u6709\u4e9b\u7cfb\u7edf\u7684\u67b6\u6784\u670d\u52a1\u7684\u8c03\u7528\u4e5f\u9700\u8981\u989d\u5916\u7684\u9274\u6743\uff0c\u7f51\u5173\u4f1a\u7b7e\u53d1\u4e00\u4e2a\u4e34\u65f6\u7684\u8c03\u7528 TOKEN \u548c\u4e00\u4e2a\u7528\u6237 TOKEN \u4e00\u8d77\u8f6c\u53d1\u5230\u5bf9\u5e94\u670d\u52a1\uff0c\u5bf9\u5e94\u670d\u52a1\u5728\u62e6\u622a\u8fd9\u4e2a token \u9274\u522b\uff0c\u4f46\u5176\u5b9e\u6ca1\u5fc5\u8981\u591a\u505a\u4e00\u6b65\uff0c\u4f60\u8981\u505a\u7684\u662f\u5b8c\u5168\u4fe1\u4efb\u9274\u6743\u4e2d\u5fc3\u548c\u9632\u706b\u5899 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137975\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Saxton <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div>  \u4f60\u4e5f\u6ca1\u8bf4\u4f60\u7684\u6280\u672f\u6808\u662f\u4ec0\u4e48<br \/>\u4f20\u7edf\u7684 springcloud \u53ef\u4ee5\u76f4\u63a5\u5728 spring-cloud-gateway \u4e0a\u8dd1\u9274\u6743<br \/>\u4f46\u6211\u7684\u505a\u6cd5\u6211\u559c\u6b22\u53e6\u5916\u8dd1\u4e00\u4e2a\u9274\u6743\u4e2d\u5fc3\uff0c\u8fd9\u4e2a\u9274\u6743\u4e2d\u5fc3\u540c\u65f6\u8fd8\u627f\u62c5\u4e86\u7b7e\u8bc1\u8d23\u4efb\uff0c\u7f51\u5173\u6c38\u8fdc\u53ea\u662f\u4e00\u4e2a\u8d1f\u8d23\u8f6c\u53d1\u7684\u4e1c\u897f\uff0c\u4e0d\u8981\u628a\u8fc7\u591a\u7684\u903b\u8f91\u538b\u5728\u7f51\u5173\u8eab\u4e0a <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137976\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : MeloForsaken <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @Saxton \u662f springcloud \uff0c\u6ca1\u6709\u8bb2\u6e05\u695a\uff0c\u6309\u4f60\u7684\u610f\u601d\uff0c\u7f51\u5173-&gt;\u9274\u6743-&gt;\u7f51\u5173\uff0c\u8fd9\u4e2a\u5f97\u600e\u4e48\u5b9e\u73b0\uff1f\u7f51\u4e0a\u6ca1\u6709\u627e\u5230\u5177\u4f53\u7684\u5b9e\u73b0\u65b9\u5f0f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137977\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : MeloForsaken <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @abersheeran @abobobo @nicholasxuu @securityCoding @eason1874 @anonydmer spring cloud \uff0c\u6253\u4e2a\u6bd4\u65b9 URL \u9274\u6743\uff0c\u7f51\u5173\u548c\u9274\u6743\u662f\u4e24\u4e2a\u670d\u52a1\uff0c\u7f51\u5173\u5177\u4f53\u600e\u4e48\u53bb\u8c03\u7528\uff1f RPC \uff1f\u628a\u9274\u6743\u62bd\u79bb\u6210\u516c\u5171\u4f9d\u8d56\uff1f\u8fd8\u662f\u6709\u4ec0\u4e48\u5176\u4ed6\u6bd4\u8f83\u597d\u7684\u5199\u6cd5\uff1f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137978\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yangyaofei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> oauth2? <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137979\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wantooo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> spring cloud \u60c5\u51b5\u4e0b request \u5230\u7f51\u5173\uff0c\u81ea\u5b9a\u4e49 globalFilter \u901a\u8fc7 feign \u8c03\u7528\u9274\u6743\u670d\u52a1\uff0c\u8fd4\u56de\u7ed3\u679c\uff0c\u51b3\u5b9a\u662f\u7ee7\u7eed chain \u8fd8\u662f\u7ed3\u675f <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137980\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qqlyatt <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u4f7f\u7528 Java \u5f00\u53d1\u6b63\u5e38\u7684\u4e1a\u52a1\u6d41\u7a0b\u5e94\u8be5\u662f\uff1a1.\u666e\u901a\u6d4f\u89c8\u4e0d\u7528\u767b\u5f55\uff0c\u7528\u6237\u70b9\u51fb\u67d0\u4e2a\u7279\u6b8a\u7684 api \u6216\u8005\u6309\u94ae\u9700\u8981\u767b\u5f55\u30022.\u9700\u8981\u767b\u5f55\uff0c\u524d\u7aef\u9875\u9762\uff0c\u5f15\u5bfc\u7528\u6237\u8df3\u8f6c\u8fdb\u5165\u300a\u8ba4\u8bc1\u670d\u52a1\u5668 Authorization-Server \u300b\u7684\u300a\u8ba4\u8bc1\u300b\u9875\u9762\uff0c\u7528\u6237\u5728\u8ba4\u8bc1\u9875\u9762\u8f93\u5165\u7528\u6237\u540d\u5bc6\u7801\u6216\u8005\u624b\u673a\u53f7\u9a8c\u8bc1\u7801\uff0c\u786e\u8ba4\u7528\u6237\u300a\u8eab\u4efd\u300b\u30023.\u786e\u8ba4\u7528\u6237\u540e\uff0c\u300a\u8ba4\u8bc1\u670d\u52a1\u5668\u300b\u8fd4\u56de\u7ed9\u524d\u7aef\u6388\u6743\u7801 authorization_code \uff0c\u524d\u7aef NodeJS \u670d\u52a1\u5668\u62ff\u7740\u6388\u6743\u7801\u5e76\u7ec4\u7ec7\u4e00\u6b21 post \u8bf7\u6c42\uff0c\u5728 POST \u8bf7\u6c42\u4e2d\u643a\u5e26\u81ea\u8eab\u7684\u5ba2\u6237\u7aef\u7528\u6237\u540d\u5bc6\u7801\u4ee5\u53ca redirect_uri \uff0c\u8fd9\u4e2a\u662f\u5728\u300a\u8ba4\u8bc1\u670d\u52a1\u5668\u300b\u4e2d\u6ce8\u518c\u8fc7\u7684\u5ba2\u6237\u7aef client \uff0c\u662f\u628a\u524d\u7aef\u5e94\u7528\u5f53\u4f5c\u4e00\u4e2a\u5916\u6765\u7684\u5ba2\u6237\u7aef\u3002\u8fd9\u4e2a redirect_uri \u662f\u7528\u6765\u63a5\u6536\u4ee4\u724c Token \u7684\u3002\u300a\u8ba4\u8bc1\u670d\u52a1\u5668\u300b\u786e\u8ba4\u8fc7\u5168\u6bb5\u670d\u52a1\u5668\u7684\u7528\u6237\u540d\uff0c\u5bc6\u7801\u548c\u6388\u6743\u7801\uff0c\u518d\u9a8c\u8bc1\u5f53\u65f6\u6ce8\u518c client \u65f6\u586b\u5199\u8fc7\u7684 redirect_uri \uff0c\u4e00\u81f4\u540e\uff0c\u54cd\u5e94\u4e00\u4e2a\u5e26\u6709\u5f53\u524d\u7528\u6237\u300a\u8eab\u4efd\u6743\u9650\u300b\u4fe1\u606f\u7684 Token \u3002\u7136\u540e\u524d\u7aef NodeJS \u5c06\u8be5 Token \u5b58\u50a8\u8d77\u6765\u5b58\u54ea\u81ea\u5df1\u770b cookie,session,redis \u3002\u6bcf\u6b21\u8be5\u7528\u6237\u8c03\u7528\u8d44\u6e90\u670d\u52a1\u7684\u65f6\u5019\uff0c\u4e5f\u5c31\u662f\u4f60\u7684\u4e1a\u52a1\u529f\u80fd\u7684\u65f6\u5019\uff0cNodeJS \u5c06\u4ed6\u7684\u4ee4\u724c Token \u62ff\u5230\uff0c\u7528\u4e00\u4e2a\u7c7b\u4f3c\u8fc7\u6ee4\u5668\u7684 func \u5c06\u6bcf\u6b21\u8bf7\u6c42\u7684\u8bf7\u6c42\u5934 Header \u90fd\u52a0\u4e0a Key:Authorization Value:Bearer Token \u503c\u3002\u8fd9\u4e2a\u8bf7\u6c42\u53ef\u4ee5\u76f4\u63a5\u53d1\u5230\u7f51\u5173\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u7528\u7f51\u5173\uff0c\u76f4\u63a5\u8bf7\u6c42\u5230\u8d44\u6e90\u670d\u52a1\u91cc\uff0c\u8d44\u6e90\u670d\u52a1\u4e5f\u80fd\u89e3\u6790\u8fd9\u4e2a Token \u786e\u8ba4\u7528\u6237\u6709\u6ca1\u6709\u6743\u9650\u8bf7\u6c42\u8fd9\u4e2a\u8d44\u6e90\u3002\u4e0d\u8fc7\u4f60\u662f\u7528\u7f51\u5173\u7684\uff0c\u6240\u4ee5\uff0c\u8fd9\u4e2a\u8bf7\u6c42\u53d1\u5230\u7f51\u5173\u4e0a\uff0c\u7136\u540e\u7f51\u5173\u4e0a\u8fc7\u6ee4\u8fd9\u4e2a\u8bf7\u6c42 Header \uff0c\u9a8c\u8bc1\u8fd9\u4e2a\u7528\u6237\u7684\u6743\u9650\u662f\u5426\u548c\u4ed6\u8bf7\u6c42\u7684\u8d44\u6e90\u5730\u5740\u5339\u914d\uff0c\u5982\u679c\u4e0d\u5339\u914d\uff0c\u505a\u51fa\u54cd\u5e94 403 \u65e0\u6743\u9650\u54cd\u5e94\u3002\u5982\u679c\u5339\u914d\u90a3\u5c31\u901a\u8fc7\uff0c\u5e76\u8f6c\u53d1\u5230\u8d44\u6e90\u670d\u52a1\u5668\uff0c\u83b7\u53d6\u8d44\u6e90\u670d\u52a1\u5668\u54cd\u5e94\u3002\u5982\u679c\u4f60\u914d\u7f6e\u4e86 OAuth2+JWT \uff0c\u7f51\u5173\u8fc7\u6ee4\u8fd9\u4e00\u5757\u4e0d\u7528\u624b\u6572\u4e86\uff0c\u53ea\u9700\u8981\u7b80\u5355\u7684\u914d\u7f6e\u51e0\u4e0b\u5c31\u884c\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137981\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : qqlyatt <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u7f51\u5173\u4e0a\u90a3\u4e2a\u8fc7\u6ee4\u8bf7\u6c42 Header \u7684\u8fc7\u7a0b\u5c31\u53eb\u505a\u300a\u9274\u6743\u300b\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137982\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : eason1874 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @MeloForsaken \u4e0d\u662f\u516c\u5171\u4f9d\u8d56\uff0c\u5c31\u62e6\u622a\u8fc7\u6ee4<br \/>\u7f51\u5173-&gt;\u9274\u6743-&gt;\u7f51\u5173\uff0c\u8fd9\u79cd\u662f\u628a\u8bf7\u6c42\u8f6c\u53d1\u7ed9 Spring Cloud Gateway \u5339\u914d\u8def\u7531\u6267\u884c Filters \uff0cFilter \u628a\u6743\u9650\u4fe1\u606f\u52a0\u5728 Headers \u4e4b\u540e Spring Cloud Gateway \u518d\u81ea\u5df1\u628a\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u4e1a\u52a1\u540e\u7aef\uff0c\u76f8\u5f53\u4e8e\u603b\u5171\u53cd\u4ee3\u4e24\u6b21<br \/>\u8fd8\u6709\u4e00\u79cd\u5e38\u89c1\u7684\u662f\u7c7b\u4f3c\u5fae\u670d\u52a1\u7684\u5f62\u5f0f\uff0c\u9274\u6743\u670d\u52a1\u4e0d\u7ba1\u5b9e\u9645\u8bf7\u6c42\uff0c\u53ea\u63d0\u4f9b\u9274\u6743 HTTP API \uff0c\u7f51\u5173\u6536\u5230\u8bf7\u6c42\u628a\u4fe1\u606f\u53d1\u7ed9\u9274\u6743 HTTP API \uff0c\u62ff\u5230\u6743\u9650\u4fe1\u606f\u6dfb\u52a0\u5230 Headers \u8f6c\u53d1\u7ed9\u540e\u7aef<br \/>\u6bd4\u5982\u7528 Nginx + ngx_lua \u53ef\u4ee5\u5728 rewrite_by_lua \u9636\u6bb5\u8bf7\u6c42\u9274\u6743 HTTP API \uff0c\u628a\u54cd\u5e94\u7684\u6743\u9650\u4fe1\u606f\u5199\u5165 Nginx \u53d8\u91cf\uff0c\u901a\u8fc7 proxy_set_header \u4f20\u9012\u7ed9\u540e\u7aef<br \/>location \/openapi\/ {<br \/> set $authinfo &#8221;;<br \/> rewrite_by_lua_block {<br \/> &#8230; resty.http \u8bf7\u6c42\u9274\u6743\u5185\u7f51 HTTP API<br \/> ngx.var.authinfo = \u54cd\u5e94\u7684\u6743\u9650\u4fe1\u606f;<br \/> }<br \/> proxy_set_header &#8220;AuthInfo&#8221; $authinfo;<br \/> proxy_pass &#8230;\u8bf7\u6c42\u5185\u7f51\u540e\u7aef\u7684\u53cd\u4ee3\u914d\u7f6e<br \/>}<br \/>\u8fd9\u6837\u540e\u7aef\u5c31\u53ef\u4ee5\u5728 HTTP Header \u7684 AuthInfo \u91cc\u53d6\u5f53\u524d\u7528\u6237\u548c\u6743\u9650\u4fe1\u606f\u4e86 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137983\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : abobobo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u76ee\u524d\u6211\u662f\u9274\u6743+\u7f51\u5173\u4e00\u4e2a\u670d\u52a1\uff0c\u8ba4\u8bc1\u4e00\u4e2a\u670d\u52a1\uff0c\u4e00\u4e2a url \u5982\u679c\u9700\u8981\u767b\u5f55\uff08 token \uff09\u624d\u80fd\u8bbf\u95ee\uff0c\u7f51\u5173\u7684 filter \u4f1a\u5bf9 url \u8fdb\u884c\u9274\u6743\uff0c\u6210\u529f\u5c31\u8f6c\u53d1\u5230\u6307\u5b9a\u670d\u52a1\uff0c\u4e0d\u6210\u529f\u5c31\u8fd4\u56de\u5931\u8d25\u63d0\u793a\u3002\u7528\u7684\u662f spring-cloud-gateway \u8ddf JWT \u3002<br \/>@MeloForsaken <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137984\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Saxton <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @abobobo \u4e00\u5927\u5806 github -\u300b zhoutaoo\/SpringCloud <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137985\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Saxton <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @MeloForsaken @\u9519\u4eba\u4e86 github-\u300b \/zhoutaoo\/SpringCloud <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137986\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : james2013 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u5728\u7f51\u5173\u91cc\u5148\u8c03\u7528\u9274\u6743\u63a5\u53e3,\u6210\u529f\u7f51\u5173\u518d\u8f6c\u53d1\u5230\u5bf9\u5e94\u670d\u52a1<br \/>\u8f6c\u53d1\u5230\u4e1a\u52a1,\u660e\u663e\u662f\u7f51\u5173\u7684\u6d3b,\u5173\u9274\u6743\u4ec0\u4e48\u4e8b? <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137987\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : nicholasxuu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> @MeloForsaken \u4ec0\u4e48\u7f51\u5173\uff1f<br \/>envoy \u7684\u8bdd\uff0c\u53ef\u4ee5\u7528 ext_authz \uff08 https:\/\/www.envoyproxy.io\/docs\/envoy\/latest\/api-v3\/extensions\/filters\/http\/ext_authz\/v3\/ext_authz.proto \uff09\uff0c\u5199\u4e2a\u9ad8\u6027\u80fd\u7684\u9274\u6743 rpc \uff0cenvoy \u4f1a\u53bb\u8c03\u7528 rpc \uff0c\u5904\u7406 request \uff0cenvoy \u518d\u628a request \u4f20\u7ed9\u540e\u9762\u7684\u670d\u52a1\u3002 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137988\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jiameng123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> \u53ef\u4ee5\u4f7f\u7528 openresty \u5b9e\u73b0\uff0c\u5728\u6307\u5b9a\u7684 location \u4e2d rewrite_by_lua \u6a21\u5757\u4e2d\u5199 lua \u811a\u672c\uff0c\u53d1\u5b50\u8bf7\u6c42\uff0c\u5b50\u8bf7\u6c42\u5e94\u7b54\u56de\u6765\u5224\u65ad\u6210\u529f\u540e\uff0c\u518d\u7ee7\u7eed\u7528\u8be5 location \u540e\u9762\u7684\u903b\u8f91\u5904\u7406 <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"7137989\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chenfcheng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>  <\/span> <\/div>\n<\/p><\/div>\n<div> apisix \u6216\u8005 \u963f\u91cc api gateway \u4e86\u89e3\u4e0b \uff1f \u9274\u6743\u90fd\u5728\u7f51\u5173\u4e0a\u505a\u4e86 <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u7f51\u5173\u8f6c\u53d1\u5230\u9274\u6743\uff0c\u9274\u6743\u518d\u8f6c\u5230\u4e1a\u52a1\u600e\u4e48&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/556546"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=556546"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/556546\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=556546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=556546"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=556546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}