mirror of
https://github.com/alibaba/higress.git
synced 2026-06-09 20:57:32 +08:00
Change jwt-auth plugin name to simple-jwt-auth (#698)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# 功能说明
|
# 功能说明
|
||||||
`jwt-auth`插件基于wasm-go实现了Token解析认证功能,可以判断Token是否有效,如果Token有效则继续访问后端微服务,Token无效或不存在直接拒绝并返回401
|
`simple-jwt-auth`插件基于wasm-go实现了Token解析认证功能,可以判断Token是否有效,如果Token有效则继续访问后端微服务,Token无效或不存在直接拒绝并返回401
|
||||||
|
|
||||||
# 配置字段
|
# 配置字段
|
||||||
| 名称 | 数据类型 | 填写要求 | 描述 |
|
| 名称 | 数据类型 | 填写要求 | 描述 |
|
||||||
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
wrapper.SetCtx(
|
wrapper.SetCtx(
|
||||||
"jwt-auth", // 配置插件名称
|
"simple-jwt-auth", // 配置插件名称
|
||||||
wrapper.ParseConfigBy(parseConfig),
|
wrapper.ParseConfigBy(parseConfig),
|
||||||
wrapper.ProcessRequestHeadersBy(onHttpRequestHeaders),
|
wrapper.ProcessRequestHeadersBy(onHttpRequestHeaders),
|
||||||
)
|
)
|
||||||
@@ -27,8 +27,8 @@ func init() {
|
|||||||
|
|
||||||
var WasmPluginsJwtAuth = suite.ConformanceTest{
|
var WasmPluginsJwtAuth = suite.ConformanceTest{
|
||||||
ShortName: "WasmPluginsJwtAuth",
|
ShortName: "WasmPluginsJwtAuth",
|
||||||
Description: "The Ingress in the higress-conformance-infra namespace test the jwt-auth wasmplugins.",
|
Description: "The Ingress in the higress-conformance-infra namespace test the simple-jwt-auth wasmplugins.",
|
||||||
Manifests: []string{"tests/go-wasm-jwt-auth.yaml"},
|
Manifests: []string{"tests/go-wasm-simple-jwt-auth.yaml"},
|
||||||
Features: []suite.SupportedFeature{suite.WASMGoConformanceFeature},
|
Features: []suite.SupportedFeature{suite.WASMGoConformanceFeature},
|
||||||
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
|
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
|
||||||
testcases := []http.Assertion{
|
testcases := []http.Assertion{
|
||||||
@@ -51,7 +51,7 @@ var WasmPluginsJwtAuth = suite.ConformanceTest{
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
t.Run("WasmPlugins jwt-auth", func(t *testing.T) {
|
t.Run("WasmPlugins simple-jwt-auth", func(t *testing.T) {
|
||||||
for _, testcase := range testcases {
|
for _, testcase := range testcases {
|
||||||
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, suite.GatewayAddress, testcase)
|
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, suite.GatewayAddress, testcase)
|
||||||
}
|
}
|
||||||
@@ -40,4 +40,4 @@ spec:
|
|||||||
defaultConfig:
|
defaultConfig:
|
||||||
token_headers: token
|
token_headers: token
|
||||||
token_secret_key: Dav7kfq3iA8S!JUj8&CUkdnQe72E@Cw6
|
token_secret_key: Dav7kfq3iA8S!JUj8&CUkdnQe72E@Cw6
|
||||||
url: file:///opt/plugins/wasm-go/extensions/jwt-auth/plugin.wasm
|
url: file:///opt/plugins/wasm-go/extensions/simple-jwt-auth/plugin.wasm
|
||||||
Reference in New Issue
Block a user