Skip to content

Commit

Permalink
Change jwt-auth plugin name to simple-jwt-auth (alibaba#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
cf1998 authored Dec 15, 2023
1 parent a3339a9 commit 5fbfbe0
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 功能说明
`jwt-auth`插件基于wasm-go实现了Token解析认证功能,可以判断Token是否有效,如果Token有效则继续访问后端微服务,Token无效或不存在直接拒绝并返回401
`simple-jwt-auth`插件基于wasm-go实现了Token解析认证功能,可以判断Token是否有效,如果Token有效则继续访问后端微服务,Token无效或不存在直接拒绝并返回401

# 配置字段
| 名称 | 数据类型 | 填写要求 | 描述 |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func main() {
wrapper.SetCtx(
"jwt-auth", // 配置插件名称
"simple-jwt-auth", // 配置插件名称
wrapper.ParseConfigBy(parseConfig),
wrapper.ProcessRequestHeadersBy(onHttpRequestHeaders),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ func init() {

var WasmPluginsJwtAuth = suite.ConformanceTest{
ShortName: "WasmPluginsJwtAuth",
Description: "The Ingress in the higress-conformance-infra namespace test the jwt-auth wasmplugins.",
Manifests: []string{"tests/go-wasm-jwt-auth.yaml"},
Description: "The Ingress in the higress-conformance-infra namespace test the simple-jwt-auth wasmplugins.",
Manifests: []string{"tests/go-wasm-simple-jwt-auth.yaml"},
Features: []suite.SupportedFeature{suite.WASMGoConformanceFeature},
Test: func(t *testing.T, suite *suite.ConformanceTestSuite) {
testcases := []http.Assertion{
Expand All @@ -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 {
http.MakeRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, suite.GatewayAddress, testcase)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ spec:
defaultConfig:
token_headers: token
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

0 comments on commit 5fbfbe0

Please sign in to comment.